lol
0
fork

Configure Feed

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

extlinux-conf-builder: don't emit MENU when timeout is zero (#318778)

authored by

Arne Keller and committed by
GitHub
8bbf8450 43cb7e62

+11 -3
+11 -3
nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh
··· 11 11 } 12 12 13 13 timeout= # Timeout in centiseconds 14 + menu=1 # Enable menu by default 14 15 default= # Default configuration 15 16 target=/boot # Target directory 16 17 numGenerations=0 # Number of other generations to include in the menu 17 18 18 19 while getopts "t:c:d:g:n:r" opt; do 19 20 case "$opt" in 20 - t) # U-Boot interprets '0' as infinite and negative as instant boot 21 + t) # U-Boot interprets '0' as infinite 21 22 if [ "$OPTARG" -lt 0 ]; then 23 + # When negative (or null coerced to -1), disable timeout which means that we wait forever for input 22 24 timeout=0 23 25 elif [ "$OPTARG" = 0 ]; then 24 - timeout=-10 26 + # When zero, which means disabled in Nix module, disable menu which results in instant boot of the default item 27 + # .. timeout is actually ignored by u-Boot but set here for the rest of the script 28 + timeout=1 29 + menu=0 25 30 else 31 + # Positive results in centi-seconds of timeout, which when passed with no input results in boot of the default item 26 32 timeout=$((OPTARG * 10)) 27 33 fi 28 34 ;; ··· 126 132 # Change this to e.g. nixos-42 to temporarily boot to an older configuration. 127 133 DEFAULT nixos-default 128 134 129 - MENU TITLE ------------------------------------------------------------ 130 135 TIMEOUT $timeout 131 136 EOF 137 + 138 + [ "$menu" == "1" ] \ 139 + && echo "MENU TITLE ------------------------------------------------------------" >> $tmpFile 132 140 133 141 addEntry $default default >> $tmpFile 134 142