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

Re: saving cheatcodes



Hi,

the newest mail by Denis prost indicates that he really did not plan
for remastering the ISO.

Afaik, installation of Knoppix to USB stick is still possible with 8.1.
The wiki page
  http://knoppix.net/wiki3/index.php?title=Bootable_USB_Key
says that since Knoppix 6 there is a built-in utility for that task.
Did you already apply it ?

If not:
You might need two USB sticks if you have no DVD drive. One stick as
substitute for a DVD with a flat copy of the KNOPPIX ISO, and one where
you install KNOPPIX.


Nevertheless, as instigator of some of the novelties in KNOPPIX 8.1
i post the new command that is needed to pack it up as ISO.

Jeffery Mewtamer wrote:
> I've already created a script to rebuild the iso since I do
> it so infrequently and genisoimage has such complicated syntax.

KNOPPIX 8.1 was created with xorriso instead of genisoimage.
The syntax is compatible with extensions which even increase complexity.

This example assumes that isolinux.cfg was copied from ISO to hard disk,
modified as needed, and is now ready at path $modified_cfg.
"/path/to/..." should be substituted by the suitable paths on hard disk.

  orig_iso=/path/to/.../KNOPPIX_V8.1-2017-09-05-EN.iso
  new_iso=/path/to/.../KNOPPIX_V8.1-custom.iso
  modified_cfg=/path/to/.../isolinux.cfg

  sudo mount "$orig_iso" /mnt/iso

  xorriso -as mkisofs \
     -o "$new_iso" \
     -V 'KNOPPIX_8' \
     -isohybrid-mbr --interval:local_fs:0s-15s:zero_mbrpt:"$orig_iso" \
     -partition_offset 16 \
     -append_partition 2 0xef \
                       --interval:local_fs:8855280d-8885999d::"$orig_iso" \
     -append_partition 3 0x83 \
                       --interval:local_fs:8886000d-8894191d::"$orig_iso" \
     -iso_mbr_part_type 0x00 \
     -c /boot/isolinux/boot.cat \
     -b /boot/isolinux/isolinux.bin \
        -no-emul-boot -boot-load-size 4 -boot-info-table \
     -eltorito-alt-boot \
     -e --interval:appended_partition_2:all:: \
        -no-emul-boot \
     /mnt/iso \
     -graft-points \
     /boot/isolinux/isolinux.cfg="$modified_cfg"

Sorry for this text salad. Backwards compatibility has its price and
the complexity of the task cannot be hidden easily.

You need xorriso-1.4.8 or newer for this run.
If you omit option "-iso_mbr_part_type 0x00", then xorriso-1.4.6 can
do it, too.

----------------------------------------------------------------------------
The novelties towards genisoimage for KNOPPIX 7 are in particular:

     -isohybrid-mbr --interval:local_fs:0s-15s:zero_mbrpt:"$orig_iso" \
makes the ISO bootable via (legacy) BIOS from USB stick. The x86 code in
the MBR will hop onto the program /boot/isolinux/isolinux.bin as would
BIOS do if the ISO was presented on DVD.
The longish pseudo file path "--interval:..." tells xorriso to cut out
the first 16 ISO blocks from the original, zeroize their MBR partition
table, and use it instead of the usual SYSLINUX file "isohdpfx.bin".
Re-using the MBR from the ISO avoids potential compatibility problems
between MBR and program "isolinux.bin" in the ISO.

     -partition_offset 16 \
causes the MBR partition 1 with the ISO filesystem to start at ISO block 16
which is USB stick block 64. The price is a second superblock and directory
tree. The benefit is that it avoids partition start 0 and gives the overall
ISO filesystem the opportunity to claim all 3 partitions as its data.

     -append_partition 2 0xef \
                       --interval:local_fs:8855280d-8885999d::"$orig_iso" \
MBR partition 2 in KNOPIX 8.1 is the EFI System Partition.
fdisk -l shows:
 Device                          Boot   Start     End Sectors  Size Id Type
 KNOPPIX_V8.1-2017-09-05-EN.iso1 *         64 8855279 8855216  4.2G  0 Empty
 KNOPPIX_V8.1-2017-09-05-EN.iso2      8855280 8885999   30720   15M ef EFI (FAT
 KNOPPIX_V8.1-2017-09-05-EN.iso3      8886000 8894191    8192    4M 83 Linux
The pseudo file path "--interval:..." tells xorriso to cut out the 512-byte
blocks from number 8855280 to 8885999 from $orig_iso and append it to the
new ISO as partition 2 with type 0xef.

     -append_partition 3 0x83 \
                       --interval:local_fs:8886000d-8894191d::"$orig_iso" \
MBR partition 3 contains the expandable ReiserFS, which is supposed to grow
up to the end of the USB stick on first booting.

     -iso_mbr_part_type 0x00 \
gives partition 1 the type 0x00, which is a leftover from the layout of
KNOPPIX 8.0. Many partition editors understand type 0x00 as "empty".
So consider to use instead:   -iso_mbr_part_type 0x83 \
or to simply omit this option (will yield type 0x17).

     -eltorito-alt-boot \
switches after the definition of the BIOS boot image to the next definition
which will be for EFI.

     -e --interval:appended_partition_2:all:: \
        -no-emul-boot \
similar to option -b, this normally marks a idata file in the ISO as
El Torito boot image for EFI rather than BIOS. But since the EFI System
Partition is not a data file in the ISO, xorriso gets instructed to use
the appended partition.

-------------------------------------------------------------------------
The options for overwriting the original isolinux.cfg are valid with
genisoimage, too. But sometimes it fails in such situations.
xorriso is safe and predictable with this.

     -graft-points \
enables the "pathspec" syntax for file arguments: /iso/path=/disk/path

     /boot/isolinux/isolinux.cfg="$modified_cfg"
tells xorriso to put $modified_cfg into the ISO with the path
  /boot/isolinux/isolinux.cfg
This will overwrite the mapping of /mnt/iso/boot/isolinux/isolinux.cfg
which was registered for the same path in the ISO. So the content of
$modified_cfg will appear in $new_iso.


Have a nice day :)

Thomas


Reply to: