[LIVE] XBMCBuntu nfscow not working
#1
Hi,
I tried to NetBoot XBMCBuntu with nfsroot and nfscow but it seems that nfscow is not picked up and therefore just get the "read only" portion of the system.
The same config works with dharma livecd.

Any idea ?

Here is my pxelinux.cfg

prompt 0
default menu
implicit 0
timeout 30
menu title XBMCBuntu 11.0
ipappend 2

label menu
menu hide
kernel menu.c32
append XBMC-11.0/pxelinux.cfg
ipappend 0

label xbmccow
menu label XBMCLive NFS Persistent
menu default
kernel XBMC-11.0/casper/vmlinuz
append initrd=XBMC-11.0/casper/initrd.lz netboot=nfs nfsroot=192.168.0.2:/export/XBMC/11.0-XBMCBuntu ip=dhcp root=/dev/nfs usbcore.autosuspend=-1 video=vesafb boot=casper xbmc=autostart,nodiskmount,noredir splash quiet loglevel=0 quickreboot quickusbmodules notimezone noaccessibility noapparmor noaptcdrom noautologin noxautologin noconsolekeyboard nofastboot nognomepanel nohosts nokpersonalizer nolanguageselector nolocales nopowermanagement noprogramcrashes nojockey nosudo noupdatenotifier nouser nopolkitconf noxautoconfig noxscreensaver nopreseed union=aufs nfscow=192.168.0.2:/export/nfsroot/XBMC-11.0/client_mac_address


label safecow
menu label XBMCLive, NFS Persistent SAFE MODE
kernel XBMC-11.0/casper/vmlinuz
append initrd=XBMC-11.0/casper/initrd.lz netboot=nfs nfsroot=192.168.0.2:/export/XBMC/11.0-XBMCBuntu ip=dhcp root=/dev/nfs usbcore.autosuspend=-1 boot=casper xbmc=nodiskmount,noredir quiet loglevel=0 quickreboot quickusbmodules notimezone noaccessibility noapparmor noaptcdrom noautologin noxautologin noconsolekeyboard nofastboot nognomepanel nohosts nokpersonalizer nolanguageselector nolocales nopowermanagement noprogramcrashes nojockey nosudo noupdatenotifier nouser nopolkitconf noxautoconfig noxscreensaver nopreseed union=aufs nfscow=192.168.0.2:/export/nfsroot/XBMC-11.0/client_mac_address
Reply
#2
Solved the issue, I had to decompress initrd.lz.
I discovered that the casper scripts don't handle nfscow at all.
I had to modify it to add the support.
Works now.
Reply
#3
Hi tafypz,

Could you please tell us what you modified/did to get the nfscow to work?
I'm currently using the v32 version of the casper beta 3 image, all works fine except the nfscow. I've ripped the initrd apart and I also see that there is no nfscow handling in the initrd\scripts\casper script.
I've looked at the script from the 10.1 live cd, and in that initrd\scripts\live there is nfscow handling, however, the script is so much different, that I don't see where to put what.

Thanks in advance.
Reply
#4
Ok, found what to do. Actually quite a bit Smile

Here is a brief walk-trough:

Uncompress and cpio out the original initrd.lz, using this info: http://blog.mybox.ro/2010/05/12/how-to-c...trd-image/

Then edit the <initrd>/scripts/casper-helpers.

Add the folowing function:
Code:
get_mac ()
{
    mac=""

    for adaptor in /sys/class/net/*
    do
        status="$(cat ${adaptor}/iflink)"

        if [ "${status}" -eq 2 ]
        then
            mac="$(cat ${adaptor}/address)"
            mac="$(echo ${mac} | sed 's/:/-/g' | tr '[a-z]' '[A-Z]')"
        fi
    done

    echo ${mac}
}

Save the file.

Then edit the file <initrd>/scripts/casper

Add the following in the case $x that starts on line 35, adding the first line on line 64:
Code:
nfscow=*)
    NFS_COW="${x#nfscow=}"
    export NFS_COW ;;

Then on line 432 (just under the mkdir -p /cow), add the following:
Code:
cow_mountopt="rw,noatime"

    if [ -n "${NFS_COW}" ] && [ -z "${NOPERSISTENT}" ]
    then
        # check if there are any nfs options
        if echo ${NFS_COW}|grep -q ','
        then
            nfs_cow_opts="-o nolock,$(echo ${NFS_COW}|cut -d, -f2-)"
            nfs_cow=$(echo ${NFS_COW}|cut -d, -f1)
        else
            nfs_cow_opts="-o nolock"
            nfs_cow=${NFS_COW}
        fi
        mac="$(get_mac)"
        if [ -n "${mac}" ]
        then
            cowdevice=$(echo ${nfs_cow}|sed "s/client_mac_address/${mac}/")
            cow_fstype="nfs"
        else
            panic "unable to determine mac address"
        fi
        
        if [ "${cow_fstype}" = "nfs" ]
        then
            log_begin_msg \
                "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow"
            nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \
                panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on /cow"
        else
            mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \
                panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on /cow"
        fi
    fi

And then uncomment (place a # in front of) the line 482 (mount command)

Please note, line numbers are according to the modified file!

Then repack the initrd:

Code:
# find ./ | cpio -H newc -o > ../initrdEdenv32_nfscow
# lzma < ../initrdEdenv32_nfscow > ../initrdEdenv32_nfscow.lz

Happy scripting!
Reply
#5
This is really useful. However after modified script, the files under /etc didn't get persistent. Any idea?

Thanks

Noodle
Reply
#6
Just wanted to say thanks for the info in this thread. It works!

However there are some issues,
  • Addon updates almost always fail - I have to manually delete the addon dir from my share on the server, then the update succeeds
  • /etc issue as mentioned above

All in all I think the netboot is not really worth it at the moment. If you could use the builtin "casper-rw" persistency file support over NFS it would be neat, but I can't get that working... (If anyone has tried that succesfully, please post about it Smile)
Reply
#7
/etc issue is because of scripts during XBMCBuntu startup, it keep creating /etc/passwd, /etc/shadow every time which almost overwrite your change.
Reply
#8
Actually it's pretty strange that the support for NFS COW was/is broken.
It's such a valuable addition to the whole xbmc linux package.

I haven't tested Frodo yet, but it seems that it also doesn't work on that release. Is there any way to get a developer for xbmc-linux to address this issue? Should we post a bugreport?
Reply
#9
And even Frodo XBMCbuntu still doesn't support nfs cow yet!

Sad
Reply

Logout Mark Read Team Forum Stats Members Help
[LIVE] XBMCBuntu nfscow not working0