OpenELEC Forum
[SOLVED] PXE using CIFS having mixed results - Printable Version

+- OpenELEC Forum (https://forum.openelec.tv)
+-- Forum: Generic Forum (https://forum.openelec.tv/forumdisplay.php?fid=5)
+--- Forum: NETWORK (https://forum.openelec.tv/forumdisplay.php?fid=49)
+---- Forum: PXE / Network boot (https://forum.openelec.tv/forumdisplay.php?fid=50)
+---- Thread: [SOLVED] PXE using CIFS having mixed results (/showthread.php?tid=30601)

Pages: 1 2 3


[SOLVED] PXE using CIFS having mixed results - KillerKelvUK - 04-09-2012

Hi, as per ack006's post over here I've shifted the below support request into this new thread. I've also had a look through ack006's new sticky on PXE here and believe I've got the correct syntax. Any help/pointers are apprecaited.

K

Original post below...

Been toying around with PXE'ing using Samba and thereabouts got it working albeit with some random issues which seem file permission related.

pxelinux.cfg/default file looks like this...
Code:
LABEL OE_Fusion_x86_64_r10254_cifs
MENU LABEL OpenELEC Fusion x86_64 Devel r10254 CIFS
KERNEL openelec/Fusion/r10254/KERNEL
APPEND ip=dhcp boot=CIFS=//xxx.xxx.xxx.xxx/shareroot,user=xxxx,password=xxxx,
prefixpath=relative path from boot-shareroot to subdir as needed/
disk=CIFS=//xxx.xxx.xxx.xxx/shareroot,user=xxx,password=xxxx,
prefixpath=relative path from disk-shareroot to subdir as needed/
nosplash ssh debugging

boot=CIFS and disk=CIFS are case sensitive just like the NFS variant. I also noted that termining the shareroot directory with a / resulted in an error e.g.

boot=CIFS=//xxx.xxx.xxx.xxx/openelec/ <--Doesn't work
boot=CIFS=//xxx.xxx.xxx.xxx/openelec <--Works

Combined with the prefixpath option which needs to start as a relative path from the shareroot as above.

So onto my problem...it doesn't boot everytime! If I delete the storage directory and let OE re-create it on boot then okay, however when rebooted I get SSH permission errors and seemingly a black screen at the point its trying to spring xbmc. Manually correct the SSH permissions with a chmod -R 700 /storage/.cache/ssh, the SSH error ceases to present but still the black screen after and no xbmc.

Anyone offer any guidance/insight?

EDIT: Forgot to mention that PXE the same KERNEL and SYSTEM files but using NFS works no issues :angry:


Re: [Help] PXE using CIFS having mixed results - ack006 - 04-09-2012

Are you sure the 'prefixpath' option is supported? Please note that OpenELEC's initramfs uses Busybox 'mount', which probably isn't as 'pimped out' as the real util-linux 'mount'.
At least I couldn't find mention of this option in Busybox source.

If you don't mind doing a little debugging from the shell (you will need to attach a keyboard :-) ), please remove 'nosplash' and add the following to the kernel parameters:
Code:
break=mount_disks
This will start a debugging shell right after OpenELEC has done the mounts. Now you can use 'mount' to check if everything was mounted correctly. Please let me know if there are any problems.


Re: [Help] PXE using CIFS having mixed results - KillerKelvUK - 04-09-2012

ack006 post=30611 Wrote:Are you sure the 'prefixpath' option is supported? Please note that OpenELEC's initramfs uses Busybox 'mount', which probably isn't as 'pimped out' as the real util-linux 'mount'.
At least I couldn't find mention of this option in Busybox source.

If you don't mind doing a little debugging from the shell (you will need to attach a keyboard :-) ), please remove 'nosplash' and add the following to the kernel parameters:
Code:
break=mount_disks
This will start a debugging shell right after OpenELEC has done the mounts. Now you can use 'mount' to check if everything was mounted correctly. Please let me know if there are any problems.

Smile Using Acer Aspire One 722 netbook for testing on the 1.95.1 Fusion build so keyboard isn't a problem Confusedide:

Mounts work fine, I had to "figure out" your new code for the mounting process and so spent a lot of time in bb trying different combinations until I got it working there before I updated my PXE config.

One thing I did just note from the debugging as per your recommendatios is that the mounts have 2 parameters I didn't specify which are file_mode=0755 and dir_mode=0755. I can alter these if I specify something different in the mount command...are these correct considering OE throws an SSH error message if the keyfiles have permissions greater than 0700?


Re: [Help] PXE using CIFS having mixed results - ack006 - 04-10-2012

KillerKelvUK post=30625 Wrote:One thing I did just note from the debugging as per your recommendatios is that the mounts have 2 parameters I didn't specify which are file_mode=0755 and dir_mode=0755. I can alter these if I specify something different in the mount command...are these correct considering OE throws an SSH error message if the keyfiles have permissions greater than 0700?

These are the defaults (of bb mount, not init) when you mount a CIFS share without overriding them. If I'm not mistaken they specify the dir/file mode (not the mask!) for newly created directories and files.
What exactly happens with actual file permissions probably depends on whether your server is on some *nix (or whether it supports Unix extensions for CIFS) or Windows.
This definitely needs some testing/experimenting, I'll try and ask around.


Re: [Help] PXE using CIFS having mixed results - chewitt - 04-10-2012

CIFS/SMB/FAT/FAT32 filesystems do not support unix filesystem permissions. You can mess with the mask value but OpenSSH checks the permissions on the SSH keys in /storage/.cache and if they are not 644 (or more restrictive, 600 would be better) sshd will not start. The default mount mask in OE for FAT/FAT32 is 777. CIFS and SMB may be different, but you'll have the same fundamental problem.


Re: [Help] PXE using CIFS having mixed results - KillerKelvUK - 04-10-2012

I've tried playing around with different permissions e.g. 0600 as chewitt called out but my problem is unchanged...I get the splash screen and then flicker to a v low backlit black screen and nothing. I did try and SSH onto the OE instance but no success, I've also replacated this using a Generic build off my desktop PC.

I'm using a Qnap TS-259Pro+ as my PXE and CIFS server, runs latest f/w. And to reconfirm I've just re-tested the same build (Fusion) but using NFS and it works without issue. Undecided

EDIT: I can ssh onto OE, I also can get bash with ctrl+alt+f3.

mounts look like...

Code:
rootfs on / type rootfs (rw)
none on /dev type devtmpfs (rw,relatime,size=883988k,nr_inodes=220997,mode=755)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
//192.168.1.100/PXE on /flash type cifs (ro,mand,noatime,sec=ntlm,unc=192.168.1.100PXE,username=XXXX,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.100,file_mode=0600,dir_mode=0600,nounix,serverino,rsize=61440,wsize=65536,actimeo=1)
//192.168.1.100/PXE on /storage type cifs (rw,mand,noatime,sec=ntlm,unc=192.168.1.100PXE,username=XXXX,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.100,file_mode=0600,dir_mode=0600,nounix,serverino,rsize=61440,wsize=65536,actimeo=1)
/dev/loop0 on / type squashfs (ro,relatime)
none on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
none on /dev/shm type tmpfs (rw,relatime)
none on /var type ramfs (rw,relatime)
/dev/sda1 on /var/media/PQSERVICE type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sda2 on /var/media/SYSTEM RESERVED type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sda3 on /var/media/Windows type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sda6 on /var/media/c62b370d-a313-4472-9650-c8e8b25b6917 type ext4 (rw,nosuid,nodev,relatime,barrier=1,data=ordered)
/dev/sda7 on /var/media/OpenELEC Storage type ext3 (rw,nosuid,nodev,relatime,barrier=1,nodelalloc,data=ordered)
/dev/sda8 on /var/media/OpenELEC Boot type ext3 (rw,nosuid,nodev,relatime,barrier=1,nodelalloc,stripe=4,data=ordered)

top also confirms Xorg is running...

Code:
Mem: 323340K used, 1449580K free, 0K shrd, 40432K buff, 163452K cached
CPU: 22.1% usr 7.7% sys 0.0% nic 69.7% idle 0.0% io 0.0% irq 0.2% sirq
Load average: 1.08 0.41 0.15 1/183 2324
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
655 1 root S 216m 12.4 0 1.4 Xorg :0.0 vt01 -s 0 -noreset -allowMouseOpenFail -nolisten tcp -logverbose 6 -verbose 6 -conf
511 1 root S 186m 10.7 1 0.9 /usr/lib/polkit-1/polkitd --no-debug
61 2 root SW 0 0.0 1 0.9 [irq/40-eth0]
3 2 root RW 0 0.0 0 0.6 [ksoftirqd/0]
291 1 dbus S 15460 0.8 1 0.5 dbus-daemon --system
9 2 root SW 0 0.0 1 0.5 [ksoftirqd/1]
391 1 root S 1012m 58.3 0 0.3 console-kit-daemon
81 2 root SW 0 0.0 1 0.3 [cifsd]
1282 1 root S 192m 11.0 0 0.1 /usr/lib/upower/upowerd
747 498 root S 42308 2.3 0 0.1 ratpoison
1 0 root S 11664 0.6 1 0.1 {init} /bin/sh /sbin/init
2258 1769 root R 7616 0.4 0 0.1 top
403 1 root S 192m 11.1 0 0.0 /usr/lib/udisks/udisks-daemon
177 1 root S 190m 10.9 1 0.0 fbsplashd --theme=default --type=bootup
493 403 root S 47236 2.6 0 0.0 udisks-daemon: not polling any devices
1004 1 root S 42816 2.4 0 0.0 smbd --daemon --configfile=/var/run/smb.conf
1020 1004 root S 42816 2.4 0 0.0 smbd --daemon --configfile=/var/run/smb.conf
334 1 root S 31368 1.7 1 0.0 /usr/bin/wpa_supplicant -u
1715 533 root S 28184 1.5 1 0.0 {sshd} sshd: root@pts/0
506 1 avahi S 25880 1.4 0 0.0 avahi-daemon: running [openelec.local]



Re: [Help] PXE using CIFS having mixed results - chewitt - 04-10-2012

OE assumes that /storage is a Unix filesystem and there are a whole bunch of things that require correct permissions to work correctly so forcing everything to 600 (or any other blanket setting) will break more than it solves. I doubt you will ever get OE to run with /storage on a CIFS share.


Re: [Help] PXE using CIFS having mixed results - KillerKelvUK - 04-10-2012

chewitt post=30656 Wrote:...I doubt you will ever get OE to run with /storage on a CIFS share.

Ah right, I'd just assumed that since this option had been coded in then it was a functioning solution. My preference is to use NFS however I have another (unrelated) challenges in that arean hence trying CIFS.

Just before I give up however does the output I posted in my previous not indiciate that OE has created the environment and that its just xbmc left to spring?

EDIT: I just re-read ack006's sticky here and it does state that mounting /storage using CIFS will work, so I'm a little confused now... :S


Re: [Help] PXE using CIFS having mixed results - KillerKelvUK - 04-13-2012

Hi, is this definately a dead duck or is there some more debugging I can do?


Re: [Help] PXE using CIFS having mixed results - ack006 - 04-13-2012

chewitt post=30656 Wrote:OE assumes that /storage is a Unix filesystem and there are a whole bunch of things that require correct permissions to work correctly so forcing everything to 600 (or any other blanket setting) will break more than it solves. I doubt you will ever get OE to run with /storage on a CIFS share.

It is (or at least it was when I last tested my init changes on CIFS mounts, r10275) most certainly possible to boot and run OE off CIFS shares (for both SYSTEM and /storage).
Also, Unix extensions for CIFS do exist, see here.

I tested booting and running OE with an Ubuntu box as CIFS server, but I haven't tested sharing ssh keys (I simply entered the password every time), nor have I tested booting OE off a Windows box so I can't tell if/how it is possible to set that up to support full unix permissions.