Bug 504652

Summary: kiwi: netboot fails using clicfs image
Product: [openSUSE] openSUSE.org Reporter: Jigish Gohil <cyberorg>
Component: System ImagingAssignee: Marcus Schaefer <ms>
Status: RESOLVED FIXED QA Contact: Adrian Schröter <adrian.schroeter>
Severity: Normal    
Priority: P5 - None CC: cyberorg, ms
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: boot.kiwi using nbdroot
boot.kiwi using aoeroot
latest log with new changes

Description Jigish Gohil 2009-05-18 07:06:51 UTC
+++ This bug was initially created as a clone of Bug #497172 +++

https://bugzilla.novell.com/attachment.cgi?id=292644
boot.kiwi using nbdroot

Manually created clicfs image, attached are the boot.kiwi logs using NBDROOT
and AOEROOT

------- Comment #7 From Jigish Gohil 2009-05-17 06:18:40 MDT (-) [reply] -------

https://bugzilla.novell.com/attachment.cgi?id=292645
boot.kiwi using aoeroot

manually mounting the image works in kiwidebug shell:

for AOE
clicfs /dev/etherd/e0.1 /read-only
mkdir /read-write
mount -o loop /read-only/fsdata.ext3 /read-write


for NBD
clicfs /dev/nbd0 /read-only
mkdir /read-write
mount -o loop /read-only/fsdata.ext3 /read-write
Comment 1 Stephan Kulow 2009-05-18 09:33:19 UTC
The boot.kiwi calls: clicfs -m 1007 /read-only

clicfs needs two arguments at least
Comment 2 Marcus Schaefer 2009-05-18 09:39:50 UTC
this was fixed in kiwi already
Comment 3 Marcus Schaefer 2009-05-18 13:52:28 UTC
reopened
Comment 4 Marcus Schaefer 2009-05-18 14:20:49 UTC
does the following patch solve the problem ?

diff --git a/modules/KIWILinuxRC.sh b/modules/KIWILinuxRC.sh
index a0d3e3a..f739221 100644
--- a/modules/KIWILinuxRC.sh
+++ b/modules/KIWILinuxRC.sh
@@ -3294,11 +3294,15 @@ function mountSystemClicFS {
        #--------------------------------------
        mkdir -p $roDir
        #======================================
-       # check for NFS export location
+       # check for NFS,AOE,NBD export location
        #--------------------------------------
-       if [ ! -z "$NFSROOT" ];then
+       if \
+               [ ! -z "$NFSROOT" ] || \
+               [ ! -z "$AOEROOT" ] || \
+               [ ! -z "$NBDROOT" ]
+       then
                if ! kiwiMount "$imageRootDevice" "$roDir" "" $loopf;then
-                       Echo "Failed to mount NFS filesystem"
+                       Echo "Failed to mount remote filesystem"
                        return 1
                fi
                loopf=$(ls -1 $roDir/*.clicfs &>/dev/null)
Comment 5 Marcus Schaefer 2009-05-18 14:23:50 UTC
for clicfs you need to export the clicfs file as something .clicfs
could you test it ?

Thanks
Comment 6 Jigish Gohil 2009-05-18 15:09:45 UTC
Created attachment 292784 [details]
boot.kiwi using nbdroot

Image is created using:

<type boot="netboot/suse-11.1" bootprofile="diskless">clicfs</type> so it puts file as fsdata.ext3 inside clicfs file, not .clicfs.
Comment 7 Jigish Gohil 2009-05-18 15:10:14 UTC
Created attachment 292785 [details]
boot.kiwi using aoeroot
Comment 8 Marcus Schaefer 2009-05-18 16:14:26 UTC
ok next try, last patch was crap try this one:

diff --git a/modules/KIWILinuxRC.sh b/modules/KIWILinuxRC.sh
index a0d3e3a..2b56edb 100644
--- a/modules/KIWILinuxRC.sh
+++ b/modules/KIWILinuxRC.sh
@@ -3280,6 +3280,7 @@ function mountSystemClicFS {
        local loopf=$1
        local roDir=/read-only
        local rwDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`
+       local roDevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`
        local clic_cmd=clicfs
        local haveBytes
        local haveKByte
@@ -3297,12 +3298,13 @@ function mountSystemClicFS {
        # check for NFS export location
        #--------------------------------------
        if [ ! -z "$NFSROOT" ];then
-               if ! kiwiMount "$imageRootDevice" "$roDir" "" $loopf;then
+               roDevice="$imageRootDevice"
+               if ! kiwiMount "$roDevice" "$roDir" "" $loopf;then
                        Echo "Failed to mount NFS filesystem"
                        return 1
                fi
-               loopf=$(ls -1 $roDir/*.clicfs &>/dev/null)
-               if [ ! -e $loopf ];then
+               roDevice=$(ls -1 $roDir/*.clicfs &>/dev/null)
+               if [ ! -e $roDevice ];then
                        Echo "Can't find an uniqly exported *.clicfs file"
                        return 1
                fi
@@ -3330,7 +3332,7 @@ function mountSystemClicFS {
        #======================================
        # mount clic container
        #--------------------------------------
-       if ! $clic_cmd $loopf $roDir; then  
+       if ! $clic_cmd $roDevice $roDir; then  
                Echo "Failed to mount clic filesystem"
                return 1
        fi
Comment 9 Jigish Gohil 2009-05-18 16:54:37 UTC
Created attachment 292816 [details]
latest log with new changes
Comment 10 Marcus Schaefer 2009-05-19 09:55:47 UTC
patch applied incorrectly, worked afterwards