Required: bchunk, mkisofs, cdrecord.
Target: Make an .iso from .bin/.cue, edit it, burn it to a disc and then create an .iso from the disk.
Let’s say we are in /home/user, where something.bin and something.cue can be found. The first thing to do is to install bchunk and convert those to an .iso:
wget http://he.fi/bchunk/bchunk-1.2.0.tar.gz
tar -zxvf bchunk-1.2.0.tar.gz
cd bchunk-1.2.0
make
sudo make install
cd ..
bchunk something.bin something.cue something.iso
We will create a directory to temporary mount the .iso (this is the same as what Daemon Tools and Nero Image Drive will do for you on Windows) and then create a directory where we will copy the files from the .iso.
mkdir tmp
mkdir iso_edit
mount -o loop -t iso9660 something.iso tmp/
cp -r /media/tmp/* iso_edit/
We don’t need the .iso to be mounted, so we can do a little bit of cleanup:
umount tmp/
rm -rf tmp
rm something.iso
Next let’s add a description file to the files for the iso:
cd iso_edit/
echo "My brand new edited ISO :)" > DESCRITPION
cd ..
To make the iso, write the md5 hash to a file and delete the temporary files:
mkisofs -o new.iso -RJ iso_edit/
md5sum -b new.iso > MD5SUMS
rm -rf iso_edit/
To burn the .iso (/dev/XXX is your cd-rw drive):
cdrecord -dev=/dev/hdb new.iso
To make an iso from the cd:
dd if=/dev/cdrom of=new_copy.iso