Fix error SRCDIR when using usrmerge DISTRO_FEATURES
PATCH 1/1 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
After ptest compiling, check and modify SRCDIR in test_script and test_one.
--- meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +2 -0
@@ -122,6 +122,8 @@ RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck do_compile_ptest() { oe_runmake -C ${B}/tests + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_one + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_script } do_install_ptest() {
Signature · 1 line
2.25.1
Hello Qiu,
Quoted 39 lines · On Wed, 26 Apr 2023 14:31:07 +0800 "[email protected]" <[email protected]>…
From: Qiu Tingting <[email protected]>
When build e2fsprogs ptest with usrmerge
DISTRO_FEATURES, intest_scriptandtest_onescripts, value of SRCDIR has problem.
SRCDIR=/usr/usr/lib/e2fsprogs/ptest/testptest 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: 0Reason
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_scriptprefix=/usr
libdir=/usr/lib (when usrmerge is set)solution
After ptest compiling, check and modify SRCDIR intest_scriptandtest_one.Signed-off-by Qiu Tingting <[email protected]>--- meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb | 2 ++ 1 file changed, 2 insertions(+)meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +0
-0
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck · line 126
Quoted 5 lines
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +2
-0@@ -122,6 +122,8 @@ RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck do_compile_ptest() { oe_runmake -C ${B}/tests + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_one + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_script
There is a duplicate '-i' in each line.
Also the regex would more readable by using another spearator character, which would allow getting rid of the backslashes e.g.:
sed -i 's,/usr/usr,/usr,g' -i ${B}/tests/test_one
Best regards,
Luca
Signature · 3 lines
Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Qiu,
Quoted 52 lines · On Wed, 26 Apr 2023 11:23:22 +0200 "Luca Ceresoli via lists.openembedded.org"…
Hello Qiu,
Quoted 39 lines · On Wed, 26 Apr 2023 14:31:07 +0800 "[email protected]" <[email protected]>…
From: Qiu Tingting <[email protected]>
When build e2fsprogs ptest with usrmerge
DISTRO_FEATURES, intest_scriptandtest_onescripts, value of SRCDIR has problem.
SRCDIR=/usr/usr/lib/e2fsprogs/ptest/testptest 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: 0Reason
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_scriptprefix=/usr
libdir=/usr/lib (when usrmerge is set)solution
After ptest compiling, check and modify SRCDIR intest_scriptandtest_one.Signed-off-by Qiu Tingting <[email protected]>--- meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb | 2 ++ 1 file changed, 2 insertions(+)meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +0
-0meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck · line 126
Quoted 5 lines
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +2
-0@@ -122,6 +122,8 @@ RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck do_compile_ptest() { oe_runmake -C ${B}/tests + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_one + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_scriptThere is a duplicate '-i' in each line.
Quoted 4 lines
Also the regex would more readable by using another spearator character, which would allow getting rid of the backslashes e.g.:
sed -i 's,/usr/usr,/usr,g' -i ${B}/tests/test_one
And I forgot, this can be done in single command on both files:
sed -i 's,/usr/usr,/usr,g' \
${B}/tests/test_one \
${B}/tests/test_script Or maybe, in case it makes sense:
sed -i 's,/usr/usr,/usr,g' ${B}/tests/test_*
Best regards,
Luca
Signature · 3 lines
Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi, Luca
Thanks for your reviewing, It looks good.
I will send patch v2 for it.
Best regards,
Qiu Tingting
________________________________
发件人: [email protected] <[email protected]> 代表 Luca Ceresoli via lists.openembedded.org <[email protected]>
发送时间: 2023年4月26日 17:26
收件人: Luca Ceresoli via lists.openembedded.org <[email protected]>
抄送: [email protected] <[email protected]>; Qiu, Tingting/仇 婷婷 <[email protected]>; [email protected] <[email protected]>; FNST fnstml-fujitsuten <[email protected]> 主题: Re: [OE-core] [PATCH V1] Fix error SRCDIR when using usrmerge DISTRO_FEATURES
Hi Qiu,
Quoted 52 lines · On Wed, 26 Apr 2023 11:23:22 +0200 "Luca Ceresoli via lists.openembedded.org"…
Hello Qiu,
Quoted 39 lines · On Wed, 26 Apr 2023 14:31:07 +0800 "[email protected]" <[email protected]>…
From: Qiu Tingting <[email protected]>
When build e2fsprogs ptest with usrmerge
DISTRO_FEATURES, intest_scriptandtest_onescripts, value of SRCDIR has problem.
SRCDIR=/usr/usr/lib/e2fsprogs/ptest/testptest 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: 0Reason
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_scriptprefix=/usr
libdir=/usr/lib (when usrmerge is set)solution
After ptest compiling, check and modify SRCDIR intest_scriptandtest_one.Signed-off-by Qiu Tingting <[email protected]>--- meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb | 2 ++ 1 file changed, 2 insertions(+)meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +0
-0meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck · line 126
Quoted 5 lines
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +2
-0@@ -122,6 +122,8 @@ RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck do_compile_ptest() { oe_runmake -C ${B}/tests + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_one + sed -i 's/\/usr\/usr/\/usr/g' -i ${B}/tests/test_scriptThere is a duplicate '-i' in each line.
Quoted 4 lines
Also the regex would more readable by using another spearator character, which would allow getting rid of the backslashes e.g.:
sed -i 's,/usr/usr,/usr,g' -i ${B}/tests/test_one
And I forgot, this can be done in single command on both files:
sed -i 's,/usr/usr,/usr,g' \
${B}/tests/test_one \
${B}/tests/test_scriptOr maybe, in case it makes sense:
sed -i 's,/usr/usr,/usr,g' ${B}/tests/test_*
Best regards,
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com