at91bootstrap and linux_image_dt with ubifs commands

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

cajjed
Posts: 37
Joined: Thu Aug 25, 2016 3:12 am

at91bootstrap and linux_image_dt with ubifs commands

Wed Apr 03, 2019 12:46 am

This question is a follow up to these two previous questions:

viewtopic.php?f=12&t=28901&p=54045#p54045
viewtopic.php?f=12&t=29058

and specifically this statement from bluez:
The modern preference is to utilize the filesystem capabilities of U-Boot (e.g. ubifsmount and ubifsload), and store the kernel and dtb images as files within the Linux root filesystem (i.e. the /boot directory), which is presumably in a NAND partition/volume.
Ideally you want as much of the NAND flash to be part of the filesystem (or UBI volume) as possible (rather than as raw partitions) so that wear-leveling (and bad-block management) can be more effective.
So is there a way to run the ubifs commands in at91bootstrap so you don't have to use Uboot? Commands like the following:

Code: Select all

ubifsmount ubi0:rootfs, ubifsload 0x22000000 /boot/zImage, ubifsload 0x21000000 /boot/sama5d3.dtb
or for now is the best method to just put the kernel and dtb in nand flash and update them each time rootfs updates the kernel?
blue_z
Location: USA
Posts: 1943
Joined: Thu Apr 19, 2007 10:15 pm

Re: at91bootstrap and linux_image_dt with ubifs commands

Thu Apr 04, 2019 10:27 pm

cajjed wrote: So is there a way to run the ubifs commands in at91bootstrap so you don't have to use Uboot?
To point out the obvious:
1. AT91Bootstrap has no CLI, therefore it cannot process or "run" commands.
2. AT91Bootstrap has no support for UBI volumes nor UBIFS files.

If you want to bloat AT91Bootstrap with such capabilities, then be cognizant of the SRAM size restriction.
travisgriggs
Posts: 7
Joined: Wed Sep 17, 2014 6:38 pm

Re: at91bootstrap and linux_image_dt with ubifs commands

Fri Apr 05, 2019 1:11 am

I work with @cajjed. I think... what we want... is a solution that does what we need it to do, but has the least moving parts. We're both neophytes in this area. That the answers seem to evolve over the years makes it hard using Professor Google to discern information that is "old-school" / not-preferred vs good approaches.

Our (simple?) goal is:
1) Boot into debian linux with acceptably quickly, and with as few moving parts as possible
2) Get a file system configuration running that is (usually) ro for / and rw for /var (we're willing to go rw on / when upgrading)
3) mechanism for updating our kernel/dts
4) Straightforward mechanism to install it all

It's been hard at time to figure out just which piece happens where. I think @cajjed was wondering if... given the above... is it be possible to remove uboot as one of the moving pieces.
blue_z
Location: USA
Posts: 1943
Joined: Thu Apr 19, 2007 10:15 pm

Re: at91bootstrap and linux_image_dt with ubifs commands

Sat Apr 06, 2019 1:19 am

Rather than focus on "moving pieces", what about a "broken piece" due to a failed kernel update?

When updating the kernel and dtb images in raw NAND flash, the time spent erasing multiple blocks and then programming multiple pages is a window of vulnerability. Any interruption that causes the update to not complete successfully results in the board no longer able to boot Linux from NAND; essentially you have a bricked board. If there is only AT91Bootstrap in NAND, then you will need to have a recovery method using an alternate boot medium.

When updating the kernel and dtb images as UBIFS files, the window of vulnerability is merely the time to rename several files; i.e. during the update the original file and the new file can coexist. To ensure the integrity of the newly written files, you could even validate them using read verify and/or a hash function before the renaming.
Since UBIFS is a journaled filesystem, the actual window of vulnerability (in theory) is nil. An interrupted/failed update should still allow the board to boot Linux, and the update can be retried.


BTW it's not difficult to figure out that AT91Bootstrap doesn't support UBI and UBIFS.
You need to look at or use the source code instead of searching the web.
1. Simply inspect the fs (for filesystem) directory. There's only code for FAT. There's no UBIFS.
2. Perform a `make menuconfig`. There's no option for UBI or UBIFS anywhere.
3. Do a text search on the source code for the string "ubi". You're not going to find anything relevant, mostly kernel parameter strings.
What could you guess from any of these three results?

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 3 guests