Genisoimage "Read-Only" Commandline?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Genisoimage "Read-Only" Commandline?
# 8  
Old 11-19-2014
@ygemici:

Good eye!

From the manpages (genisoimage, mkisofs):
Quote:
-boot-info-table
Specifies that a 56-byte table with information of the CD-ROM
layout will be patched in at offset 8 in the boot file. If this
option is given, the boot file is modified in the source
filesystem, so make a copy of this file if it cannot be easily
regenerated! See the EL TORITO BOOT INFO TABLE section for a
description of this table.
As this parameter seems to be rather ubiquitous in the context of pre-specified distro ISO build commandlines, could someone elaborate on what the implications might be for an ISO generated without calling -boot-info-table at build time (in both CD/DVD and flash media endpoint contexts)?


@Corona688:

Sounds like a clever workaround! Thanks for adding to the discussion Smilie

For those of us who might not be familiar with this niche, what would an implementation of a unionfs mountup look like in this scenario?


Thanks again, all; and have a great day.

Last edited by LinQ; 11-19-2014 at 01:34 PM.. Reason: Clarification . . .
# 9  
Old 11-19-2014
# 10  
Old 11-20-2014
Quote:
Originally Posted by LinQ
@ygemici:

Good eye!

From the manpages (genisoimage, mkisofs):As this parameter seems to be rather ubiquitous in the context of pre-specified distro ISO build commandlines, could someone elaborate on what the implications might be for an ISO generated without calling -boot-info-table at build time (in both CD/DVD and flash media endpoint contexts)?
Hi LinQ,
without calling boot-info-table results Smilie
we need to go to as root code for some points.
let us examine.

isolinux.asm
Code:
		; This table hopefully gets filled in by mkisofs using the
		; -boot-info-table option.  If not, the values in this
		; table are default values that we can use to get us what
		; we need, at least under a certain set of assumptions.
		global iso_boot_info
iso_boot_info:
bi_pvd:		dd 16				; LBA of primary volume descriptor
bi_file:	dd 0				; LBA of boot file
bi_length:	dd 0xdeadbeef			; Length of boot file
bi_csum:	dd 0xdeadbeef			; Checksum of boot file
bi_reserved:	times 10 dd 0xdeadbeef		; Reserved
bi_end:

Code:
The  format of this table is as follows; all integers are in sec-
       tion 7.3.1 ("little endian") format.

         Offset    Name           Size      Meaning
          8        bi_pvd         4 bytes   LBA of primary volume descriptor
         12        bi_file        4 bytes   LBA of boot file
         16        bi_length      4 bytes   Boot file length in bytes
         20        bi_csum        4 bytes   32-bit checksum
         24        bi_reserved    40 bytes  Reserved

       The 32-bit checksum is the sum of all the  32-bit  words  in  the
       boot file starting at byte offset 64.  All linear block addresses
       (LBAs) are given in CD sectors (normally 2048 bytes).

Example of Boot Information Table. (starts at offset 8 and is 56 bytes long.)
Code:
.........
[ORG 0x7C00]
[BITS 16]
start:
  jmp	0x0000:boot
  times 8-($-$$) db 0
 
  ;	Boot Information Table
  bi_PrimaryVolumeDescriptor  resd  1    ; LBA of the Primary Volume Descriptor
  bi_BootFileLocation         resd  1    ; LBA of the Boot File
  bi_BootFileLength           resd  1    ; Length of the boot file in bytes
  bi_Checksum                 resd  1    ; 32 bit checksum
  bi_Reserved                 resb  40   ; Reserved 'for future standardization'
 
boot:
  ;	Boot code here - set segment registers etc...
  jmp $
.........

now lets look at the our mounts.
--------------------------
Code:
.........
/tmp/cdcopy_with_boot.iso          690M  690M     0 100% /cdrom_with_boot
/tmp/cdcopy_without_boot.iso       690M  690M     0 100% /cdrom_without_boot
/tmp/ubuntu-9.10-desktop-i386.iso  690M  690M     0 100% /cdrom_original

lets try to check.
-----------------
Code:
# md5sum /cdrom_without_boot/isolinux/isolinux.bin /cdrom_original/isolinux/isolinux.bin
22a0d22c797fcd979d226b6d2ba3bac6  /cdrom_without_boot/isolinux/isolinux.bin
22a0d22c797fcd979d226b6d2ba3bac6  /cdrom_original/isolinux/isolinux.bin
92c85fac672312ffb21239adbba1b985  /cdrom_with_boot/isolinux/isolinux.bin

without modify table and original iso checksums are seem same.
but modificated iso's boot image is seem different.because we modified it.

lets try to find differents.
Code:
# cmp -l /cdrom_without_boot/isolinux/isolinux.bin /cdrom_with_boot/isolinux/isolinux.bin
   13 206 207

it says in 13.bytes differs for files and its below.
Code:
13. -> 134*dec	206	86*hex	10000110   (without_boot)
13. -> 135*dec	207	87*hex	10000111   (with_boot)

so we can see the just first lines (bytes) in the images.for see the boot-table..
Code:
# hexdump -Cv /cdrom_with_boot/isolinux/isolinux.bin|head -4
00000000  fa ea 40 7c 00 00 90 90  10 00 00 00 87 00 00 00  |..@|............|
00000010  93 39 00 00 a4 87 2c 54  00 00 00 00 00 00 00 00  |.9....,T........|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

# hexdump -Cv /cdrom_without_boot/isolinux/isolinux.bin|head -4
00000000  fa ea 40 7c 00 00 90 90  10 00 00 00 86 00 00 00  |..@|............|
00000010  93 39 00 00 a4 87 2c 54  00 00 00 00 00 00 00 00  |.9....,T........|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
#### in this boot-table is not modified that come from original iso (read-only) but !!
#### in the below command (isoinfo which read the iso information) displays the it is 135(87 hex) NOT 134 (86 hex)
#### so actually LBA of the our boot-image (isolinux.bin) value is actually wrong ( its in the boot-table and locate offset 12-16. bytes of the boot-image)
#### real LBA is must be 135(87 hex) but seem like 134.

# hexdump -Cv /cdrom_original/isolinux/isolinux.bin|head -4
00000000  fa ea 40 7c 00 00 90 90  10 00 00 00 86 00 00 00  |..@|............|
00000010  93 39 00 00 a4 87 2c 54  00 00 00 00 00 00 00 00  |.9....,T........|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

* original and without_boot isos boot table's are same because of we change the boot-file from original iso in when creating the without_boot iso.
* with boot and without boot isos boot table differs in the 13.byte(s). and if i m not point to wrong offset it was for BootFileLocation.(12-16 nr. bytes for saving lba of boot file/image location) . because of we want to re-genarate the boot-table with new values with boot-info-table option.(but it seems there are just one change)

lets remember this.
Code:
...........
Offset    Name           Size      Meaning
          8        bi_pvd         4 bytes   LBA of primary volume descriptor
         12        bi_file        4 bytes   LBA of boot file

so we want to modify boot-table (with -boot-info-table) values and LBA of the Boot File (as addresssing to CD-ROM image in) was changed..it is all.
Code:
-boot-info-table
              Specifies that a 56-byte table with information of the CD-ROM layout will be patched in at offset 8 in the boot file.  If  this
              option  is given, the boot file is modified in the source filesystem, so make a copy of this file if it cannot be easily regen-
              erated!  See the EL TORITO BOOT INFO TABLE section for a description of this table.

lets look at the more preview.
( first read the boot-info-table and then gets primary volume descriptor address after gets information from the primary volume descriptor )

Code:
# isoinfo -d -J -R -i /tmp/cdcopy_with_boot.iso|grep Bootoff
        Bootoff 87 135

Code:
# isoinfo -d -J -R -i /tmp/cdcopy_without_boot.iso|grep Bootoff
        Bootoff 87 135

Code:
# isoinfo -d -J -R -i /tmp/ubuntu-9.10-desktop-i386.iso |grep Bootoff
        Bootoff 86 134

we already gets the lba boot table values from hexdump. (see above)
-----------------------------------------------------------------------------------------
86 hex = 134 dec (lba boot image) --> original iso (cdrom)
87 hex = 135 dec (lba boot image) --> new iso's values (with_boot and without_boot)
-----------------------------------------------------------------------------------------

at the sametime we check it from isoinfo via primary volume descriptor (like ext fs superblock --> more details in cdfs-iso-primary.html)

i see the boot image locations from above outputs in there new iso boot image's lba values are same and little differ from the original iso.
probably mkisofs/genisoimage located its (and others iso fs specs) to default values (pre-defined in the mkisofs/genisoimage ) of iso filesystem while creating new iso and therefore there is a little change.

finally only change seems this and to me it must not be problem for boot process while system boot.
and i tested all isos in the vm enviroment and all of them are worked success without any warning or exception.

also @Corona688's advice is very well.
for this u can try to this little nice script.
Quick remastering of a Ubuntu based Live iso - Bash - Snipplr Social Snippet Repository

regards
ygemici

Last edited by ygemici; 11-24-2014 at 02:22 PM.. Reason: updated some informations..
This User Gave Thanks to ygemici For This Post:
# 11  
Old 11-21-2014
@ygemici:

Wow and awesome. Looking forward to really digging in here: So much to learn Smilie

Thanks again!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies

3. Shell Programming and Scripting

Quick Perl "s2p" Commandline Q . . .

Greetings! Looking to clear up a rather simple matter which seems to nonetheless elude me: How does one call Perl's s2p from the commandline? I've tried such as this:perl -e s2p '-i 's/first/last/g' ./somefile.txt'...to convert a similarly-formed GNU sedline over to the Perl equivalent (without... (2 Replies)
Discussion started by: LinQ
2 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. Shell Programming and Scripting

Read from "list1" and list matches in "list2"

I want to print any matching IP addresse in List1 with List 2; List 1 List of IP addresses; 161.85.58.210 250.57.15.129 217.23.162.249 74.76.129.101 30.221.177.237 3.147.200.59 170.58.142.64 127.65.109.33 150.167.242.146 223.3.20.186 25.181.180.99 2.55.199.32 (3 Replies)
Discussion started by: lewk
3 Replies

6. Shell Programming and Scripting

Purpose of "read" and "$END$" in ksh ?

Hi, Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator? cat $AMS/version|read a b verno d DBVer=$(/usr/bin/printf "%7s" $verno) I checked that the cat $AMS/version command returns following output: ... (10 Replies)
Discussion started by: dbadmin100
10 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

10. Shell Programming and Scripting

how to request a "read" or "delivered" receipt for mails

Dears, I've written a script which allows me to send mails in different formats with different attaches. Now I still want to add a feature to this script. My users would like to be able to receive a "read" or "delivered" receipt for their mails. The script send mails on behalve of an specific... (1 Reply)
Discussion started by: plelie2
1 Replies
Login or Register to Ask a Question