#!/bin/bash ##################################################################### # prepareSCSICD.sh # prepares to access the ide-cdrom hdc as SCSI-(emulated-)device # and to excute xcdroast as regular user # This is for RedHat 7.3 on Laptop Gericom 1st Supersonic (model A440) # Details: http://ContemporaryCodes.com/LinuxOnGericom/index.html # Date: 2004-04-13 # Michael Besteck, a.b.c@gmx.net # ##################################################################### # MUST BE RUN AS ROOT ##################################################################### # for easy use just copied from the "CD-Writing HOWTO": # /usr/share/doc/HOWTO/HTML/en/CD-Writing-HOWTO.html # create SCSI-devices from cdrom if not existing ##################################################################### test `whoami` = 'root' \ || { echo "You must be root to execute the commands." ; exit ; } ##################################################################### cd /dev umask -S u=rwx,g=rwx,o-rwx [ -f loop0 ] \ || ./MAKEDEV loop \ || for i in 0 1 2 3 4 5 6 7; do mknod loop$i b 7 $i; done [ -f sg0 -o -f sga ] \ || ./MAKEDEV sg \ || for i in 0 1 2 3 4 5 6 7; do mknod sg$i c 21 $i; done ####################################################################### # create the SCSI-device rm -f cdrom ln -s scd0 cdrom # this will be done by kudzu automatically rm -f cdrom1 ln -s hdc cdrom1 cd ~ ###################################################################### ###################################################################### # prepare permissions to run xcdroast 0.98 as regular user # for easy use just copied from # /usr/share/doc/xcdroast-0.98a9/README.nonroot ###################################################################### /usr/sbin/groupadd cdwrite cd /usr/bin chown root:cdwrite cdrecord cdda2wav mkisofs readcd chmod 4710 cdrecord cdda2wav mkisofs readcd cd /usr/lib/xcdroast-0.98/bin chown root:cdwrite xcdrwrap chmod 2755 xcdrwrap ###################################################################### ###################################################################### # ensure mount dirs ###################################################################### cd ~ mkdir -p /mnt/cdrom chown -f root:root /mnt/cdrom chmod -f 777 /mnt/cdrom mkdir -p /mnt/cdrom1 chown -f root:root /mnt/cdrom1 chmod -f 777 /mnt/cdrom1 exit ######################################################################