[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please consider to let live-build add file /.disk/mkisofs to the ISO



Hi,

Raphaël, are you aware that the change in live-build
  https://anonscm.debian.org/cgit/debian-live/live-build.git/commit/?id=ff71712590a809d0f7ba680e787a9f091ed853b2
did not work and caused
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881941
?

Reason is obviously repeated shell parser evaluation of variable content
with quotation marks.

Daniel Reichelt proposes in bug 881941 to move the creation of the file
up from the ISO production script "binary.sh" to the script producing
script "binary_iso". Depending on when "binary.sh" gets finally executed
this architectural change might cause undesired effects.

Maybe one should rather strive to fix the problem more locally.

The following gesture passes my test with ${XORRISO_OPTIONS} containing
"-marks and '-marks. (Actually i use it since years in shell based backup
scenarios.)
The xorriso command line gets wrapped into '-marks for maximum resistence
against further interpretation by the shell parser. The sed expression
escapes '-marks by '"'"' (i.e.  leave '-quotation, enter "-quotation,
write '-literally, leave "-quotation, enter '-quotation).

For scripts/build/binary_iso :
-------------------------------------------------------------------------------

 DISK_MKISOFS="$(echo "xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary" | sed -e s"/'/'"'"'"'"'"'"'/g")"
 cat >> binary.sh << EOF

 mkdir -p binary/.disk
-echo "xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary" > binary/.disk/mkisofs
+echo '$DISK_MKISOFS' > binary/.disk/mkisofs
 xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary
 EOF

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

Tested by:

  $ XORRISO_OPTIONS='a "b c" d'" 'x y'"
  $ echo "$XORRISO_OPTIONS $IMAGE"
  a "b c" d 'x y' image
  $ IMAGE=image
  $ DISK_MKISOFS="$(echo "xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary" | sed -e s"/'/'"'"'"'"'"'"'/g")"
  $ cat > binary.sh << EOF
  > echo '$DISK_MKISOFS' > mki
  > EOF

This yields in binary.sh

  echo 'xorriso -as mkisofs a "b c" d '"'"'x y'"'"' -o image binary' > mki

Execution of binary.sh yields in "mki"

  xorriso -as mkisofs a "b c" d 'x y' -o image binary


Have a nice day :)

Thomas


Reply to: