#!/bin/bash
-imagename="$1"
+PROG="${0}"
+ISODIR=/worksrc/isofiles
+REPOSRC=/worksrc/sysresccd-src
+REPOBIN=/worksrc/sysresccd-bin
+CATALYSTDIR=/var/tmp/catalyst
-case ${imagename} in
+usage()
+{
+ cat <<EOF
+Usage: ${PROG} [options] <imagename>
+
+Build the distribution kernel (and other things?)
+
+imagename: rescue64 | altker32 | altker64
+
+Options:
+ -h|--help Display this screen and exit
+ -i ISODIR Directory containing the iso file to rebuild ($ISODIR)
+ <isodir>/systemrescuecd-<arch>-current.iso
+ -r REPOSRC Location of git systemrescuecd repo ($REPOSRC)
+ -b REPOBIN ? ($REPOBIN)
+ -m CATALYSTDIR Set catalyst's output directory ($CATALYSTDIR)
+
+Distributed under the GNU Public License version 2 - http://www.sysresccd.org
+EOF
+}
+
+while getopts "i:r:b:c:" Option
+do
+ case $Option in
+ i ) ISODIR="$OPTARG";;
+ r ) REPOSRC="$OPTARG";;
+ b ) REPOBIN="$OPTARG";;
+ c ) CATALYSTDIR="$OPTARG";;
+ * ) usage; exit 1;; # Default, handles -h
+ esac
+done
+shift $(($OPTIND - 1))
+
+IMAGENAME="$1"
+case ${IMAGENAME} in
rescue64)
KERTYPE=std
- ARCHNAME=amd64
+ ARCH=amd64
+ BASEARCH=x86
LIBDIR=lib64
;;
altker32)
KERTYPE=alt
- ARCHNAME=i386
+ ARCH=i386
+ BASEARCH=x86
LIBDIR=lib
;;
altker64)
KERTYPE=alt
- ARCHNAME=amd64
+ ARCH=amd64
+ BASEARCH=x86
LIBDIR=lib64
;;
*)
- echo "$0: invalid argument"
+ usage
exit 1
;;
esac
+VERSION=$(cat ${REPOSRC}/overlay-squashfs-${BASEARCH}/root/version)
-(cd /worksrc/sysresccd-src/mainfiles ; nice catalyst -a -f sysresccd-stage2-${imagename}.spec)
+SPEC=$(cat ${REPOSRC}/mainfiles/sysresccd-stage2-${IMAGENAME}.spec \
+ | sed "s!VERSION_STAMP!${VERSION}-${KERTYPE}!" \
+ | sed "s!ISODIR!${ISODIR}!" \
+ | sed "s!REPOSRC!${REPOSRC}!" \
+ | sed "s!REPOBIN!${REPOBIN}!" \
+ )
+(cd ${REPOSRC}/mainfiles ; nice catalyst -a -f <(echo "$SPEC") )
-targetdir="/worksrc/sysresccd-bin/overlay-squashfs-x86/${LIBDIR}/modules"
-rootkernel=$(ls -d /var/tmp/catalyst/builds/default/livecd-stage2-${ARCHNAME}-*-${KERTYPE}/isolinux)
-rootmodule=$(ls -d /var/tmp/catalyst/tmp/default/livecd-stage2-${ARCHNAME}-*-${KERTYPE}/${LIBDIR}/modules)
+targetdir="${REPOBIN}/overlay-squashfs-x86/${LIBDIR}/modules"
+rootkernel=$(ls -d ${CATALYSTDIR}/builds/default/livecd-stage2-${ARCH}-*-${KERTYPE}/isolinux)
+rootmodule=$(ls -d ${CATALYSTDIR}/tmp/default/livecd-stage2-${ARCH}-*-${KERTYPE}/${LIBDIR}/modules)
kerversion=$(ls ${rootmodule})
echo "rootkernel=[${rootkernel}]"
echo "rootmodule=[${rootmodule}]"
echo "kerversion=[${rootmodule}]"
-echo "cp ${rootkernel}/${imagename}* /worksrc/sysresccd-bin/kernels-x86/"
-cp ${rootkernel}/${imagename}* /worksrc/sysresccd-bin/kernels-x86/
+echo "cp ${rootkernel}/${IMAGENAME}* ${REPOBIN}/kernels-x86/"
+cp ${rootkernel}/${IMAGENAME}* ${REPOBIN}/kernels-x86/
echo "(cd ${rootmodule} ; tar cfj ${targetdir}/${kerversion}.tar.bz2 ${kerversion})"
(cd ${rootmodule} ; tar cfj ${targetdir}/${kerversion}.tar.bz2 ${kerversion})
-
--- /dev/null
+#!/bin/bash
+
+PROG="${0}"
+REPOSRC=/worksrc/sysresccd-src
+NEWDATE=$(date --date='1 days ago' '+%Y%m%d')
+
+usage()
+{
+ cat <<EOF
+Usage: ${PROG} [options] [NEWDATE]
+
+Replace the snapshot date in REPOSRC/mainfiles/*.spec with NEWDATE (defaults
+to ${NEWDATE}).
+
+Options:
+ -h|--help Display this screen and exit
+ -r REPOSRC Location of git systemrescuecd repo ($REPOSRC)
+EOF
+}
+
+while getopts "r:" Option
+do
+ case $Option in
+ r ) REPOSRC="$OPTARG";;
+ * ) usage; exit 1;; # Default, handles -h
+ esac
+done
+shift $(($OPTIND - 1))
+
+if [ "${1}" == "--help" ]
+then
+ usage
+ exit 1
+fi
+
+if [ -n "${1}" ]
+then
+ NEWDATE="${1}"
+fi
+
+for f in ${REPOSRC}/mainfiles/sysresccd-*.spec
+do
+ sed -i -e "s!^snapshot: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]!snapshot: ${NEWDATE}!g" ${f}
+done
+
+grep '^snapshot: ' ${REPOSRC}/mainfiles/sysresccd-*.spec
+++ /dev/null
-#!/bin/bash
-
-if [ -n "${1}" ]
-then
- newdate="${1}"
-else
- newdate="$(date --date='1 days ago' +%Y%m%d)"
-fi
-
-for f in sysresccd-*.spec
-do
- sed -i -e "s!^snapshot: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]!snapshot: ${newdate}!g" ${f}
-done
-
-grep '^snapshot: ' *.spec
-
profile: default/linux/x86/10.0
snapshot: 20100315
source_subpath: default/livecd-stage1-i386-1.5
-portage_confdir: /worksrc/sysresccd-src/portage-etc-x86
-portage_overlay: /worksrc/sysresccd-src/portage-overlay
+portage_confdir: REPOSRC/portage-etc-x86
+portage_overlay: REPOSRC/portage-overlay
livecd/fstype: none
livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-3.09-cdtar.tar.bz2
-livecd/iso: /worksrc/isofiles/systemrescuecd-x86-current.iso
+livecd/iso: ISODIR/systemrescuecd-x86-current.iso
livecd/splash_type:
livecd/splash_theme:
livecd/bootargs: dokeymap
livecd/gk_mainargs: --makeopts="-j5"
-livecd/linuxrc: /worksrc/sysresccd-src/mainfiles/linuxrc
+livecd/linuxrc: REPOSRC/mainfiles/linuxrc
livecd/type: generic-livecd
livecd/readme:
livecd/motd:
livecd/modblacklist:
-livecd/overlay: /worksrc/sysresccd-src/overlay-iso-x86
-livecd/root_overlay: /worksrc/sysresccd-src/overlay-squashfs-x86
+livecd/overlay: REPOSRC/overlay-iso-x86
+livecd/root_overlay: REPOSRC/overlay-squashfs-x86
livecd/devmanager: udev
livecd/users:
livecd/volid: sysresccd
boot/kernel: altker32
boot/kernel/altker32/sources: sys-kernel/alt-sources
-boot/kernel/altker32/config: /worksrc/sysresccd-src/kernelcfg/config-x86-2.6.27-alt150.conf
+boot/kernel/altker32/config: REPOSRC/kernelcfg/config-x86-2.6.27-alt150.conf
boot/kernel/altker32/use: pcmcia usb -X png truetype
boot/kernel/altker32/extraversion: i386
-boot/kernel/altker32/initramfs_overlay: /worksrc/sysresccd-src/overlay-initramfs
+boot/kernel/altker32/initramfs_overlay: REPOSRC/overlay-initramfs
boot/kernel/altker32/packages:
app-accessibility/speakup
net-dialup/speedtouch-usb
subarch: amd64
-version_stamp: 1.5-alt
+version_stamp: VERSION_STAMP
target: livecd-stage2
rel_type: default
profile: default/linux/x86/10.0
snapshot: 20100315
source_subpath: default/livecd-stage1-amd64-1.5
-portage_confdir: /worksrc/sysresccd-src/portage-etc-x86
-portage_overlay: /worksrc/sysresccd-src/portage-overlay
+portage_confdir: REPOSRC/portage-etc-x86
+portage_overlay: REPOSRC/portage-overlay
livecd/fstype: none
livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-3.09-cdtar.tar.bz2
-livecd/iso: /worksrc/isofiles/systemrescuecd-amd64-current.iso
+livecd/iso: ISODIR/systemrescuecd-amd64-current.iso
livecd/splash_type:
livecd/splash_theme:
livecd/bootargs: dokeymap
livecd/gk_mainargs: --makeopts="-j5"
-livecd/linuxrc: /worksrc/sysresccd-src/mainfiles/linuxrc
+livecd/linuxrc: REPOSRC/mainfiles/linuxrc
livecd/type: generic-livecd
livecd/readme:
livecd/motd:
livecd/modblacklist:
-livecd/overlay: /worksrc/sysresccd-src/overlay-iso-x86
-livecd/root_overlay: /worksrc/sysresccd-src/overlay-squashfs-x86
+livecd/overlay: REPOSRC/overlay-iso-x86
+livecd/root_overlay: REPOSRC/overlay-squashfs-x86
livecd/devmanager: udev
livecd/users:
livecd/volid: sysresccd
boot/kernel: altker64
boot/kernel/altker64/sources: sys-kernel/alt-sources
-boot/kernel/altker64/config: /worksrc/sysresccd-src/kernelcfg/config-amd64-2.6.27-alt150.conf
+boot/kernel/altker64/config: REPOSRC/kernelcfg/config-amd64-2.6.27-alt150.conf
boot/kernel/altker64/use: pcmcia usb -X png truetype
boot/kernel/altker64/extraversion: amd64
-boot/kernel/altker64/initramfs_overlay: /worksrc/sysresccd-src/overlay-initramfs
+boot/kernel/altker64/initramfs_overlay: REPOSRC/overlay-initramfs
boot/kernel/altker64/packages:
app-accessibility/speakup
net-dialup/hsfmodem
subarch: amd64
-version_stamp: 1.5-std
+version_stamp: VERSION_STAMP
target: livecd-stage2
rel_type: default
profile: default/linux/x86/10.0
snapshot: 20100315
source_subpath: default/livecd-stage1-amd64-1.5
-portage_confdir: /worksrc/sysresccd-src/portage-etc-x86
-portage_overlay: /worksrc/sysresccd-src/portage-overlay
+portage_confdir: REPOSRC/portage-etc-x86
+portage_overlay: REPOSRC/portage-overlay
livecd/fstype: none
livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-3.09-cdtar.tar.bz2
-livecd/iso: /worksrc/isofiles/systemrescuecd-amd64-current.iso
+livecd/iso: ISODIR/systemrescuecd-amd64-current.iso
livecd/splash_type:
livecd/splash_theme:
livecd/bootargs: dokeymap
livecd/gk_mainargs: --makeopts="-j5"
-livecd/linuxrc: /worksrc/sysresccd-src/mainfiles/linuxrc
+livecd/linuxrc: REPOSRC/mainfiles/linuxrc
livecd/type: generic-livecd
livecd/readme:
livecd/motd:
livecd/modblacklist:
-livecd/overlay: /worksrc/sysresccd-src/overlay-iso-x86
-livecd/root_overlay: /worksrc/sysresccd-src/overlay-squashfs-x86
+livecd/overlay: REPOSRC/overlay-iso-x86
+livecd/root_overlay: REPOSRC/overlay-squashfs-x86
livecd/devmanager: udev
livecd/users:
livecd/volid: sysresccd
boot/kernel: rescue64
boot/kernel/rescue64/sources: sys-kernel/std-sources
-boot/kernel/rescue64/config: /worksrc/sysresccd-src/kernelcfg/config-amd64-2.6.32-std150.conf
+boot/kernel/rescue64/config: REPOSRC/kernelcfg/config-amd64-2.6.32-std150.conf
boot/kernel/rescue64/use: pcmcia usb -X png truetype
boot/kernel/rescue64/extraversion: amd64
-boot/kernel/rescue64/initramfs_overlay: /worksrc/sysresccd-src/overlay-initramfs
+boot/kernel/rescue64/initramfs_overlay: REPOSRC/overlay-initramfs
boot/kernel/rescue64/packages:
net-dialup/speedtouch-usb
net-dialup/hsfmodem
subarch: i386
-version_stamp: 1.5-std
+version_stamp: VERSION_STAMP
target: livecd-stage2
rel_type: default
profile: default/linux/x86/10.0
snapshot: 20100315
source_subpath: default/livecd-stage1-i386-1.5
-portage_confdir: /worksrc/sysresccd-src/portage-etc-x86
-portage_overlay: /worksrc/sysresccd-src/portage-overlay
+portage_confdir: REPOSRC/portage-etc-x86
+portage_overlay: REPOSRC/portage-overlay
livecd/fstype: squashfs
livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-3.09-cdtar.tar.bz2
-livecd/iso: /worksrc/isofiles/systemrescuecd-x86-current.iso
-livecd/fsscript: /worksrc/sysresccd-src/mainfiles/fsscript.sh
+livecd/iso: ISODIR/systemrescuecd-x86-current.iso
+livecd/fsscript: REPOSRC/mainfiles/fsscript.sh
livecd/splash_type:
livecd/splash_theme:
livecd/bootargs: dokeymap
livecd/gk_mainargs: --makeopts="-j5"
-livecd/linuxrc: /worksrc/sysresccd-src/mainfiles/linuxrc
+livecd/linuxrc: REPOSRC/mainfiles/linuxrc
livecd/type: generic-livecd
livecd/readme:
livecd/motd:
livecd/modblacklist:
-livecd/root_overlay: /worksrc/sysresccd-bin/overlay-squashfs-x86 /worksrc/sysresccd-src/overlay-squashfs-x86
+livecd/root_overlay: REPOBIN/overlay-squashfs-x86 REPOSRC/overlay-squashfs-x86
livecd/devmanager: udev
livecd/users:
livecd/volid: sysresccd
boot/kernel: rescuecd
boot/kernel/rescuecd/sources: sys-kernel/std-sources
-boot/kernel/rescuecd/config: /worksrc/sysresccd-src/kernelcfg/config-x86-2.6.32-std150.conf
+boot/kernel/rescuecd/config: REPOSRC/kernelcfg/config-x86-2.6.32-std150.conf
boot/kernel/rescuecd/use: pcmcia usb -X png truetype
boot/kernel/rescuecd/extraversion: i386
boot/kernel/rescuecd/packages: