diff options
author | Peter Gavin <pete@gentoo.org> | 2001-08-10 02:28:38 +0000 |
---|---|---|
committer | Peter Gavin <pete@gentoo.org> | 2001-08-10 02:28:38 +0000 |
commit | cc3511f4cd9fce94756be0cbfd980b3e55a30678 (patch) | |
tree | 77e8065aeda6b71c9f3ff827348210272002c993 /scripts | |
parent | changed to reflect kde-apps dispersal (diff) | |
download | gentoo-2-cc3511f4cd9fce94756be0cbfd980b3e55a30678.tar.gz gentoo-2-cc3511f4cd9fce94756be0cbfd980b3e55a30678.tar.bz2 gentoo-2-cc3511f4cd9fce94756be0cbfd980b3e55a30678.zip |
*** empty log message ***
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/autobuildimg.sh | 2 | ||||
-rw-r--r-- | scripts/autosysimg.sh | 66 |
2 files changed, 47 insertions, 21 deletions
diff --git a/scripts/autobuildimg.sh b/scripts/autobuildimg.sh index fcf46836b931..5966968fe7de 100644 --- a/scripts/autobuildimg.sh +++ b/scripts/autobuildimg.sh @@ -12,6 +12,7 @@ TODAY=`date '+%Y%m%d'` [ -z "${PORTDIR}" ] && PORTDIR=/usr/portage [ -z "${BUILDTARBALL}" ] && BUILDTARBALL="build-${TODAY}.tbz2" [ -z "${BUILD_PACKAGES}" ] && BUILD_PACKAGES=`ls -1 ${PORTDIR}/files/build-*.packages | sort | tail -1` +mkdir -p ${PORTDIR}/distribution echo ">>> Cleaning up ${ROOT}..." rm -rf "${ROOT}" @@ -23,6 +24,7 @@ rm -rf "${ROOT}/tmp" mkdir -p ${ROOT}/tmp chown root.root ${ROOT}/tmp chmod 1777 ${ROOT}/tmp +mv ${ROOT}/var/db/pkg ${ROOT}/var/db/pkg.build echo ">>> Creating ${BUILDTARBALL}..." cd ${ROOT} diff --git a/scripts/autosysimg.sh b/scripts/autosysimg.sh index fcf46836b931..22cd44cba80d 100644 --- a/scripts/autosysimg.sh +++ b/scripts/autosysimg.sh @@ -1,31 +1,55 @@ #!/bin/bash -export USE=build export CFLAGS="-O2 -mcpu=i486 -march=i486 -O2 -pipe" export CXXFLAGS="${CFLAGS}" export CHOST="i486-pc-linux-gnu" -export ROOT=/tmp/autobuildimg +export SYSIMG_ROOT=/tmp/autosysimg export STEPS="clean unpack compile install qmerge clean" +[ -z "${USE}" ] || USE="slang readline gpm tcpd pam libwww ssl nls mitshm perl python oss" TODAY=`date '+%Y%m%d'` [ -z "${PORTDIR}" ] && PORTDIR=/usr/portage -[ -z "${BUILDTARBALL}" ] && BUILDTARBALL="build-${TODAY}.tbz2" -[ -z "${BUILD_PACKAGES}" ] && BUILD_PACKAGES=`ls -1 ${PORTDIR}/files/build-*.packages | sort | tail -1` - -echo ">>> Cleaning up ${ROOT}..." -rm -rf "${ROOT}" -mkdir -p "${ROOT}" - -scripts/autocompile.sh "${BUILD_PACKAGES}" - -rm -rf "${ROOT}/tmp" -mkdir -p ${ROOT}/tmp -chown root.root ${ROOT}/tmp -chmod 1777 ${ROOT}/tmp - -echo ">>> Creating ${BUILDTARBALL}..." -cd ${ROOT} -tar -cj --numeric-owner -p -f "${PORTDIR}/distribution/${BUILDTARBALL}" . - -rm -rf ${ROOT} +[ -z "${BUILD_TARBALL}" ] && BUILD_TARBALL=`ls -1 ${PORTDIR}/distribution/build-*.tbz2 2> /dev/null | sort | tail -1` +if [ -z "${BUILD_TARBALL}" ] +then + echo "You must create a build tarball before running this script." + exit 1 +fi +[ -z "${SYS_PACKAGES}" ] && SYS_PACKAGES=`ls -1 ${PORTDIR}/distribution/sys-*.tbz2 2> /dev/null | sort | tail -1` +[ -z "${BOOTSTRAP_PACKAGES}" ] && SYS_PACKAGES=`ls -1 ${PORTDIR}/files/bootstrap-*.packages 2> /dev/null | sort | tail -1` +[ -z "${SYS_TARBALL}" ] && SYS_TARBALL="sys-${TODAY}.tbz2" +mkdir -p ${PORTDIR}/distribution + +echo ">>> Cleaning up ${SYSIMG_ROOT}..." +rm -rf "${SYSIMG_ROOT}" +mkdir -p "${SYSIMG_ROOT}" + +mount --bind ${PORTDIR} ${SYSIMG_ROOT}/${PORTDIR} +chroot bash -c "cd ${PORTDIR} ; scripts/bootstrap.sh ${BOOTSTRAP_PACKAGES}" +chroot bash -c "cd ${PORTDIR} ; scripts/autocompile.sh ${SYS_PACKAGES}" + +# now unmerge the build packages +mv ${SYSIMG_ROOT}/var/db/pkg ${SYSIMG_ROOT}/var/db/pkg.new +mv ${SYSIMG_ROOT}/var/db/pkg.build ${SYSIMG_ROOT}/var/db/pkg +FIRSTDIR=`pwd` +cd ${SYSIMG_ROOT}/var/db/pkg +for ebuildfile in `find . -type f -name '*.ebuild'` +do + ROOT=${SYSIMG_ROOT} ebuild ${ebuildfile} unmerge +done +rm -rf ${SYSIMG_ROOT}/var/db/pkg +mv ${SYSIMG_ROOT}/var/db/pkg.new ${SYSIMG_ROOT}/var/db/pkg +umount ${SYSIMG_ROOT}/${PORTDIR} + +rm -rf "${SYSIMG_ROOT}/tmp" +mkdir -p ${SYSIMG_ROOT}/tmp +chown root.root ${SYSIMG_ROOT}/tmp +chmod 1777 ${SYSIM_ROOT}/tmp +mv ${SYSIMG_ROOT}/var/db/pkg ${ROOT}/var/db/pkg.build + +echo ">>> Creating ${SYS_TARBALL}..." +cd ${SYSIMG_ROOT} +tar -cj --numeric-owner -p -f "${PORTDIR}/distribution/${SYS_TARBALL}" . + +rm -rf ${SYSIMG_ROOT} |