From d6f1fbb05905909e0ed13b62c14173dcff8af9d2 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Fri, 6 Jul 2012 18:48:53 -0400 Subject: Fix some typos, add stage3 script. Adds build-id. --- stage1 | 36 +++++++++++++++++++++++----- stage3 | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 6 deletions(-) create mode 100755 stage3 diff --git a/stage1 b/stage1 index 3a8123b..84a5938 100755 --- a/stage1 +++ b/stage1 @@ -31,6 +31,7 @@ TOP=$PWD MYDIR=${0%/*} STAGE2=$MYDIR/stage2 +STAGE3=$MYDIR/stage3 SRPMDIR=$TOP/SRPMs SRPMDIR_LOCAL=$TOP/SRPMlocal @@ -51,7 +52,7 @@ NEED_UBOOT=yes # The cross-compiler target TARGET=armv7hl-redhat-linux-gnueabi # the RPMBUILD target for prepping sources -RPMTARGET=armv7l-redhat-linux-gnu +RPMTARGET=armv7hl-redhat-linux-gnu # this is where the new rootfs will be built ROOTFS=$TOP/rootfs @@ -362,6 +363,7 @@ case "$1" in go ccache go stage2 + go stage3 ;; @@ -773,10 +775,11 @@ EOF "t-gcc" ) srpm gcc mcd $BUILDDIR/t-gcc - $SRC/gcc-*/configure $TCONFIGARGS + $SRC/gcc-*/configure $TCONFIGARGS --enable-linker-build-id notparallel make $J make $J install DESTDIR=${ROOTFS} + test -e ${ROOTFS}/usr/bin/cc && rm ${ROOTFS}/usr/bin/cc ln -s gcc ${ROOTFS}/usr/bin/cc ;; @@ -905,7 +908,7 @@ EOF distcc ) srpm distcc - mcd $BUILDDIR distcc + mcd $BUILDDIR/distcc $SRC/${1}-*/configure $TCONFIGARGS --disable-Werror notparallel make $J V=1 @@ -921,7 +924,7 @@ EOF ccache ) srpm ccache - mcd $BUILDDIR ccache + mcd $BUILDDIR/ccache $SRC/${1}-*/configure $TCONFIGARGS notparallel make $J V=1 @@ -960,12 +963,14 @@ EOF cp $MYDIR/macros.bashrc $ROOTFS/stage2 cp $MYDIR/script2makefile $ROOTFS/stage2 - for PKG in $ROOTFS/stage2/recipe.d/[0-9][0-9][0-9][0-9]-* + for PKG in $ROOTFS/stage2/recipe.d/* do case "$PKG" in *~ ) ;; + *# ) ;; + */XXXX-* ) ;; *) - PKG=$(echo $PKG | sed "s/.*\\/[0-9][0-9][0-9][0-9]-//") + PKG=$(echo $PKG | sed "s/.*\\///; s/^[0-9][0-9][0-9][0-9]-//") echo "Installing SRPM for $PKG" rsrpm $PKG ;; @@ -1027,6 +1032,25 @@ EOF ;; + stage3 ) + # This assumes stage2 was run and the fies are available + + test -e $ROOTFS/stage3/local.conf && rm $ROOTFS/stage3/local.conf + ln -s ../stage2/local.conf $ROOTFS/stage3/local.conf + + mkdirp $ROOTFS/stage3/stage3.d + cp $MYDIR/stage3.d/* $ROOTFS/stage3/stage3.d + cp $MYDIR/macros.bashrc $ROOTFS/stage3 + cp $MYDIR/script2makefile $ROOTFS/stage3 + + cp $STAGE3 $ROOTFS/stage3/stage3 + + test -d $ROOTFS/stage3/done || mkdir $ROOTFS/stage3/done + + echo stage3 ready + + ;; + esac exit 0 diff --git a/stage3 b/stage3 new file mode 100755 index 0000000..ece315c --- /dev/null +++ b/stage3 @@ -0,0 +1,85 @@ +#!/bin/bash +# +# This script is the third stage in bootstrapping a Fedora build to a +# new platform or architecture. +# +# This script assumes that all the needed source RPMs are installed in +# /SRPMS unless local.conf overrides $SRPMS. It's up to you to figure +# out how to get them there. If you're building in a chroot, you'll +# also need to bind mount /proc into the chroot. +# +# You may pass a single package name on the command line to rebuild +# just that one package. +# +# The master upstream for this script is: +# git://fedorapeople.org/~djdelorie/bootstrap.git +# +# ------------------------------------------------------------ +# +# --- NOTES FOR PACKAGE PORTING --- +# +# This script is stage THREE of a bootstrap process. EVERYTHING that +# this script uses MUST be provided by the stage ONE or TWO scripts - +# filesystem, utilities, sources, etc. Please keep this in mind when +# editing this script - anything you do manually to "prepare" for your +# build, will NOT be reproducible. +# +# To "port" a package, create a shell script in stage3.d/ that calls +# one of the rpm* macros in macros.bashrc (rpmi to install, rpmb to +# build, or rpma to do it all). List dependencies with #requires +# lines which name other scripts which must be built first. +# ------------------------------------------------------------ + +TOP=/stage3 +MYDIR=${0%/*} +STAGE3=$MYDIR/stage3 + +HOME=$TOP +J=-j2 + +# The cross-compiler target +TARGET=armv7hl-redhat-linux-gnueabi + +export TARGET BUILDDIR J SRC STAGE2 MYDIR TOP + +. $MYDIR/macros.bashrc + +mkdirp $BUILDDIR + +test -d /stage2/done || mkdir /stage2/done + +scriptmake() +{ + export HOME=/stage3 + test -d $TOP/stage3.mk || mkdir -p $TOP/stage3.mk + make -f $MYDIR/script2makefile \ + SCRIPTDIR=$TOP/stage3.d \ + FRAGDIR=$TOP/stage3.mk \ + RCFILE=$TOP/macros.bashrc \ + SRC="$SRC" \ + J="$J" \ + BUILDDIR="$BUILDDIR" \ + TARGET="$TARGET" \ + $1 +} + +case "$1" in + "" ) + go clean + scriptmake + ;; + + "clean" ) + ;; + +#-------------------------------------------------- + + *~ ) ;; + + * ) + scriptmake "$@" + ;; +esac + +exit 0 + -- cgit