X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-helpers;h=504a3f4e5348709693d6a3b6e6b34e1fbb269ad0;hb=cabcd3723fc124a3816f7e992912189e65c7b382;hp=e74108c6e6965aa3faefd51785bdced347f7a406;hpb=658c0f1514abe8176d76897c61cad8e0ba8ed610;p=live-boot-grml.git diff --git a/scripts/live-helpers b/scripts/live-helpers index e74108c..504a3f4 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -1,16 +1,6 @@ #!/bin/sh # live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot -if [ "${BUILD_SYSTEM}" = "Ubuntu" ] -then - MP_QUIET="-Q" -elif [ "${BUILD_SYSTEM}" = "Debian" ] -then - MP_QUIET="-q" -else - MP_QUIET="" -fi - if [ ! -x "/bin/fstype" ] then # klibc not in path -> not in initramfs @@ -157,7 +147,7 @@ setup_loop () local offset=${4} local encryption=${5} - modprobe ${MP_QUIET} -b "${module}" + modprobe -q -b "${module}" udevsettle for loopdev in ${pattern} @@ -278,7 +268,7 @@ find_files () devname=$(sys2dev "${dev}") devfstype="$(get_fstype ${devname})" - if [ "${devfstype}" = "vfat" ] || [ "${devfstype}" = "ext2" ] || [ "${devfstype}" = "ext3" ] + if [ "${devfstype}" = "vfat" ] || [ "${devfstype}" = "ext2" ] || [ "${devfstype}" = "ext3" ] || [ "${devfstype}" = "jffs2" ] then # FIXME: all supported block devices should be scanned mkdir -p "${snap_backing}" @@ -298,3 +288,21 @@ find_files () done done } + +get_mac () +{ + mac="" + + for adaptor in /sys/class/net/* + do + status="$(cat ${adaptor}/iflink)" + + if [ "${status}" -eq 2 ] + then + mac="$(cat ${adaptor}/address)" + mac="$(echo ${mac} | sed 's/:/-/g' | tr '[a-z]' '[A-Z]')" + fi + done + + echo ${mac} +}