diff options
author | maximilian attems <maks@debian.org> | 2007-08-08 19:32:33 +0200 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2007-08-08 19:32:33 +0200 |
commit | 9102a2d94ffd7b74ba8afc678836480f018b0d42 (patch) | |
tree | 7aff63fb46931d38c69c3142cd12a55f50cd3ee1 | |
parent | 788877833dc1e5201030927742f75b41bec324d7 (diff) | |
download | initramfs-tools-9102a2d94ffd7b74ba8afc678836480f018b0d42.tar.gz initramfs-tools-9102a2d94ffd7b74ba8afc678836480f018b0d42.zip |
initramfs-tools.preinst: Inhibit resume var creation.
don't create /etc/initramfs-tools/conf.d/resume
in chroot for debian-live and other custom debian distributions
which build their systems in a chroot.
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | debian/initramfs-tools.preinst | 14 |
2 files changed, 18 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 4dfa781..70685fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,13 +13,16 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low * scripts/functions: Add error message on verbose mode about ignored files in boot/hooks dir. Thanks Kornilios Kourtis <kkourt@cslab.ece.ntua.gr> for the initial patch. Fixes a double set_initlist call too. Ignore empty - dirs earlier too. (closes: #433459) + dirs earlier too. (closes: #428729, #433459) * mkinitramfs.8: Document verbose mode. + * debian/initramfs-tools.preinst: Inhibit /etc/initramfs-tools/conf.d/resume + creation in chroot for debian-live and other. (closes: #433190) + Thanks Kel Modderman <kel@otaku42.de> for the patch. [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems <maks@debian.org> Wed, 08 Aug 2007 19:08:15 +0200 + -- maximilian attems <maks@debian.org> Wed, 08 Aug 2007 19:29:23 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 1379766..6a8b88f 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -2,6 +2,17 @@ set -e +chrooted() { + # borrowed from udev's postinst + if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then + # the devicenumber/inode pair of / is the same as that of + # /sbin/init's root, so we're *not* in a chroot and hence + # return false. + return 1 + fi + return 0 +} + case "$1" in install) mkdir -p /etc/initramfs-tools/conf.d @@ -15,7 +26,8 @@ case "$1" in if [ -e /etc/mkinitrd/mkinitrd.conf ]; then . /etc/mkinitrd/mkinitrd.conf fi - if [ -n "${RESUME}" ]; then + # write conf.d/resume if not in a chroot + if [ -n "${RESUME}" ] && ! chrooted; then echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume fi |