summaryrefslogtreecommitdiff
path: root/doc/develop
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-10-08 02:19:22 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-10-10 17:34:25 +0300
commit88991b965f8343030a47d40287daa3b13a2dc212 (patch)
tree497e2b59b6118768c5390bdcdff6939decea194f /doc/develop
parent627b0ba397e44a0ef0105c2ec5f0679c36b816a0 (diff)
downloadu-boot-88991b965f8343030a47d40287daa3b13a2dc212.tar.xz
doc: describe usage of virt-make-fs for testing
We want tests to avoid the usage of sudo. Describe that virt-make-fs can generate disk images without being root. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'doc/develop')
-rw-r--r--doc/develop/py_testing.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/develop/py_testing.rst b/doc/develop/py_testing.rst
index 92fbd22721..6ff7810340 100644
--- a/doc/develop/py_testing.rst
+++ b/doc/develop/py_testing.rst
@@ -47,6 +47,7 @@ will be required. The following is an incomplete list:
* coreutils
* dosfstools
* efitools
+* guestfs-tools
* mount
* mtools
* sbsigntool
@@ -63,6 +64,24 @@ The test script supports either:
physical board, attach to the board's console stream, and reset the board.
Further details are described later.
+The usage of command 'sudo' should be avoided in tests. To create disk images
+use command virt-make-fs which is provided by package guestfs-tools. This
+command creates a virtual machine with QEMU in which the disk image is
+generated.
+
+Command virt-make-fs needs read access to the current kernel. On Ubuntu only
+root has this privilege. You can add a script /etc/initramfs-tools/hooks/vmlinuz
+with the following content to overcome the problem:
+
+.. code-block:: bash
+
+ #!/bin/sh
+ echo "chmod a+r vmlinuz-*"
+ chmod a+r /boot/vmlinuz-*
+
+The script should be chmod 755. It will be invoked whenever the initial RAM file
+system is updated.
+
Using `virtualenv` to provide requirements
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~