Advertisement
Guest User

BBBlfs HOWTO

a guest
Dec 13th, 2015
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. Clone https://github.com/ungureanuvladvictor/BBBlfs
  2. Follow the README up to the point "Go to bin/"
  3. Once in the bin/ dir, do NOT execute any of its scripts, they're garbage.
  4. (Also, the remark about BOOTP servers on your network is nonsense and can be disregarded.)
  5. # ./usb_flasher
  6. Contrary to its name this tool doesn't flash anything but boots up the BBB into a tiny linux system which serves the eMMC using the USB mass storage gadget driver. You now have direct access to eMMC and proceed to flash it, or repair it, or whatever it is you wanted to do.
  7.  
  8. NOTE: the tool is quite brittle and implicitly depends on RNDIS initialization being performed by the kernel already. If you're using NetworkManager it'll bring up the interface automatically. Otherwise you may need to fidget a bit: during the procedure the BBB will appear as RNDIS network interface 3 times, and each time it needs to be brought up or the usb_flasher tool will fail. An ugly workaround is:
  9. # while sleep 0.1; do ip link set usb0 up; done
  10. once usb_flasher says "U-Boot has started! Sending now the FIT image!" you can stop the loop.
  11.  
  12.  
  13. What happens step by step: (along with what you'll see on the serial console if you have one):
  14.  
  15. 1. power up with S2 button held: this makes the boot device order: SPI flash, μSD card, USB (RNDIS), UART (XMODEM). Since none of those work ROM will keep cycling through them. You see periodic CCC output on the console as it attempts to boot via XMODEM.
  16.  
  17. 2. connect USB: the BBB will enumerate as RNDIS network interface and ROM will begin attempting to netboot from it. At this point you see no console output. NetworkManager brings the link up, which means the kernel performs RNDIS initialization.
  18.  
  19. 3. execute usb_flasher: it will detach the kernel driver and continue using the usb device from userspace. It will act as BOOTP + TFTP server to send the u-boot SPL. You can see "U-Boot SPL ..." on the console.
  20.  
  21. 4. SPL will reset the usb interface and once again appears as RNDIS interface. Again the kernel driver is responsible for initializing RNDIS (console output: "USB RNDIS network up!").
  22.  
  23. 5. usb_flasher takes it from there ("SPL has started!"), once more acting as BOOTP + TFTP server to send full u-boot.img, with progress indication visible on the console, along with output from U-Boot once it starts.
  24.  
  25. 6. this routine is done a third time to download the FIT (Flattened Image Tree) to U-Boot, which contains a kernel + device tree + initramfs which will boot. This takes the longest amount of time.
  26.  
  27. 7. the tiny linux system serves the eMMC using the g_mass_storage driver.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement