Skip to contentSkip to conversation

e2fsprogs: Fix error SRCDIR when using usrmerge DISTRO_FEATURES

PATCH New [email protected] 1 participant 1 message May 15, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 e2fsprogs: Fix error SRCDIR when using usrmerge DISTRO_FEATURES

From: Qiu Tingting <[email protected]>

When build e2fsprogs ptest with usrmerge DISTRO_FEATURES, in test_script and test_one scripts, value of SRCDIR has problem.
SRCDIR=/usr/usr/lib/e2fsprogs/ptest/test

ptest log
# ptest-runner e2fsprogs
START: ptest-runner
2022-12-17T11:08
BEGIN: /usr/lib/e2fsprogs/ptest
ls: cannot access '/usr/usr/lib/e2fsprogs/ptest/test/[a-zA-Z]_*': No such file or directory ./test_script: line 54: /usr/usr/lib/e2fsprogs/ptest/test/test_post: No such file or directory
DURATION: 0
END: /usr/lib/e2fsprogs/ptest
2022-12-17T11:08
STOP: ptest-runner
TOTAL: 1 FAIL: 0

Reason
In Makefile.in, SRCDIR is set by prefix and libdir.
@echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_one @echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_script
prefix=/usr
libdir=/usr/lib (when usrmerge is set)

solution
Use PTEST_PATH to fix it.

---
 meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch | 4 ++--
 meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch +2 -2
index c3e46ce65f..20839b7286 100644
@@ -22,7 +22,7 @@ index 8c4d2048..e021af32 100644
  	@echo "HTREE=y" >> test_one
  	@echo "QUOTA=y" >> test_one
 -	@echo "SRCDIR=@srcdir@" >> test_one
-+	@echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_one
++	@echo "SRCDIR=@PTEST_PATH@/test" >> test_one
  	@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
  	@echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one
  	@echo "DD=@DD@" >>test_one
@@ -31,7 +31,7 @@ index 8c4d2048..e021af32 100644
  	@[ -f test_script ] && chmod u+w test_script || true
  	@echo "#!/bin/sh" > test_script
 -	@echo "SRCDIR=@srcdir@" >> test_script
-+	@echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_script
++	@echo "SRCDIR=@PTEST_PATH@/test" >> test_script
  	@cat $(srcdir)/test_script.in >> test_script
  	@chmod +x-w test_script
  
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +1 -0
index 403995e9cf..761b6c1198 100644
@@ -132,6 +132,7 @@ do_install_ptest() {
 	sed -e 's!../e2fsck/e2fsck!e2fsck!g' \
 	    -e 's!../misc/tune2fs!tune2fs!g' -i ${D}${PTEST_PATH}/test/*/expect*
 	sed -e 's!../e2fsck/e2fsck!${base_sbindir}/e2fsck!g' -i ${D}${PTEST_PATH}/test/*/script
+	sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/test/test_script ${D}${PTEST_PATH}/test/test_one
 
 	# Remove various files
 	find "${D}${PTEST_PATH}" -type f \
Signature · 1 line
2.25.1