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

Bug#1031696: Use of symbolic links in non-free ISO images breaks file system transposition support



Hi,

James Addison wrote:
> it looks like the selection of CD image
> creation tool is configured per-architecture here:
> https://salsa.debian.org/images-team/debian-cd/-/blob/5aebb6794a3b8b2393663fb643e35eb8e510c9a4/Makefile#L24

I wish i would understand the clause
  ifneq (,$(filter i386 amd64 arm64 hppa,$(ARCHES)))

Surely i386, amd64, and arm64 get their published Debian ISOs made
by xorriso. hppa seems to have switched to xorriso between Debian 10 and
11. sparc64 10.0 is genisoimage, ppc64el 10.8.0 is xorriso,
armhf 10.1.0 is xorriso ...
powerpc needs HFS and thus its ISO is made by genisoimage.


So let's test hardlink handling in genisoimage:

  $ ls -l /u/test/hardlinks
  total 88
  -rw-r--r-- 2 thomas thomas 42786 Nov 14  2005 hardlink_x
  -rw-r--r-- 2 thomas thomas 42786 Nov 14  2005 x
  $ genisoimage -o test2.iso -R /u/test/hardlinks
  ...
  196 extents written (0 MB)

We inspect the resulting ISO by xorriso:

  $ xorriso -indev test2.iso -find / -type f -exec report_lba --
  ...
  Report layout: xt , Startlba ,   Blocks , Filesize , ISO image path
  File data lba:  0 ,       25 ,       21 ,    42786 , '/hardlink_x'
  File data lba:  0 ,       25 ,       21 ,    42786 , '/x'
  $

Both files in the ISO refer to the same block range starting at 2048-byte
block 25 up to block 45. So in the ISO, they are deduplicated

Now for a bit of kernel slapstick:

  $ sudo mount test2.iso /mnt/iso
  mount: /mnt/iso: WARNING: source write-protected, mounted read-only.
  $ ls -li /mnt/iso
  1479 -rw-r--r-- 2 thomas thomas 42786 Nov 14  2005 hardlink_x
  1483 -rw-r--r-- 2 thomas thomas 42786 Nov 14  2005 x

Note the link count 2 in combination with the differing inode numbers.
(The link count stems from Rock Ridge field PX. By mistake i mentoned it
as "PN" in my previous mail.)

The false link count does not hamper restoring of the files:

  $ cp -r /mnt/iso /u/test/hardlinks_restored
  $ ls -li  /u/test/hardlinks_restored
  total 88
  8913418 -rw-r--r-- 1 thomas thomas 42786 Mar 11 17:38 hardlink_x
  8913419 -rw-r--r-- 1 thomas thomas 42786 Mar 11 17:38 x

So the files are independent after being restored by Debian 11 to ext4.

The same happens with an ISO made by xorriso:

  $ xorriso -as mkisofs -o test.iso -R /u/test/hardlinks
  ...
  $ xorriso -indev test.iso -find / -type f -exec report_lba
  ...
  Report layout: xt , Startlba ,   Blocks , Filesize , ISO image path
  File data lba:  0 ,       33 ,       21 ,    42786 , '/hardlink_x'
  File data lba:  0 ,       33 ,       21 ,    42786 , '/x'

  $ sudo mount test.iso /mnt/iso
  ...
  $ cp -r /mnt/iso /u/test/hardlinks_restored
  $ ls -li  /u/test/hardlinks_restored
  total 88
  8913418 -rw-r--r-- 1 thomas thomas 42786 Mar 11 17:47 hardlink_x
  8913419 -rw-r--r-- 1 thomas thomas 42786 Mar 11 17:47 x

Just to prove that the restored files are really not hardlinked:

  $ echo some_tail_bytes >> /u/test/hardlinks_restored/x
  $ ls -li  /u/test/hardlinks_restored
  total 88
  8913418 -rw-r--r-- 1 thomas thomas 42786 Mar 11 17:47 hardlink_x
  8913419 -rw-r--r-- 1 thomas thomas 42802 Mar 11 17:48 x
  $


Have a nice day :)

Thomas


Reply to: