summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-02-25 06:05:59 +0100
committerDirk von Suchodoletz2009-02-25 06:05:59 +0100
commit268f23ce234484ce5c6044f17f703eb0737f0ed7 (patch)
treed2cded72c5bf367b3f0d93046fe6449f6d75309b
parentAdded some hints/thoughts of Volkers vbox activities ... (diff)
downloadcore-268f23ce234484ce5c6044f17f703eb0737f0ed7.tar.gz
core-268f23ce234484ce5c6044f17f703eb0737f0ed7.tar.xz
core-268f23ce234484ce5c6044f17f703eb0737f0ed7.zip
Cleaned up/restructured the mounting of fs components (function
fsmount), removed creation of /dev/rtc (as it is a moving target in newer distros (25N 0 instead of traditional 10 135) - solution to be found), earlier start of dbus/hal in Ubuntu. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2639 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--initramfs/distro-specs/ubuntu/functions-default4
-rwxr-xr-xinitramfs/stage3-stuff/bin/servconfig13
-rw-r--r--initramfs/stage3-stuff/etc/functions42
-rwxr-xr-xinitramfs/stage3-stuff/init29
4 files changed, 61 insertions, 27 deletions
diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default
index fd99fe7e..d5cb3f9b 100644
--- a/initramfs/distro-specs/ubuntu/functions-default
+++ b/initramfs/distro-specs/ubuntu/functions-default
@@ -211,8 +211,8 @@ if [ "x$start_dreshal" = "xyes" ]; then
-e "s/@@return@@/ <return result=\"yes\"\/>/"
sed -i /mnt/etc/dbus-1/system.d/hal.conf \
-e "s/^\([^d]*\)deny\(.*Volume.*\)/\1allow\2/"
- rllinker "dbus" 17 20
- rllinker "hal" 18 15
+ rllinker "dbus" 2 20
+ rllinker "hal" 3 18
if [ ! -e /mnt/etc/init.d/policykit ] ; then
testmkd /mnt/var/lib/PolicyKit root:polkituser 1770
testmkd /mnt/var/lib/PolicyKit-public root:polkituser
diff --git a/initramfs/stage3-stuff/bin/servconfig b/initramfs/stage3-stuff/bin/servconfig
index 1c4b43cf..3234d915 100755
--- a/initramfs/stage3-stuff/bin/servconfig
+++ b/initramfs/stage3-stuff/bin/servconfig
@@ -282,12 +282,11 @@ if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then
*)
tmpserv=$(uri_token $scratch server)
tmppath=$(uri_token $scratch path)
- # check that nfs is available
- nfsmod
# hanging mount processes might stop further setup - timeout
- # should be configured ... it is possible to mount "nolock" only
- mount -t nfs -o rw,tcp,nolock,intr,nodev,soft,timeo=2,nosuid \
- ${tmpserv}:${tmppath} /tmp/scratch >/dev/null 2>&1 && {
+ # should be configured ...
+ # fsmount proto server path target options
+ fsmount nfs ${tmpserv} ${temppath} /tmp/scratch \
+ "rw,intr,soft,timeo=2,nosuid" && {
if [ -d /tmp/scratch/${clientip} ] ; then
mv /tmp/scratch/${clientip} /tmp/scratch/${clientip}.totrash
rm -rf /tmp/scratch/${clientip}.totrash 2>/dev/null &
@@ -295,8 +294,8 @@ if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then
testmkd /tmp/scratch/${clientip}
# no need for tempfs there ...
umount /mnt/tmp >/dev/null 2>&1
- mount -t nfs -o rw,tcp,nolock,intr,nodev,soft,timeo=2,nosuid \
- ${tmpserv}:${tmppath}/${clientip} /mnt/tmp >/dev/null 2>&1
+ fsmount nfs ${tmpserv} ${temppath} /mnt/tmp \
+ "rw,intr,soft,timeo=2,nosuid"
# somehow we need to move it to the vmware plugin. Any ideas
# how to handle the dependencies?
# create an empty container file for vmware *.vmem, it does not
diff --git a/initramfs/stage3-stuff/etc/functions b/initramfs/stage3-stuff/etc/functions
index 647ba2dc..84140b94 100644
--- a/initramfs/stage3-stuff/etc/functions
+++ b/initramfs/stage3-stuff/etc/functions
@@ -127,10 +127,43 @@ case "$2" in
esac
}
#############################################################################
-# load the kernel nfs module if not compiled in
-nfsmod () {
-cat /proc/filesystems | grep -q -E "[[:space:]]nfs" || \
- { modprobe ${MODPRV} nfs 2>/dev/null || error "$error_nfsmod" nonfatal; }
+# mounter for different file sources
+fsmount () {
+local proto=$1
+local server=$2
+local srcpath=$3
+local target=$4
+local mntopt=$5
+local transport
+testmkd ${target}
+case "${proto}" in
+ *nbd)
+ # TODO: to be filled in ...
+ ;;
+ lbdev)
+ # we expect the stuff on toplevel directory, filesystem type should be
+ # autodetected here ... (vmimgserv is blockdev here)
+ vmbdev=/dev/${server}
+ waitfor ${vmbdev} 20000
+ echo -e "ext2\nreiserfs\nvfat\nxfs" >/etc/filesystems
+ mount -o ro ${vmbdev} ${target} || error "$scfg_evmlm" nonfatal
+ ;;
+ nfs)
+ # we expect nfs mounts here ... check that nfs module is loaded before
+ cat /proc/filesystems | grep -q -E "[[:space:]]nfs" || \
+ { modprobe ${MODPRV} nfs 2>/dev/null || error "$error_nfsmod" nonfatal; }
+ for transport in tcp udp fail; do
+ [ $transport = "fail" ] && { error "$init_nfs" nonfatal;
+ noimg=yes; break;}
+ mount -n -t nfs -o ${mntopt},nolock,${transport} \
+ ${server}:${srcpath} ${target} && break
+ done
+ ;;
+ smb|cifs)
+ mount -n -t ${proto} -o ${mntopt},user=guest,guest \
+ //${server}/${srcpath} ${target}
+ ;;
+esac
}
#############################################################################
# configure Xen bridge xenbr0
@@ -829,7 +862,6 @@ include_in_fsroot_union () {
nfs)
# activate kernel nfs if not present, nfsroot consists now of two
# different parts
- nfsmod
root_path=$(uri_token $ROOTFS path)
nfsserver=$(uri_token $ROOTFS server)
mkdir -p /mnt/tmp/${root_path}_${union_id}
diff --git a/initramfs/stage3-stuff/init b/initramfs/stage3-stuff/init
index 0d09a6f6..6277fd81 100755
--- a/initramfs/stage3-stuff/init
+++ b/initramfs/stage3-stuff/init
@@ -34,7 +34,7 @@ for i in "/dev/mem c 1 1" "/dev/null c 1 3" "/dev/zero c 1 5" \
"/dev/tty7 c 4 7" "/dev/tty8 c 4 8" "/dev/tty9 c 4 9" \
"/dev/tty10 c 4 10" "/dev/tty c 5 0" "/dev/console c 5 1" \
"/dev/ptmx c 5 2" "/dev/psaux c 10 1" "/dev/agpgart c 10 175" \
- "/dev/fb0 c 29 0" "/dev/rtc0 c 10 135" "/dev/xconsole p"; do
+ "/dev/fb0 c 29 0" "/dev/xconsole p"; do
mknod $i
done
mkdir -p ${devdir}/pts ${devdir}/shm ${devdir}/.udevdb ${devdir}/.udev \
@@ -233,7 +233,7 @@ in $0\ncountry=\"${COUNTRY}\"" >>/etc/initramfs-setup
srvproto=$(uri_token $rootfs prot)
case $srvproto in
nfs)
- # nfsroot consists now of two different parts
+ # nfsroot consists of two components
nfspath=$(uri_token $rootfs path)
nfsserver=$(uri_token $rootfs server)
grep -q -E "nfsserver" /etc/initramfs-setup || \
@@ -277,12 +277,16 @@ line in $0\nnfsserver=\"${nfsserver}\"\nnfspath=\"${nfspath}\"" \
# ip configuration client-ip:server-ip:gateway:netmask
ip=*)
ipinfo=${opts#ip=};;
- # deprecated: nfs server and path (will be removed soon)
+ # deprecated: nfs server and path (rewritten to standard style)
nfsroot=*)
+ srvproto=nfs
nfsroot=${opts#nfsroot=}
- echo -e "\n# nfs root information gotten via kernel command line in \n\
-$0\n# deprecated: please use rootfs=nfs://...\nnfsroot=\"${nfsroot}\"\n" \
->> /etc/initramfs-setup
+ nfspath=${nfsroot#*:}
+ nfsserver=${nfsroot%:/*}
+ grep -q -E "nfsserver" /etc/initramfs-setup || \
+ echo -e "\n# nfs root information gotten via kernel command line \n\
+in $0\n# deprecated: please use rootfs=nfs://...\nnfsserver=\"${nfsserver}\"\
+\nnfspath=\"${nfspath}\"">> /etc/initramfs-setup
;;
# size of tempfs if not max. 50% of RAM should be used
tmpfssize=*)
@@ -640,21 +644,20 @@ if [ -z "${bldmod}" -a -z "${bldserver}" ] ; then
# prefer nfsserver and nfspath from kernel commandline over the information
# gotten from dhcp server
if [ -n "${nfsserver}" -a -n "${nfspath}" ] ; then
- # load the nfs module if needed
- nfsmod
# check if nfsserver is set as variable @@@serverip@@@
nfsserver=$(checkip $nfsserver)
- nfsroot=${nfsserver}:${nfspath}
else
# we got a problem here
error "$init_nfssp" fatal
fi
# interface might not be properly up - check reachability
ping -c 1 -w 15 ${nfsserver} >/dev/null 2>&1
- for proto in tcp udp fail; do
- [ $proto = "fail" ] && { error "$init_nfs"; break; }
- mount -n -t nfs -o ro,nolock,${proto} ${nfsroot} /mnt && break
- done
+ # mount the rootfs via nfs readonly (ro)
+ fsmount nfs ${nfsserver} ${nfspath} /mnt ro
+ #for transport in tcp udp fail; do
+ # [ $proto = "fail" ] && { error "$init_nfs"; break; }
+ # mount -n -t nfs -o ro,nolock,${transport} ${nfsroot} /mnt && break
+ #done
[ $DEBUGLEVEL -eq 20 ] && echo "** finished nfs mount at $(sysup)"
fi