From 76844afa5692effee6d167ebf21e80e37b30f1ee Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Thu, 19 Jul 2007 17:22:19 +0000 Subject: 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 --- initramfs/initrd-stuff/etc/functions | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'initramfs/initrd-stuff/etc/functions') 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 -- cgit v1.2.3-55-g7522