Bug#1053457: live-build: Building live image fails when unmounting /sys: 'target is busy'

2023-12-05 Thread Roland Clobus

Hello Witold Baryluk,

On 05/12/2023 16:35, Witold Baryluk wrote:

Also had this issue for some time (maybe 2-3 months) on my amd64
machine.

But I am not so sure it is due to efivars, at least not only.


> ... so I made another workaround - try to unmount efivars, then try 
to unmount sys in

> a loop with a bit of sleep, until it finally succeeds.

I'm running live-build for some time now on a UEFI-booted machine 
(previously I used BIOS boot) without issues.


I think that the fix is applied to the git version, see 
https://salsa.debian.org/live-team/live-build/-/merge_requests/326


The fix does a proper unmount of efivars before unmounting sys.

Can you try to run live-build from the git version to see whether that 
fixes the issue for you?


I've written some instructions on 
https://wiki.debian.org/ReproducibleInstalls/LiveImages
The key to running the git version is in the definition of the 
environment variable LIVE_BUILD which should point to the root of the 
git clone.


With kind regards,
Roland Clobus


OpenPGP_signature.asc
Description: OpenPGP digital signature


Bug#1053457: live-build: Building live image fails when unmounting /sys: 'target is busy'

2023-12-05 Thread Witold Baryluk
Package: live-build
Version: 1:20230502
Followup-For: Bug #1053457
X-Debbugs-Cc: witold.bary...@gmail.com

Also had this issue for some time (maybe 2-3 months) on my amd64
machine.

But I am not so sure it is due to efivars, at least not only.


Instrumented chroot_sysfs with mount | grep chroot, and got this

devpts-live on /home/user/tmp-live-build/20231205T051432Z/chroot/dev/pts type 
devpts (rw,relatime,gid=5,mode=620,ptmxmode=000,x-gvfs-hide)
proc-live on /home/user/tmp-live-build/20231205T051432Z/chroot/proc type proc 
(rw,relatime,x-gvfs-hide)
sysfs-live on /home/user/tmp-live-build/20231205T051432Z/chroot/sys type sysfs 
(rw,relatime,x-gvfs-hide)


Outside of chroot efivars is indeed mounted tho:

efivarfs on /sys/firmware/efi/efivars type efivarfs 
(rw,nosuid,nodev,noexec,relatime)


I think it is a bit racy, because sometimes I do see efivars being mounted 
under chroot.

2-3 months ago my workaround was to just add a bit of extra sleep (just
few seconds were enough) before attempting to unmount chroot/sys.

Now, this workaround does not look to be really working, so I made
another workaround - try to unmount efivars, then try to unmount sys in
a loop with a bit of sleep, until it finally succeds.

Cheers



Bug#1053457: live-build: Building live image fails when unmounting /sys: 'target is busy'

2023-11-08 Thread Emanuele Rocca
On 2023-10-04 03:10, Emanuele Rocca wrote:
>  P: Begin unmounting /sys...
>  umount: /tmp/sid-image/chroot/sys: target is busy.
>  E: An unexpected failure occurred, exiting...

The reason why /sys is busy is that efivarfs is mounted under
/sys/firmware/efi/efivars.

It seems that efivarfs gets mounted at the following stage during lb build:

 P: Begin installing packages (install pass)...
 [...]
 Nov 06 19:28:28 W: Possible missing firmware 
/lib/firmware/amdgpu/smu_13_0_10.bin for module amdgpu
 Nov 06 19:28:29 live-boot: core filesystems dm-verity devices utils udev 
blockdev dns.



Bug#1053457: live-build: Building live image fails when unmounting /sys: 'target is busy'

2023-10-04 Thread Emanuele Rocca
Package: live-build
Version: 1:20230502
Severity: normal

Dear Maintainer,

Building a live image with `lb build` fails towards the end with the
following error:

 P: Begin unmounting /sys...
 umount: /tmp/sid-image/chroot/sys: target is busy.
 E: An unexpected failure occurred, exiting...

The issue can be reproduced as follows:

 lb config --distribution sid --updates false --archive-areas 'main 
non-free-firmware' --bootloaders grub-efi
 echo live-task-lxde > config/package-lists/desktop.list.chroot
 lb build --debug