X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fboot%2Fmisc-helpers.sh;h=856a023a27112cf519ef3960e82df39d5232231e;hb=5097c70efc48e5039ddb4c46c0e359c0c389dba9;hp=202ebe6255b0c4db3aff6fc1615875876ae5e9b0;hpb=6d3f4fd5557f5efc83c42374417f4a05e99d3744;p=live-boot-grml.git diff --git a/scripts/boot/misc-helpers.sh b/scripts/boot/misc-helpers.sh index 202ebe6..856a023 100755 --- a/scripts/boot/misc-helpers.sh +++ b/scripts/boot/misc-helpers.sh @@ -1,5 +1,22 @@ #!/bin/sh +#set -e + +really_export () +{ + STRING="${1}" + VALUE="$(eval echo -n \${$STRING})" + + if [ -f /live.vars ] && grep -sq "export ${STRING}" /live.vars + then + sed -i -e 's/\('${STRING}'=\).*$/\1'${VALUE}'/' /live.vars + else + echo "export ${STRING}=\"${VALUE}\"" >> /live.vars + fi + + eval export "${STRING}"="${VALUE}" +} + is_in_list_separator_helper () { local sep=${1} shift @@ -695,16 +712,16 @@ removable_dev () then if [ -z "${want_usb}" ] then - dev_ok="yes" + dev_ok="true" else if readlink ${sysblock} | grep -q usb then - dev_ok="yes" + dev_ok="true" fi fi fi - if [ "${dev_ok}" = "yes" ] + if [ "${dev_ok}" = "true" ] then case "${output_format}" in sys) @@ -923,7 +940,7 @@ get_custom_mounts () opt_source=${opt#source=} ;; link) - opt_link="yes" + opt_link="true" ;; union|bind) ;; @@ -991,22 +1008,22 @@ activate_custom_mounts () while read device source dest options # < ${custom_mounts} do - local opt_bind="yes" + local opt_bind="true" local opt_link="" local opt_union="" for opt in $(echo ${options} | tr ',' ' '); do case "${opt}" in bind) - opt_bind="yes" + opt_bind="true" unset opt_link opt_union ;; link) - opt_link="yes" + opt_link="true" unset opt_bind opt_union ;; union) - opt_union="yes" + opt_union="true" unset opt_bind opt_link ;; esac