summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-08-01 14:50:33 +0200
committerDirk von Suchodoletz2007-08-01 14:50:33 +0200
commit2529d5de958238d2914e8670f3ed9104c39d9db5 (patch)
treef1890d6a6bb3fcb3e13307d9258eeff167b05dba /initramfs
parent* dropped support for CSV databases, as they are simply not good enough (diff)
downloadcore-2529d5de958238d2914e8670f3ed9104c39d9db5.tar.gz
core-2529d5de958238d2914e8670f3ed9104c39d9db5.tar.xz
core-2529d5de958238d2914e8670f3ed9104c39d9db5.zip
Allow local block device for client root filesystem (URI is
rootfs=lbdev://disk/fs, e.g. disk=sda2, fs=squashfs) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1296 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rw-r--r--initramfs/initrd-stuff/etc/functions8
-rw-r--r--initramfs/initrd-stuff/etc/messages2
-rwxr-xr-xinitramfs/initrd-stuff/init35
-rwxr-xr-xinitramfs/mkdxsinitrd11
4 files changed, 37 insertions, 19 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index c0a45725..34b1cd27 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -182,11 +182,11 @@ fi
#############################################################################
# definition of wlan interface name and wireless connect
wlanlinksetup () {
-if=$(iwconfig 2>/dev/null|sed -n "/ESSID:/p"|sed "s/ .*//")
+local wlanif=$(iwconfig 2>/dev/null|sed -n "/ESSID:/p"|sed "s/ .*//")
if [ -n "$if" ] ; then
- ip link set dev $if up
- if iwconfig $if mode managed essid "${essid}"; then
- nwif=$if
+ ip link set dev ${wlanif} up
+ if iwconfig ${wlanif} mode managed essid "${essid}"; then
+ nwif=${wlanif}
else
error "$init_nowlan"
fi
diff --git a/initramfs/initrd-stuff/etc/messages b/initramfs/initrd-stuff/etc/messages
index 8753cfa1..f31040a3 100644
--- a/initramfs/initrd-stuff/etc/messages
+++ b/initramfs/initrd-stuff/etc/messages
@@ -79,7 +79,7 @@ init_loadcow=" Loading of Copy On Write (COW - special block device) module \
failed -\n Either module is not present or module does not match the \
running\n kernel. If you do not want to see this message remove the token \
'cowloop' from kernel command line."
-init_cownobld=" Loading of cow module is of no sense if no network block \
+init_cownobld=" Loading of cow module is of no sense if no network/other block \
device is used or\n UnionFS/AUFS was specified as read write layer too. Remove \
UnionFS/AUFS token from\n kernel commandline if cowloop should be used instead."
init_nfs=" Mount of root filesystem via NFS was requested via kernel command \
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index bbc71d63..8d8384d8 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -220,17 +220,19 @@ line in $0\n#nfsroot=\"${nfsserver}:${nfspath}\"\n" >> /etc/machine-setup
;;
aoe)
echo "Not implemented yet"
+ bldmod=
;;
iscsi)
echo "Not implemented yet"
+ bldmod=
#iscsiserver=$(uri_token $rootfs server)
#iscsiport=$(uri_token $rootfs port)
#iscsitarget=$(uri_token $rootfs path)
;;
- device)
+ lbdev)
# use a local device for mounting root block device with given
# filesystem, e.g. rootfs=device://sda2/squashfs
- bldmod=""
+ bldmod="sata_sil sd_mod"
blddev=$(uri_token $rootfs server)
bldfst=$(uri_token $rootfs path)
bldfst=${bldfst#/*}
@@ -306,7 +308,7 @@ export LOGFILE
if [ "${DEBUGLEVEL}" -gt 0 -a "${DEBUGLEVEL}" != 8 ] ; then
# if LOGFILE should be used within initial ramdisk add '/mnt' in front
# of the variable
- LOGFILE="/var/log/dxs-boot.log"
+ LOGFILE="/var/log/slx-boot.log"
echo "1 4 1 7" >/proc/sys/kernel/printk
[ "${DEBUGLEVEL}" -ge 2 ] && MODPRV="-v"
[ "${DEBUGLEVEL}" -gt 3 -a "${DEBUGLEVEL}" -le 10 ] && {
@@ -327,6 +329,8 @@ fi
# for multiple ethernet interfaces (not implemented yet)
hwautocfg nwmod
if [ -n "${essid}" ] ; then
+ # WLAN setup will most probably change the network interface name stored in
+ # nwif (to wlan0 or something like that)
wlanlinksetup
#echo "Starting shell for testing of WLAN setup procedure"
#/bin/ash
@@ -389,22 +393,24 @@ sed "s,@@@serverip@@@,$serverip," -i /etc/machine-setup
# ... or via tftp file get (in background)
[ -n "$file" ] && fileget &
-# if root filesystem should be imported via (d) network block device
+# if root filesystem should be imported via local or a network block device
if [ -n "${bldmod}" ] ; then
- # load block device driver if needed
- modprobe ${MODPRV} ${bldmod} || error "$init_errbld"
+ # load block device driver(s) if needed
+ for module in ${bldmod} ; do
+ modprobe ${MODPRV} ${module} || error "$init_errbld"
+ done
[ -x /bin/mdev ] && mdev -s
[ -z "$bldrfst" ] && bldrfst=squashfs
bldhost=$(checkip $bldhost)
if [ $DEBUGLEVEL -eq 20 ] ; then
echo "** starting setup of ${bldmod} at $(sysup)"
else
- echo "Diskless client using ${bldmod} on $bldhost:$bldport with $bldrfst"
+ echo "Stateless client using ${bldmod} on $bldhost:$bldport with $bldrfst"
fi
# fixme: check for fs in /proc/filesystems before trying to load the module
- modprobe -a ${MODPRV} ${bldrfst} || error "$init_errbld" nonfatal
+ modprobe ${MODPRV} ${bldrfst} || error "$init_errbld" nonfatal
- case "${bldmod}" in
+ case "${srvproto}" in
# network block device present in standard kernel
nbd)
RDEV=/dev/nbd0
@@ -471,8 +477,9 @@ if [ -n "${bldmod}" ] ; then
echo noop > /sys/block/dnbd0/queue/scheduler
echo 0 > /sys/block/dnbd0/queue/read_ahead_kb
;;
- device)
- # using clients local disk (partition is to be specified)
+ lbdev)
+ # using clients local block device (disk partition is to be specified)
+ echo "B: /dev/$blddev"
RDEV=/dev/$blddev
;;
esac
@@ -504,12 +511,12 @@ if [ -n "${bldmod}" ] ; then
# use normal UnionFS behaviour because rootfs is not NFS
unset nfsro
fi
- # finally mount the block device
- for i in 1 50 100 200 400 1000 ; do
+ # finally mount the configured network/local block device
+ for i in 0 5000 20000 100000 500000 1000000 ; do
usleep $i
mount -n -t $bldrfst -o $RWRO $RDEV /mnt 2>/dev/null && break
done
- [ $DEBUGLEVEL -eq 20 ] && echo "** finished nw blockdev stuff at $(sysup)"
+ [ $DEBUGLEVEL -eq 20 ] && echo "** finished blockdev setup stuff at $(sysup)"
elif [ -n ${iscsiserver} ] ; then
[ $DEBUGLEVEL -eq 20 ] && echo "** started setting up iSCSI initiator at \
$(sysup)"
diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd
index 553c94b4..e9541f65 100755
--- a/initramfs/mkdxsinitrd
+++ b/initramfs/mkdxsinitrd
@@ -594,6 +594,10 @@ for module in af_packet unix ${NWMODULES} ${FSMODULES} ${MISCMODULES} \
modcp ${ROOTDIR}/$mod ${INSTDIR}/${mod%/*} ${ROOTDIR}
done
;;
+ # for unsupported WLAN devices
+ ndiswrapper)
+ cp -a ${ROOTDIR}/etc/ndiswrapper ${INSTDIR}/etc
+ ;;
nfs)
# create directory structure for modules needed and copy them
# to the proper place (as expected by modprobe/modules.dep)
@@ -635,6 +639,13 @@ for module in af_packet unix ${NWMODULES} ${FSMODULES} ${MISCMODULES} \
tpm)
# tpm module stuff
;;
+ sata_sil|sata_nv|sata_via)
+ # serial ata local disk support
+ mkdir -p ${ddirprefix}/drivers/scsi ${ddirprefix}/drivers/ata
+ cp ${rdirprefix}/drivers/scsi/{scsi,sd}_mod.ko \
+ ${ddirprefix}/drivers/scsi
+ cp ${rdirprefix}/drivers/ata/libata.ko ${ddirprefix}/drivers/ata
+ ;;
esac
fi
done