LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-20-2007, 12:04 PM   #1
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Lightbulb Easy ISO remastering/editing


Hey guys,

I've seen a lot of threads asking how to edit ISO images on Linux. I asked a few questions on it but I never got or saw any easy answers. Everybody just said there are tools on winbloze, blah, blah, blah. The problem is that you can't modify a loopback filesystem (they are r/o) so you have to know what mkisofs command to use and that seems to be a mystery.

Why don't we just use the same mkisofs command as they did to build the ISO in the first place? Because I never heard how to get it.

I'm working on a Solaris compatibility problem with Sun and (actually they're working and I'm just trying) and the guy Moinak gave me an easy way to extract the mkisofs command. It's a real Simpsons DOH! it's so simple.

Code:
cat original-iso-image.iso | strings | grep mkisofs > remaster.sh # extract mkisofs command from original ISO image
This will scan the ISO image and copy the mkisofs command string (and it a bit of other rubbish possibly) into the remaster.sh file. You don't have to save the ouput but it's a bit easier than trying to remember it. It was my semi-brilliant idea to save the output and make a shell script from it

Then just edit the remaster.sh and delete all the rubbish that's not part of the mkisofs command (it will be very obvious, not to worry), change the pathspec in the mkisofs command (the name of the directory mkisofs supposed to use to build the ISO from, it's the last parameter on the command) to be your directory you want to build the ISO from. Change "-o filename" to be "-o /tmp/mynewiso.iso" or whatever you please. Add a #!/bin/bash as the first line and you've now got a shell script to build an ISO automagically.

It's actually quicker to do all this than it is to explain it. If it seems complicated or confusing just try it and you'll see it's quite simple.

Here's the process for editing/remastering your own ISO:

Code:
01. cat original-iso-image.iso | strings | grep mkisofs > remaster.sh # extract mkisofs command from image
02. edit remaster.sh:
    a. add "#!/bin/bash" on first line.
    b. clean up mkisofs command, delete extraneous text.
    c. change pathspec (last file name on mkisofs command) to /tmp/ISO.
    d. Change "-o filename" to name of ISO image you want to create, ex.
       slackware-remaster-disk1.iso
    e. save changes to remaster.sh
03. mount original-iso-image.iso -o loop /mnt/loop
04. mkdir /tmp/ISO
05. copy everything from /mnt/loop to /tmp/ISO
06. umount /mnt/loop
07. add/remove desired files from /tmp/ISO
08. cd /tmp
09. remaster.sh
10. Now you can check your work by mount -o loop /tmp/mynewiso.iso /mnt/loop
    and you should be able to see all your files as you wanted.
11. burn the CD using cdrecord, xcdroast, K3B, or whichever tool you prefer
12. enjoy (everyone always seems to insist on adding this step)
If you're good with Perl or Bash you can probably automate this even more. If I did it a lot I would write my own scripts but it's not very often I do it.

Sorry if all this has been said before. I wasn't able to find it in my searches.

Cheers,
Rand
 
Old 02-21-2007, 04:52 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 377Reputation: 377Reputation: 377Reputation: 377
thanks for sharing this tip!!! it should probably go in another forum, though (for better exposure)... anyhow, just wondering if you know what mkisofs option allows for this info to be included in the ISO itself... i ask cuz apparently this doesn't work on all ISOs, as the following test i did shows:
Code:
win32sux@candystore:~/Desktop$ cat /mnt/archives/iso/ubuntu-6.06.1-desktop-i386.iso | strings | grep mkisofs
mkisofs 4:2.01+01a01-4ubuntu6
mkisofs 4:2.01+01a01-4ubuntu6
mkisofs.8
win32sux@candystore:~/Desktop$ cat /mnt/archives/iso/ubuntu-6.10-desktop-i386.iso | strings | grep mkisofs
mkisofs 4:2.01+01a03-5ubuntu2
mkisofs 4:2.01+01a03-5ubuntu2
mkisofs.8
win32sux@candystore:~/Desktop$ cat /mnt/archives/iso/slackware-10.2-install-d1.iso | strings | grep mkisofs
mkisofs 2.01 -R -J -V Slk102d1 -hide-rr-moved -v -d -N -no-emul-boot -boot-load-size 4 -boot-info-table -sort isolinux/iso.sort -b isolinux/isolinux.bin -c isolinux/isolinux.boot -p Slackware Linux, Inc. <info@slackware.com> -publisher Slackware Linux, Inc. <info@slackware.com> -A Slackware Linux 10.2 disc 1 .
cdrtools: mkisofs  -- create ISO9660/HFS/Joliet CD-ROM images.
mkisofs -o /tmp/slackware.iso \
  UPDATE:  I've now been informed that there's a Windows version of mkisofs
cdrtools: mkisofs  -- create ISO9660/HFS/Joliet CD-ROM images.
win32sux@candystore:~/Desktop$
i usually use my own mkisofs options regardless of what the original ISO maker used - but this is still pretty neat and can be quite useful to many people...

Last edited by win32sux; 02-21-2007 at 04:53 PM.
 
Old 02-21-2007, 05:36 PM   #3
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Original Poster
Rep: Reputation: 54
That's a downer I thought it might be too good to be true but it worked on the 3 ISOs I tested. I don't know the answer about which command to use to save the string in the ISO but now we should research this issue. Or just don't try to remaster Ubuntu maybe it's their way of stopping people from modding it.
 
Old 02-21-2007, 06:10 PM   #4
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 14
Posts: 542

Rep: Reputation: 33
I feel very confortable with this:
http://littlesvr.ca/isomaster/
Ciao
 
Old 02-21-2007, 06:16 PM   #5
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Original Poster
Rep: Reputation: 54
Thanks for the link. It's the first time I've seen any app for *NIX that does what we've been looking for.
 
Old 02-22-2007, 12:46 AM   #6
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
seems to be a nice trick, (not for making iso's) but for tweeking

but i was thinking there will be only one mkisofs command, in an iso image.
we dont know from where we must run that command. (from the root folder of the uncompresed image or somewhere else)

here is the slackware dvd iso making
http://rkrishna.tp.googlepages.com/s...asics#inst-dvd

for buning check cd write/read tricks

happy to mention that it is pats way.
 
Old 02-22-2007, 05:02 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,882

Rep: Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567
Excellent reference urka58! That is a unique application - I wish he'd done it in GTK-1.2 though. I smell another dir in my Projects area...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mounting an ISO Image & Editing it linuxnewbie82 Fedora 21 10-05-2010 07:35 AM
Editing ISO image Guignol Linux - Software 2 02-28-2006 04:27 PM
SUSE Installer ISO editing help pokemaster SUSE / openSUSE 1 02-27-2006 10:25 AM
Easy quint about making .iso cd s carrie Linux - Newbie 4 10-10-2004 12:26 AM
easy to use image editing program sethgeekx86 Linux - Software 2 03-14-2004 10:13 PM

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

All times are GMT -5. The time now is 06:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration