summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/buildinstall26
-rwxr-xr-xscripts/mk-images21
2 files changed, 29 insertions, 18 deletions
diff --git a/scripts/buildinstall b/scripts/buildinstall
index e323597cb..7205c616c 100755
--- a/scripts/buildinstall
+++ b/scripts/buildinstall
@@ -55,9 +55,10 @@ if [ -z "$RELEASESTR" ]; then
usage
fi
-p=`cd $DIR; /bin/pwd | sed 's,/md1/,/,g'`
+p=`cd $DIR; /bin/pwd`
BUILDINSTDIR=$p/buildinstall.tree.$$
+TREEDIR=/tmp/treedir.$$
rm -rf $BUILDINSTDIR
mkdir -p $BUILDINSTDIR
@@ -88,27 +89,32 @@ fi
MK_IMAGES=$BUILDINSTDIR/mk-images
echo "Building images..."
-$UPD_INSTROOT --comp $COMPNAME $p/RedHat/RPMS $p/image-template $p/RedHat/instimage
+if [ -x /usr/bin/runroot ]; then
+ runroot $COMPNAME --onlyone --arch $BUILDARCH "$UPD_INSTROOT --comp $COMPNAME $p/RedHat/RPMS $TREEDIR/image-template $TREEDIR/instimage"
+else
+ $UPD_INSTROOT --comp $COMPNAME $p/RedHat/RPMS $TREEDIR/image-template $TREEDIR/instimage
+fi
# XXX hack - msw
if [ $BUILDARCH = "sparc" ]; then
BUILDARCH=sparc64
fi
-if [ -n "$PKGORDER" -a -x $p/RedHat/instimage/usr/lib/anaconda-runtime/pkgorder ]; then
+if [ -n "$PKGORDER" -a -x $TREEDIR/instimage/usr/lib/anaconda-runtime/pkgorder ]; then
echo "Getting package order..."
if [ -x /usr/bin/runroot ]; then
- runroot --quiet $COMPNAME --onlyone --arch $BUILDARCH \
+ runroot $COMPNAME --onlyone --arch $BUILDARCH \
"PYTHONPATH=$p/RedHat/instimage/usr/lib/anaconda $p/RedHat/instimage/usr/lib/anaconda-runtime/pkgorder $p $BUILDARCH" > $PKGORDER
else
- PYTHONPATH=$p/RedHat/instimage/usr/lib/anaconda $p/RedHat/instimage/usr/lib/anaconda-runtime/pkgorder $p $BUILDARCH > $PKGORDER
+ PYTHONPATH=$TREEDIR/instimage/usr/lib/anaconda $TREEDIR/instimage/usr/lib/anaconda-runtime/pkgorder $p $BUILDARCH > $PKGORDER
fi
fi
+echo "Making images..."
if [ -x /usr/bin/runroot ]; then
- runroot $COMPNAME --onlyone --arch $BUILDARCH "cd $BUILDINSTDIR\; ./mk-images $p/RedHat/RPMS $p $p/image-template $BUILDARCH '\"$PRODUCTSTR\"' $VERSION"
+ runroot $COMPNAME --onlyone --arch $BUILDARCH "cd $BUILDINSTDIR\; ./mk-images $p/RedHat/RPMS $p $TREEDIR/image-template $TREEDIR/instimage $BUILDARCH '\"$PRODUCTSTR\"' $VERSION"
else
- $MK_IMAGES $p/RedHat/RPMS $p $p/image-template $BUILDARCH "$PRODUCTSTR" $VERSION
+ $MK_IMAGES $p/RedHat/RPMS $p $TREEDIR/image-template $TREEDIR/instimage $BUILDARCH "$PRODUCTSTR" $VERSION
fi
MK_STAMP=./makestamp.py
@@ -126,4 +132,8 @@ MK_STAMP=$BUILDINSTDIR/makestamp.py
$MK_STAMP --releasestr="$RELEASESTR" --arch=$BUILDARCH --discNum="1,2,3" --baseDir=RedHat/base --packagesDir=RedHat/RPMS --pixmapsDir=RedHat/pixmaps --outfile=$p/.discinfo
rm -rf $BUILDINSTDIR
-rm -rf $p/image-template $p/RedHat/instimage
+if [ -x /usr/bin/runroot ]; then
+ runroot $COMPNAME --onlyone --arch $BUILDARCH "rm -rf $TREEDIR/image-template $TREEDIR/instimage"
+else
+ rm -rf $TREEDIR/image-template $TREEDIR/instimage
+fi
diff --git a/scripts/mk-images b/scripts/mk-images
index 4981dc1c3..a1a250a69 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -4,14 +4,14 @@ PATH=$PATH:/sbin:/usr/sbin
IMAGEUUID=$(date +%Y%m%d%H%M)
usage () {
- echo "usage: mk-images <pkgsrc> <toplevel> <template> <buildarch> <productname> <version>"
+ echo "usage: mk-images <pkgsrc> <toplevel> <template> <imgdir> <buildarch> <productname> <version>"
exit 0
}
-if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$5" -o -z "$6" ]; then usage; fi
+if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$5" -o -z "$6" -o -z "$7" ]; then usage; fi
-PRODUCT=$5
-VERSION=$6
+PRODUCT=$6
+VERSION=$7
TOPDIR=$(echo $0 | sed "s,/[^/]*$,,")
if [ $TOPDIR = $0 ]; then
@@ -23,15 +23,15 @@ TOPDIR=$(cd $TOPDIR; pwd)
# Set, verify, and create paths
KERNELPATH=$1
TOPDESTPATH=$2
- IMAGEPATH=$2/images
+ IMAGEPATH=$TOPDESTPATH/images
FULLMODPATH=/tmp/instimagemods.$$
- FINALFULLMODPATH=$2/RedHat/instimage/modules
- INSTIMGPATH=$2/RedHat/base
+ FINALFULLMODPATH=$4/modules
+ INSTIMGPATH=$TOPDESTPATH/RedHat/base
INSTIMGTEMPLATE=$3
- IMGPATH=$2/RedHat/instimage
+ IMGPATH=$4
KERNELROOT=/tmp/updboot.kernel.$$
MODDEPS=$KERNELROOT/moddeps
- BUILDARCH=$4
+ BUILDARCH=$5
if [ "$BUILDARCH" = "ppc" -o "$BUILDARCH" = "ppc64" ]; then
KERNELNAME=vmlinux
@@ -709,7 +709,8 @@ makeinstimage () {
makeproductfile $tmpdir
echo "Running mkcramfs $CRAMBS $tmpdir $INSTIMGPATH/${imagename}2.img"
- mkcramfs $CRAMBS $tmpdir $INSTIMGPATH/${imagename}2.img
+ mkcramfs $CRAMBS $tmpdir /tmp/${imagename}2.img.$$
+ cp /tmp/${imagename}2.img.$$ $INSTIMGPATH/${imagename}2.img
size=$(ls -l $INSTIMGPATH/${imagename}2.img | awk '{print $5}')
size=$(expr $size / 1024)
echo "Wrote $INSTIMGPATH/${imagename}2.img (${size}k)..."