From b64e86e220b3313288a90d36c8b557e92bbd4ee5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 18 Apr 2010 20:41:44 +0200 Subject: [PATCH] Adding upstream version 1.110.4. --- Makefile | 8 +++---- scripts/live | 53 +++++++++++++++++++++++++++++++++++++-------- scripts/live-bottom/12fstab | 22 +++++++++++++------ scripts/live-helpers | 14 ++++++++++++ 4 files changed, 77 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index f7573f4..347d449 100644 --- a/Makefile +++ b/Makefile @@ -104,10 +104,10 @@ uninstall: update: set -e; for FILE in docs/parameters.txt; \ do \ - sed -i -e 's/2007\\-10\\-22/2007\\-10\\-29/' \ - -e 's/2007-10-22/2007-10-29/' \ - -e 's/22.10.2007/29.10.2007/' \ - -e 's/1.110.3/1.110.4/' \ + sed -i -e 's/2007\\-10\\-29/2007\\-11\\-05/' \ + -e 's/2007-10-29/2007-11-05/' \ + -e 's/29.10.2007/05.11.2007/' \ + -e 's/1.110.4/1.110.5/' \ $$FILE; \ done diff --git a/scripts/live b/scripts/live index 9567301..1dcbc74 100755 --- a/scripts/live +++ b/scripts/live @@ -169,6 +169,11 @@ Arguments () export NFSOPTS ;; + nfscow=*) + NFS_COW="${ARGUMENT#nfscow=}" + export NFS_COW + ;; + noaccessibility) NOACCESSIBILITY="Yes" export NOACCESSIBILITY @@ -949,8 +954,6 @@ setup_unionfs () rofsstring=${rofsstring%:} mkdir -p /cow - cowdevice="tmpfs" - cow_fstype="tmpfs" # Looking for "${root_persistence}" device or file if [ -n "${PERSISTENT}" ] @@ -964,6 +967,39 @@ setup_unionfs () else [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium" fi + elif [ -n "${NFS_COW}" ] + then + # check if there are any nfs options + if echo ${NFS_COW}|grep -q ',' + then + nfs_cow_opts="-o nolock,$(echo ${NFS_COW}|cut -d, -f2-)" + nfs_cow=$(echo ${NFS_COW}|cut -d, -f1) + else + nfs_cow_opts="-o nolock" + nfs_cow=${NFS_COW} + fi + mac=$(get_mac) + if [ -n "${mac}" ] + then + cowdevice=$(echo ${nfs_cow}|sed "s/client_mac_address/${mac}/") + cow_fstype="nfs" + else + panic "unable to determine mac address" + fi + else + cowdevice="tmpfs" + cow_fstype="tmpfs" + fi + + if [ "${cow_fstype}" = "nfs" ] + then + [ "${quiet}" != "y" ] && log_begin_msg \ + "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow" + nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \ + panic "Can not mount ${cowdevice} on /cow" + else + mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \ + panic "Can not mount ${cowdevice} on /cow" fi rofscount=$(echo ${rofslist} |wc -w) @@ -979,11 +1015,8 @@ setup_unionfs () mount --bind ${exposedrootfs} ${rootmnt} || \ panic "bind mount of ${exposedrootfs} failed" - mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \ - panic "Can not mount ${cowdevice} on /cow" - - cow_dirs='/tmp /var/tmp /var/lock /var/run /var/log /var/spool - /home /live /var/lib/live' + cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool + /home /var/lib/live' for dir in ${cow_dirs}; do mkdir -p /cow${dir} @@ -994,13 +1027,15 @@ setup_unionfs () rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro" done else - mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \ - panic "Can not mount ${cowdevice} on /cow" mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \ ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \ ${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}" fi + # tmpfs file systems + mkdir -p "${rootmnt}/live" + mount -t tmpfs tmpfs ${rootmnt}/live + # Adding other custom mounts if [ -n "${PERSISTENT}" ] then diff --git a/scripts/live-bottom/12fstab b/scripts/live-bottom/12fstab index 3d036c9..ca83626 100755 --- a/scripts/live-bottom/12fstab +++ b/scripts/live-bottom/12fstab @@ -5,6 +5,7 @@ # initramfs-tools header PREREQ="" +FSTAB=/root/etc/fstab prereqs() { @@ -27,16 +28,23 @@ then exit 0 fi -log_begin_msg "Configuring fstab..." +if [ -s ${FSTAB} ] +then + log_begin_msg "Not touching preexisting fstab..." +else + log_begin_msg "Configuring fstab..." + + cat >> ${FSTAB} <<-EOF + # /etc/fstab: static file system information. + # + # + ${UNIONTYPE} / ${UNIONTYPE} rw 0 0 + tmpfs /tmp tmpfs nosuid,nodev 0 0 + EOF +fi # live-initramfs script -FSTAB=/root/etc/fstab - -cat >> ${FSTAB} << EOF -${UNIONTYPE} / ${UNIONTYPE} rw 0 0 -tmpfs /tmp tmpfs nosuid,nodev 0 0 -EOF # disabled for now #rm -f /root/etc/rcS.d/S*checkroot.sh diff --git a/scripts/live-helpers b/scripts/live-helpers index ccc3a4a..f49eaf7 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -288,3 +288,17 @@ 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 +} -- 2.1.4