X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=hooks%2Flive;h=309c26fb91f686122dd21b469f6789352c62c7d5;hb=dbc32c9e157ae184f5fe464f250f9f616e536e9f;hp=afa198d96d0bf6d0ab146b06fc029b30e0e8e0aa;hpb=6112649bf507da5d58ae1841bc1fe2f61e90a30c;p=live-boot-grml.git diff --git a/hooks/live b/hooks/live index afa198d..309c26f 100755 --- a/hooks/live +++ b/hooks/live @@ -1,6 +1,6 @@ #!/bin/sh -# initramfs hook for live-initramfs (Debian Live) +# initramfs hook for live-boot (Debian Live) set -e @@ -22,29 +22,40 @@ esac . /usr/share/initramfs-tools/hook-functions -# live-initramfs hook +[ "${QUIET}" ] || echo -n live-boot: -# Handling live-initramfs +# live-boot hook -# Configuration -if [ -r /etc/live.conf ] +# Reading configuration file from filesystem +if [ -e /etc/live/boot.conf ] then - . /etc/live.conf + . /etc/live/boot.conf +fi - mkdir -p "${DESTDIR}"/etc - cp /etc/live.conf "${DESTDIR}"/etc +if ls /etc/live/boot.d/* > /dev/null 2>&1 +then + for _FILE in /etc/live/boot.d/* + do + . ${_FILE} + done fi -mkdir -p "${DESTDIR}"/usr/share/live-initramfs -cp /usr/share/live-initramfs/languagelist "${DESTDIR}"/usr/share/live-initramfs +# Handling live-boot + +[ "${QUIET}" ] || echo -n " "core +# Configuration +if [ -e /usr/share/live-boot/languagelist ] +then + mkdir -p "${DESTDIR}"/usr/share/live-boot + cp /usr/share/live-boot/languagelist "${DESTDIR}"/usr/share/live-boot +fi # Directories -mkdir -p "${DESTDIR}"/lib/live-initramfs +mkdir -p "${DESTDIR}"/lib/live-boot # Executables -copy_exec /usr/share/live-initramfs/live-reconfigure /bin -copy_exec /usr/share/live-initramfs/live-preseed /bin -copy_exec /usr/share/live-initramfs/live-set-selections /bin +copy_exec /usr/share/live-boot/live-reconfigure /bin +copy_exec /usr/share/live-boot/live-preseed /bin # Scripts cp /usr/share/initramfs-tools/scripts/live-functions "${DESTDIR}"/scripts @@ -53,7 +64,7 @@ cp /usr/share/initramfs-tools/scripts/live-helpers "${DESTDIR}"/scripts # klibc dependencies for FILE in /lib/libacl* /lib/libblkid* /lib/libuuid* /lib/libdevmapper* /lib/libattr* do - if [ ! -e "${DESTDIR}"/"${FILE}" ] + if [ ! -e "${DESTDIR}"/"${FILE}" ] && ls ${FILE} > /dev/null 2>&1 then cp -a "${FILE}" "${DESTDIR}"/"${FILE}" fi @@ -77,6 +88,7 @@ fi # Handling other stuff +[ "${QUIET}" ] || echo -n " "filesystems # Configuration: keymap (usefull when using encryption) if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ] then @@ -93,6 +105,9 @@ then uuidgen -r > "${DESTDIR}"/conf/uuid.conf fi +# Filesystem: btrfs +manual_add_modules btrfs + # Filesystem: cifs if [ -x /sbin/mount.cifs ] then @@ -138,6 +153,7 @@ manual_add_modules vfat # Filesystem: ntfs manual_add_modules ntfs +[ "${QUIET}" ] || echo -n " "devices # Hardware: cdrom manual_add_modules ide-cd manual_add_modules ide-generic @@ -157,9 +173,19 @@ then copy_exec /usr/bin/eject /bin fi +[ "${QUIET}" ] || echo -n " "utils # Program: md5sum copy_exec /usr/bin/md5sum /bin +# Program: memdisk +if [ -x /usr/bin/memdiskfind ] +then +[ "${QUIET}" ] || echo -n :memdisk + copy_exec /usr/bin/memdiskfind + manual_add_modules phram + manual_add_modules mtdblock +fi + # Program: cpio # busybox and klibc lacks --no-absolute-filenames and --sparse, needed for snapshots if [ -e "${DESTDIR}/bin/cpio" ] @@ -172,27 +198,26 @@ copy_exec /bin/cpio /bin # Program: udev if [ -x /sbin/udevadm ] then - # lenny + [ "${QUIET}" ] || echo -n " "udev copy_exec /sbin/udevadm /sbin -else - # etch - copy_exec /sbin/udevtrigger /sbin - copy_exec /sbin/udevsettle /sbin fi if [ -x /usr/bin/udevinfo ] then + [ "${QUIET}" ] || echo -n " "udev copy_exec /usr/bin/udevinfo /bin fi # Program: wget if [ -x /usr/bin/wget ] then + [ "${QUIET}" ] || echo -n " "wget copy_exec /usr/bin/wget /bin fi # Program: blockdev if [ -x /sbin/blockdev ] then + [ "${QUIET}" ] || echo -n " "blockdev copy_exec /sbin/blockdev /sbin fi @@ -202,14 +227,49 @@ manual_add_modules fuse # FUSE filesystem: httpfs2 if [ -x /usr/bin/httpfs2_ssl ] then + [ "${QUIET}" ] || echo -n " "httpfs:ssl copy_exec /usr/bin/httpfs2_ssl /bin/httpfs elif [ -x /usr/bin/httpfs2 ] then + [ "${QUIET}" ] || echo -n " "httpfs copy_exec /usr/bin/httpfs2 /bin/httpfs fi # FUSE filesystem: curlftpfs if [ -x /usr/bin/curlftpfs ] then + [ "${QUIET}" ] || echo -n " "ftpfs copy_exec /usr/bin/curlftpfs /bin fi + +# iSCSI +if [ -x /usr/sbin/iscsistart ] +then + [ "${QUIET}" ] || echo -n " "iscsi + copy_exec /usr/sbin/iscsistart /bin + #manual_add_modules ib_iser + manual_add_modules iscsi_tcp + manual_add_modules crc32c +fi + +if [ "${LIVE_DNS}" = "true" ] +then + [ "${QUIET}" ] || echo -n " "dns + #copy_exec /lib/libnss_files.so.* /lib # /etc/hosts and /etc/passwd + copy_exec /lib/libnss_dns.so.* /lib # DNS server + #copy_exec /lib/libnss_compat.so.* /lib # /etc/passwd + + # Configuration file - may be needed if /etc/hosts is used. + #mkdir -p $DESTDIR/etc + #cp -p /etc/nsswitch.conf $DESTDIR/etc +fi + +if [ "${LIVE_UNIONMOUNT}" = "true" ] +then + [ "${QUIET}" ] || echo -n " "unionmount + # UnionMount + # only mount from patched util-linux can do this currently + copy_exec /bin/mount /bin/mount_full +fi + +[ "${QUIET}" ] || echo .