[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1040928: live-build fails ln: failed to create symbolic link '/etc/mtab': File exists caused by --chroot-filesystem ext4



Package: live-build
Severity: normal

Dear maintainer,

on Debian bookworm.

Steps to reproduce:

rm -r -f ~/live-build-test
mkdir ~/live-build-test
cd ~/live-build-test

lb config \
    --distribution "bookworm" \
    --archive-areas "main contrib non-free non-free-firmware" \
    --chroot-filesystem ext4 \
    --source false \
    --zsync false

echo "task-lxde-desktop firefox-esr" | tee ./config/package-lists/my.list.chroot >/dev/null

lb config --dump
lb config --validate

lb build

result:

   # P: Begin building root filesystem image...
   # 0+0 records in
   # 0+0 records out
   # 0 bytes copied, 2.8103e-05 s, 0.0 kB/s
   # ln: failed to create symbolic link '/etc/mtab': File exists
   # E: An unexpected failure occurred, exiting...

This only happening when using '--chroot-filesystem ext4'.

This does not happen when dropping '--chroot-filesystem ext4'.

By looking at /usr/share/live/build/hooks/normal/1000-create-mtab-symlink.hook.chroot it seems to me that it doesn't handle the case where /etc/mtab already exists as a file. I.e. not being a symlink as the script expects.

/usr/lib/live/build/binary_rootfs also does not handle this case.

Why am I interested to use '--chroot-filesystem ext4'? Because it saves a lot time during testing to skip squashfs creation.

Making the scripts resilient against this seems useful to me either way as such as situation might also happen through other kinds of customization.

Kind regards,
Patrick Schleizer


Reply to: