Wednesday, September 20, 2006

To build mkcdrec for use in the labs

To build mkcdrec for use in the labs. Get the source RPM and install it onto a SLES system with gcc installed. Install the source RPM, then extract the tar ball under /usr/src/packages/SOURCE.

cd /usr/src/packages/SOURCE
tar xzvf mkCDrec_v0.8.5.tar.gz
cd mkcdrec

Change the file Config.sh with the following

CHECK_BAD_BLOCKS="-c"

EXCLUDE_LIST= Make it what ever you want

AUTODR="y"
INITRDSIZE=8192
LINUX_KERNEL="/boot/vmlinuz"
MAXCDSIZE=700000

Extract mkCDrec_v0.7.9_utils.tar.gz into the mkcdrec directory

cd /usr/src/packages/SOURCE/mkcdrec/
tar xzvf /tmp/mkCDrec_v0.7.9_utils.tar.gz

Fix a crazy scsi disk major number problem

cd /var/opt/mkcdrec/scripts
perl -i.old -pe 's/major=65/major=8/g' clone-dsk.sh make_common.sh restore-fs.sh

Create a source tarball named with the Version: number below

cd /usr/src/packages/SOURCES
tar czvf mkCDrec_v0.8.5_TSD.tar.gz mkcdreci
rm -rf mkcdrec

Alter the SPEC file to mark the build as a custom one

cd /usr/src/packages/SPECS/
vim mkcdrec.spec

Change Version: v0.8.5 to Version: v0.8.5_TSD or something. Here's a diff of the changes I made to get it working

8c8
<> Version: v0.8.5_TSD
90a91
> mkdir -p $RPM_BUILD_ROOT%{_prefix}/utilities
130a132,134
> for fname in `find utilities -type f`; do
> install -m 755 $fname $RPM_BUILD_ROOT%{_prefix}/utilities
> done
182a187
> %{_prefix}/utilities

Then rebuild the binary package

cd /usr/src/packages
rpmbuild -bb SPECS/mkcdrec.spec

The resulting binary backage will be in /usr/src/packages/RPMS/i586/

No comments: