FAT partition on newer images

Older BBB had a very useful FAT partition when plugged in via USB. The FAT partition was also accessible directly on the SD card. However, I have tested some newer images and saw that some of them still mount the FAT partition but it’s not physically present on the SD card anymore. How can I create/modify this FAT partition? It seems to be missing on the latest Machnekit Jessie image.

Oh, it's been a few years since we nuked that partition..

The "virtual" fat image you see now is just an image *.img file we
started pushing back in 2015.12.04

Last year, i had added a "--enable-fat-partition" option to the sdcard
authoring script:

https://github.com/RobertCNelson/omap-image-builder/commit/f24e65c7b7b63a13c41216f893cde05529101722

There's a "setup_sdcard.sh" example here:

http://elinux.org/BeagleBoardDebian#Debian_.28stretch.29

Just add the --enable-fat-partition option and see what happens...

Regards,

Thanks. The script created a BOOT partition when supplying the --enable-fat-partition command. However, for some reason, it created an ext4 partition called BOOT. When I plug in the BBB to my computer via USB, it does not show up.

The FAT partition was very useful to supply host drivers and applications with the board.

Passing the "/dev/mmcblkXp1" node has to be fixed here, when
"has_img_file" is not enabled. (it should only be done when there is 2
partitions)

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L514-L534

Regards,

correction, it's implemented here:

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L466-L481

what does:

journalctl | grep am335x_evm

show in on bootup..

Regards,

Okay, retried with the --img-4gb command.

sudo ./setup_sdcard.sh --dtb beaglebone --enable-fat-partition --enable-cape-universal --enable-uboot-cape-overlays --boot_label SandyBox --enable-systemd --hostname sandybox --img-4gb test.img

Interestingly it still creates a ext4 partition

Journalcmd output

Okay, retried with the --img-4gb command.

sudo ./setup_sdcard.sh --dtb beaglebone --enable-fat-partition
--enable-cape-universal --enable-uboot-cape-overlays --boot_label SandyBox
--enable-systemd --hostname sandybox --img-4gb test.img

Interestingly it still creates a ext4 partition

Journalcmd output

debian@sandybox:~$ journalctl | grep am335x_evm
Sep 01 15:47:24 sandybox sh[641]: generic-board-startup: [startup
script=/opt/scripts/boot/am335x_evm.sh]
Sep 01 15:47:24 sandybox sh[641]: am335x_evm:
usb_image_file=[/var/local/usb_mass_storage.img]

It's detecting the *.img file, so you'll need to remove that..

sudo rm /var/local/usb_mass_storage.img || true

Sep 01 15:47:25 sandybox sh[641]: am335x_evm: uncached cpsw_2_mac:
[78:A5:04:CC:90:EF]
Sep 01 15:47:25 sandybox sh[641]: am335x_evm: cpsw_0_mac:
[78:A5:04:CC:90:EE]
Sep 01 15:47:25 sandybox sh[641]: am335x_evm: cpsw_1_mac:
[78:A5:04:CC:90:F0]
Sep 01 15:47:25 sandybox sh[641]: am335x_evm: cpsw_2_mac:
[78:A5:04:CC:90:EF]
Sep 01 15:47:25 sandybox sh[641]: am335x_evm: cpsw_3_mac:
[78:A5:04:CC:90:F1]
Sep 01 15:47:25 sandybox sh[641]: am335x_evm: cpsw_4_mac:
[78:A5:04:CC:90:F2]
Sep 01 15:47:25 sandybox sh[641]: am335x_evm: cpsw_5_mac:
[78:A5:04:CC:90:F3]
Sep 01 15:47:26 sandybox sh[641]: am335x_evm: use_libcomposite
Sep 01 15:47:26 sandybox sh[641]: am335x_evm: modprobe libcomposite
Sep 01 15:47:26 sandybox sh[641]: am335x_evm: Creating g_multi
Sep 01 15:47:26 sandybox sh[641]: am335x_evm: g_multi Created
Sep 01 15:47:26 sandybox sh[641]: am335x_evm: Starting usb0 network
Sep 01 15:47:27 sandybox sh[641]: am335x_evm: Starting usb1 network
Sep 01 15:47:28 sandybox sh[641]: am335x_evm: dnsmasq: setting up for
usb0/usb1
Sep 01 15:47:31 sandybox sh[641]: am335x_evm: Starting
serial-getty@ttyGS0.service

Regards,

I made some modifications to the setup_sdcard.sh and now it creates the flash drive.

The image file does not exist:

debian@sandybox:~$ sudo rm /var/local/usb_mass_storage.img || true
rm: cannot remove ‘/var/local/usb_mass_storage.img’: No such file or directory

Btw. I do not want to boot from the FAT partition. How does the usb_mass_storage.img solution work?

Here is how I finally achieved what I wanted:

Code hier eingeben...
sudo apt install doc-beaglebone-getting-started

sudo cp /var/cache/doc-beaglebone-getting-started/beaglebone-getting-started-2017-05-25.img /var/local/bb_usb_mass_storage.img2
sudo apt remove doc-beaglebone-getting-started
sudo rm -rf /var/cache/doc-beaglebone-getting-started/
sudo mv /var/local/bb_usb_mass_storage.img2 /var/local/bb_usb_mass_storage.img

Change usb_ms_ro=0 in /opt/scripts/boot/am335x_evm.sh

Resizing was a little bit tricky but possible using gparted and the loop driver on my host system:

`

sudo modprobe loop
sudo losetup -f
sudo losetup /dev/loop0 /var/local/bb_usb_mass_storage.img
sudo sh -c “dd if=/dev/zero bs=1M count=500 >> /var/local/bb_usb_mass_storage.img”
sudo gparted /dev/loop0
sudo losetup -d /dev/loop0

`