Commit Graph

77 Commits

Author SHA1 Message Date
Lee Chee Yang
dfedec4b2d wic: add test for partition hidden attributes
Add test for the --hidden argument introduced in Oe-Core
rev 7a111ff58d7390b79e2e63c8059f6c25f40f8977.

(From OE-Core rev: 819286cdce6471ca3dd048d3950b943b28e6d222)

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-27 22:54:59 +00:00
Richard Purdie
2564f3a432 oeqa/selftest/wic: Improve assertTrue calls
assertTrue is a problematic call use in test cases since when it fails,
you just get an unhelpful "False is not True" message.

Replace some uses with assertIn/assertNotIn which will give more helpful results
and for the rest, add msg entries which given more helpful debugging.

For example, this patch would help debugging of #15176.

(From OE-Core rev: 35d4c39e0df1a304f557471151a03d1e4b0f30c7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-20 08:57:26 +01:00
Markus Niebel
4a56d0cc93 oeqa: wic: Add test for --no-table option
Add basic test for the --no-table wic part option.

(From OE-Core rev: ad89d7e6039da2d79c1d55fe7fdc8bb9c235dacf)

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-29 09:41:07 +01:00
Richard Purdie
511d007248 oeqa/selftest/wic: Fix host contamination issue
If wic.Wic2.test_gpt_partition_name is run on a system without sfdisk, the test
will currently fail. As done in another test, it needs to use sfdisk from the
wic-tools sysroot. This patch fixes that host contamination issue.

(From OE-Core rev: 6f9200cc30d50888b9b63103824880abaf8b5eea)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-06 07:41:42 +01:00
Martin Jansa
ca12fac112 selftest: wic.py respect IMAGE_LINK_NAME
* use IMAGE_LINK_NAME instead of hardcoding
  core-image-minimal-${MACHINE} assumption

[YOCTO #12937]

(From OE-Core rev: e34d7617b00ec9423221c9c7b96be6f9e5358e6a)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-29 13:42:56 +01:00
Dit Kozmaj
a60925d00a selftest: wic: Add test for --part-name argument
Add test for wic --part-name argument in .wks file.
Test three different cases:
- Set only the --part-name argument.
- Set only the --label argument. In this case the GPT partition label
  is set to the value of --label for compatibility reasons.
- Set both. In this case the code has been changed to set the GPT
  partition label to the --part-name value.

The test uses a test_gpt_partition_name.wks file created for this
purpose.

(From OE-Core rev: 06af6795cf6f079362303bddb39a14459e228e72)

Signed-off-by: Dit Kozmaj <dit.kozmaj@kynetics.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-13 11:56:07 +01:00
Martin Jansa
e1334b120e selftest: wic: respect IMAGE_LINK_NAME also in test_rawcopy_plugin_qemu
* this one is more tricky, because the test_rawcopy_plugin.wks.in file
  is used while building core-image-minimal-mtdutils, but the image filename
  inside wks.in is from core-image-minimal, so we cannot just let bitbake
  expand IMAGE_LINK_NAME, use separate variable set in the same config fragment
  IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL

[YOCTO #12937]

(From OE-Core rev: 8864ee825fdc52fe7a8cf93876c81c639fba66f4)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-22 13:53:29 +00:00
Martin Jansa
af9f67606c selftest: wic: respect IMAGE_LINK_NAME
* use IMAGE_LINK_NAME instead of hardcoding
  core-image-minimal-${MACHINE} assumption

[YOCTO #12937]

(From OE-Core rev: d6151aeb1e8f6162113b1123fa0f162536e48a44)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-22 13:53:29 +00:00
Pavel Zhukov
2e18bbb307 oeqa/selftest/wic: Add test for uefi-kernel loader
This is regression test for [1].
[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=15033

(From OE-Core rev: d8ef15bb9ef652bf85002fe523ff5060b47bca6a)

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-02-26 11:49:00 +00:00
Ross Burton
33b4cd0c00 oeqa/selftest/wic: use skipIfNotArch instead of custom decorator
There's now a shared decorator for architecture skipping, so use that.

(From OE-Core rev: 1ce83c6b22e5835d8fe3f733f40207526c6771d4)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11 13:43:40 +00:00
Ross Burton
d3ec3aa81f oeqa/selftest/wic: skip more tests on aarch64
test_rawcopy_plugin_qemu and test_wic_image_type are x86-specific
currently as the .wks uses x86-specific bootloaders.

This can be fixed, but that can come later.

(From OE-Core rev: 93525809a1ecb01ae7218558c0d6c1b0344606c5)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11 13:43:40 +00:00
Richard Purdie
35183c1b33 selftest/wic: Tweak test case to not depend on kernel size
The current test assumes the kernel size leaves a certain amount of whitespace
in the output. Improve this constraint so a slightly larger kernel doesn't fail
the test.

(From OE-Core rev: bd60c44bef4a1b5d3c8fe77a9e6d3a8f43b0dea4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:21 +01:00
Tobias Schmidl
fd255af7de oeqa/selftest/wic.py: Repaired test_qemu()
The grep is too wide, so it falsely fits additional lines that have
a UUID (i.e, `/`).

(From OE-Core rev: f72fdea1c890ddd793aa63bb9c1c0857962161cc)

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-27 23:50:48 +01:00
Ross Burton
c4436040eb oeqa/selftest/wic: use self.td instead of get_bb_var to save on bitbake calls
When a test case starts, self.td is populated with all the variables in
the data store.  Typically this can be used instead of get_bb_var(),
which saves a bitbake call per variable lookup.

The only catch is that in parallel runs the build directory is moved
after td is populated, so paths in the build directory are wrong: these
still need to be fetched in the test.

(From OE-Core rev: 884201c6c1bbf7c1b958bab7d7c91e27577eeaac)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:38 +01:00
Ross Burton
12a1456b06 oeqa/selftest/wic: use os.path.join to join paths
Instead of using string concatenation, use os.path.join.

(From OE-Core rev: 73d1b7163792ec089ffb3bf99f1b4f8760beaea7)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:38 +01:00
Ross Burton
ada2cbb682 oeqa/selftest/wic: rearrange tests
Split the tests into further classes: one which exercises the CLI and
doesn't need to build images at all, and another which is just the
tests that manipulate existing images.

(From OE-Core rev: c9bc4def71325dba7b7ad93001f7fe1acced0bea)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:38 +01:00
Ross Burton
443d557ba0 oeqa/selftest/wic: cleanup WicTestCase.setUpLocal
Use os.path.join to construct paths, and invoke bitbake once instead of
three times.

(From OE-Core rev: 27953d4cf6edc86cd505826c3da21222864c7760)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
416cce968d oeqa/selftest: tag tests that use runqemu
There may be environments or machines which don't have working runqemu,
so tag all of the tests which use runqemu() so that they can be skipped.

(From OE-Core rev: 3f45ce6d2b1dfde8bc3d554397d55f81846c52d5)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
1985249632 oeqa/selftest/wic: add more arch-specific annotations
Some tests which are marked as x86-specific will actually work on
aarch64 (e.g. use EFI), whilst some other tests really are x86-specific
(e.g. use syslinux).

(From OE-Core rev: 1285bdaa4f472519083c03946ee34c7d8c204e27)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
e2d112b471 oeqa/selftest/wic: don't hardcode kernel image type in test_wic_rm
Don't assume bzImage, resepct KERNEL_IMAGETYPE.

(From OE-Core rev: f03d47833593734489e73f054f41c3dbbe423204)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
e9c8d638f9 oeqa/selftest/wic: clean up only_for_arch decorator
There's no need to pass a recipe name when determining the target
architecture, there's no need to cap the size of the lru_cache as it
will only have one entry, and __name__ is set by @wraps.

(From OE-Core rev: e8e6c679f6eb74cb25c124a18af88dd5c2e2c833)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
8d01207fd7 oeqa/selftest/wic: remove redundant asserts
By default bitbake() will raise an assertion if it fails, so there's no
need to wrap it in a further assert.

(From OE-Core rev: de3c8994dc482cf5e9f3317c4762fe4ac35d9f31)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
6cd1a31bef oeqa/selftest/wic: use os.rename instead of bb.utils.rename
bb.utils.rename() only exists to handle moves across filesystems. As
these moves are within the same directory we can just use os.rename().

(From OE-Core rev: 450e09b6d4ca019848aec4c62fce280a09395b97)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Stefan Herbrechtsmeier
8adc4d0c77 selftest: wic: Disable graphic of qemu to support WSL
Disable graphic support of qemu to support qemu tests in WSL.

(From OE-Core rev: 797af95eb272bd12eac193cdfe72ddffe8aa39ca)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-16 09:46:29 +00:00
Stefan Herbrechtsmeier
ba2bb92331 selftest: wic: Add rawcopy plugin unpack test
(From OE-Core rev: 0e4a030948707ef74f9c977d2d02d9f92c119f7e)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-16 09:46:29 +00:00
Stefan Herbrechtsmeier
b709e926d3 selftest: wic: Remove requirement of syslinux from test_rawcopy_plugin
Remove bootimg-pcbios from wks to eliminate requirement of syslinux from
test_rawcopy_plugin to avoid the following error.

ERROR: Couldn't find correct bootimg_dir, exiting

(From OE-Core rev: 99e2321e049fa63b83f3daa076eeff7f6791986b)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-16 09:46:29 +00:00
Kristian Klausen
b8c0f073f6 wic/bootimg-efi: Add Unified Kernel Image option
"A unified kernel image is a single EFI PE executable combining an EFI
stub loader, a kernel image, an initramfs image, and the kernel command
line.

[...]

Images of this type have the advantage that all metadata and payload
that makes up the boot entry is monopolized in a single PE file that can
be signed cryptographically as one for the purpose of EFI
SecureBoot."[1]

This commit adds a create-unified-kernel-image=true option to the
bootimg-efi plugin for creating a Unified Kernel Image[1] and installing
it into $BOOT/EFI/Linux/ with a .efi extension per the the Boot Loader
Specification[1][2]. This is useful for implementing Secure Boot.

systemd-boot is the only mainstream bootloader implementing the
specification, but GRUB should be able to boot the EFI binary, this
commit however doesn't implement the necessary changes to the GRUB
config generation logic to boot the Unified Kernel Image.

[1] https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images
[2] https://systemd.io/BOOT_LOADER_SPECIFICATION/

(From OE-Core rev: b0573f240525df561ddef6e47cb285b217d38487)

Signed-off-by: Kristian Klausen <kristian@klausen.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-04 15:03:53 +01:00
Kristian Klausen
73384ac936 wic: Add extra-space argument
This allows extra space to be added after the last partition and is
especially useful when free space is needed for ex: adding partitions on
first boot with ex: systemd-repart[1] and the image is tested in QEMU.

[1] https://www.freedesktop.org/software/systemd/man/systemd-repart.html

(From OE-Core rev: f81b188bcf5aa18746fd622eb7b5c0dcb0b5c93d)

Signed-off-by: Kristian Klausen <kristian@klausen.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-06 09:49:50 +01:00
Daniel Gomez
9986923d05 oeqa: wic: Add tests for --no-fstab-update
Add tests for the --no-fstab-update wic part command.

(From OE-Core rev: 90141d41a370ff377d95fb3dd144b63a85e22f8e)

Signed-off-by: Daniel Gomez <daniel@qtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-20 08:53:03 +01:00
Richard Purdie
65133015b1 meta: Manual override fixes
The automated conversion of OE-Core to use the new override sytax isn't
perfect. This patches some mis-converted lines and some lines which were missed
by the automation.

(From OE-Core rev: 4e9a06b64b43131b731fb59a0305f78a98e27fbd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02 15:44:10 +01:00
Richard Purdie
bb6ddc3691 Convert to new override syntax
This is the result of automated script conversion:

scripts/contrib/convert-overrides.py <oe-core directory>

converting the metadata to use ":" as the override character instead of "_".

(From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02 15:44:10 +01:00
Devendra Tewari
b71375304f classes/lib/scripts: Use bb.utils.rename() instead of os.rename()
Incremental build in Docker fails with:

OSError: [Errno 18] Invalid cross-device link

when source and destination are on different overlay filesystems.

Rather than adding fallback code to every call site, use a new wrapper
in bitbake which detects this case and falls back to shutil.move
which is slower but will handtle the overlay docker filesystems correctly.

[YOCTO #14301]

(From OE-Core rev: 656a65b2b84e7d529b89cf5de7eb838f902d84a2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-06 11:16:23 +01:00
Richard Purdie
9825a860ee selftest/wic: Fix dependency issue in rawcopy test
The current test code contains a subtle race. It is building an ext4,
then trying to reuse that image in a wic build for the same recipe.
Whilst this happened to work, the code is within its rights to clean
up the output before the wic code runs.

Avoid this by using separate image targets instead.

(From OE-Core rev: 590398080e81fb5e2f81e12b8900858837dfe25f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-20 18:54:56 +00:00
Lee Chee Yang
34ea1433fc wic: debug mode to keep tmp directory
files in wic tmp directory can be usefull for debugging, so do not remove
tmp directory when wic create run with debugging mode (-D or --debug).

also update wic.Wic.test_debug_short and wic.Wic.test_debug_long to
check for tmp directory.

[YOCTO#14216]

(From OE-Core rev: a122e2418b67d38f691edcf8dd846c167d6b4fa9)

Signed-off-by: Lee Chee Yang <Chee.Yang.Lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-09 08:56:11 +00:00
Lee Chee Yang
c05385c887 wic/selftest: test_permissions also test bitbake image
existing test case test_permissions use Wic command as standalone
tools to create wic image and check that wic image for permissions.

add extra steps to the test case to also check against image build
using bitbake do_image_wic.

(From OE-Core rev: 551ce73a90757ba43501fe5cf9ac84a7b77de549)

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-05 08:16:32 +00:00
Diego Sueiro
75b74f6b8d wic: Introduce empty plugin to create unformatted empty partitions
The empty wic plugin is used to create unformatted empty partitions for wic
images.

To use it you must pass "empty" as argument for the "--source" parameter in
the wks file. For example:
    part foo --source empty --ondisk sda --size="1024" --align 1024

Also adds a selftest for this plugin where the 'Fstype' column from 'wic
ls' should be empty for the second partition as listed in
test_empty_plugin.wks.

(From OE-Core rev: 77d174fc80663403ef76c5b808aafc1117d3545c)

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-15 22:51:56 +00:00
Khairul Rohaizzat Jamaluddin
85574ce0cf wic/bootimg-efi: IMAGE_EFI_BOOT_FILES variable added to separate bootimg-efi and bootimg-partition
Due to recent changes in bootimg-efi to include IMAGE_BOOT_FILES,
when both bootimg-partition and bootimg-efi occur in a single .wks
and IMAGE_BOOT_FILES are defined, files listed in IMAGE_BOOT_FILES
will be duplicated in both partition.
Since IMAGE_BOOT_FILES are crucial for bootimg-partition, but
optional for bootimg-efi, hence allowing bootimg-efi to have the option
to ignore it.

The new variable, IMAGE_EFI_BOOT_FILES, was added to help handle this
issue. Its basic usage is the same as IMAGE_BOOT_FILES.
Usage example:
        ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.ext4;rootfs.img \

This commit is also squashed with the updated testcase to cover for
this change.

[YOCTO #14011]

(From OE-Core rev: 945339e06b273df1935cfd784f548ef57e0b7f4c)

Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-15 11:53:28 +01:00
Joshua Watt
5fa3c3d2e3 wic: Add 512 Byte alignment to --offset
Allows the --offset argument to use the "s" or "S" suffix to specify
that it is reporting the number of 512 byte sectors.

This is required for some SoCs where the mask ROM looks for an item at a
sector that isn't aligned to a 1KB boundary.

(From OE-Core rev: 938595d1dc4abaf5f7f3a7900add3f0492b805d0)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-22 15:46:55 +01:00
Joshua Watt
4f3aca1a56 wic: Fix --extra-space argument handling
467f84e12b ("wic: Add --offset argument for partitions") broke the
--extra-space argument handling in wic. Fix the option and add a unit
test for the argument.

(From OE-Core rev: 87722a92c18f94917c8f70afc8cd0763462a5c25)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-12 08:25:04 +01:00
Joshua Watt
ba9be4bfa5 wic: Add --offset argument for partitions
Add support for an --offset argument when defining a partition. Many
SoCs require that boot partitions be located at specific offsets. Prior
to this argument, most WKS files were using the --align attribute to
specify the location of these fixed partitions but this is not ideal
because in the event that the partition couldn't be placed in the
specified location, wic would move it to the next sector with that
alignment, often preventing the device from booting. Unlike the --align
argument, wic will fail if a partition cannot be placed at the exact
offset specified with --offset.

Changes in V2:
* Fixed a small typo that prevented test_fixed_size_error from passing

(From OE-Core rev: 467f84e12b96bc977d57575023517dd6f8ef7f29)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-04 13:27:32 +01:00
Ricardo Ribalda Delgado
01619c9acb oeqa: wic: Add more tests for include_path
Make sure permissions are respected.

Add new test for orig/destination option.

Cc: Paul Barker <pbarker@konsulko.com>
(From OE-Core rev: 33785be3c7eb4d5684cded08f955412a0c008929)

Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26 14:00:50 +01:00
Ricardo Ribalda Delgado
6cfcc149ef oeqa: wic: Add tests for permissions and change-directory
Make sure that the permissions and username are respected when using all
the rootfs modifiers.

Add tests for change-directory command

Cc: Paul Barker <pbarker@konsulko.com>
(From OE-Core rev: 4aad9531df44d1b0637bd559161702ad86861b46)

Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26 14:00:50 +01:00
Kevin Hao
623326ac5a selftest: wic: Add APPEND to the optional variables list
The APPEND is an optional variable, so add it to the optional variables
list to make the wic selftest happy.

(From OE-Core rev: 7c8b3a1b920fd4cc1598357985eef0e5e0e0ac79)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-15 22:42:14 +00:00
Paul Barker
2c81446248 wic: Add --include-path argument
This option adds the contents of the given path to a partition built
with the rootfs source plugin. The path is relative to the directory in
which wic is running not the rootfs itself so use of an absolute path
is recommended. This option is most useful when multiple copies of the
rootfs are added to an image and it is required to add extra content to
only one of these copies. This option only has an effect with the
rootfs source plugin.

(From OE-Core rev: d4cd27a9837426e809190548a83c6c7c76505114)

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-10 21:18:22 +00:00
Chee Yang Lee
89288705c6 wic: 'wic cp' to copy from image
currently 'wic cp' only works for copy file from local storage to
wic image.

enhance 'wic cp' to copy file/directory from wic image to local storage.

include selftest and 'wic help' updates.

[YOCTO#12169]

(From OE-Core rev: bd669c1809a378f93580eb9e0679a26ec6746cb8)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-27 13:25:18 +00:00
Chee Yang Lee
b8c34f9a24 selftest/wic: test wic rm with -r flag
selftest to make sure wic rm with -r flag for ext partition
could remove directory and all its content.

(From OE-Core rev: d7ccbb393a71501424b7c0d4c1d78e4bac1ecccf)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-21 23:08:19 +00:00
Ross Burton
eed89d027d oeqa/selftest/wic: improve assert messages in test_fixed_size
(From OE-Core rev: ff4e6c71ac415de93b3abaa4e7f1727d72cd2971)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-16 23:02:45 +01:00
William Bourque
30c1d70c32 meta/lib/oeqa: Remove ext4 for bootimg-biosplusefi
Remove "ext4" IMAGE_FSTYPES when generating core-image-minimal
for the bootimg-biosplusefi unittests; "wic" type is enough.

(From OE-Core rev: 73f69585e9f30819d8fb484d458e3408a04c0433)

Signed-off-by: William Bourque <wbourque@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-26 08:41:39 +01:00
William Bourque
835f7eac06 meta/lib/oeqa: Test for bootimg-biosplusefi Source
Add unittests for bootimg-biosplusefi SourcePlugin in wic module.
First test check wic creation works correctly.
Second test uses qemu to boot image and checks that it has both
EFI and BIOS files in a single partition.

(From OE-Core rev: e0c3436241afca93f107e325d1b9ffcdebf706cd)

Signed-off-by: William Bourque <wbourque@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-23 22:26:28 +01:00
Chee Yang Lee
b697aba61e wic: add support for kernel with initramfs bundled
when INITRAMFS_IMAGE_BUNDLE and INITRAMFS_IMAGE are set, wic should
look for kernel with initramfs image bundled.

Include required variable MACHINE, INITRAMFS_IMAGE_BUNDLE,
INITRAMFS_IMAGE, INITRAMFS_LINK_NAME and KERNEL_IMAGETYPE in WICVARS.
No longer require default value for variable kernel as KERNEL_IMAGETYPE
is not optional variable and included in WICVARS.
image_types_wic to inherit kernel-artifact-names to obtain default
INITRAMFS_LINK_NAME when INITRAMFS_IMAGE_BUNDLE are set.

update wic.Wic2.test_image_env test case to filter optional
variable INITRAMFS_LINK_NAME, INITRAMFS_IMAGE and INITRAMFS_IMAGE_BUNDLE.

(From OE-Core rev: bac984fbb2d5ad5d13ba3275c8a3e878d8753c58)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-17 19:25:02 +01:00