Adding upstream version 3.0~b1.
[live-boot-grml.git] / backends / initramfs-tools / live.hook
index 78aae2e..89420b6 100755 (executable)
@@ -6,19 +6,15 @@ set -e
 
 [ "${QUIET}" ] || echo -n "live-boot:"
 
-# Reading configuration files
-if [ -e /etc/live/boot.conf ]
-then
-       . /etc/live/boot.conf
-fi
-
-if ls /etc/live/boot.d/*.conf > /dev/null 2>&1
-then
-       for _FILE in /etc/live/boot.d/*.conf
-       do
-               . ${_FILE}
-       done
-fi
+# Reading configuration file from filesystem and live-media
+for _FILE in /etc/live/boot.conf /etc/live/boot/* \
+            /live/image/live/boot.conf /live/image/live/boot/*
+do
+       if [ -e "${_FILE}" ]
+       then
+               . "${_FILE}"
+       fi
+done
 
 # Checking live-boot
 if [ ! -e /lib/live/boot ]
@@ -46,11 +42,7 @@ done
 # udev dependencies
 for FILE in /lib/udev/*_id
 do
-       if [ ! -e "${DESTDIR}/${FILE}" ]
-       then
-               mkdir -p "${DESTDIR}/lib/udev"
-               copy_exec "${FILE}" /lib/udev
-       fi
+       copy_exec "${FILE}"
 done
 
 # wheezy/sid
@@ -65,7 +57,7 @@ fi
 # Configuration: keymap (usefull when using encryption)
 if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
 then
-       copy_exec /bin/loadkeys /bin
+       copy_exec /bin/loadkeys
 
        mkdir -p "${DESTDIR}"/etc
        cp /etc/console/boottime.kmap.gz "${DESTDIR}"/etc
@@ -84,7 +76,7 @@ manual_add_modules btrfs
 # Filesystem: cifs
 if [ -x /sbin/mount.cifs ]
 then
-       copy_exec /sbin/mount.cifs /sbin
+       copy_exec /sbin/mount.cifs
         manual_add_modules cifs
 fi
 
@@ -101,7 +93,7 @@ then
 fi
 
 # Filesystem: squashfs
-copy_exec /sbin/losetup /sbin
+copy_exec /sbin/losetup
 manual_add_modules loop
 manual_add_modules squashfs
 manual_add_modules sqlzma
@@ -166,7 +158,7 @@ fi
 if [ -x /sbin/udevadm ]
 then
        [ "${QUIET}" ] || echo -n " udev"
-       copy_exec /sbin/udevadm /sbin
+       copy_exec /sbin/udevadm
 fi
 if [ -x /usr/bin/udevinfo ]
 then
@@ -185,7 +177,7 @@ fi
 if [ -x /sbin/blockdev ]
 then
        [ "${QUIET}" ] || echo -n " blockdev"
-       copy_exec /sbin/blockdev /sbin
+       copy_exec /sbin/blockdev
 fi
 
 # FUSE kernel module
@@ -225,13 +217,18 @@ case "${LIVE_DNS}" in
        true)
                [ "${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
+               # /lib/libnss_dns.so.*:a   DNS
+               # /lib/libnss_files.so.*:  /etc/hosts and /etc/passwd
+               # /lib/libnss_compat.so.*: /etc/passwd
+
+               for _SHLIB in $(find /lib -name 'libnss_dns.so.*')
+               do
+                       copy_exec "${_SHLIB}"
+               done
 
-               # Configuration file - may be needed if /etc/hosts is used.
-               #mkdir -p $DESTDIR/etc
-               #cp -p /etc/nsswitch.conf $DESTDIR/etc
+               # might be needed if /etc/hosts is used
+               #mkdir -p "${DESTDIR}/etc"
+               #cp -p /etc/nsswitch.conf "${DESTDIR}/etc"
                ;;
 esac