Sunday, November 30, 2008

cdrtools script

Based on a thread over at the pclinuxos "hack" forums I've found there to be a decent demand for the cdrtools package as opposed to cdrkit that is included in many distributions.

I've written this script for pclos, but it should be applicable for just about any linux distrobution.

The script assumes proper setup of sudo on your distro for your user.
Be sure to chmod +x the script before running it.

Here is the script for reference.

#!/bin/bash

#compile smake for pclos
cd ~
wget ftp://ftp.berlios.de/pub/smake/alpha/smake-1.2a41.tar.gz
tar -zxf smake-1.2a41.tar.gz
cd smake-1.2
sudo cp Gmake.linux /usr/bin/Gmake
Gmake
sudo cp /opt/schily/bin/smake /usr/bin
sudo chmod +x /usr/bin/smake

#compile cdrtools for pclos
cd ~
wget ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-beta.tar.gz
tar -zxf cdrtools-beta.tar.gz
cd cdrtools-2.01.01
sudo smake
sudo smake install

# Ensure root ownership for proper operation
sudo chown root:root /opt/schily/bin/*

# Backup cdrkit files
cd ~
mkdir cdrkitbackup
sudo mv /usr/bin/wodim ~/cdrkitbackup
sudo mv /usr/bin/readom ~/cdrkitbackup
sudo mv /usr/bin/genisoimage ~/cdrkitbackup
sudo mv /usr/bin/btcflash ~/cdrkitbackup
sudo mv /usr/bin/devdump ~/cdrkitbackup
sudo mv /usr/bin/isodump ~/cdrkitbackup
sudo mv /usr/bin/isodebug ~/cdrkitbackup
sudo mv /usr/bin/isoinfo ~/cdrkitbackup
sudo mv /usr/bin/isovfy ~/cdrkitbackup
sudo mv /usr/bin/icedax ~/cdrkitbackup

# Remove soft links to cdrkit programs
sudo rm /usr/bin/cdrecord
sudo rm /usr/bin/cdda2wav
sudo rm /usr/bin/mkhybrid
sudo rm /usr/bin/mkisofs
sudo rm /usr/bin/readcd

# Create soft links to cdrtools programs
# Create soft links to cdrkit naming conventions for compatibility
sudo ln -s /opt/schily/bin/cdrecord /usr/bin/cdrecord
sudo ln -s /opt/schily/bin/cdrecord /usr/bin/wodim
sudo ln -s /opt/schily/bin/mkisofs /usr/bin/genisoimage
sudo ln -s /opt/schily/bin/mkisofs /usr/bin/mkisofs
sudo ln -s /opt/schily/bin/mkhybrid /usr/bin/mkhybrid
sudo ln -s /opt/schily/bin/readcd /usr/bin/readom
sudo ln -s /opt/schily/bin/readcd /usr/bin/readcd
sudo ln -s /opt/schily/bin/cdda2wav /usr/bin/cdda2wav
sudo ln -s /opt/schily/bin/cdda2wav /usr/bin/icedax
sudo ln -s /opt/schily/bin/btcflash /usr/bin/btcflash
sudo ln -s /opt/schily/bin/isodebug /usr/bin/isodebug
sudo ln -s /opt/schily/bin/isodump /usr/bin/isodump
sudo ln -s /opt/schily/bin/isoinfo /usr/bin/isoinfo
sudo ln -s /opt/schily/bin/isovfy /usr/bin/isovfy

2 comments:

kdulcimer said...

There's one issue with your script: anything coded for PCLinuxOS shouldn't use sudo! PCLinuxOS isn't set up for sudo. You should have your script check to make sure it's being run as root instead.

muaythaimaster said...

Thanks for the input.

I'll update my blog with a revised script for pclos.