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 /debian/initramfs-tools.preinst | |
| 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.
Diffstat (limited to 'debian/initramfs-tools.preinst')
| -rw-r--r-- | debian/initramfs-tools.preinst | 14 |
1 files changed, 13 insertions, 1 deletions
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 |
