aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/block
Commit message (Collapse)AuthorAgeFilesLines
* kernel: generic: fix warning in FIT partition parserDaniel Golle2022-03-271-2/+2
| | | | | | | Use 'const char *' where necessary to make gcc get quiet. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit d3a4607fc61f890d5d4bedef6e542046038294d9)
* kernel: generic: improve FIT partition parserDaniel Golle2022-03-271-12/+40
| | | | | | | | | | * only map filesystems configured in 'loadables' * allow mapping more than one filesystem (e.g. customization/branding or localization in addition to rootfs) * small cleaning here and there Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit ab143647efef2a13bcce2f28a2797899fbc83946)
* kernel: generic: use chosen bootconf in FIT partition parserDaniel Golle2022-03-271-4/+13
| | | | | | | | | | If the selected boot configuration is stored by U-Boot in '/chosen' node as 'bootconf' attribute, use that configuration to resolve the block device used as rootfs. Fall back to use the default configuration in case 'bootconf' is not present. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 503f3b9f0e9693bb983a0f259aa4ba106a690140)
* generic: deny write to uImage.FIT sub-image partitionsDaniel Golle2022-01-111-1/+1
| | | | | | | Set policy bit to force read-only mode on uImage.FIT filesystem sub-images mapped as block partitions by the FIT partition parser. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: properly handle paging errors in fit partition parserDaniel Golle2021-08-271-2/+5
| | | | | | | | The uImage.FIT partition uses page mapping without properly handling paging errors. This can lead to Kernel Oops in case of read errors while trying to parse uImage.FIT partitions. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: make uImage.FIT partition parser work on MBR partitionsDaniel Golle2021-07-201-2/+2
| | | | | | | Introduce new partition type 0x2e representing uImage.FIT and trigger FIT partition parser on partitions having that type. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: support FIT partition parser on mtdblock devicesDaniel Golle2021-04-091-9/+8
| | | | | | | | | | | | | | | Allow using the FIT block-device partition partition parser to work on top of mtdblock devices. This is more tricky than it sounds as it requires to reorganize the procedure of registering mtdblock devices in order to avoid locking troubles caused by the block partition parsers then trying to open the mtdblock device for reading while locks are still being held. Fix that by moving the adding of the disks after the entire device has been probed when locks no longer need to be held. Also address issue with mtdsuper surfaced when using sub-partitions which prevented mounting JFFS2 using the /dev/mtdblock* device. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* image: extend FIT partition parser for use on eMMC/SDcardDaniel Golle2021-02-281-12/+33
| | | | | | | | | | Introduce a magic GUID_PARTITION_LINUX_FIT_GUID to designate a GPT partition to be interpreted by the FIT partition parser. In that way, sub-partitions for (external-data) uImage.FIT stored directly in a partition can be split, similar like we do for devices with raw flash storage. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* image: add support for building FIT image with filesystemDaniel Golle2021-02-241-0/+233
Allow for single (external-data) FIT image to hold kernel, dtb and squashfs. In that way, the bootloader verifies the system integrity including the rootfs, because what's the point of checking that the hash of the kernel is correct if it won't boot in case of squashfs being corrupted? Better allow bootloader to check everything needed to make it at least up to failsafe mode. As a positive side effect this change also makes the sysupgrade process on nand potentially much easier as it is now. In short: mkimage has a parameter '-E' which allows generating FIT images with 'external' data rather than embedding the data into the device-tree blob itself. In this way, the FIT structure itself remains small and can be parsed easily (rather than having to page around megabytes of image content). This patch makes use of that and adds support for adding sub-images of type 'filesystem' which are used to store the squashfs. Now U-Boot can verify the whole OS and the new partition parsers added in the Linux kernel can detect the filesystem sub-images, create partitions for them, and select the active rootfs volume based on the configuration in FIT (passing configuration via device tree could be implemented easily at a later stage). This new FIT partition parser works for NOR flash (on top of mtdblock), NAND flash (on top of ubiblock) as well as classic block devices (ie. eMMC, SDcard, SATA, NVME, ...). It could even be used to mount such FIT images via `losetup -P` on a user PC if this patch gets included in Linux upstream one day ;) Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Daniel Golle <daniel@makrotopia.org>