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

Re: Remastering KNOPPIX adding KNOPPIX[n] overlay's to iso file



Hi Christian, Hi Thomas,
Hi List :-) !

Thank you very much for the answers.

You both targeted the solution: using the isohybrid command solved the issue!

Following Christian instructions, I typed the command:

   "isohybrid /media/sda4/knx/custom.iso",

   Ok, it warned me about its size (~ 5.2GB):

   isohybrid: Warning: more than 1024 cylinders: 5221
   isohybrid: Not all BIOSes will be able to boot this device.

   then I wrote it in a 8GB flash disk.

Surprinsingly, it worked out of the box both in UEFI and in non UEFI.
I've made some tests and enjoyed a little bit here (That's why I was
late on reply you ;).

I am very glad everything worked.

>From Thomas' comment:
"For being bootable by EFI firmware, you will have to extract the EFI
System Partition image from the original Knoppix ISO, append it to the new
ISO, and mark it in the MBR partition table as partition 2 of type 0xef.
Program "fdisk" will tell the start and size of the EFI partition in the
original ISO."

I've checked the output of fdisk, and is as follows:
*KNX82.iso = is KNOPPIX_V8.2-2018-05-10-EN.iso. I just renamed it to
boot from HD easy.

root@Microknoppix:/media/sda4# fdisk -l KNX82.iso
Disk KNX82.iso: 4.4 GiB, 4697300992 bytes, 9174416 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6a2a1840

## Then I've got the three partitions as Thomas explained:

Device     Boot   Start     End Sectors  Size Id Type
KNX82.iso1 *         64 9135503 9135440  4.4G  0 Empty
KNX82.iso2      9135504 9166223   30720   15M ef EFI (FAT-12/16/32)
KNX82.iso3      9166224 9174415    8192    4M 83 Linux

## And from the custom.iso, we have only one:

root@Microknoppix:/media/sda4# fdisk -l knx/test*
Disk knx/custom.iso: 5.1 GiB, 5474615296 bytes, 10692608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4dd6a3cf

Device                Boot Start      End  Sectors  Size Id Type
knx/custom.iso1 *        0 10692607 10692608  5.1G 17 Hidden HPFS/NTFS

Analyzing the outputs, probably my custom.iso is not that good. Later
I'll follow carefully Thomas' instructions to get it well organized.

Thank you all,

Best,

RicardoEm qui, 18 de out de 2018 às 13:06, Thomas Schmitt
<scdbackup@gmx.net> escreveu:
>
> Hi,
>
> your genisoimage run produces no boot entries for BIOS or EFI to boot
> from USB stick. I guess that the virtual machines went along the El Torito
> boot record to isolinux.bin, despite this is only valid on optical media.
>
> You can make the result of genisoimage bootable for BIOS from USB stick
> by a run of program "isohybrid". See
>   https://www.syslinux.org/wiki/index.php?title=Isohybrid
>
> (Just before sending this mail i note Christian Perle was faster than me
>  with that proposal.)
>
>
> For being bootable by EFI firmware, you will have to extract the EFI
> System Partition image from the original Knoppix ISO, append it to the new
> ISO, and mark it in the MBR partition table as partition 2 of type 0xef.
> Program "fdisk" will tell the start and size of the EFI partition in the
> original ISO.
>
>   $ /sbin/fdisk -l KNOPPIX_V8.2-2018-05-10-EN.iso
>   ...
>   Device                          Boot   Start     End Sectors  Size Id Type
>   KNOPPIX_V8.2-2018-05-10-EN.iso1 *         64 9135503 9135440  4.4G  0 Empty
>   KNOPPIX_V8.2-2018-05-10-EN.iso2      9135504 9166223   30720   15M ef EFI (FAT-1
>   KNOPPIX_V8.2-2018-05-10-EN.iso3      9166224 9174415    8192    4M 83 Linux
>
> Your new ISO's partition 1 will not be of type 0x00 after "isohybrid".
> This peculiar type is a leftover of Knoppix 8.0 ISO, where partition 2
> was located inside partition 1. No need to imitate this aspect.
>
> Probably you will want to add the ReiserFS image of original partition 3
> as partition 3 to the new ISO.
>
> ------------------------------------------------------------------------
>
> Knoppix 8.2 was produced by my program "xorriso", version 1.4.7. Freshly
> released version 1.5.0 or one year old version 1.4.8 should be suitable, too.
>
> It proposes by
>
>   $ xorriso -indev KNOPPIX_V8.2-2018-05-10-EN.iso -report_system_area as_mkisofs
>
> to use the following boot related options:
>
>   -V 'KNOPPIX_8'
>   --modification-date='2018051501260800'
>   -isohybrid-mbr --interval:local_fs:0s-15s:zero_mbrpt:'KNOPPIX_V8.2-2018-05-10-EN.iso'
>   -partition_cyl_align off
>   -partition_offset 16
>   --mbr-force-bootable
>   -append_partition 2 0xef --interval:local_fs:9135504d-9166223d::'KNOPPIX_V8.2-2018-05-10-EN.iso'
>   -append_partition 3 0x83 --interval:local_fs:9166224d-9174415d::'KNOPPIX_V8.2-2018-05-10-EN.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_start_2283876s_size_30720d:all::'
>   -no-emul-boot
>   -boot-load-size 30720
>
> The arguments "--interval:...EN.iso" would pick block ranges from the original
> ISO, if it is in the current working directory.
>
> But let's do it a bit more like it was done with the original.
> First extract images of MBR code, partitions 2 and 3 from the original ISO:
>
>   dd if=KNOPPIX_V8.2-2018-05-10-EN.iso bs=1 count=432 of=/tmp/mbr_code.img
>   dd if=KNOPPIX_V8.2-2018-05-10-EN.iso bs=512 skip=9135504 count=30720 \
>                                                       of=/tmp/part2.img
>   dd if=KNOPPIX_V8.2-2018-05-10-EN.iso bs=512 skip=9166224 count=8192 \
>                                                       of=/tmp/part3.img
>
> Then use them in a xorriso run, which is inspired by your genisoimage run
> and xorriso's proposals:
>
>   xorriso -as mkisofs \
>     -l -r -J -V "KNOPPIX" \
>     \
>     -isohybrid-mbr /tmp/mbr_code.img \
>     -partition_offset 16 --mbr-force-bootable \
>     -iso_mbr_part_type 0x83 \
>     -append_partition 2 0xef /tmp/part2.img \
>     -append_partition 3 0x83 /tmp/part3.img \
>     \
>     -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 \
>     \
>     -o /media/sda4/knx/custom.iso /media/sda4/knx/master
>
> The resulting ISO should then bear MBR code and partition table for booting
> from USB stick with BIOS and EFI.
>
>   xorriso -indev /media/sda4/knx/custom.iso \
>           -report_system_area plain -report_el_torito plain
>
> is supposed to report after some other message lines:
>
>   System area summary: MBR isohybrid cyl-align-off
>   ISO image size/512 : 9165944
>   Partition offset   : 16
>   MBR heads per cyl  : 0
>   MBR secs per head  : 0
>   MBR partition table:   N Status  Type        Start       Blocks
>   MBR partition      :   1   0x80  0x83           64      9126368
>   MBR partition      :   2   0x00  0xef      9126432        30720
>   MBR partition      :   3   0x00  0x83      9157152         8192
>   El Torito catalog  : 78  1
>   El Torito cat path : /boot/isolinux/boot.cat
>   El Torito images   :   N  Pltf  B   Emul  Ld_seg  Hdpt  Ldsiz         LBA
>   El Torito boot img :   1  BIOS  y   none  0x0000  0x00      4          79
>   El Torito boot img :   2  UEFI  y   none  0x0000  0x00  30720     2281608
>   El Torito img path :   1  /boot/isolinux/isolinux.bin
>   El Torito img opts :   1  boot-info-table isohybrid-suitable
>   El Torito img blks :   2  7680
>
> The original ISO causes a similar xorriso report, with different type
> of MBR partition 1.
> Of course ISO image size and partition start positions will vary by
> the changes you made to /media/sda4/knx/master.
>
> The man pages of xorriso and its "-as mkisofs" emulation are available online
>   https://www.gnu.org/software/xorriso/man_1_xorriso.html
>   https://www.gnu.org/software/xorriso/man_1_xorrisofs.html
>
>
> Have a nice day :)
>
> Thomas
>


Reply to: