X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-main.sh;h=b50952fe1af877a9657882ddcc8130f0c3942c12;hb=56ec826fbe66584bb41d3b0460aec362886f14c3;hp=4ea8ee118c7c373fde02fc6668df420fcff2e707;hpb=07d13d4a81e8e3ea3f7cff63a6528efd5a46b1e7;p=live-boot-grml.git diff --git a/components/9990-main.sh b/components/9990-main.sh index 4ea8ee1..b50952f 100755 --- a/components/9990-main.sh +++ b/components/9990-main.sh @@ -33,7 +33,7 @@ Live () # Needed here too because some things (*cough* udev *cough*) # changes the timeout - if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ] || [ ! -z "${HTTPFS}" ] || [ ! -z "${FTPFS}" ] + if [ -n "${NETBOOT}" ] || [ -n "${FETCH}" ] || [ -n "${HTTPFS}" ] || [ -n "${FTPFS}" ] then if do_netmount then @@ -52,7 +52,7 @@ Live () else if [ -x /usr/bin/memdiskfind ] then - if ! MEMDISK=$(/usr/bin/memdiskfind) + if MEMDISK=$(/usr/bin/memdiskfind) then # We found a memdisk, set up phram # Sometimes "modprobe phram" can not successfully create /dev/mtd0. @@ -165,13 +165,27 @@ Live () fi fi + if [ -f /etc/hostname ] && ! grep -E -q -v '^[[:space:]]*(#|$)' "${rootmnt}/etc/hostname" + then + log_begin_msg "Copying /etc/hostname to ${rootmnt}/etc/hostname" + cp -v /etc/hostname "${rootmnt}/etc/hostname" + log_end_msg + fi + + if [ -f /etc/hosts ] && ! grep -E -q -v '^[[:space:]]*(#|$|(127.0.0.1|::1|ff02::[12])[[:space:]])' "${rootmnt}/etc/hosts" + then + log_begin_msg "Copying /etc/hosts to ${rootmnt}/etc/hosts" + cp -v /etc/hosts "${rootmnt}/etc/hosts" + log_end_msg + fi + if [ -L /root/etc/resolv.conf ] ; then # assume we have resolvconf DNSFILE="${rootmnt}/etc/resolvconf/resolv.conf.d/base" else DNSFILE="${rootmnt}/etc/resolv.conf" fi - if [ -f /etc/resolv.conf ] && ! grep -E -q -v '^[[:space:]]*#|^[[:space:]]*$' "${DNSFILE}" + if [ -f /etc/resolv.conf ] && ! grep -E -q -v '^[[:space:]]*(#|$)' "${DNSFILE}" then log_begin_msg "Copying /etc/resolv.conf to ${DNSFILE}" cp -v /etc/resolv.conf "${DNSFILE}"