X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F43disable_updateinitramfs;h=44e2d1f8094c62e1eba861e753b6b6194f718c52;hb=ad7598cb46a5a6268ca60e5dba156056fb86c09d;hp=2b60315e1f5382820f23fd12caf48c4e0507a148;hpb=3f682b4344b8b6fb0e8478ce684783f183c4802d;p=live-boot-grml.git diff --git a/scripts/live-bottom/43disable_updateinitramfs b/scripts/live-bottom/43disable_updateinitramfs index 2b60315..44e2d1f 100755 --- a/scripts/live-bottom/43disable_updateinitramfs +++ b/scripts/live-bottom/43disable_updateinitramfs @@ -30,16 +30,30 @@ chroot /root dpkg-divert --add --rename --quiet \ /usr/sbin/update-initramfs # Running off a USB disk or other writable media. -if [ -w /cdrom ] && \ - ! grep -q '^[^ ]* /cdrom [^ ]* [^ ]*\' /proc/mounts; then +if [ -w /root/cdrom ] && \ + # rw is guaranteed to be first. + grep -q ' /root/cdrom rw[, ]' /proc/self/mountinfo then cat > /root/usr/sbin/update-initramfs << 'EOF' #!/bin/sh +set -e + update-initramfs.distrib "$@" -cp /initrd.img /cdrom/live/initrd.gz -cp /vmlinuz /cdrom/live/vmlinuz + +if [ -e /cdrom/live/initrd.lz ] +then + zcat /initrd.img | lzma -9c >/cdrom/live/initrd.lz.new + mv /cdrom/live/initrd.lz.new /cdrom/live/initrd.lz +else + cp /initrd.img /cdrom/live/initrd.gz.new + mv /cdrom/live/initrd.gz.new /cdrom/live/initrd.gz +fi + +cp /vmlinuz /cdrom/live/vmlinuz.new +mv /cdrom/live/vmlinuz.new /cdrom/live/vmlinuz + exit 0 EOF