Repository navigation
libpam-tmpdir breaks grml-debootstrap #232
Description
Activity
Maybe installing libpam-tmpdir inside the chroot would prevent this too. Will test.
Yes. Using grml-debootstrap with
--include=...,libpam-tmpdiralso 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-tmpdiralso 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_handlerAdded 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 --reproducibleEven 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 --reproducibleThat is actually a different issue:
I managed to fix grml-debootstrap comparability with
libpam-tmpdir. 3 changes were required.-
- In function
preparechrootadded:[ -n "$TMPDIR" ] && mkdir --parents "${MNTPOINT}/${TMPDIR}"
- In function
-
- installation of the
libpam-tmpdirpackage usinggrml-debootstrapwith--include
- installation of the
-
- installation of the
libpam-systemdpackage using the same. (dracut requires libpam-systemd / how do you install systemd? #233)
- installation of the
Now works for me. Image is bootable.
-
TODO, in short: implement
clean_chroot() { env -i chroot "$@" }
as previously discussed in #234
Instead of $chroot, we could have sth like
clean_chroot() { env -i chroot "$@" }(?)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.
Reacted by Michael Prokop- added 2 commits that reference this issue
on Dec 23, 2023 - added a commit that references this issue
on Aug 14, 2024 - added 3 commits that reference this issue
on Nov 22, 2024
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.