From 9102a2d94ffd7b74ba8afc678836480f018b0d42 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 19:32:33 +0200 Subject: 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. --- debian/changelog | 7 +++++-- debian/initramfs-tools.preinst | 14 +++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'debian') 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 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 for the patch. [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Wed, 08 Aug 2007 19:08:15 +0200 + -- maximilian attems 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 -- cgit v1.2.3