diff options
author | Daniel Baumann <daniel@debian.org> | 2009-11-11 17:25:50 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:09:48 +0100 |
commit | dbcae19129fb310cef3330d9e8342602e2845589 (patch) | |
tree | 99b53cfa4a94fe2d9cae99e466d63efb06844a64 /examples/hooks/live-installer_lenny-usbfix.sh | |
parent | 02fee2236aa2203dbda715ab8c07c7678527f974 (diff) | |
download | live-build-dbcae19129fb310cef3330d9e8342602e2845589.zip live-build-dbcae19129fb310cef3330d9e8342602e2845589.tar.gz |
Renaming example hooks and prefixing them with distribution name.
Diffstat (limited to 'examples/hooks/live-installer_lenny-usbfix.sh')
-rwxr-xr-x | examples/hooks/live-installer_lenny-usbfix.sh | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/examples/hooks/live-installer_lenny-usbfix.sh b/examples/hooks/live-installer_lenny-usbfix.sh deleted file mode 100755 index ded8b80..0000000 --- a/examples/hooks/live-installer_lenny-usbfix.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh - -echo "BINARY-HOOK: fix install from USB in Lenny." - -# This is a *binary-hook* to allow disk installations from USB for -# Debian 5.0.x Lenny. Place this file in config/binary_local-hooks/, -# make it executable and rebuild your live image (binary only). - -# This workaround for debian-installer was adapted from Chris Lamb -original patch: -# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498143#5 - -# It works by fooling apt-setup. With an existing /hd-media directory -# apt-setup will not try to umount /cdrom. Enable live installer with -# lh_config: -# -# lh_config --debian-installer "live" -# -# Rebuild your binary image. No options needed on boot. - -cat > cdrom-detect.postinst.patch << 'EOF' -@@ -44,6 +44,30 @@ do - fi - done - -+ # Try disk partitions masquerading as Debian CDs for Debian Live -+ # "usb-hdd" images. Only vfat and ext are supported. -+ modprobe vfat >/dev/null 2>&1 || true -+ for device in $(list-devices partition); do -+ if mount -t vfat -o ro,exec $device /cdrom || -+ mount -t ext2 -o ro,exec $device /cdrom; then -+ log "Pseudo CD-ROM mount succeeded: device=$device" -+ -+ # Test whether it's a Debian CD -+ if [ -e /cdrom/.disk/info ]; then -+ mounted=1 -+ db_set cdrom-detect/cdrom_device $device -+ # fake hd-media install so that apt-setup doesn't break. -+ mkdir /hd-media -+ break -+ else -+ log "Ignoring pseudo CD-ROM device $device - it is not a Debian CD" -+ umount /cdrom 2>/dev/null || true -+ fi -+ else -+ log "Psuedo CD-ROM mount failed: device=$device" -+ fi -+ done -+ - if [ "$mounted" = "1" ]; then - break - fi - -EOF - -# for the syslinux installer -mkdir usb-install-syslinux -cd usb-install-syslinux -zcat ../binary/install/initrd.gz | cpio -iv -patch ./var/lib/dpkg/info/cdrom-detect.postinst < ../cdrom-detect.postinst.patch -PATCH_ERROR=${?} -if [ "${PATCH_ERROR}" != 0 ] -then - # if there was an error, say it and undo everything. - echo "ERROR: error while patching cdrom-detect.postinst." - cd .. - rmdir -rf usb-install-syslinux - exit 0 -fi -# rebuild the initrd -find . -print0 | cpio -0 -H newc -ov | gzip -c > ../initrd-new.gz -cd .. -mv initrd-new.gz binary/install/initrd.gz -rm -rf usb-install-syslinux - -# for the gtk installer -mkdir usb-install-gtk -cd usb-install-gtk -zcat ../binary/install/gtk/initrd.gz | cpio -iv -patch ./var/lib/dpkg/info/cdrom-detect.postinst < ../cdrom-detect.postinst.patch -PATCH_ERROR=${?} -if [ "${PATCH_ERROR}" != 0 ] -then - # if there was an error, say it and undo everything - echo "ERROR: error while patching cdrom-detect.postinst." - cd .. - rmdir -rf usb-install-gtk - exit 0 -fi -# rebuild the initrd -find . -print0 | cpio -0 -H newc -ov | gzip -c > ../initrd-new.gz -cd .. -mv initrd-new.gz binary/install/gtk/initrd.gz -rm -rf usb-install-gtk - -rm cdrom-detect.postinst.patch |