Advertisement
adamchilcott

postproc.sh

Sep 24th, 2018
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.96 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ASM=StorMan
  4. REPLACE_XLOADIMAGE=true
  5.  
  6. function ProcessBootCD () {
  7.  
  8.   WDIR=$1
  9.  
  10.   pushd ${WDIR} >/dev/null
  11.  
  12.   tar zxf bootcd.tar.gz
  13.   rm -f bootcd.tar.gz
  14.  
  15.   if [ "${REPLACE_XLOADIMAGE}" ] ; then
  16.     if [ -f "xloadimage.tgz" ] ; then
  17.       tar zxf xloadimage.tgz
  18.       rm -f xloadimage.tgz
  19.       rm -f install.sh
  20.     else
  21.       echo "Cannot replace xloadimage, the tarfile is missing!!"
  22.       REPLACE_XLOADIMAGE=
  23.     fi
  24.   fi
  25.  
  26.   pushd bootcd >/dev/null
  27.  
  28.   if [ "${REPLACE_XLOADIMAGE}" ] ; then
  29.     base=usr/X11R6/bin
  30.     cp -p ../xloadimage.4.1/xloadimagerc usr/lib/X11/Xloadimage
  31.     rm -f ${base}/xloadimage
  32.     rm -f ${base}/xsetbg
  33.     rm -f ${base}/xview
  34.     rm -f ${base}/uufilter
  35.     cp -p ../xloadimage.4.1/xloadimage ${base}/xloadimage
  36.     cp -p ../xloadimage.4.1/uufilter ${base}/uufilter
  37.   fi
  38.  
  39.   if [ -d "../../cdrom5/linux/manager/" ];then
  40.     RPMFILE=`find ../../cdrom5/linux/manager/ -name "${ASM}*.i386.rpm"`
  41.   fi
  42.  
  43.   if [ -f "$RPMFILE" ];then
  44.     rpm2cpio $RPMFILE | cpio -id
  45.     find usr/${ASM} -name arcconf -exec chmod 775 {} \;
  46.     find usr/${ASM} -name hrconf -exec chmod 775 {} \;
  47.     rm -f usr/${ASM}/*.exe
  48.     tar zxf usr/${ASM}/*jre*.tgz -C usr/${ASM}
  49.     rm -f usr/${ASM}/*jre*.tgz
  50.     rm -rf usr/${ASM}/pftw
  51.  
  52.     mkdir -p common/usr/${ASM}
  53.     for i in `ls usr/${ASM}`;do
  54.       ln -s /usr/${ASM}_CD/$i common/usr/${ASM}/$i
  55.     done
  56.  
  57.     ln -s /common/usr/${ASM}/Search.htm usr/${ASM}/help/Search.htm
  58.  
  59.     if [ "${REPLACE_XLOADIMAGE}" ] ; then
  60.       mkdir -p common/usr/X11R6/bin
  61.       ls -l common/usr/X11R6/bin
  62.       ln -s /usr/X11R6/bin/xloadimage common/usr/X11R6/bin/xsetbg
  63.       ls -l common/usr/X11R6/bin/xsetbg
  64.       ln -s /usr/X11R6/bin/xloadimage common/usr/X11R6/bin/xview
  65.       ls -l common/usr/X11R6/bin/xview 
  66.     fi
  67.  
  68.     gunzip ramdisk.tgz
  69.     tar rf ramdisk.tar common/
  70.     rm -rf common/
  71.     gzip ramdisk.tar
  72.     mv ramdisk.tar.gz ramdisk.tgz
  73.  
  74.     mv usr/${ASM} usr/${ASM}_CD
  75.     ln -s /common/usr/${ASM} usr/${ASM}
  76.  
  77.   else
  78.     echo "ERROR: can't find the ${ASM} RPM!"
  79.   fi
  80.  
  81.   if [ "${REPLACE_XLOADIMAGE}" ] ; then
  82.     rm -rf ../xloadimage.4.1
  83.   fi
  84.  
  85.   popd >/dev/null
  86.   popd >/dev/null
  87.  
  88. }
  89.  
  90. pushd ../cdrom3 >/dev/null
  91.   mkdir -p isoboot
  92.   tar zxf isolinux.tar.gz -C isoboot/
  93.   rm -f isolinux.tar.gz
  94.  
  95.   pushd isoboot/bootcd/isolinux >/dev/null
  96.   gunzip initrd.gz
  97.   mkdir tmp
  98.   mount -oloop initrd tmp/
  99.  
  100.   echo ""
  101.  
  102.   echo "Updating BUILD_NUM to ${KABOODLE_NUM}"
  103.  
  104.   sed   -e "s,^BUILD_NUM=.*,BUILD_NUM=${KABOODLE_NUM},"  tmp/start > tmp/newstart
  105.   chmod 755 tmp/newstart
  106.   mv -f tmp/newstart tmp/start
  107.  
  108.   echo ""
  109.  
  110.   umount tmp
  111.   rmdir tmp
  112.   gzip initrd
  113.   popd >/dev/null
  114.  
  115. popd >/dev/null
  116.  
  117. ProcessBootCD ../cdrom1
  118. ProcessBootCD ../cdrom4
  119.  
  120. #############
  121. # START NOTES
  122. #############
  123.  
  124. ## Shell script on the bundled DVD Disc for a consumer grade Adaptec RAID 6405.
  125. ## Only modifications to the Script are these comments.
  126.  
  127. ###########
  128. # END NOTES
  129. ###########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement