/[gentoo-x86]/scripts/autosysimg.sh
Gentoo

Contents of /scripts/autosysimg.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download) (as text)
Mon Sep 27 20:07:36 2004 UTC (15 years ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +0 -0 lines
File MIME type: text/x-sh
FILE REMOVED
old stuff; use catalyst

1 #!/bin/bash
2
3 export CFLAGS="-O2 -mcpu=i486 -march=i486 -O2 -pipe"
4 export CXXFLAGS="${CFLAGS}"
5 export CHOST="i486-pc-linux-gnu"
6 export SYSIMG_ROOT=/tmp/autosysimg
7 export STEPS="clean unpack compile install qmerge clean"
8 [ -z "${USE}" ] || USE="slang readline gpm tcpd pam libwww ssl nls perl python oss"
9
10 TODAY=`date '+%Y%m%d'`
11
12 [ -z "${PORTDIR}" ] && PORTDIR=/usr/portage
13 [ -z "${BUILD_TARBALL}" ] && BUILD_TARBALL=`ls -1 ${PORTDIR}/distribution/build-*.tbz2 2> /dev/null | sort | tail -1`
14 if [ -z "${BUILD_TARBALL}" ]
15 then
16 echo "You must create a build tarball before running this script."
17 exit 1
18 fi
19 [ -z "${SYS_PACKAGES}" ] && SYS_PACKAGES=`ls -1 ${PORTDIR}/distribution/sys-*.tbz2 2> /dev/null | sort | tail -1`
20 [ -z "${BOOTSTRAP_PACKAGES}" ] && SYS_PACKAGES=`ls -1 ${PORTDIR}/files/bootstrap-*.packages 2> /dev/null | sort | tail -1`
21 [ -z "${SYS_TARBALL}" ] && SYS_TARBALL="sys-${TODAY}.tbz2"
22 mkdir -p ${PORTDIR}/distribution
23
24 echo ">>> Cleaning up ${SYSIMG_ROOT}..."
25 rm -rf "${SYSIMG_ROOT}"
26 mkdir -p "${SYSIMG_ROOT}"
27
28 mount --bind ${PORTDIR} ${SYSIMG_ROOT}/${PORTDIR}
29 mkdir ${SYSIMG_ROOT}/scripts
30 chroot bash -c "cd ${PORTDIR} ; ROOT=/sysimg scripts/bootstrap.sh ${BOOTSTRAP_PACKAGES}"
31 chroot bash -c "cd ${PORTDIR} ; scripts/autocompile.sh ${SYS_PACKAGES}"
32
33 # now unmerge the build packages
34 mv ${SYSIMG_ROOT}/var/db/pkg ${SYSIMG_ROOT}/var/db/pkg.new
35 mv ${SYSIMG_ROOT}/var/db/pkg.build ${SYSIMG_ROOT}/var/db/pkg
36 FIRSTDIR=`pwd`
37 cd ${SYSIMG_ROOT}/var/db/pkg
38 for ebuildfile in `find . -type f -name '*.ebuild'`
39 do
40 ROOT=${SYSIMG_ROOT} ebuild ${ebuildfile} unmerge
41 done
42 rm -rf ${SYSIMG_ROOT}/var/db/pkg
43 mv ${SYSIMG_ROOT}/var/db/pkg.new ${SYSIMG_ROOT}/var/db/pkg
44 umount ${SYSIMG_ROOT}/${PORTDIR}
45
46 rm -rf "${SYSIMG_ROOT}/tmp"
47 mkdir -p ${SYSIMG_ROOT}/tmp
48 chown root.root ${SYSIMG_ROOT}/tmp
49 chmod 1777 ${SYSIMG_ROOT}/tmp
50 mv ${SYSIMG_ROOT}/var/db/pkg ${ROOT}/var/db/pkg.build
51
52 echo ">>> Creating ${SYS_TARBALL}..."
53 cd ${SYSIMG_ROOT}
54 tar -cj --numeric-owner -p -f "${PORTDIR}/distribution/${SYS_TARBALL}" .
55
56 rm -rf ${SYSIMG_ROOT}

  ViewVC Help
Powered by ViewVC 1.1.20