Skip to contentSkip to conversation

fs/iso9660: bugfix for iso9660/isofs.sh

PATCH New zhanglianjie 2 participants 2 messages Mar 26, 2021 – Apr 1, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/iso9660: bugfix for iso9660/isofs.sh

Debian uses genisoimage to replace mkisofs, the prompt of genisoimage is the same as that of mkisofs.

---
 testcases/kernel/fs/iso9660/isofs.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
testcases/kernel/fs/iso9660/isofs.sh +7 -1
index 9de3f7cdc..69ab6e357 100755
@@ -12,6 +12,12 @@
 TST_NEEDS_CMDS="mkisofs"
 TST_NEEDS_TMPDIR=1
 TST_TESTFUNC=do_test
+which mkisofs >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+       TST_NEEDS_CMDS="genisoimage"
+fi
+MKISOFS_CMD=$TST_NEEDS_CMDS
+
 . tst_test.sh
 
 MAX_DEPTH=3
@@ -56,7 +62,7 @@ do_test() {
 		"-allow-lowercase -allow-multidot -iso-level 3 -f -l -D -J -allow-leading-dots -R"
 	do
 		rm -f isofs.iso
-		EXPECT_PASS mkisofs -o isofs.iso -quiet $mkisofs_opt $make_file_sys_dir 2\> /dev/null \
+		EXPECT_PASS $MKISOFS_CMD -o isofs.iso -quiet $mkisofs_opt $make_file_sys_dir 2\> /dev/null \
 			|| continue
 
 		for mount_opt in \

--
2.20.1

#1 lore raw

PATCH 1/1 fs/iso9660: bugfix for iso9660/isofs.sh

Hi,

Quoted 2 lines

Debian uses genisoimage to replace mkisofs, the prompt of genisoimage is the same as that of mkisofs.

...

testcases/kernel/fs/iso9660/isofs.sh line 18

Quoted 9 lines

+++ b/testcases/kernel/fs/iso9660/isofs.sh

testcases/kernel/fs/iso9660/isofs.sh +4 -0
@@ -12,6 +12,12 @@
 TST_NEEDS_CMDS="mkisofs"
 TST_NEEDS_TMPDIR=1
 TST_TESTFUNC=do_test
+which mkisofs >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+       TST_NEEDS_CMDS="genisoimage"
+fi

You can omit whole $? check:

if ! which mkisofs >/dev/null 2>&1; then
TST_NEEDS_CMDS="genisoimage"
fi

Also IMHO mkisofs is not dead [1], it just moved to schilytools [2] and some distros use it (at least openSUSE [3]).
Thus asking for genisoimage (from cdrkit) can be a bit misleading.

But, is it really needed? Both Debian [4] and Fedora [5] creates mkisofs symlink to genisoimage, Debian installs automatically genisoimage when installing mkisofs.

Kind regards,
Petr

[1] https://wiki.osdev.org/Mkisofs
[2] http://sf.net/projects/schilytools/files/
[3] https://build.opensuse.org/package/show/utilities/schily
[4] https://tracker.debian.org/media/packages/c/cdrkit/changelog-91.1.11-3.2
[5] https://src.fedoraproject.org/rpms/cdrkit/blob/rawhide/f/cdrkit.spec

Quoted 1 line
testcases/kernel/fs/iso9660/isofs.sh +1 -0
+MKISOFS_CMD=$TST_NEEDS_CMDS

...