* [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target
@ 2013-01-29 23:04 Saul Wold
2013-01-30 10:13 ` Enrico Scholz
0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2013-01-29 23:04 UTC (permalink / raw)
To: openembedded-core
This change ensures that the ls /etc/rpm-postinsts runs in the target
at first boot time, rather than at the creation time of the script on
the host.
This was causing the following error in the rootfs log:
+ install -d /srv/ssd/sgw/machines/fri2/tmp/work/fri2-poky-linux/core-image-minimal/1.0-r0/rootfs//etc/rcS.d
+ i=
+ ls /etc/rpm-postinsts/
ls: cannot access /etc/rpm-postinsts/: No such file or directory
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
meta/classes/rootfs_rpm.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index accd7d9..119bf92 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -108,7 +108,7 @@ fakeroot rootfs_rpm_do_rootfs () {
i=\$i
cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << EOF
#!/bin/sh
-for i in `ls /etc/rpm-postinsts/`; do
+for i in \`ls /etc/rpm-postinsts/\`; do
i=/etc/rpm-postinsts/$i
echo "Running postinst $i..."
if [ -f $i ] && $i; then
--
1.8.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target
2013-01-29 23:04 [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target Saul Wold
@ 2013-01-30 10:13 ` Enrico Scholz
2013-01-30 18:35 ` Saul Wold
0 siblings, 1 reply; 3+ messages in thread
From: Enrico Scholz @ 2013-01-30 10:13 UTC (permalink / raw)
To: openembedded-core; +Cc: Saul Wold
Saul Wold <sgw-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> writes:
> This change ensures that the ls /etc/rpm-postinsts runs in the target
> at first boot time, rather than at the creation time of the script on
> the host.
> ...
> -for i in `ls /etc/rpm-postinsts/`; do
> +for i in \`ls /etc/rpm-postinsts/\`; do
> i=/etc/rpm-postinsts/$i
> echo "Running postinst $i..."
are you really sure, this is enough? $i gets probably expanded too. A
better way than to escape all and everything is to quote the EOF marker.
E.g. compare
i=abc
cat << "EOF"
echo $i
EOF
cat << EOF
echo $i
EOF
Enrico
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target
2013-01-30 10:13 ` Enrico Scholz
@ 2013-01-30 18:35 ` Saul Wold
0 siblings, 0 replies; 3+ messages in thread
From: Saul Wold @ 2013-01-30 18:35 UTC (permalink / raw)
To: Enrico Scholz; +Cc: openembedded-core
On 01/30/2013 02:13 AM, Enrico Scholz wrote:
> Saul Wold <sgw-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> writes:
>
>> This change ensures that the ls /etc/rpm-postinsts runs in the target
>> at first boot time, rather than at the creation time of the script on
>> the host.
>> ...
>> -for i in `ls /etc/rpm-postinsts/`; do
>> +for i in \`ls /etc/rpm-postinsts/\`; do
>> i=/etc/rpm-postinsts/$i
>> echo "Running postinst $i..."
>
> are you really sure, this is enough? $i gets probably expanded too. A
> better way than to escape all and everything is to quote the EOF marker.
>
Yes, I verified the out put in the S98run-postinsts script that is on
disk and it's correct.
There a line above that sets i=\$i so the expansion occurs back to $i!
Sau!
> E.g. compare
>
> i=abc
>
> cat << "EOF"
> echo $i
> EOF
>
> cat << EOF
> echo $i
> EOF
>
>
> Enrico
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-30 18:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 23:04 [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target Saul Wold
2013-01-30 10:13 ` Enrico Scholz
2013-01-30 18:35 ` Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox