From: Evgeni Golov Date: Sun, 20 Dec 2015 19:07:07 +0000 (+0100) Subject: Merge remote-tracking branch 'grml' X-Git-Tag: debian/1%20160511~9 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=f5716f9a79564e44e38f5d4164a4dc1d77cb8c3a;hp=30b31df28b63f2b684327f16d566326ad84a25b9 Merge remote-tracking branch 'grml' --- diff --git a/Makefile b/Makefile index e3f3946..082bf1e 100644 --- a/Makefile +++ b/Makefile @@ -47,9 +47,13 @@ install: # Installing executables mkdir -p $(DESTDIR)/usr/share/initramfs-tools/hooks - cp backend/initramfs-tools/live.hook $(DESTDIR)/usr/share/initramfs-tools/hooks/live + for f in backend/initramfs-tools/*.hook; do \ + cp $${f} $(DESTDIR)/usr/share/initramfs-tools/hooks/$$(basename $${f} .hook); \ + done mkdir -p $(DESTDIR)/usr/share/initramfs-tools/scripts - cp backend/initramfs-tools/live.script $(DESTDIR)/usr/share/initramfs-tools/scripts/live + for f in backend/initramfs-tools/*.script; do \ + cp $${f} $(DESTDIR)/usr/share/initramfs-tools/scripts/$$(basename $${f} .script); \ + done mkdir -p $(DESTDIR)/bin cp frontend/* $(DESTDIR)/bin diff --git a/backend/initramfs-tools/kms.hook b/backend/initramfs-tools/kms.hook new file mode 100644 index 0000000..7302c12 --- /dev/null +++ b/backend/initramfs-tools/kms.hook @@ -0,0 +1,25 @@ +#!/bin/sh +# hook for adding kms modules + +set -e + +# initramfs-tools header + +PREREQ="" +prereqs() +{ + echo "${PREREQ}" +} + +case "${1}" in + prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +for module in i915 radeon nouveau ; do + manual_add_modules $module +done diff --git a/backend/initramfs-tools/live.hook b/backend/initramfs-tools/live.hook index fc3d6b4..ac2c0ce 100755 --- a/backend/initramfs-tools/live.hook +++ b/backend/initramfs-tools/live.hook @@ -215,23 +215,19 @@ fi # Some experimental stuff -case "${LIVE_DNS}" in - true) - [ "${QUIET}" ] || echo -n " dns" - - # /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 - - # might be needed if /etc/hosts is used - #mkdir -p "${DESTDIR}/etc" - #cp -p /etc/nsswitch.conf "${DESTDIR}/etc" - ;; -esac +[ "${QUIET}" ] || echo -n " dns" + +# /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 + +# might be needed if /etc/hosts is used +#mkdir -p "${DESTDIR}/etc" +#cp -p /etc/nsswitch.conf "${DESTDIR}/etc" [ "${QUIET}" ] || echo . diff --git a/components/0020-read-only b/components/0020-read-only index fc0dde0..a2c86ef 100755 --- a/components/0020-read-only +++ b/components/0020-read-only @@ -53,4 +53,20 @@ Read_only () ;; esac done + + if grep -qe persistence /proc/cmdline + then + printf " * Persistence mode enabled, searching for persistency related devices to unlock\n" >/dev/console + + for label in custom-ov home-rw home-sn live-rw live-sn persistence + do + if blkid -t LABEL="$label" | grep -q '.' + then + device=$(blkid -t LABEL="$label" | awk -F: '{print $1}') + printf " - Setting device %-9s with label '%s' to write mode for persistence mode: " "$device" "$label" >/dev/console + blockdev --setrw $device && printf "done\n" >/dev/console || printf "failed\n" >/dev/console + fi + done + fi + } diff --git a/components/9990-cmdline-old b/components/9990-cmdline-old index efb33c1..1549bb4 100755 --- a/components/9990-cmdline-old +++ b/components/9990-cmdline-old @@ -17,7 +17,12 @@ Cmdline_old () BOOTIF=*) BOOTIF="${_PARAMETER#BOOTIF=}" ;; - + dns=*) + DNS=${_PARAMETER#dns=} + DNSSERVERS=$(echo ${DNS} | sed 's/,/ /g') + export DNSSERVERS + unset DNS + ;; dhcp) # Force dhcp even while netbooting # Use for debugging in case somebody works on fixing dhclient diff --git a/components/9990-main.sh b/components/9990-main.sh index 512c624..e5884f9 100755 --- a/components/9990-main.sh +++ b/components/9990-main.sh @@ -58,6 +58,7 @@ Live () then # We found a memdisk, set up phram modprobe phram phram=memdisk,${MEMDISK} + modprobe phram phram=memdisk,${MEMDISK} # Load mtdblock, the memdisk will be /dev/mtdblock0 modprobe mtdblock diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index 83eca32..39e609d 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -420,6 +420,12 @@ is_supported_fs () return 1 fi + # get_fstype might report "unknown" or "swap", ignore it as no such kernel module exists + if [ "${fstype}" = "unknown" ] || [ "${fstype}" = "swap" ] + then + return 1 + fi + # Try to look if it is already supported by the kernel if grep -q ${fstype} /proc/filesystems then diff --git a/components/9990-networking.sh b/components/9990-networking.sh index dbdc913..9613364 100755 --- a/components/9990-networking.sh +++ b/components/9990-networking.sh @@ -151,7 +151,7 @@ do_netsetup () echo "search ${DNSDOMAIN}" >> /etc/resolv.conf fi - for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1} + for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1} ${DNSSERVERS} do if [ -n "$i" ] && [ "$i" != 0.0.0.0 ] then diff --git a/components/9990-toram-todisk.sh b/components/9990-toram-todisk.sh index e7938e0..5b76d54 100755 --- a/components/9990-toram-todisk.sh +++ b/components/9990-toram-todisk.sh @@ -86,8 +86,7 @@ copy_live_to () echo " * Copying whole medium to RAM" 1>/dev/console rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console # "cp -a" from busybox also copies hidden files else - mkdir -p ${copyto}/${LIVE_MEDIA_PATH} - cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/* ${copyto}/${LIVE_MEDIA_PATH} + cp -a ${copyfrom}/* ${copyto}/ if [ -e ${copyfrom}/${LIVE_MEDIA_PATH}/.disk ] then cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/.disk ${copyto}