Open adrelanos opened 12 months ago
Maybe installing libpam-tmpdir inside the chroot would prevent this too. Will test.
Yes. Using grml-debootstrap with --include=...,libpam-tmpdir
also fixed the issue for me.
Good enough for me but maybe you also want a general bugfix for everyone.
Yes. Using grml-debootstrap with
--include=...,libpam-tmpdir
also fixed the issue for me.
Unfortunately, this is insufficient. Later on, dracut installation is failing.
+ echo 'Generating initrd.'
Generating initrd.
+ '[' dracut = dracut ']'
+ DEBIAN_FRONTEND=noninteractive
+ apt-get -y --no-install-recommends install -o Acquire::http::Proxy=http://127.0.0.1:3142 -o Acquire::https::Proxy=http://127.0.0.1:3142 -o Acquire::tor::Proxy=http://127.0.0.1:3142 -o APT::Update::Error-Mode=any -o Acquire::Languages=none -o Acquire::IndexTargets::deb::Contents-deb::DefaultEnabled=false -o Apt::Install-Recommends=false -o Acquire::Retries=5 -o Dpkg::Options::=--force-confnew dracut
Reading package lists... Done
...
Processing triggers for dracut (059-4) ...
dracut: Generating /boot/initrd.img-6.1.0-13-amd64
realpath: /tmp/user/0: No such file or directory
dracut: Invalid tmpdir '/tmp/user/0'.
dpkg: error processing package dracut (--configure):
installed dracut package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
dracut
E: Sub-process /usr/bin/dpkg returned an error code (1)
++ error_handler
Added to function preparechroot
:
mkdir --parents "${MNTPOINT}/${TMPDIR}"
That helped a bit but still having dracut issues.
dracut-install: ERROR: installing 'poweroff'
dracut-install: ERROR: installing 'reboot'
dracut-install: ERROR: installing 'halt'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /tmp/user/0/dracut.Yir3ea/initramfs -a umount poweroff reboot halt losetup stat sleep timeout
+ dracut --no-hostonly --kver 6.1.0-13-amd64 --fstab --add-fstab /etc/fstab --force --reproducible
Even a workaround prepending:
sudo env --unset TMPDIR --unset TMP --unset TEMPDIR --unset TEMP grml-debootstrap ...
does not help.
Added to function
preparechroot
:mkdir --parents "${MNTPOINT}/${TMPDIR}"
That helped a bit but still having dracut issues.
dracut-install: ERROR: installing 'poweroff' dracut-install: ERROR: installing 'reboot' dracut-install: ERROR: installing 'halt' dracut: FAILED: /usr/lib/dracut/dracut-install -D /tmp/user/0/dracut.Yir3ea/initramfs -a umount poweroff reboot halt losetup stat sleep timeout + dracut --no-hostonly --kver 6.1.0-13-amd64 --fstab --add-fstab /etc/fstab --force --reproducible
That is actually a different issue:
I managed to fix grml-debootstrap comparability with libpam-tmpdir
. 3 changes were required.
preparechroot
added: [ -n "$TMPDIR" ] && mkdir --parents "${MNTPOINT}/${TMPDIR}"
libpam-tmpdir
package using grml-debootstrap
with --include
libpam-systemd
package using the same. (https://github.com/grml/grml-debootstrap/issues/233)Now works for me. Image is bootable.
TODO, in short: implement clean_chroot() { env -i chroot "$@" }
as previously discussed in https://github.com/grml/grml-debootstrap/pull/234
@zeha
Instead of $chroot, we could have sth like
clean_chroot() { env -i chroot "$@" }
(?)
@adrelanos
Since @mika liked the post, seems to agree with it (and I personally don't need the environment variable), I am happy to and will attempt to implement this at a later time when other PR is ready and merged to avoid merge conflicts.
https://packages.debian.org/bookworm/libpam-tmpdir installed on the host operating system breaks grml-debootstrap.
Running:
before:
Fixes this.
For the purpose of a PR to fix this: Can I add this mkdir unconditionally or should this only be done conditionally if using libpam-tmpdir (in that case environment variables TMP, TEMP and TMPDIR will be set accordingly already).
I will also investigate alternative solutions. 1 comes to mind. Maybe installing libpam-tmpdir inside the chroot would prevent this too. Will test.