diff options
Diffstat (limited to 'examples/hooks')
-rwxr-xr-x | examples/hooks/all_binary_debian-installer-banner.sh | 2 | ||||
-rwxr-xr-x | examples/hooks/all_chroot_losetup-lukshome.sh | 37 | ||||
-rwxr-xr-x | examples/hooks/lenny_binary_live-installer-usbfix.sh | 96 | ||||
-rwxr-xr-x | examples/hooks/lenny_chroot_aufs-modules.sh | 23 | ||||
-rwxr-xr-x | examples/hooks/lenny_chroot_kpdf-nodrm.sh | 17 | ||||
-rwxr-xr-x | examples/hooks/lenny_chroot_madwifi-modules.sh | 26 | ||||
-rwxr-xr-x | examples/hooks/lenny_chroot_nvidia-legacy-modules.sh | 56 | ||||
-rwxr-xr-x | examples/hooks/lenny_chroot_squashfs-modules.sh | 23 | ||||
-rwxr-xr-x | examples/hooks/lenny_chroot_sun-java5.sh | 28 |
9 files changed, 17 insertions, 291 deletions
diff --git a/examples/hooks/all_binary_debian-installer-banner.sh b/examples/hooks/all_binary_debian-installer-banner.sh index 61c160ca6..76c5d0785 100755 --- a/examples/hooks/all_binary_debian-installer-banner.sh +++ b/examples/hooks/all_binary_debian-installer-banner.sh @@ -5,7 +5,7 @@ # To enable it, copy or symlink this hook into your config/binary_local-hooks # directory and add a replacement banner.png at: # -# config/binary_debian-installer/banner.png +# config/binary_local-includes/binary/install/banner.png # # The file should be a PNG image of dimensions 800 x 75. diff --git a/examples/hooks/all_chroot_losetup-lukshome.sh b/examples/hooks/all_chroot_losetup-lukshome.sh index b6f33bf7f..95d3c053a 100755 --- a/examples/hooks/all_chroot_losetup-lukshome.sh +++ b/examples/hooks/all_chroot_losetup-lukshome.sh @@ -333,32 +333,27 @@ do esac done -if [ -x /sbin/blkid ] -then - CRYPTHOME=$(/sbin/blkid -L ${LUKSPART}) -else - # search for a partition labeled "lukshome" or $LUKSPART - for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd) +# search for a partition labeled "lukshome" or $LUKSPART +for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd) +do + for dev in $(subdevices "${sysblock}") do - for dev in $(subdevices "${sysblock}") - do - devname=$(sys2dev "${dev}") - # find partition name and filesystem type - if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${LUKSPART}" ] - then - # found one partition with correct label - CRYPTHOME="${devname}" - # don't search further - break - fi - done - # if already found, don't search further - if [ -n "${CRYPTHOME}" ] + devname=$(sys2dev "${dev}") + # find partition name and filesystem type + if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${LUKSPART}" ] then + # found one partition with correct label + CRYPTHOME="${devname}" + # don't search further break fi done -fi + # if already found, don't search further + if [ -n "${CRYPTHOME}" ] + then + break + fi +done # if no partition found, exit if [ -z "${CRYPTHOME}" ] diff --git a/examples/hooks/lenny_binary_live-installer-usbfix.sh b/examples/hooks/lenny_binary_live-installer-usbfix.sh deleted file mode 100755 index ded8b80ed..000000000 --- a/examples/hooks/lenny_binary_live-installer-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 diff --git a/examples/hooks/lenny_chroot_aufs-modules.sh b/examples/hooks/lenny_chroot_aufs-modules.sh deleted file mode 100755 index 2d0d16e40..000000000 --- a/examples/hooks/lenny_chroot_aufs-modules.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# This is a hook for live-build(7) to install aufs drivers -# To enable it, copy or symlink this hook into your config/chroot_local-hooks -# directory. -# -# Note: You only want to use this hook if there is no prebuild aufs-modules-* -# package available for your kernel flavour. - -apt-get install --yes build-essential - -# Building kernel module -which module-assistant || apt-get install --yes module-assistant -module-assistant update - -for KERNEL in /boot/vmlinuz-* -do - VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')" - - module-assistant --non-inter --quiet auto-install aufs -l ${VERSION} -done - -module-assistant clean aufs diff --git a/examples/hooks/lenny_chroot_kpdf-nodrm.sh b/examples/hooks/lenny_chroot_kpdf-nodrm.sh deleted file mode 100755 index 20a4f9f33..000000000 --- a/examples/hooks/lenny_chroot_kpdf-nodrm.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# This is a hook for live-build(7) to configure KDE's PDF viewer to ignore -# manipulation restriction on "DRM protect" PDF documents. -# -# To enable it, copy or symlink this hook into your config/chroot_local-hooks -# directory. - -if [ -d /usr/share/config ] -then - -cat > /usr/share/config/kpdfpartrc << EOF -[General] -ObeyDRM=false -EOF - -fi diff --git a/examples/hooks/lenny_chroot_madwifi-modules.sh b/examples/hooks/lenny_chroot_madwifi-modules.sh deleted file mode 100755 index 336e84ca3..000000000 --- a/examples/hooks/lenny_chroot_madwifi-modules.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# This is a hook for live-build(7) to install madwifi drivers -# To enable it, copy or symlink this hook into your config/chroot_local-hooks -# directory. -# -# Note: This hook requires packages from the contrib category. Make sure you enabled -# it in your configuration. - -apt-get install --yes build-essential - -# Building kernel module -which module-assistant || apt-get install --yes module-assistant -module-assistant update - -for KERNEL in /boot/vmlinuz-* -do - VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')" - - module-assistant --non-inter --quiet auto-install madwifi -l ${VERSION} -done - -module-assistant clean madwifi - -# Installing additional stuff -apt-get install --yes madwifi-tools diff --git a/examples/hooks/lenny_chroot_nvidia-legacy-modules.sh b/examples/hooks/lenny_chroot_nvidia-legacy-modules.sh deleted file mode 100755 index 7374ce4a2..000000000 --- a/examples/hooks/lenny_chroot_nvidia-legacy-modules.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -# This is a hook for live-build(7) to install nvidia-kernel-legacy drivers -# To enable it, copy or symlink this hook into your config/chroot_local-hooks -# directory. -# -# Note: This hook requires packages from the non-free category. Make sure you -# enabled it in your configuration. - -apt-get install --yes build-essential - -# Building kernel module -which module-assistant || apt-get install --yes module-assistant nvidia-kernel-common -module-assistant update - -for KERNEL in /boot/vmlinuz-* -do - VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')" - - module-assistant --non-inter --quiet auto-install nvidia-kernel-legacy -l ${VERSION} -done - -module-assistant clean nvidia-kernel-legacy - -# Installing additional stuff -apt-get install --yes nvidia-glx-legacy nvidia-xconfig discover - -# Fix #421028 -if [ -f /usr/lib/xorg/modules/drivers/nvidia_drv.o ] -then - cd /usr/lib/xorg/modules/drivers - gcc -shared -o nvidia_drv.so nvidia_drv.o - cd ${OLDPWD} -fi - -# Adding init script -cat > /etc/init.d/nvidia-debian-live << EOF -#!/bin/sh -# script that modify xorg configuration enabling -# the nvidia proprietary module if the card is detected -# as an NVidia - -if discover --type-summary display | grep -i nvidia -then - # forcing depth to 24, bad detection on some card (e.g my GeForce4 440 Go) - echo "Configuring Xorg for nvidia ..." - nvidia-xconfig -d 24 -else - # not with nvidia h/w ? remove those GLX diversions - # (FIXME) - apt-get --quiet --yes remove nvidia-glx-legacy -fi -EOF - -chmod 0755 /etc/init.d/nvidia-debian-live -update-rc.d nvidia-debian-live defaults diff --git a/examples/hooks/lenny_chroot_squashfs-modules.sh b/examples/hooks/lenny_chroot_squashfs-modules.sh deleted file mode 100755 index cfa2f776c..000000000 --- a/examples/hooks/lenny_chroot_squashfs-modules.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# This is a hook for live-build(7) to install squashfs drivers -# To enable it, copy or symlink this hook into your config/chroot_local-hooks -# directory. -# -# Note: You only want to use this hook if there is no prebuild -# squashfs-modules-* package available for your kernel flavour. - -apt-get install --yes build-essential - -# Building kernel module -which module-assistant || apt-get install --yes module-assistant -module-assistant update - -for KERNEL in /boot/vmlinuz-* -do - VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')" - - module-assistant --non-inter --quiet auto-install squashfs -l ${VERSION} -done - -module-assistant clean squashfs diff --git a/examples/hooks/lenny_chroot_sun-java5.sh b/examples/hooks/lenny_chroot_sun-java5.sh deleted file mode 100755 index 27034a7e3..000000000 --- a/examples/hooks/lenny_chroot_sun-java5.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# This is a hook for live-build(7) to install sun-java. -# To enable it, copy or symlink this hook into your config/chroot_local-hooks -# directory. -# -# Note: This hook requires packages from the non-free category. Make sure you -# enabled it in your configuration. - -# live-build sets DEBIAN_FRONTEND to 'noninteractive' to advise debconf to not -# ask any questions while installing packages. Suns redistribution terms for -# Java do not allow this, therefore we need to overwrite DEBIAN_FRONTEND for -# this apt-get call only. - -# In case you do accept the license terms, you can also preseed the values -# for a complete non-interactive build, by uncommenting the following three lines: - -#echo "sun-java5-bin shared/accepted-sun-dlj-v1-1 boolean true" > /root/preseed -#debconf-set-selections < /root/preseed -#rm -f /root/preseed - -DEBIAN_FRONTEND="dialog" apt-get install --yes sun-java5-bin sun-java5-demo \ - sun-java5-doc sun-java5-fonts sun-java5-jdk sun-java5-jre \ - sun-java5-plugin sun-java5-source - -# Ensure that /tmp has the right permissions; apparently sun-java5-doc tampers -# with it -chmod 1777 /tmp |