summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-07-19 19:22:19 +0200
committerDirk von Suchodoletz2007-07-19 19:22:19 +0200
commit76844afa5692effee6d167ebf21e80e37b30f1ee (patch)
tree0730373e4db8b702f34d38711285296d8974994e /initramfs
parentRewrite of tftp fileget - should be possible to use other servers than (diff)
downloadcore-76844afa5692effee6d167ebf21e80e37b30f1ee.tar.gz
core-76844afa5692effee6d167ebf21e80e37b30f1ee.tar.xz
core-76844afa5692effee6d167ebf21e80e37b30f1ee.zip
Repaired uri_token function (no prepend of leading slash is required any
more) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1258 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rwxr-xr-xinitramfs/initrd-stuff/bin/servconfig2
-rw-r--r--initramfs/initrd-stuff/etc/functions16
-rwxr-xr-xinitramfs/initrd-stuff/init7
-rwxr-xr-xinitramfs/mkdxsinitrd2
4 files changed, 14 insertions, 13 deletions
diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig
index 66fe5099..5e676d70 100755
--- a/initramfs/initrd-stuff/bin/servconfig
+++ b/initramfs/initrd-stuff/bin/servconfig
@@ -126,7 +126,7 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then
elif strinstr "/" "$vmware" ; then
vmimgprot=$(uri_token $vmware prot)
vmimgserv=$(uri_token $vmware server)
- vmimgpath="/$(uri_token $vmware path)"
+ vmimgpath="$(uri_token $vmware path)"
fi
if [ -n "${vmimgserv}" ] ; then
testmkd /mnt/var/lib/vmware
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 99d06fe6..7c91391c 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -104,8 +104,8 @@ if strinstr ":" "$rest" ; then
else
tmpval=$rest
rest="${rest#*/}"
- path="${tmpval#*/}"
- server="${tmpval%/$path}"
+ server="$(echo $tmpval|sed 's,/.*,,')"
+ path="${tmpval#${server}}"
port=""
fi
# get path and query components - URI path, query
@@ -350,7 +350,7 @@ local cfgfile
echo "$fileprot $filepath $filepath" > /tmp/fileblub
[ "x$fileprot" = "x" ] && fileprot=tftp
if [ "x$filepath" != "x" ] ; then
- cfgfile=/${filepath}
+ cfgfile=${filepath}
[ "x$fileserv" = "x" ] && fileserv=$(checkip ${serverip})
case "$fileprot" in
ftp|http)
@@ -358,8 +358,8 @@ if [ "x$filepath" != "x" ] ; then
2>/dev/null && { unpack /tmp/$(basename $cfgfile) && break; }
;;
*)
-echo "tftp -g -r /$cfgfile -l /tmp/$(basename $cfgfile) $fileserv" >> /tmp/fileblub
- tftp -g -r /$cfgfile -l /tmp/$(basename $cfgfile) $fileserv \
+echo "tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $fileserv" >> /tmp/fileblub
+ tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $fileserv \
&& unpack /tmp/$(basename $cfgfile)
ls -la /tmp/$(basename $cfgfile) >> /tmp/fileblub
echo "F: /tmp/$(basename $cfgfile)" >>/tmp/fileblub
@@ -385,8 +385,8 @@ and as last\n# distro/default" >> /tmp/confviafile
2>/dev/null && { unpack /tmp/$(basename $cfgfile) && break; }
;;
tftp)
-echo "tftp -g -r /$cfgfile -l /tmp/$(basename $cfgfile) $fileserv" >> /tmp/fileblub
- tftp -g -r /$cfgfile -l /tmp/$(basename $cfgfile) $fileserv \
+echo "tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $fileserv" >> /tmp/fileblub
+ tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $fileserv \
&& { unpack /tmp/$(basename $cfgfile) && break; }
;;
esac
@@ -848,7 +848,7 @@ include_in_fsroot_union () {
case $srvproto in
nfs)
# nfsroot consists now of two different parts
- root_path=/$(uri_token $ROOTFS path)
+ root_path=$(uri_token $ROOTFS path)
nfsserver=$(uri_token $ROOTFS server)
mkdir -p /mnt/tmp/${root_path}_${union_id}
for proto in tcp udp fail; do
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index 0e3ed439..80d38e8b 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -204,7 +204,7 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup
case $srvproto in
nfs)
# nfsroot consists now of two different parts
- nfspath=/$(uri_token $rootfs path)
+ nfspath=$(uri_token $rootfs path)
nfsserver=$(uri_token $rootfs server)
echo -e "\n# nfs root information gotten via kernel command \
line in $0\n#nfsroot=\"${nfsserver}:${nfspath}\"\n" >> /etc/machine-setup
@@ -212,10 +212,11 @@ line in $0\n#nfsroot=\"${nfsserver}:${nfspath}\"\n" >> /etc/machine-setup
*nbd*)
nbdmod=$srvproto
# get settings for nbd-client, filesystem equals to path in URI
- # notation
+ # notation (remove leading slash from filesystem at the end)
nbdhost=$(uri_token $rootfs server)
nbdport=$(uri_token $rootfs port)
nbdrfst=$(uri_token $rootfs path)
+ nbdrfst=${nbdrfst#/*}
;;
aoe)
echo "Not implemented yet"
@@ -385,7 +386,7 @@ if [ -n "${nbdmod}" ] ; then
# load block device driver if needed
modprobe ${MODPRV} ${nbdmod} || error "$init_errnbd"
[ -x /bin/mdev ] && mdev -s
- [ -z "$nbdrfst" ] && nbdrfst=ext2
+ [ -z "$nbdrfst" ] && nbdrfst=squashfs
nbdhost=$(checkip $nbdhost)
if [ $DEBUGLEVEL -eq 20 ] ; then
echo "** starting setup of ${nbdmod} at $(sysup)"
diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd
index 7c83b583..553c94b4 100755
--- a/initramfs/mkdxsinitrd
+++ b/initramfs/mkdxsinitrd
@@ -431,7 +431,7 @@ for bbins in [ ar arping ash bunzip2 cat chmod chown chroot cp cpio cut \
insmod id ip kill killall ln ls lsmod mdev mkdir \
mknod mkswap modprobe mount mv nice ping printf ps rdate \
rm rmmod sed sleep sort swapoff swapon switch_root tar test tftp \
- time touch tr udhcpc umount uptime usleep vconfig vi zcat zcip; do
+ time touch tr udhcpc umount uptime usleep vconfig vi wget zcat zcip; do
ln -fs /bin/busybox ${INSTDIR}/bin/$bbins
done
# fake the sh link in busybox environment