@@ -7,27 +7,41 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
77 set -o errexit
88 set -o nounset
99 set -o errtrace
10- set -o pipefail
10+ # set -o pipefail
11+ fi
12+
13+ was_pipefail_enabled=' false'
14+ if [ -o pipefail ]; then
15+ was_pipefail_enabled=' true'
16+ set +o pipefail
1117fi
1218
13- if [ -z " ${proc_cmdline_output +x} " ]; then
14- proc_cmdline_output =" $( cat -- /proc/cmdline ) "
19+ if [ -z " ${mount_command_output +x} " ]; then
20+ mount_command_output =" $( mount ) "
1521fi
1622
1723# # Detect if the system was booted in live mode
1824# # Check for 'rd.live.image' first, because both, ISO and grub-live come with 'boot=live' kernel parameter.
19- if printf " %s" " ${proc_cmdline_output } " | grep --quiet --fixed-strings -e ' root=live ' -e ' rd.live.image ' ; then
25+ if printf " %s" " ${mount_command_output } " 2> /dev/null | grep --quiet ' LiveOS_rootfs on / type overlay ' ; then
2026 live_status_detected_live_mode_environment_pretty=" ISO Live"
2127 live_status_detected_live_mode_environment_machine=" iso-live"
2228 live_status_word_pretty=" ISO"
2329 live_status_detected=" true"
2430 live_status_maybe_iso_live_message=" <br/><u>This message can be safely ignored if only using this ISO to install to the hard drive.</u><br/>"
25- elif printf " %s" " ${proc_cmdline_output} " | grep --quiet --fixed-strings -e ' boot=live' -e ' rootovl' -e ' rd.live.overlay.overlayfs=1' ; then
26- live_status_detected_live_mode_environment_pretty=" grub-live"
27- live_status_detected_live_mode_environment_machine=" grub-live"
28- live_status_word_pretty=" Live"
29- live_status_detected=" true"
30- live_status_maybe_iso_live_message=" "
31+ elif printf " %s" " ${mount_command_output} " 2> /dev/null | grep --quiet ' overlay on / type overlay' ; then
32+ if printf " %s" " ${mount_command_output} " 2> /dev/null | grep --quiet ' /dev/.* on /home ' ; then
33+ live_status_detected_live_mode_environment_pretty=" grub-live-semi-persistent"
34+ live_status_detected_live_mode_environment_machine=" grub-live-semi-persistent"
35+ live_status_word_pretty=" Semi-persistent"
36+ live_status_detected=" true"
37+ live_status_maybe_iso_live_message=" "
38+ else
39+ live_status_detected_live_mode_environment_pretty=" grub-live"
40+ live_status_detected_live_mode_environment_machine=" grub-live"
41+ live_status_word_pretty=" Live"
42+ live_status_detected=" true"
43+ live_status_maybe_iso_live_message=" "
44+ fi
3145else
3246 live_status_detected_live_mode_environment_pretty=" false"
3347 live_status_detected_live_mode_environment_machine=" false"
3650 live_status_maybe_iso_live_message=" "
3751fi
3852
53+ if [ " $was_pipefail_enabled " = ' true' ]; then
54+ set -o pipefail
55+ fi
56+
3957if [[ " ${BASH_SOURCE[0]} " == " ${0} " ]]; then
4058 var_list=(
4159 " live_status_detected_live_mode_environment_pretty"
0 commit comments