diff options
-rw-r--r-- | files/sys-20010806.packages | 2 | ||||
-rw-r--r-- | scripts/autobuildimg.sh | 2 | ||||
-rw-r--r-- | scripts/autosysimg.sh | 66 |
3 files changed, 48 insertions, 22 deletions
diff --git a/files/sys-20010806.packages b/files/sys-20010806.packages index 8f61155ca503..7f3c49133ad2 100644 --- a/files/sys-20010806.packages +++ b/files/sys-20010806.packages @@ -84,7 +84,7 @@ ./sys-libs/cracklib/cracklib-2.7-r2.ebuild ./sys-libs/db/db-3.2.3h-r4.ebuild ./sys-libs/gdbm/gdbm-1.8.0-r3.ebuild -./sys-libs/glibc/glibc- +./sys-libs/glibc/glibc-2.2.3-r4.ebuild ./sys-libs/gpm/gpm-1.19.3-r3.ebuild ./sys-libs/ncurses/ncurses-5.2-r4.ebuild ./sys-libs/nss-db/nss-db-2.2-r1.ebuild 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} |