Live Scan Grub Menu lsgm.rwx.work
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

grub.cfg.sh

+144 -119
+13 -96
build.sh
··· 55 55 MEMDISK_ROOT='boot' 56 56 MEMDISK_DIRECTORY="${MEMDISK_ROOT}/grub" 57 57 MEMDISK_FILE="${MEMDISK_DIRECTORY}/grub.cfg" 58 - MEMDISK_PUB="${MEMDISK_DIRECTORY}/grub.pub" 58 + MEMDISK_PUB="${MEMDISK_DIRECTORY}/grub.pgp" 59 59 MEMDISK_ARCHIVE="${MEMDISK_ROOT}.tar" 60 60 UEFI_ROOT="${ROOT}/efi" 61 61 UEFI_DIRECTORY="${UEFI_ROOT}/boot" ··· 70 70 GRUB_ROOT="${ROOT}/boot/grub" 71 71 GRUB_CFG="${GRUB_ROOT}/grub.cfg" 72 72 GRUB_ENV="${ROOT}/grub.env" 73 - GRUB_PUB="${GRUB_ROOT}/grub.pub" 73 + GRUB_PUB="${GRUB_ROOT}/grub.pgp" 74 74 75 75 # wipe ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 76 76 ··· 175 175 176 176 # grub / cfg ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 177 177 178 - echo -n "\ 179 - function list_vars { 180 - echo -n \"\\ 181 - root | \${root} 182 - prefix | \${prefix} 183 - check_signatures | \${check_signatures} 184 - \" 185 - list_trusted 186 - } 187 - 188 - clear 189 - ls 190 - echo -n \"\\ 191 - --- 192 - cpu-platform | \${grub_cpu}-\${grub_platform} 193 - cmdpath | \${cmdpath} 194 - --- 195 - \" 196 - if [ -f '/.disk/info' -o -f '/.disk/mini-info' ] ; then 197 - for f in '/.disk/info' '/.disk/mini-info' ; do 198 - echo -n ' |' 199 - if [ -f \"\${f}\" ] ; then 200 - echo -n '*' 201 - else 202 - echo -n ' ' 203 - fi 204 - echo \"(\${root})\${f}\" 205 - done 206 - unset f 207 - echo ' *' 208 - fi 209 - list_vars 210 - echo ' ---' 211 - 212 - unset cmdroot 213 - regexp --set cmdroot '^\((.*)\)' \"\${cmdpath}\" 214 - echo \" cmdroot | \${cmdroot}\" 215 - if [ \"\${cmdroot}\" != \"\${root}\" ] ; then 216 - if [ -d \"(\${cmdroot})/boot/grub/\${grub_cpu}-\${grub_platform}\" ] ; then 217 - prefix=\"(\${cmdroot})/boot/grub\" 218 - root=\"\${cmdroot}\" 219 - fi 220 - fi 221 - unset cmdroot 222 - check_signatures='enforce' 223 - trust --skip-sig \"\${prefix}/grub.pub\" 224 - 225 - function set_init { 226 - data_uuid='${DATA}' 227 - search --no-floppy --set data \\ 228 - --fs-uuid \"\${data_uuid}\" 229 - # 230 - unset esp 231 - regexp --set esp '^\((.*)\)' \"\${prefix}\" 232 - env=\"(\${esp})/grub.env\" 233 - live=\"(\${esp})/${PROJECT}/live\" 234 - # 235 - for file in \${live}/source/*.sh ; do 236 - source \"\${file}\" 237 - done 238 - unset file 239 - } 240 - 241 - set_init 242 - 243 - source \"\${live}/main.sh\" 244 - 245 - echo ' *' 246 - list_vars 247 - echo -n \"\\ 248 - --- 249 - escape | \" 250 - sleep --interruptible --verbose 1000 251 - " > "${GRUB_CFG}" 178 + cp "${DIRECTORY}/grub.cfg.sh" "${GRUB_CFG}" 252 179 253 180 # grub / env ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 254 181 255 - echo -n "\ 256 - # GRUB Environment Block 257 - #######################################\ 258 - ################################################################\ 259 - ################################################################\ 260 - ################################################################\ 261 - ################################################################\ 262 - ################################################################\ 263 - ################################################################\ 264 - ################################################################\ 265 - ################################################################\ 266 - ################################################################\ 267 - ################################################################\ 268 - ################################################################\ 269 - ################################################################\ 270 - ################################################################\ 271 - ################################################################\ 272 - ################################################################\ 273 - " > "${GRUB_ENV}" 182 + grubenv="# GRUB Environment Block 183 + live_name=${PROJECT} 184 + data_uuid=${DATA} 185 + " 186 + grublen=${#grubenv} 187 + while [ $grublen -lt 1024 ] ; do 188 + grubenv="${grubenv}#" 189 + grublen=${#grubenv} 190 + done 191 + echo -n "${grubenv}" > "${GRUB_ENV}" 274 192 275 193 # grub / fonts ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 276 194 ··· 313 231 mkdir --parents "${GRUB_ROOT}/${target}" 314 232 cd "/usr/lib/grub/${target}" 315 233 for module in *.lst *.mod ; do 316 - echo "${target}/${module}" 317 234 cp "${module}" "${GRUB_ROOT}/${target}" 318 235 done 319 236 done
+107
grub.cfg.sh
··· 1 + function grub_fix { 2 + unset cmdroot 3 + regexp --set cmdroot '^\((.*)\)' "${cmdpath}" 4 + if [ "${cmdroot}" != "${root}" ] ; then 5 + echo -n "\ 6 + |*${cmdpath} 7 + " 8 + if [ -d "(${cmdroot})/boot/grub/${grub_cpu}-${grub_platform}" ] ; then 9 + prefix="(${cmdroot})/boot/grub" 10 + root="${cmdroot}" 11 + fi 12 + fi 13 + unset cmdroot 14 + check_signatures='enforce' 15 + trust --skip-sig "${prefix}/grub.pgp" 16 + } 17 + 18 + function grub_list_const { 19 + echo -n "\ 20 + cpu-platform | ${grub_cpu}-${grub_platform} 21 + cmdpath | ${cmdpath} 22 + " 23 + } 24 + 25 + function grub_list_info { 26 + if [ -f '/.disk/info' -o -f '/.disk/mini-info' ] ; then 27 + for f in '/.disk/info' '/.disk/mini-info' ; do 28 + echo -n "\ 29 + |" 30 + if [ -f "${f}" ] ; then 31 + echo -n '*' 32 + else 33 + echo -n ' ' 34 + fi 35 + echo "(${root})${f}" 36 + done 37 + unset f 38 + fi 39 + } 40 + 41 + function grub_list_vars { 42 + echo -n "\ 43 + root | ${root} 44 + prefix | ${prefix} 45 + check_signatures | ${check_signatures} 46 + " 47 + list_trusted 48 + } 49 + 50 + function grub_list_xtra { 51 + echo -n "\ 52 + env | ${env} 53 + live | ${live} 54 + data | ${data} 55 + " 56 + } 57 + 58 + function grub_main { 59 + ls 60 + grub_list_const 61 + grub_split 62 + if [ ! "${data}" ] ; then 63 + grub_list_info 64 + grub_list_vars 65 + grub_split 66 + # 67 + grub_fix 68 + set_init 69 + for file in ${live}/source/*.sh ; do 70 + source "${file}" 71 + done 72 + unset file 73 + source "${live}/main.sh" 74 + fi 75 + grub_list_vars 76 + grub_list_xtra 77 + grub_split 78 + grub_pause 79 + } 80 + 81 + function grub_pause { 82 + echo -n "\ 83 + escape | " 84 + sleep --interruptible --verbose 1000 85 + } 86 + 87 + function grub_split { 88 + echo -n "\ 89 + --- 90 + " 91 + } 92 + 93 + function set_init { 94 + regexp --set esp '^\((.*)\)' "${prefix}" 95 + # 96 + env="(${esp})/grub.env" 97 + # 98 + load_env --skip-sig --file "${env}" \ 99 + 'live_name' 'data_uuid' 100 + # 101 + live="(${esp})/${live_name}/live" 102 + # 103 + search --no-floppy --set data \ 104 + --fs-uuid "${data_uuid}" 105 + } 106 + 107 + grub_main
-1
live/main.sh
··· 1 - env_init 2 1 menu_init 3 2 4 3 default='scan'
-1
live/menu/cmd.sh
··· 1 - env_init 2 1 menu_init 3 2 4 3 menuentry 'halt' { halt }
-1
live/menu/env.sh
··· 1 - env_init 2 1 menu_init "${env} → ${env_mod}" 3 2 4 3 menuentry 'list file' {
-1
live/menu/gfx.sh
··· 1 - env_init 2 1 menu_init 3 2 4 3 menuentry 'list' {
-1
live/menu/scan.sh
··· 1 - env_init 2 1 menu_init "${scan}" 3 2 4 3 scan "${scan}"
-1
live/menu/set.sh
··· 1 - env_init 2 1 menu_init 3 2 4 3 default='split'
+23 -17
live/source/boot.sh
··· 1 1 function debsquash { 2 2 lmp="${1}" 3 3 sfs="filesystem.squashfs" 4 - if [ -f "(${data})${lmp}/vmlinuz" ]; then 5 - linux_path="(${data})${lmp}/vmlinuz" 6 - initrd_path="(${data})${lmp}/initrd.img" 7 - else 8 - linux_path="(squash)/vmlinuz" 9 - initrd_path="(squash)/initrd.img" 10 - loopback "squash" "${lmp}/${sfs}" 11 - fi 4 + chk="(${data})${lmp}/${sfs}" 12 5 # 13 - echo 'linux' 14 - echo "${linux_path}" 15 - linux \ 6 + echo 'verify_detached' 7 + echo "${chk}" 8 + if verify_detached "${chk}" "${chk}.sig" ; then 9 + if [ -f "(${data})${lmp}/vmlinuz" ]; then 10 + linux_path="(${data})${lmp}/vmlinuz" 11 + initrd_path="(${data})${lmp}/initrd.img" 12 + else 13 + linux_path="(squash)/vmlinuz" 14 + initrd_path="(squash)/initrd.img" 15 + loopback "squash" "${lmp}/${sfs}" 16 + fi 17 + # 18 + echo 19 + echo 'linux' 20 + echo "${linux_path}" 21 + linux \ 16 22 "${linux_path}" \ 17 23 boot="live" \ 18 24 elevator="deadline" \ ··· 20 26 live-media-path="${lmp}" \ 21 27 live-media-uuid="${data_uuid}" \ 22 28 toram="${sfs}" 23 - # 24 - echo 25 - # 26 - echo 'initrd' 27 - echo "${initrd_path}" 28 - initrd "${initrd_path}" 29 + # 30 + echo 31 + echo 'initrd' 32 + echo "${initrd_path}" 33 + initrd "${initrd_path}" 34 + fi 29 35 }
+1
live/source/menu.sh
··· 16 16 } 17 17 18 18 function menu_init { 19 + env_init 19 20 if [ "${menu}" ] ; then 20 21 if [ "${1}" ] ; then 21 22 menuentry "→ ${menu} → ${1}" { nop }