Can't apply partition table modifications on U-Boot

Hi,

Host OS: Ubuntu 16.04 LTS x86_64
Target: ConnectCore i.MX6UL Starter Kit
Target OS: Embedded Linux
Build Environment: DEY-2.2
Issue: Can’t change the partition table

I’m trying to change the partition table, by reducing the size of Rootfs and Update partitions, and adding new partitions as explained in the following link:
https://www.digi.com/resources/documentation/digidocs/90001548/#task/t_change_partition_table.htm#NAND

In my case, I boot from the NAND. I want to add 1 RO partition sized of 2MB, and 3 RW partitions sized of 3MB, 12MB, 14MB respectively. The new size of Rootfs passes from 122MB to 92MB and Update keeps having the rest of space by - .

As shown on documentation, there are two ways to proceed:

1- At run-time:

After editing mtdparts variable with my new partition table configuration (editenv mtdparts), then saving changes (saveenv) and erasing these new + resized partitions (nand erase.part );

Booting with the new parameters gives a kernel panic due to ubi1 that can’t anymore open device 1:
ubi1 error: ubi_open_volume.part.0: cannot open device 1, volume 0, error -19
VFS: Cannot open root device “ubi1_0” or unknown-block(0,0): error -19
Please append a correct “root=” boot option; here are the available partitions:
0100 65536 ram0 (driver?)
0101 65536 ram1 (driver?)
0102 65536 ram2 (driver?)
0103 65536 ram3 (driver?)
0104 65536 ram4 (driver?)
0105 65536 ram5 (driver?)
0106 65536 ram6 (driver?)
0107 65536 ram7 (driver?)
0108 65536 ram8 (driver?)
0109 65536 ram9 (driver?)
010a 65536 ram10 (driver?)
010b 65536 ram11 (driver?)
010c 65536 ram12 (driver?)
010d 65536 ram13 (driver?)
010e 65536 ram14 (driver?)
010f 65536 ram15 (driver?)
1f00 3072 mtdblock0 (driver?)
1f01 1024 mtdblock1 (driver?)
1f02 1024 mtdblock2 (driver?)
1f03 12288 mtdblock3 (driver?)
1f04 14336 mtdblock4 (driver?)
1f05 94208 mtdblock5 (driver?)
1f06 2048 mtdblock6 (driver?)
1f07 3072 mtdblock7 (driver?)
1f08 12288 mtdblock8 (driver?)
1f09 14336 mtdblock9 (driver?)
1f0a 104448 mtdblock10 (driver?)
b310 15138816 mmcblk1 driver: mmcblk
b311 15134720 mmcblk1p1 00000000-01
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
—[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

2- At build-time:

As indicated in the documentation, I searched for the ccimx6ulstarter header files in U-Boot source code.
The strange thing is that I found nothing under: /usr/local/dey-2.2/sources
but find these following two headers under: workspace/ccimx6ulstarter/tmp/work/ccimx6ulstarter-dey-linux-gnueabi/u-boot-dey/2015.04-r0/git/include/configs/
ccimx6ul_common.h & ccimx6ulstarter.h

Applying the same modifications mentionned above to these headers and adding the indexes, changing the name of the boot, recovery and rootfs images in the following file:
/usr/local/dey-2.2/sources/meta-digi/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt
So that matches with the dey-image-tiny configuration, then recompiling U-Boot (bitbake u-boot-dey) overwrites the related changes to defaults (in header files).

flashing the generated files boot.src + install_linux_fw_sd.src + u-boot-ccimx6ulstarter.imx shows that nothing changed !

After the call of do_unpack function in U-Boot compilation the two header files are overwritten with the default parameters (rootfs 122m …etc).

I tried to keep the install_linux_fw_sd.txt as it is and changed only the two header files then recompiling U-Boot, but nothing happened (no new output files).

I gess I’m not changing the partition table at the right place, but I can find the mentionned headers only at the Build directory and not on the source one.

Could you please help me to resolve this issue ?

Thanks in advance.

Regards.

YC

in u-boot

  1. change variable - setenv parts_linux …
  2. saveenv
  3. run partition_mmc_linux
  4. update all images in flash

Hi Leonid,

Thank you for your answer.

Could you be more precise please ?
I didn’t understand your steps …

I want to do the change at build-time and not at run-time, and I’m still booting from NAND and not from MMC.

      1. parts_linux and partition_mmc_linux variables aren’t defined in my U-Boot environment.
  1. To update all images in flash I use:

run install_linux_fw_sd

Is it the right way to do ?

Thanks in advance.

Regards.

YC

regardless of what you do in build time, the partition table is in NVRAM of your module, so you have to change the U-boot variable prior to FLASHing. When replying, please click “Reply” button and not create a new answer, otherwise, i do not see when you respond

Hi Leonid,

Thanks for your answer.

I’m sorry for the inconvenience about the replies. I take it into account and from now I’ll use the reply instead of the answer.

OK now I understood the fact that I have to update U-Boot variables before flashing the images into NAND.

But in my U-Boot, the linux_parts variable isn’t defined and I can’t find the partition_mmc_linux scricpt.

So do I fill the linux_parts variable content with the updated mtdparts one ? And where can I find the partition_mmc_linux scricpt please ?

Thank you in advance.

Regards.

YC

Change mtdparts variable from:
workspace/ccimx6ulstarter/tmp/work/ccimx6ulstarter-dey-linux-gnueabi/u-boot-dey/2015.04-r0/git/include/configs/ccimx6ul_common.h

Then force U-BOOT to compile:

bitbake -f -c compile u-boot-dey

bitbake u-boot-dey

After flash the new U-Boot image and boot on it, and set env variables to default: # env default -a

Finally, erase and flash linux, recovery and rootfs partitions.

1 Like