Re: Add genisoimage parameter -keep-top-dirs

2022-01-03 Thread Steve McIntyre
Hey Thomas! Happy New Year!

On Thu, Dec 30, 2021 at 04:05:31PM +0100, Thomas Schmitt wrote:
>
>Kai Engert wrote:
>> If growisofs is going to survive for another few years, then maybe it's
>> worth keeping the toolchain alive? (which requires genisoimage)
>
>xorriso can substitue for mkisofs and genisoimage by help of its link
>"xorrisofs" and the growisofs variable "MKISOFS". man xorrisofs has
>an example:
>
>$ export MKISOFS="xorrisofs"
>$ growisofs -Z /dev/dvd /some/files
>$ growisofs -M /dev/dvd /more/files
>  If  no  "xorrisofs"  is available on your system, then you will have to
>  create a link pointing to the xorriso binary and tell growisofs to  use
>  it. E.g. by:
>$ ln -s $(which xorriso) "$HOME/xorrisofs"
>$ export MKISOFS="$HOME/xorrisofs"
>
>> Is there a primary repository somewhere (e.g. github) that is equivalent to
>> the most recent cdrkit release that debian and fedora packages are based on?
>
>The original repo is gone, i fear.
>This here looks like going back to the fork from cdrtools in 2006:
>  https://code.launchpad.net/ubuntu/+source/cdrkit

The most recent official cdrkti releases were fromm svn at
svn.debian.org, which has now gone away. We can grab the backups and
do a git conversion if that's really wanted, but I'm not sure it's
worth the effort.

>It knows my Launchpad Id and offers
>  git clone git+ssh://[email protected]/ubuntu/+source/cdrkit
>I guess you get at least offered
>  git clone https://git.launchpad.net/ubuntu/+source/cdrkit
>
>> Is there an official download location for the most recent tar archive, or
>> would it be fine to simple use the archive found in the debian package?
>
>The most recent Debian package
>  https://packages.debian.org/unstable/genisoimage
>is obviously based on
>  http://deb.debian.org/debian/pool/main/c/cdrkit/cdrkit_1.1.11.orig.tar.gz
>  
> http://deb.debian.org/debian/pool/main/c/cdrkit/cdrkit_1.1.11-3.2.debian.tar.xz
>You may inspect the source online at
>  https://sources.debian.org/src/cdrkit/9:1.1.11-3.2/

Nod.

-- 
Steve McIntyre, Cambridge, [email protected]
Into the distance, a ribbon of black
Stretched to the point of no turning back



Re: Add genisoimage parameter -keep-top-dirs

2021-12-30 Thread Thomas Schmitt
Hi,

Kai Engert wrote:
> If growisofs is going to survive for another few years, then maybe it's
> worth keeping the toolchain alive? (which requires genisoimage)

xorriso can substitue for mkisofs and genisoimage by help of its link
"xorrisofs" and the growisofs variable "MKISOFS". man xorrisofs has
an example:

$ export MKISOFS="xorrisofs"
$ growisofs -Z /dev/dvd /some/files
$ growisofs -M /dev/dvd /more/files
  If  no  "xorrisofs"  is available on your system, then you will have to
  create a link pointing to the xorriso binary and tell growisofs to  use
  it. E.g. by:
$ ln -s $(which xorriso) "$HOME/xorrisofs"
$ export MKISOFS="$HOME/xorrisofs"


> Is there a primary repository somewhere (e.g. github) that is equivalent to
> the most recent cdrkit release that debian and fedora packages are based on?

The original repo is gone, i fear.
This here looks like going back to the fork from cdrtools in 2006:
  https://code.launchpad.net/ubuntu/+source/cdrkit

It knows my Launchpad Id and offers
  git clone git+ssh://[email protected]/ubuntu/+source/cdrkit
I guess you get at least offered
  git clone https://git.launchpad.net/ubuntu/+source/cdrkit


> Is there an official download location for the most recent tar archive, or
> would it be fine to simple use the archive found in the debian package?

The most recent Debian package
  https://packages.debian.org/unstable/genisoimage
is obviously based on
  http://deb.debian.org/debian/pool/main/c/cdrkit/cdrkit_1.1.11.orig.tar.gz
  
http://deb.debian.org/debian/pool/main/c/cdrkit/cdrkit_1.1.11-3.2.debian.tar.xz
You may inspect the source online at
  https://sources.debian.org/src/cdrkit/9:1.1.11-3.2/


> Maybe Sam's other changes should be ignored / kept separate.

At least other changes should be kept out of the game until you unpacked
the original source, applied at least the two bitrot patches from
  https://sources.debian.org/src/cdrkit/9:1.1.11-3.2/debian/patches/
(namely "fix_libcap_detection.patch" and "gcc10.patch".),
and managed to build the binaries.


> Regarding the 2038 issue and time64_t, you referred to a iso_date function
> and to a filename that I cannot find in the cdrkit archive.

That bug sits in the Linux kernel. Line 19 and 22 in
  https://github.com/torvalds/linux/blob/master/fs/isofs/util.c
Line 109 in
  https://github.com/torvalds/linux/blob/master/fs/isofs/isofs.h


> Regardless, is my understanding correct that the 2038 bug will be limited to
> 32bit platforms, because on 64bit platforms time_t is already sufficiently
> big to avoid the 2038 bug?

The current type is int, not time_t. I don't expect that int will
become 64 bit on the then mainstream architectures before kernels get
compiled which are expected to be still on duty when 2038 arrives.

I have a patch with demonstration of the problem by

  xorriso -outdev /tmp/test_date.iso \
  -blank as_needed \
  -map /bin/true /victim \
  -alter_date m 'Oct 01 22:06:12 2040' /victim --

When mounted the kernel returns the victim's timestamp as
  Aug 26  1904


But i gave up on submitting Linux patches after even a kernel Oops on
powerpc64 was ignored.

Maybe i learn to know somebody until 2038 who has the standing to get
at least a review for a patch submission.
(Another isofs bug is about Rock Ridge names of byte length 254 or 255,
which get shown massively truncateid by Linux - up to name collisions.
More bugs are around in cdrom and sr.)


Have a nice day :)

Thomas



Re: Add genisoimage parameter -keep-top-dirs

2021-12-30 Thread Thomas Schmitt
Hi,

Kai Engert wrote:
> I wasn't aware that
> growisofs/genisoimage are close to being obsoleted by other tools

Luckily growisofs isn't in danger to get removed from Debian, although
it is not developed any more since about 2008.
It still does its job, except when hitting some few known bugs.

The problem with cdrkit is that its upstream maintainers were Debian
Developers who have lots of other work to do, and that the only expert
for the job was in fierce conflict with Debian.
So the cdrkit maintainers decided a few years later that it is easier to
switch the own ISO production to xorriso. Only the inofficial ISOs for
architecture "powerpc" are still made by genisoimage.
For that purpose, Adrian had to come to genisoimage's rescue in the last
minute.


> so your links and the summary are very helpful.

To complete the summary, here are the remaining main reasons to keep
cdrkit and dvd+rw-tools (i.e. growisofs) alive, although there is
no active development:

- genisoimage can produce UDF filesystem structures for video DVD.

- genisoimage can produce old HFS (without "+") filesystem structures
  for booting machines of CPU architecture "powerpc".

- wodim can burn various exotic CD sector formats beyond CD-ROM (data)
  and CD-DA (audio).

- growisofs burns formatted BD-R with write type Pseudo-Overwrite.

About all other use cases are covered by libburn, libisofs, and libisoburn
on which xorriso and cdrskin are built.
(I don't plan to implement the missing features but would give assistance
 if somebody else wants to give them a shot.)


> If xorisso is considered the modern replacement,

At least it is the last such project with a developer.
I would not mind to get some competition. {:-)


> I'll give it a try!

Welcome, new user. Don't hesitate to ask for support.


Have a nice day :)

Thomas



Re: Add genisoimage parameter -keep-top-dirs

2021-12-30 Thread Thomas Schmitt
Hi,

Kai Engert wrote:
> I'm attaching a patch to add a new parameter -keep-top-dirs to
> genisoimage.

I guess that you will have to take over upstream maintainership of cdrkit
if you want to get any changes published.

cdrkit was in danger of getting erased from Debian.
John Paul Adrian Glaubitz adopted it as Debian maintainer:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974914
Afaik, his main motivation is to keep genisoimage alive.
So he would be your natural ally.

I would be your competitor, but not your enemy. :)
(See below for a proposal how to perform your use case with xorriso.)

If you plan to use genisoimage for several more years, then consider
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990468
  "genisoimage: Bad time stamps for post-2027 files"

(The next timestamp bug would be in Linux, where the time value is
squeezed through the 32-bit return value of fs/isofs/util.c function
iso_date(). Rollover will happen in 2038. Solution would be to change
the type of iso_date() and its local variable crtime from int to time64_t.
In 2155 the year field of the ISO 9660 format will overflow.)

-

xorriso's command -add can do what you strive for:

  xorriso -for_backup -outdev output.iso -add 2015-* --

In order to burn the ISO directly onto optical medium:

  xorriso -for_backup -outdev /dev/sr0 -add 2015-* --

If the locations of the input file objects are not as simple, then you
could use xorriso commands -cdx and -disk_pattern:

  xorriso -for_backup -outdev output.iso -disk_pattern on \
  -cdx "$HOME"/archive -add '2015-*' -- \
  -cdx /home/guest -add '*-backup' '*-archive' --

Note that in this example the patterns get protected by quotation marks
from being expanded by the shell parser. The expansion will be done by
xorriso in the current -cdx directory, because -disk_pattern is "on".
(Still the -add commands need their terminating "--" arguments.)

I propose to use xorriso command -for_backup. Mainly for getting MD5
checksums which can later be verified by commands like in:

  xorriso -for_backup -indev /dev/sr0 -check_media --

  xorriso -for_backup -indev /dev/sr0 -check_md5_r sorry / --

(Would of course also work with: -indev output.iso )


Have a nice day :)

Thomas