[Fedora-livecd-list] [PATCH] Bug 689329 - livecd-iso-to-disk installs syslinux files in root directory

Frederick Grose fgrose at gmail.com
Mon Mar 21 07:16:50 UTC 2011


On Mon, Mar 21, 2011 at 2:46 AM, Frederick Grose <fgrose at gmail.com> wrote:

> *Bug 689329* <https://bugzilla.redhat.com/show_bug.cgi?id=689329> - livecd-iso-to-disk
> installs syslinux files in root directory
>
> From the bug report:
>
> The new set -o pipefail option, set early, changes a return value in
>
> checkSyslinuxVersion() leading to SYSLINUXPATH being set to "".
>
> The attached patch rewrites the test. The earlier test tested the usage
>
> function in /usr/bin/syslinux.
>
> The replacement checks the the --version output for a general 'syslinux'
> response.
>
> This should exercise the installed program like the previous test, but I'm not
>
>
> familiar with the use case for the failure condition that leads to SYSLINUXPATH
> being set to "".
>
>        --Fred


Fixing the test logic:

commit 38c1015f1f920fd45561f6fc6b47c032f4be5afb
Author: Frederick Grose <fgrose at gmail.com>
Date:   Mon Mar 21 03:07:48 2011 -0400

    Fix pipefailure in checkSyslinuxVersion()

    Use a list operation to bypass the erroneous return value.
    Alter the test to something that could be used to check the
    syslinux version, if desired.

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index deb5473..3f4ae0d 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -559,7 +559,8 @@ checkSyslinuxVersion() {
         echo "You need to have syslinux installed to run this script"
         exit 1
     fi
-    if ! syslinux 2>&1 | grep -qe -d; then
+    check=($(syslinux --version 2>&1)) || :
+    if [[ 'syslinux' != $check ]]; then
         SYSLINUXPATH=""
     elif [ -n "$multi" ]; then
         SYSLINUXPATH="$LIVEOS/syslinux"
@@ -1006,7 +1007,6 @@ fi
 [ -n "$efi" -a ! -d $TGTMNT$EFI_BOOT ] && mkdir -p $TGTMNT$EFI_BOOT

 # Live image copy
-set -o pipefail
 if [ "$srctype" = "live" -a -z "$skipcopy" ]; then
     echo "Copying live image to target device."
     [ ! -d $TGTMNT/$LIVEOS ] && mkdir $TGTMNT/$LIVEOS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/livecd/attachments/20110321/c41057d5/attachment.html 


More information about the livecd mailing list