Jim Meyering wrote:
Hi,

I noticed that the following part of the big here-document
in creator/mayflower was not backslash-escaped (along with the
following two lines):

FWIW, In my own as yet unpublished tool, I keep the init as a separate file even. I.e. I also haven't seen a real need to do any expansion. Though I also effectively pass the livecd label on the kernel command line, so as to achieve the functionality in that last filesystem layout patch which wasn't applied.

-dmc


    cat > init <<EOF
    ...
    if [ -f /etc/fstab ] ; then
        root=$(cat /etc/fstab | while read d m f o r; do if [ "$m" == "/" ] ; 
then echo $d; fi; done)

So it would end up generating hard-coded bits like this:

    if [ -f /etc/fstab ] ; then
        root=dm_multipath

[dm_mulipath came from an earlier loop where $m iterated
through module names]

At first I just fixed that by backslash-quoting things,
but then I realized that nothing in that entire here document
required expansion, so I've attached a better patch.

The patch looks big, but it's largely mechanical:
It uses <<'EOF' rather than <<EOF, which saves you the readability
and maintenance hassle of backslash-escaping all of the "$" and "`"
in the "init" here-doc.



------------------------------------------------------------------------

--
Fedora-livecd-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list

--
Fedora-livecd-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list

Reply via email to