HOME LINKS SAL PUBLIC SOFTWARE SEARCH MADE UP

#!/bin/sh

# mkrhcd 1.0, (c) 1998 SALSOFT <ondrejj@salstar.award.sk>
#   Jan ONDREJ, Pavla Dobsinskeho 10, 048 01, Roznava
# This is a script for making a RedHat instalation CD.

RHVER="RedHat-5.1"
CDPATH="/home/ftp/pub/linux/$RHVER"
OUTFILE="/mnt/e/rh51iso.raw"
PREPARER_ID="SAL"
PUBLISHER_ID="Red Hat Software, Inc."

############################################################################
##             WARNING: Don't change these parameters !!!                 ##
############################################################################

BOOTIMG="images/boot.img"
APPLICATION_ID=$RHVER
VOLUME_ID=$RHVER

# Show size of CD
echo -n "Size of CD is "
mkhybrid -o /dev/null $CDPATH 2>&1 | gawk '
  /^Total exte/ {
    print $8*2/1024" MB"
    getline P < "/dev/pid"
    system("kill -9 " P)
  }'

# Add execute flag to instimage binaries.
echo -n "Adding execute flag ... "
chmod +x \
  $CDPATH/RedHat/instimage/lib/* \
  $CDPATH/RedHat/instimage/usr/bin/*
FS=`file \`find $CDPATH/misc/src -print\` \
  | egrep ':.*((script)|(executable))' \
  | cut -d: -f1`
chmod +x $FS
echo "done."

# Update hdlist.
export HDLP="$CDPATH/misc/src/install"
echo -n "Generating hdlist ... "
chmod +x $HDLP/genhdlist $HDLP/dmphdlist
$HDLP/genhdlist $CDPATH
X=`$HDLP/dmphdlist $CDPATH | wc -l`
echo "done ($X RPMs)."

# Update rpmcontents.gz
echo -n "Updating rpmcontents ... "
L="-----------------------------------------------------------------------------"
for i in $CDPATH/RedHat/RPMS/*.rpm; do
  echo $L
  rpm -qip $i
  echo $L
  rpm -qlp $i
  echo ""
done | gzip > $CDPATH/RedHat/rpmcontents.gz
echo "done."

# Make raw ISO file.
mkhybrid $CDPATH \
 -o $OUTFILE \
 -a -r -J -L \
 -b $BOOTIMG \
 -P $PUBLISHER_ID \
 -p $PREPARER_ID \
 -V $VOLUME_ID \
 -A $APPLICATION_ID

# Mount created filesystem as CD-ROM.
sync
echo "Press ENTER to mount as /mnt/cdrom ..."
read a
mount $OUTFILE /mnt/cdrom -t iso9660 -o loop