Message ID | 20210912141140.253778-14-romain.naour@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [01/16] support/testing: test_file_capabilities: bump to kernel 4.19.204 | expand |
Romain, All, On 2021-09-12 16:11 +0200, Romain Naour spake thusly: > Since the ubi/ubifs test has been introduced, it's not possible to > boot the same ubi image twice [1]: > > "TODO: if you boot Qemu twice on the same UBI image, it fails to > attach the image the second time, with "ubi0 error: > ubi_read_volume_table: the layout volume was not found"." > > For some reason, the kernel corrupt the ubi image if the ubifs > rootfs is mounted with write access. Use a custom config file > to mount the rootfs readonly (vol_type=static). Doing so requires > to add the flash size (vol_size=64MiB). > > At least it allows to boot several times the same ubi image. > > [1] bf4a6490e4ee70f0a46e588602995ba34e6c872a > > Signed-off-by: Romain Naour <romain.naour@gmail.com> > Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Applied to master, thanks. Regards, Yann E. MORIN. > --- > support/testing/tests/fs/test_ubi.py | 9 ++++----- > .../tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg | 8 ++++++++ > 2 files changed, 12 insertions(+), 5 deletions(-) > create mode 100644 support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg > > diff --git a/support/testing/tests/fs/test_ubi.py b/support/testing/tests/fs/test_ubi.py > index 7c687c1982..564a436d42 100644 > --- a/support/testing/tests/fs/test_ubi.py > +++ b/support/testing/tests/fs/test_ubi.py > @@ -13,12 +13,11 @@ class TestUbi(infra.basetest.BRTest): > BR2_TARGET_ROOTFS_UBI=y > BR2_TARGET_ROOTFS_UBI_PEBSIZE=0x40000 > BR2_TARGET_ROOTFS_UBI_SUBSIZE=1 > - """ > + BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y > + BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="{}" > + """.format( > + infra.filepath("tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg")) > > - # TODO: if you boot Qemu twice on the same UBI image, it fails to > - # attach the image the second time, with "ubi0 error: > - # ubi_read_volume_table: the layout volume was not found". > - # To be investigated. > def test_run(self): > img = os.path.join(self.builddir, "images", "rootfs.ubi") > out = infra.run_cmd_on_host(self.builddir, ["file", img]) > diff --git a/support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg b/support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg > new file mode 100644 > index 0000000000..52dd5f0007 > --- /dev/null > +++ b/support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg > @@ -0,0 +1,8 @@ > +[ubifs] > +mode=ubi > +vol_id=0 > +vol_type=static > +vol_name=rootfs > +vol_alignment=1 > +vol_size=64MiB > +image=BR2_ROOTFS_UBIFS_PATH > -- > 2.31.1 > > _______________________________________________ > buildroot mailing list > buildroot@lists.buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot
diff --git a/support/testing/tests/fs/test_ubi.py b/support/testing/tests/fs/test_ubi.py index 7c687c1982..564a436d42 100644 --- a/support/testing/tests/fs/test_ubi.py +++ b/support/testing/tests/fs/test_ubi.py @@ -13,12 +13,11 @@ class TestUbi(infra.basetest.BRTest): BR2_TARGET_ROOTFS_UBI=y BR2_TARGET_ROOTFS_UBI_PEBSIZE=0x40000 BR2_TARGET_ROOTFS_UBI_SUBSIZE=1 - """ + BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y + BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="{}" + """.format( + infra.filepath("tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg")) - # TODO: if you boot Qemu twice on the same UBI image, it fails to - # attach the image the second time, with "ubi0 error: - # ubi_read_volume_table: the layout volume was not found". - # To be investigated. def test_run(self): img = os.path.join(self.builddir, "images", "rootfs.ubi") out = infra.run_cmd_on_host(self.builddir, ["file", img]) diff --git a/support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg b/support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg new file mode 100644 index 0000000000..52dd5f0007 --- /dev/null +++ b/support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg @@ -0,0 +1,8 @@ +[ubifs] +mode=ubi +vol_id=0 +vol_type=static +vol_name=rootfs +vol_alignment=1 +vol_size=64MiB +image=BR2_ROOTFS_UBIFS_PATH
Since the ubi/ubifs test has been introduced, it's not possible to boot the same ubi image twice [1]: "TODO: if you boot Qemu twice on the same UBI image, it fails to attach the image the second time, with "ubi0 error: ubi_read_volume_table: the layout volume was not found"." For some reason, the kernel corrupt the ubi image if the ubifs rootfs is mounted with write access. Use a custom config file to mount the rootfs readonly (vol_type=static). Doing so requires to add the flash size (vol_size=64MiB). At least it allows to boot several times the same ubi image. [1] bf4a6490e4ee70f0a46e588602995ba34e6c872a Signed-off-by: Romain Naour <romain.naour@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> --- support/testing/tests/fs/test_ubi.py | 9 ++++----- .../tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg | 8 ++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 support/testing/tests/fs/test_ubi/ubinize_qemu_pflash_cfi01.cfg