#!/bin/bash #Copyright 2003 William Stearns #Version 0.0.1 if [ -z "$WorkDir" ]; then WorkDir="$HOME/staticiso-build/" fi CacheDir=/usr/src/ GetFile () { while [ -n "$1" ]; do if [ ! -f "`basename "$1"`" ]; then if [ -f "$CacheDir/`basename $1`" ]; then cp -p "$CacheDir/`basename $1`" "$WorkDir/sources/" else case "$1" in http*|ftp*) cd "$WorkDir/sources/" wget "$1" cd - ;; /*) cp -p "$1" "$WorkDir/sources/" ;; *::*) rsync -av --progress "$1" "$WorkDir/sources" ;; esac fi fi shift done } if [ -d "$WorkDir" ]; then echo "$WorkDir exists, exiting." exit 1 fi mkdir --parents "$WorkDir" mkdir --parents "$WorkDir/sources/" mkdir --parents "$WorkDir/unpack/" if ! cd "$WorkDir" 2>/dev/null ; then echo "Unable to change to $WorkDir, exiting." exit 1 fi export CFLAGS="$CFLAGS -static" #Fileutils: ls GetFile zaphod.stearns.org::redhatmirror/pub/redhat/linux/updates/7.3/en/os/SRPMS/fileutils-4.1-10.1.src.rpm rpm --rebuild "$WorkDir/sources/fileutils-4.1-10.1.src.rpm" cd "$WorkDir/unpack/" rpm2cpio /home/wstearns/rpm/RPMS/i386/fileutils-4.1-10.1.i386.rpm | cpio -i -d -m cd "$WorkDir" mkisofs -gid 0 -uid 0 -pad -r -T -o "$WorkDir/static.`date +%y%m%d`.iso" unpack/ bzip2 -9 -k "$WorkDir/static.`date +%y%m%d`.iso"