4 ISODIR=/worksrc/isofiles
5 REPOSRC=/worksrc/sysresccd-src
6 REPOBIN=/worksrc/sysresccd-bin
7 CATALYSTDIR=/var/tmp/catalyst
12 Usage: ${PROG} [options] <imagename>
14 Build the distribution kernel (and other things?)
16 imagename: rescue64 | altker32 | altker64
19 -h|--help Display this screen and exit
20 -i ISODIR Directory containing the iso file to rebuild ($ISODIR)
21 <isodir>/systemrescuecd-<arch>-current.iso
22 -r REPOSRC Location of git systemrescuecd repo ($REPOSRC)
23 -b REPOBIN ? ($REPOBIN)
24 -m CATALYSTDIR Set catalyst's output directory ($CATALYSTDIR)
26 Distributed under the GNU Public License version 2 - http://www.sysresccd.org
30 while getopts "i:r:b:c:" Option
33 i ) ISODIR="$OPTARG";;
34 r ) REPOSRC="$OPTARG";;
35 b ) REPOBIN="$OPTARG";;
36 c ) CATALYSTDIR="$OPTARG";;
37 * ) usage; exit 1;; # Default, handles -h
40 shift $(($OPTIND - 1))
67 VERSION=$(cat ${REPOSRC}/overlay-squashfs-${BASEARCH}/root/version)
69 SPEC=$(cat ${REPOSRC}/mainfiles/sysresccd-stage2-${IMAGENAME}.spec \
70 | sed "s!VERSION_STAMP!${VERSION}-${KERTYPE}!" \
71 | sed "s!ISODIR!${ISODIR}!" \
72 | sed "s!REPOSRC!${REPOSRC}!" \
73 | sed "s!REPOBIN!${REPOBIN}!" \
75 (cd ${REPOSRC}/mainfiles ; nice catalyst -a -f <(echo "$SPEC") )
77 targetdir="${REPOBIN}/overlay-squashfs-x86/${LIBDIR}/modules"
78 rootkernel=$(ls -d ${CATALYSTDIR}/builds/default/livecd-stage2-${ARCH}-*-${KERTYPE}/isolinux)
79 rootmodule=$(ls -d ${CATALYSTDIR}/tmp/default/livecd-stage2-${ARCH}-*-${KERTYPE}/${LIBDIR}/modules)
80 kerversion=$(ls ${rootmodule})
82 echo "rootkernel=[${rootkernel}]"
83 echo "rootmodule=[${rootmodule}]"
84 echo "kerversion=[${rootmodule}]"
86 echo "cp ${rootkernel}/${IMAGENAME}* ${REPOBIN}/kernels-x86/"
87 cp ${rootkernel}/${IMAGENAME}* ${REPOBIN}/kernels-x86/
89 echo "(cd ${rootmodule} ; tar cfj ${targetdir}/${kerversion}.tar.bz2 ${kerversion})"
90 (cd ${rootmodule} ; tar cfj ${targetdir}/${kerversion}.tar.bz2 ${kerversion})