Author Topic: 'Diskless' Raspberry Pis are out in the wild!  (Read 12781 times)

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
'Diskless' Raspberry Pis are out in the wild!
« on: September 21, 2016, 01:43:15 am »
Hey everyone!  I wanted to pass on some of the recent work I've been doing in relation to the Raspberry Pis.

It's been a long slog bringing the system to the RPi line of systems.  In the original LMCE release for the RPi I had spent 2 months hacking u-boot to provide a really robust 'PXE like' boot process for the RPi in LMCE.  It was intense and required understanding and programing u-boot for low-level memory access to pass boot parameters (ATAGS) properly to the linux kernel.  When the RPi2 was released the hardware had changed significantly and the broadcom SOC was upgraded to a multi-core cpu and armv7 rather than the older armv6 architecture.  Due to the architecture changes in the SOC u-boot failed to work with the new Raspberries.  So I revived the old, old concept of disked Media Directors for the RPi2.  This worked well as long as the power didn't go out (which meant you would have to re-write the sdcard and let the system re-install all the software packages again.)  With the RPi foundation's recent announcement of netboot capability (https://www.raspberrypi.org/blog/pi-3-booting-part-ii-ethernet-all-the-awesome/) we have a new way to boot all Raspberry Pi B's (1, 2 and 3).

Head on over to http://wiki.linuxmce.org/index.php/RaspberryPi to read about how to setup a network booting RPi Media Director.

Keep in mind that the RPi foundation (and myself) still consider this to be very experimental.

Have fun!

G.I.R.

  • Veteran
  • ***
  • Posts: 58
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #1 on: September 21, 2016, 02:57:51 pm »
Absolut fantastic work!
Thank You very much! A dream comes true! :)
It is near to that point that i would label this whole linuxmce thing as magical...
Affortable and noiseless md for every room. fantastic!

I am already trying to get it working.

Using a raspberry pi model 3b.

Updated and upgraded my linuxmce 14.04 system to the newest available point:
i386 - 201609172308+325de35d (besides the webadmin and the weborbiter are showing older version numbers)

Prepared the raspberry for network/usb booting (it is showing 0x3020000a).
I have not used the sdcard mentioned in the wiki. I used the way it was described there:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
Should be the same result?

Installed the default netboot kernel package.

Changed the TARGET_TYPE. (Do i need to change it back after i have created the tarball?)

The raspberry didn`t get recognized. So i even tried to add the template manually, providing a mac address and an ip address.

it won`t boot.

I made a tcpdump on the core/hybrid and all i could find is this:

Code: [Select]
13:48:52.061106 IP moon142.49154 > 0.0.0.0.tftp: 29 RRQ "autoboot.txt" octet tsize 0
13:48:53.061145 IP moon142.49155 > 0.0.0.0.tftp: 27 RRQ "config.txt" octet tsize 0
13:48:54.061306 IP moon142.49156 > 0.0.0.0.tftp: 29 RRQ "recovery.elf" octet tsize 0
13:48:55.061453 IP moon142.49157 > 0.0.0.0.tftp: 26 RRQ "start.elf" octet tsize 0
13:48:56.061562 IP moon142.49158 > 0.0.0.0.tftp: 26 RRQ "fixup.dat" octet tsize 0

I copied something via tft to the core and vice versa without any problem.

I don`t know what i can do. Maybe reinstall everything? Did the netboot kernel package changed since last week? Is it a good idea to reinstall that?

I would really like to have a noiseless raspberry as md.
And i really would be very thankfull for any idea/suggestion/hint!

But again thanks!




phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #2 on: September 21, 2016, 05:28:45 pm »
While I and one other have been successful I've heard of a couple issues more recently.  I've heard of some issues with the diskless filesystem being created but the device itself should be creating.

Prepared the raspberry for network/usb booting (it is showing 0x3020000a).
I have not used the sdcard mentioned in the wiki. I used the way it was described there:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
Should be the same result?

I assume you're booting without an sdcard.  The RPi foundation has found a couple of bugs in that method.  Try booting with an sdcard that has just bootcode.bin on it (or use the new one I just posted on the wiki, it'll set the OTP bit, rewrite the sdcard contents and reboot automatically).

Installed the default netboot kernel package.

Changed the TARGET_TYPE. (Do i need to change it back after i have created the tarball?)

No, it simply needs to be set for the target type you want the image created for prior to running the script.  You could create a tarball for both i386 and rpi, for example.

The raspberry didn`t get recognized. So i even tried to add the template manually, providing a mac address and an ip address.

it won`t boot.

I really, really, really do not recommend adding the DT manually, it will not contain the serial number of the RPi, which is a requirement to netboot.  The automatic process will pass the serial number to the core when it is discovered.


I made a tcpdump on the core/hybrid and all i could find is this:

Code: [Select]
13:48:52.061106 IP moon142.49154 > 0.0.0.0.tftp: 29 RRQ "autoboot.txt" octet tsize 0
13:48:53.061145 IP moon142.49155 > 0.0.0.0.tftp: 27 RRQ "config.txt" octet tsize 0
13:48:54.061306 IP moon142.49156 > 0.0.0.0.tftp: 29 RRQ "recovery.elf" octet tsize 0
13:48:55.061453 IP moon142.49157 > 0.0.0.0.tftp: 26 RRQ "start.elf" octet tsize 0
13:48:56.061562 IP moon142.49158 > 0.0.0.0.tftp: 26 RRQ "fixup.dat" octet tsize 0

That doesn't seem like it's passing the files.  Can you run 'ls -lah /tftpboot/ | pastebinit' so I can see if all of the tftp files are setup properly.

I don`t know what i can do. Maybe reinstall everything? Did the netboot kernel package changed since last week? Is it a good idea to reinstall that?

Shouldn't have to re-install.  The default kernel package has not changed since last week, the only change is that I've provided an sdcard to setup the OTP bit and rewrite the card automatically.

I would really like to have a noiseless raspberry as md.
And i really would be very thankfull for any idea/suggestion/hint!

The rpi is pretty nice as a lightweight MD, I've been running 3 permanent and 2 testing units for many years now.

I'll be checking into the issues that you, and others, have been reporting over the next few days.  Thanks for testing!

G.I.R.

  • Veteran
  • ***
  • Posts: 58
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #3 on: September 21, 2016, 06:28:25 pm »
thanks for the quick reply.

here is the pastebin (ls -lah /tftpboot/)

http://paste.ubuntu.com/23211976/

and this is /tftboot/rpi

http://paste.ubuntu.com/23211995/

i deleted the manually created device (moon142) via webadmin.

is it okay that there is still this link:
Code: [Select]
boot -> /usr/pluto/diskless/142/boot
i tried booting with a sdcard only having bootcode.bin on it.
but i will try that one from the wiki, when i am at home.

would doing a tcpdump again help?

Thanks for Your help!


phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #4 on: September 21, 2016, 09:15:12 pm »
I would definitely try with my sdcard, in case there is some version mismatch between your bootcode.bin and start.elf in the default network boot directory.  Your files all look good.

The link should be removed, it is not created properly as it doesn't contain the rpi serial number.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #5 on: September 22, 2016, 01:31:01 am »
If it still doesn't boot we need to check the dhcp config.  I'm thinking that even with the upgraded packages the dhcp config may not have been rewritten to provide the proper magic text to the rpi to permit it to network boot.

In that case you can run '/usr/pluto/bin/DHCP_config.sh' to rewrite the dhcp config, then run 'service isc-dhcp-server restart'.

Let me know what works out and I can make any required changes to package installs.

G.I.R.

  • Veteran
  • ***
  • Posts: 58
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #6 on: September 22, 2016, 10:31:26 am »
Hello,

i tried the sd card provided by the wiki.
But with no luck.

And i run DHCP_config.sh and restarted the service.
It just won`t boot.

I did a tcpdump again.
Searching with wireshark for DHCP, this is what i found:

Code: [Select]
1081 24.256112 0.0.0.0 255.255.255.255 DHCP 362 DHCP Discover - Transaction ID 0x26f30339
1167 29.594817 0.0.0.0 255.255.255.255 DHCP 362 DHCP Discover - Transaction ID 0x26f30339
1201 30.596061 192.168.80.1 192.168.80.143 DHCP 342 DHCP Offer    - Transaction ID 0x26f30339
1300 35.592479 0.0.0.0 255.255.255.255 DHCP 362 DHCP Discover - Transaction ID 0x26f30339
1319 36.593282 192.168.80.1 192.168.80.144 DHCP 342 DHCP Offer    - Transaction ID 0x26f30339
1390 40.592633 0.0.0.0 255.255.255.255 DHCP 362 DHCP Discover - Transaction ID 0x26f30339
1421 41.594131 192.168.80.1 192.168.80.145 DHCP 342 DHCP Offer    - Transaction ID 0x26f30339
1908 45.592694 0.0.0.0 255.255.255.255 DHCP 362 DHCP Discover - Transaction ID 0x26f30339
2003 46.593630 192.168.80.1 192.168.80.146 DHCP 342 DHCP Offer    - Transaction ID 0x26f30339


Edit:
Found this, filtering for the raspberrys mac:

Code: [Select]
1328 43.276709 0.0.0.0 255.255.255.255 DHCP 362 DHCP Discover - Transaction ID 0x26f30339
1344 44.278321 192.168.80.1 192.168.80.140 DHCP 342 DHCP Offer    - Transaction ID 0x26f30339
1458 48.276786 0.0.0.0 255.255.255.255 DHCP 362 DHCP Discover - Transaction ID 0x26f30339
1474 49.278368 192.168.80.1 192.168.80.141 DHCP 342 DHCP Offer    - Transaction ID 0x26f30339
1558 54.276634 192.168.80.141 0.0.0.0 TFTP 77 Read Request, File: 71638953/start.elf, Transfer type: octet, tsize=0
1583 55.293906 192.168.80.141 0.0.0.0 TFTP 71 Read Request, File: autoboot.txt, Transfer type: octet, tsize=0
1609 56.294059 192.168.80.141 0.0.0.0 TFTP 69 Read Request, File: config.txt, Transfer type: octet, tsize=0
1627 57.294111 192.168.80.141 0.0.0.0 TFTP 71 Read Request, File: recovery.elf, Transfer type: octet, tsize=0
1640 58.294142 192.168.80.141 0.0.0.0 TFTP 68 Read Request, File: start.elf, Transfer type: octet, tsize=0
1666 59.913080 192.168.80.141 0.0.0.0 TFTP 68 Read Request, File: fixup.dat, Transfer type: octet, tsize=0

Destination/Source is the mac-address of my raspberry.

I hope this is of any help. i am definitly in no way an expert.
just playing around.

Thanks for Your time!

« Last Edit: September 22, 2016, 12:11:46 pm by G.I.R. »

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #7 on: September 22, 2016, 02:02:59 pm »
Well, it looks like the RPi is network booting but stopping after tftp of fixup.dat.  Can you confirm that you see the square rainbow box on your RPi screen a few moments after turning it on (this indicates that start.elf transferred)?  I'm at a little bit of a loss at the moment as to why it's stopping.

J.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #8 on: September 22, 2016, 02:15:47 pm »
I wonder if you have an old diskless image for the rpi.  I added the bits to bring in the experimental kernel just a week ago or so.  You might try creating a new diskless image.

Edit: it's the default image that's not booting.  I know I suggested not doing it but perhaps try re-downloading the default image and re-install it.
« Last Edit: September 22, 2016, 08:39:16 pm by phenigma »

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #9 on: September 22, 2016, 11:50:33 pm »
Well, good news is that I am able to re-create the issue you are having with one of my RPi3s.  I'm booting without an sdcard and it looks like a conflict between the gpu's bootcode.bin on the version of start.elf in the default package.  This is my theory atm.  When I use my sdcard and an RPi2 it is working.  I'll try to figure out what is conflicting.

If I boot with my sdcard from the wiki, the RPi3 boots fully.  Don't remove the card.

Use this on the core to track tftpbooting (change eth1 to whatever your internal nic is):  tcpdump -i eth1 -vv | grep "tftp"

A full boot first boot will look like this: http://paste.ubuntu.com/23217748

J.
« Last Edit: September 22, 2016, 11:58:31 pm by phenigma »

G.I.R.

  • Veteran
  • ***
  • Posts: 58
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #10 on: September 23, 2016, 10:09:04 am »
okay thanks.

the last boot attempts i was using the sdcard from the wiki.

but  it didn`t show the rainbow. my lcd is just saying "no signal".

i will try to reinstall the default image and report back.

there must be away.... :)

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #11 on: September 23, 2016, 08:39:50 pm »
I've put up a new default netboot image for the rpis.  This is working on my RPi3 without an sdcard again.  I highly recommend leaving the sdcard in as the RPi3 SOC has some bugs that make netbooting very unreliable without the sdcard.  So grab the two files from the wiki page (default image and sdcard image) and try again with these fresh files.

* phenigma crosses fingers.

G.I.R.

  • Veteran
  • ***
  • Posts: 58
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #12 on: September 23, 2016, 11:21:48 pm »
hmm, sorry no luck.

just to be sure not to make any stupid mistakes somewhere:
i installed the linux-image-default-raspbian-jessie_4.4.17-v7+-lmce5_all.deb with dpkg -i.
then i made a new diskless image.
i copied the diskless image to the sdcard:
Code: [Select]
dd bs=4M if=2016-09-20-netboot-lmce.img of=/dev/sdbstarted the raspberry.
it boots, doing the programming things and then it reboots (sdcard still inside).
but all i can see at this time is "no signal".

tcpdump i showing this:
Code: [Select]
          file "/tftpboot/pxelinux.0"
          file "/tftpboot/pxelinux.0"
          file "/tftpboot/pxelinux.0"
    192.168.80.198.49153 > 0.0.0.0.tftp: [no cksum]  35 RRQ "71638953/start.elf" octet tsize 0
    192.168.80.198.49154 > 0.0.0.0.tftp: [no cksum]  29 RRQ "autoboot.txt" octet tsize 0
    192.168.80.198.49155 > 0.0.0.0.tftp: [no cksum]  27 RRQ "config.txt" octet tsize 0
    192.168.80.198.49156 > 0.0.0.0.tftp: [no cksum]  29 RRQ "recovery.elf" octet tsize 0
    192.168.80.198.49157 > 0.0.0.0.tftp: [no cksum]  26 RRQ "start.elf" octet tsize 0
    192.168.80.198.49158 > 0.0.0.0.tftp: [no cksum]  26 RRQ "fixup.dat" octet tsize 0

Should the other files You had in Your tcpdump and that gets transferred be also in the /tftboot/ folder?

I will try to install a shiny new linuxmce system on sunday on my old 12.04 partition.
maybe i wrecked something else...

thanks again!

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #13 on: September 23, 2016, 11:41:45 pm »
It's now working for others that were having similar problems.  You aren't using the command I gave for tcpdump so I cannot compare what you are providing to what I know it should look like.  Installing the default netboot package will put all the files in the correct location within tftpboot.

Just to cover another base can you pastebin the file /etc/dhcp/dhcpd.conf.

J.
« Last Edit: September 23, 2016, 11:47:14 pm by phenigma »

G.I.R.

  • Veteran
  • ***
  • Posts: 58
    • View Profile
Re: 'Diskless' Raspberry Pis are out in the wild!
« Reply #14 on: September 24, 2016, 08:21:56 am »
good morning!

this is /etc/dhcp/dhcpd.conf
http://paste.ubuntu.com/23223444/

and this is the output of tcpdump:

Code: [Select]
dcerouter_1047514:/home/linuxmce# tcpdump -i eth1 -vv | grep "tftp"
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
          file "/tftpboot/pxelinux.0"
          file "/tftpboot/pxelinux.0"
          file "/tftpboot/pxelinux.0"
          file "/tftpboot/pxelinux.0"
          file "/tftpboot/pxelinux.0"
    0.0.0.0.49153 > 0.0.0.0.tftp: [no cksum]  35 RRQ "71638953/start.elf" octet tsize 0
    0.0.0.0.49154 > 0.0.0.0.tftp: [no cksum]  29 RRQ "autoboot.txt" octet tsize 0
    0.0.0.0.49155 > 0.0.0.0.tftp: [no cksum]  27 RRQ "config.txt" octet tsize 0
    0.0.0.0.49156 > 0.0.0.0.tftp: [no cksum]  29 RRQ "recovery.elf" octet tsize 0
    0.0.0.0.49157 > 0.0.0.0.tftp: [no cksum]  26 RRQ "start.elf" octet tsize 0
    0.0.0.0.49158 > 0.0.0.0.tftp: [no cksum]  26 RRQ "fixup.dat" octet tsize 0
          file "/tftpboot/pxelinux.0"

sorry, need to figure out howto use pastebinit with tcpdump...