diff options
Diffstat (limited to 'debian/patches')
3 files changed, 141 insertions, 0 deletions
diff --git a/debian/patches/fix-test-running-tests-no-longer-requires-to-be-root.patch b/debian/patches/fix-test-running-tests-no-longer-requires-to-be-root.patch new file mode 100644 index 0000000..0dc6e44 --- /dev/null +++ b/debian/patches/fix-test-running-tests-no-longer-requires-to-be-root.patch @@ -0,0 +1,107 @@ +From: Laszlo Gombos <laszlo.gombos@gmail.com> +Date: Tue, 21 Feb 2023 00:20:29 +0000 +Subject: fix(test): running tests no longer requires to be root + +Origin: upstream, https://github.com/dracutdevs/dracut/pull/2429 +--- + Makefile | 1 - + docs/HACKING.md | 10 +++++----- + test/Makefile | 1 - + test/test-functions | 12 ------------ + 4 files changed, 5 insertions(+), 19 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -264,7 +264,6 @@ + endif + + check: all syncheck +- @[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; } + @$(MAKE) -C test check + + testimage: all +--- a/docs/HACKING.md ++++ b/docs/HACKING.md +@@ -253,27 +253,27 @@ + mentioned in the `test/container` Dockerfiles. + + ``` +-$ sudo make clean check ++$ make clean check + ``` + + in verbose mode: + ``` +-$ sudo make V=1 clean check ++$ make V=1 clean check + ``` + + only specific test: + ``` +-$ sudo make TESTS="01 20 40" clean check ++$ make TESTS="01 20 40" clean check + ``` + only runs the 01, 20 and 40 tests. + + debug a specific test case: + ``` + $ cd TEST-01-BASIC +-$ sudo make clean setup run ++$ make clean setup run + ``` + ... change some kernel parameters in `test.sh` ... + ``` +-$ sudo make run ++$ make run + ``` + to run the test without doing the setup. +--- a/test/Makefile ++++ b/test/Makefile +@@ -1,7 +1,6 @@ + .PHONY: all check clean $(wildcard TEST-??-*) + + $(wildcard TEST-??-*): +- @[ "$(shell id -u)" = 0 ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; } + @{ \ + [ -d $@ ] || exit 0; \ + [ -f $@/Makefile ] || exit 0; \ +--- a/test/test-functions ++++ b/test/test-functions +@@ -52,15 +52,6 @@ + COLOR_WARNING='\033[0;33m' + COLOR_NORMAL='\033[0;39m' + +-check_root() { +- if ((EUID != 0)); then +- SETCOLOR_FAILURE +- echo "Tests must be run as root! Please use 'sudo'." +- SETCOLOR_NORMAL +- exit 1 +- fi +-} +- + # generate qemu arguments for named raw disks + # + # qemu_add_drive_args <index> <args> <filename> <id-name> [<bootindex>] +@@ -122,13 +113,11 @@ + while (($# > 0)); do + case $1 in + --run) +- check_root + echo "TEST RUN: $TEST_DESCRIPTION" + test_check && test_run + exit $? + ;; + --setup) +- check_root + echo "TEST SETUP: $TEST_DESCRIPTION" + test_check && test_setup + exit $? +@@ -141,7 +130,6 @@ + exit $? + ;; + --all) +- check_root + if ! test_check 2 &> test${TEST_RUN_ID:+-$TEST_RUN_ID}.log; then + echo -e "TEST: $TEST_DESCRIPTION " "$COLOR_WARNING" "[SKIPPED]" "$COLOR_NORMAL" + exit 0 diff --git a/debian/patches/series b/debian/patches/series index 291266d..74e9921 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,5 @@ fido-libz vconsole microcode initrd-not-initramfs.patch +fix-test-running-tests-no-longer-requires-to-be-root.patch +test-FULL-SYSTEMD-no-need-to-include-dbus-to-the-target-r.patch diff --git a/debian/patches/test-FULL-SYSTEMD-no-need-to-include-dbus-to-the-target-r.patch b/debian/patches/test-FULL-SYSTEMD-no-need-to-include-dbus-to-the-target-r.patch new file mode 100644 index 0000000..a149d7c --- /dev/null +++ b/debian/patches/test-FULL-SYSTEMD-no-need-to-include-dbus-to-the-target-r.patch @@ -0,0 +1,32 @@ +From: Laszlo Gombos <laszlo.gombos@gmail.com> +Date: Sat, 4 Nov 2023 02:25:18 -0400 +Subject: test(FULL SYSTEMD): no need to include dbus to the target rootfs + +systemd does not depend on dbus. + +Origin: upstream, https://github.com/dracutdevs/dracut/pull/2549 +--- + test/TEST-04-FULL-SYSTEMD/test-init.sh | 3 +-- + test/TEST-04-FULL-SYSTEMD/test.sh | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +--- a/test/TEST-04-FULL-SYSTEMD/test-init.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh +@@ -37,5 +37,4 @@ + setsid $CTTY sh -i + fi + echo "Powering down." +-systemctl --no-block poweroff +-exit 0 ++poweroff -f +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -52,7 +52,7 @@ + + # Create what will eventually be our root filesystem onto an overlay + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ +- -m "test-root dbus" \ ++ -m "test-root systemd" \ + -I "ldconfig" \ + -i ./test-init.sh /sbin/test-init \ + -i ./fstab /etc/fstab \ |