1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 12_uuid_support.dpatch by Michael Prokop <prokop@grml-forensic.org>
4 ## DP: This patch enables support for verifying the ISO through bootid=.... bootoption.
5 ## DP: Logic behind bootoptions and possible combinations:
6 ## DP: * bootid.txt + wrong bootid=... => fails to boot
7 ## DP: * bootid.txt + right bootid=... => boots
8 ## DP: * bootid.txt + ignore_bootid => boots
9 ## DP: * bootid.txt + no bootid=... + no ignore_bootid => fails to boot
10 ## DP: * no bootid.txt + no bootid=... + no ignore_bootid => boots
11 ## DP: * no bootid.txt + bootid=... => fails to boot
12 ## DP: * no bootid.txt + ignore_bootid=... => boots
15 Index: live-boot-grml/components/9990-misc-helpers.sh
16 ===================================================================
17 --- live-boot-grml.orig/components/9990-misc-helpers.sh 2014-03-08 13:25:32.293262071 +0100
18 +++ live-boot-grml/components/9990-misc-helpers.sh 2014-03-08 13:25:32.289262541 +0100
27 + if [ -n "$IGNORE_BOOTID" ] ; then
28 + echo " * Ignoring verification of bootid.txt as requested via ignore_bootid.">>/boot.log
32 + if [ -n "$BOOTID" ] && ! [ -r "${path}/conf/bootid.txt" ] ; then
33 + echo " * Warning: bootid=... specified but no bootid.txt found on currently requested device.">>/boot.log
37 + [ -r "${path}/conf/bootid.txt" ] || return 0
39 + bootid_conf=$(cat "${path}/conf/bootid.txt")
41 + if [ -z "$BOOTID" -a -z "$IGNORE_BOOTID" ]
43 + echo " * Warning: bootid.txt found but ignore_bootid / bootid=.. bootoption missing...">>/boot.log
47 + if [ "$BOOTID" = "$bootid_conf" ]
49 + echo " * Successfully verified /conf/bootid.txt from ISO, continuing... ">>/boot.log
51 + echo " * Warning: BOOTID of ISO does not match. Retrying and continuing search...">>/boot.log
61 if [ "${IGNORE_UUID}" ] || [ ! -e /conf/uuid.conf ]
65 if is_live_path ${mountpoint} && \
66 - ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
67 + ([ "${skip_uuid_check}" ] || grml_match_bootid ${mountpoint})
75 - elif [ "${fstype}" = "squashfs" -o \
76 - "${fstype}" = "btrfs" -o \
77 - "${fstype}" = "ext2" -o \
78 - "${fstype}" = "ext3" -o \
79 - "${fstype}" = "ext4" -o \
80 - "${fstype}" = "jffs2" ]
82 - # This is an ugly hack situation, the block device has
83 - # an image directly on it. It's hopefully
84 - # live-boot, so take it and run with it.
85 - ln -s "${devname}" "${devname}.${fstype}"
86 - echo "${devname}.${fstype}"
91 Index: live-boot-grml/components/9990-cmdline-old
92 ===================================================================
93 --- live-boot-grml.orig/components/9990-cmdline-old 2014-03-08 13:25:32.293262071 +0100
94 +++ live-boot-grml/components/9990-cmdline-old 2014-03-08 13:25:32.289262541 +0100
96 BOOTIF="${_PARAMETER#BOOTIF=}"
100 + BOOTID="${_PARAMETER#bootid=}"
105 # Force dhcp even while netbooting
106 # Use for debugging in case somebody works on fixing dhclient
112 + IGNORE_BOOTID="Yes"
113 + export IGNORE_BOOTID