cannot use growisofs to write iso image

Bug #1832922 reported by Hugo van der Sanden
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dvd+rw-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

% lsb_release -rd
Description: Ubuntu 18.04.2 LTS
Release: 18.04
% apt-cache policy dvd+rw-tools
dvd+rw-tools:
  Installed: 7.1-12
  Candidate: 7.1-12
  Version table:
 *** 7.1-12 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
%

The man page says:
  To use growisofs to write a pre-mastered ISO-image to a DVD:
      growisofs -dvd-compat -Z /dev/dvd=image.iso

So having downloaded the iso image I wanted, I ran:
  growisofs -speed=1 -dvd-compat -Z /dev/sr0=ubuntu-16.04.6-desktop-amd64.iso
expecting this to create a bootable Xenial installation DVD.

Instead it created a DVD which was not bootable; mounting it showed a single file "ubuntu_1.iso" clearly an 8.3-truncated version of the input filename. Along the way it showed what it was doing:
  genisoimage ubuntu-16.04.6-desktop-amd64.iso | builtin_dd of=/dev/sr0 obs=32k seek=0
.. so it looks like genisoimage is always getting called, and is creating a new iso image with the supplied iso as a simple file inside it.

As a workaround, I found that replacing genisoimage with a symlink to /bin/cat allowed me to use the same growisofs invocation to create the bootable DVD I wanted.

Revision history for this message
Thomas Schmitt (scdbackup) wrote :

Hi,

this looks as if the '=' in /dev/sr0=ubuntu-16.04.6-desktop-amd64.iso
is interpreted by the shell parser as whitespace.

I get the message about genisoimage only if i do

  growisofs -speed=1 -dvd-compat -Z /dev/sr0 ubuntu-16.04.6-desktop-i386.iso

Then it says

  About to execute 'genisoimage ubuntu-16.04.6-desktop-i386.iso | builtin_dd of=/dev/sr4 obs=32k seek=0'

and lets genisoimage pack up the .iso file as only data file of a new ISO
filesystem which it then burns to DVD.
Without option -R or -J this yields the dull short file name.

If i run

  growisofs -speed=1 -dvd-compat -Z /dev/sr0=ubuntu-16.04.6-desktop-i386.iso

i get to see

  About to execute 'builtin_dd if=ubuntu-16.04.6-desktop-i386.iso of=/dev/sr4 obs=32k seek=0'

and the desired plain burn without genisoimage gets performed.

If i run with both, '=' and ' '

  growisofs -speed=1 -dvd-compat -use-the-force-luke=notray -Z /dev/sr0= ubuntu-16.04.6-desktop-i386.iso

i get

  :-( unable to open64("",O_RDONLY): No such file or directory

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

So somehow your shell parser and/or growisofs manage to neatly separate
/dev/sr0 from ubuntu-16.04.6-desktop-amd64.iso before they get used as
parameters for genisoimage and "buildin_dd".

To test the shell parser you could do:

  for i in /dev/sr0=ubuntu-16.04.6-desktop-amd64.iso ; do echo $i ; done

It should put out a single line

  /dev/sr0=ubuntu-16.04.6-desktop-amd64.iso

If you see two lines
  /dev/sr0
  ubuntu-16.04.6-desktop-amd64.iso
then the '=' was interpreted as white space.

growisofs itself is fewly maintained. If you get fed up with your smart
cat trick, be invited to try my programs cdrskin and xorrecord for image
burning.

Have a nice day :)

Thomas

Revision history for this message
Thomas Schmitt (scdbackup) wrote :

Hi,

i made experiments with shell variable IFS which can declare '=' to
be white space.
When i do

  echo -n x"$IFS"x | od -c

i get

  0000000 x \t \n x
  0000005

(The 'x' are for better recognizing the gaps of blank characters.)

Contrary to my expectation, the shell loop "for" does not react on IFS:

  IFS="$IFS"=
  echo -n x"$IFS"x | od -c
  for i in /dev/sr0=ubuntu-16.04.6-desktop-amd64.iso ; do echo "$i" ; done )

yields

  0000000 x \t \n = x
  0000006
  /dev/sr0=ubuntu-16.04.6-desktop-amd64.iso

But with functions, built-in commands, and programs IFS would be a possible
explanation for growisofs' behavior:

  show_args() { for i in $@ ; do echo $i ; done; }
  show_args /dev/sr0=ubuntu-16.04.6-desktop-amd64.iso

yields

  /dev/sr0
  ubuntu-16.04.6-desktop-amd64.iso

Without seeing the '=', growisofs will employ genisoimage.

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

So what do you get from

  echo -n x"$IFS"x | od -c

Have a nice day :)

Thomas

Revision history for this message
Hugo van der Sanden (hugovds2) wrote :

For 'echo -n x"$IFS"x | od -c' I get:
0000000 x \t \n x
0000005

But based on your comments it seems quite likely I actually invoked it as '/dev/sr0 image.iso'. It is common to treat such things the same whether it's a single '='-separated argument to two separate arguments, and my cursory reading of the code suggested it intended to treat them the same. If the '=' is mandatory it is at certainly worth emphasising that in the docs.

I'm reluctant to do stand-alone experiments for this since I have only a few blank disks, but I'll aim to check this again when I have another image to write.

Hugo

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.