2

I need to mount my boot partition in order to perform software updates in my yocto built. I would expect to mount it in /boot but I see that there is a directory there already

I cant seem to find information about what this /boot directory is and why its needed. It contains the same .itb file that is in the boot partition

Do I need this boot directory? Who is it used by? Is there a way to tell yocto not to create it?

gcb
  • 366
  • 5
  • 16

2 Answers2

0
In Short

The short answer is, normally, unless you've tempered with the etc/fstab file, the boot partition is mounted in /boot. Yo can check that it is indeed the boot partition that is mounted with the df command.

fstab

Now I'm a bit of a fstab noob myself but here is what I could get from it. In the fstab file is the file responsible for automatically mounting device. In general, by default yocto generates a fstab file looking like this:

/dev/mmcblk0p1  /boot   vfat    defaults    0   0

Meaning (from what I can get) that your first partition will be mounted in /boot automatically. (If there are any fstab wizard out here feel free to elaborate)

From my experience

This work as normally mounted folder. You can modify all you want in /boot and the changes will happen on the boot partition. Once your changes are done, reboot and you should be able to see your changes having taken effect.

As for your questions

I have a broad idea but I suspect this depends on your build and target. And I have no yocto build I can check that with atm. So here are my hints:

  • Do you need it? I don't think so... unless you have a module or a script that is supposed to automatically mess with the boot partition... and even so I don't think this is vital. I'd the fastest way to find out is to remove the line from /etc/fstab mounting the boot partition and see if somthing crashes
  • Who is it used by? I suspect no one. I think that it is just a handy way to access your boot partition buas I said, haven't had the opportunity to confirm that.
  • How do you prevent yocto from creating it? All you should need to do is tell yocto to write a fstab file without the line mounting /boot. Here is how to override a file installed by a parent layer. Know that fstab is installed by /poky/meta/recipes-core/basefiles/base-files_X.X.X.bb.

Note that overall I'm not a 100% certain what /boot this is used for but I wouldn't recommend getting rid of it. In my opinion there is no draw backs to having your boot partition mounted and it is a handy tool to check on your boot partition while investigating your build.

LNiederha
  • 911
  • 4
  • 18
  • fstab doesnt mount /boot and also the contents is different between the rootfs /boot and partition. I didnt check with df, will try that tomororw - I did however try mountpoint on /boot and it came back as nothing. Also one of the output files .rootfs.gz has a boot folder in it - so I think its safe to say its not mounted from the partition – gcb Sep 02 '21 at 17:41
  • @gcb Ok that's intersting. What target are you building for? – LNiederha Sep 03 '21 at 08:59
  • Also, may I ask what is in your fstab?... I suspect mine was actually very specific to my build, my answer might have been a bit misinformed, sorry – LNiederha Sep 03 '21 at 09:33
  • The only thing I do in my fstab is mount an spi flash drive. The targert is for atmel sama5d27 - maybe they are adding this boot folder in their own recipies. I use their uboot and bootstrap. If this is strange/not expected behavior maybe its worth asking them also – gcb Sep 03 '21 at 12:09
  • Hum... ok yeah I'm sorry I can't help any further. It is probable that they add or at least populate the `\boot` folder in their layer. I haven't worked with this target and this issue seem related to your hardware meta-layer...I think it is indeed worth asking atmel or whoever wrote the layer you're using. – LNiederha Sep 03 '21 at 12:43
  • Think I found it: https://github.com/linux4sam/meta-atmel/blob/07867084ec52b5580e55eb67c861823eaab5e4c3/recipes-bsp/dt-overlay-at91/dt-overlay-at91_git.bb#L51 they copy the overlays files to /boot! So I just need to somehow disable this or delete the /boot folder. Thanks for your help! – gcb Sep 03 '21 at 13:08
  • @gcb Oh it is from an overlay! Hum... if it was coded right you might actually need this folder to make the overlay work – LNiederha Sep 03 '21 at 13:23
  • The overlays from atmel are mainly for different screens - can safely remove I think! Thanks! – gcb Sep 03 '21 at 14:45
0

Turns out that atmel dt overlay was putting overlay files in the /boot directory. These overlays aren't relevent for my machine so I removed the dt-overlay dependency

https://github.com/linux4sam/meta-atmel/blob/07867084ec52b5580e55eb67c861823eaab5e4c3/recipes-bsp/dt-overlay-at91/dt-overlay-at91_git.bb#L51

gcb
  • 366
  • 5
  • 16