LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-19-2022, 07:11 AM   #1
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Rep: Reputation: Disabled
Remastering a Debian-live operating system


On an installed Debian 11 system I'm trying to do a "simple" test of remastering an ISO file, without actual modifications, with the following script:

Code:
#!/bin/bash

mech="»»» "

isofile="debian-live-11.4.0-amd64-gnome.iso"
newisofile="new"$isofile

echo $mech$isofile
echo $mech$newisofile

echo $mech"Temporary directory to put the extracted files:"
tempdir=$(mktemp -d)
echo $mech$tempdir

echo $mech"Extract all files from the ISO:"
xorriso -osirrox on -indev $isofile -extract / $tempdir

echo $mech"Make the files in $tempdir writable:"
chmod -R +w $tempdir

###

echo $mech"Putting the ISO back together:"
xorriso -as mkisofs \
	-o $newisofile \
	-isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
        -c isolinux/boot.cat \
        -b isolinux/isolinux.bin \
        -no-emul-boot \
        -boot-load-size 4 \
        -boot-info-table $tempdir

echo $mech"Remove "$tempdir" :"
rm -r $tempdir

exit
#        -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \    
#        -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
#xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/usr/lib/syslinux/isohdpfx.bin'
#xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/usr/lib/ISOLINUX/isohdpfx.bin'
And I get the "Given path does not exist on disk" error message.

Is this because it can't find the proper bootloader, and if so how can I correct my script?
If not what else should I be aware of?

Last edited by PaulExordium; 07-21-2022 at 09:32 AM. Reason: typo
 
Old 07-20-2022, 09:23 AM   #2
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
Running the command:
Code:
sudo apt-get install -y xorriso p7zip-full fakeroot binutils isolinux
Created this path:
Code:
/usr/lib/ISOLINUX/isohdpfx.bin
And that solved the problem. Apparently one or more package was missing.
Thanks for reading.
 
Old 07-20-2022, 11:47 AM   #3
scdbackup
Member
 
Registered: Oct 2013
Posts: 158

Rep: Reputation: Disabled
Hi,

congrats to your success and thanks for flying xorriso.

Just for the records:

You could have obtained the missing file content from the start of the
ISO image by
Code:
dd if="$isofile" bs=1 count=446 of=mbr_template.bin
and used it instead of /usr/lib/syslinux/isohdpfx.bin
Code:
...
-isohybrid-mbr mbr_template.bin \
...
(The MBR code should match the El Torito boot image isolinux.bin that's in
the ISO. So it is best to use the MBR code of the ISO rather than the
currently installed isohdpfx.bin. But since ISOLINUX gets more or less no
development any more, you'd need very old ISOs to see an actual mismatch.)

Have a nice day

Thomas
 
1 members found this post helpful.
Old 07-20-2022, 04:32 PM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,140
Blog Entries: 6

Rep: Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828
My 2 cents. Quote your variables. Quote your variables in the echo statement, then quote the whole statement.

Code:
newisofile="new"$isofile""

echo ""$mech""$isofile""
echo ""$mech""$newisofile""

echo ""$mech"Temporary directory to put the extracted files:"

echo ""$mech""$tempdir""

echo ""$mech"Extract all files from the ISO:"

xorriso -osirrox on -indev "$isofile" -extract / "$tempdir"
Why is that important?
https://linuxconfig.org/correct-vari...uoting-in-bash
https://stackoverflow.com/questions/...shell-variable
 
1 members found this post helpful.
Old 07-21-2022, 09:29 AM   #5
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
scdbackup,
I did as you suggested, put the new ISO on a multiboot USB stick (all Linux-based OS) with the "MultiBootUSB-9.2.0" tool and ran it: flawless!
Thank you.
 
Old 07-21-2022, 09:30 AM   #6
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
teckk,
thank you for your links. They add to my modest knowledge of bash sripting.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To: Remastering Debian Stretch/Buster using Linux-live-debian-050419 into a Live CD/DVD/USB/HDD linus72 Debian 1 10-14-2019 01:25 PM
How To: Remastering Slackware14.2/current using Linux-live-slack-050419 into a Live CD/DVD/USB/HDD linus72 Slackware 0 05-05-2019 05:44 PM
graphics programs and linux opearating system manuchanel Linux - Newbie 1 01-07-2008 04:19 AM
Remastering live CDs ? DavidTempler Linux - General 3 11-14-2004 05:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration