Skip to content

Commit

Permalink
- support new kiwi bundler, handing over the bundling
Browse files Browse the repository at this point in the history
to kiwi itself
  • Loading branch information
adrianschroeter committed Jun 4, 2014
1 parent 25adffc commit 5486f57
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
19 changes: 13 additions & 6 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,15 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
cleanup_and_exit 1
fi
MYSRCDIR="$SRCDIR"
# strip prefix from autogenerated files of source services.
REMOVEMYSRCDIR=
for i in $SRCDIR/_service\:* ; do
REMOVEMYSRCDIR=1
MYSRCDIR="$SRCDIR.$$"
mkdir -p "$MYSRCDIR"
ln "$i" "${MYSRCDIR}/${i##*:}"
done
RECIPEFILE="${RECIPEFILE##*:}"

# special hack to build from a .src.rpm
test "$RECIPEFILE" != "${RECIPEFILE%.src.rpm}" && recipe_unpack_srcrpm
Expand Down Expand Up @@ -1171,13 +1180,11 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do

# fill build directories with sources. Also sets TOPDIR
recipe_setup
# cleanup temporary sourcedir
if [ -n "$REMOVEMYSRCDIR" ]; then
rm -fr "$REMOVEMYSRCDIR"
fi

# strip prefix from autogenerated files of source services.
for i in $BUILD_ROOT$TOPDIR/SOURCES/_service\:* ; do
mv "$i" "${i%/*}/${i##*:}"
done
RECIPEFILE="${RECIPEFILE##*:}"

# create .build.packages link
rm -f $BUILD_ROOT/.build.packages
ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
Expand Down
16 changes: 16 additions & 0 deletions build-recipe-kiwi
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,32 @@ build_kiwi_appliance() {
echo "starting device mapper for kiwi..."
test -x /etc/init.d/boot.device-mapper && /etc/init.d/boot.device-mapper start
fi
RUN_BUNDLE="true"
for imgtype in $imagetype ; do
echo "running kiwi --prepare for $imgtype..."
# Do not use $BUILD_USER here, since we always need root permissions
chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --prepare $TOPDIR/SOURCES --logfile terminal --root $TOPDIR/KIWIROOT-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
echo "running kiwi --create for $imgtype..."
mkdir -p $BUILD_ROOT/$TOPDIR/KIWI-$imgtype
chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --create $TOPDIR/KIWIROOT-$imgtype --logfile terminal --type $imgtype -d $TOPDIR/KIWI-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
rm -rf "/$TOPDIR/KIWI.bundle"
if chroot $BUILD_ROOT su -c "kiwi --bundle-build $TOPDIR/KIWI-$imgtype -d /$TOPDIR/KIWI.bundle/ --bundle-id Build$RELEASE" - root < /dev/null; then
mv "/$TOPDIR/KIWI.bundle/*" "/$TOPDIR/KIWI/"
rmdir "/$TOPDIR/KIWI.bundle"
unset RUN_BUNDLE
fi
done
BUILD_SUCCEEDED=true

if test -z "$RUN_BUNDLE"; then
# new kiwi has bundled our result already :)
return
fi

#
# Legacy bundling code for kiwi version below 5.06.106
#

# create tar.gz of images, in case it makes sense
buildnum=
if test -n "$RELEASE"; then
Expand Down
2 changes: 1 addition & 1 deletion build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ vm_first_stage() {
cleanup_and_exit ${BUILDSTATUS#BUILDSTATUS}
;;
*)
echo "No buildstatus set, either the base system is broken (glibc/bash/perl)"
echo "No buildstatus set, either the base system is broken (kernel/initrd/udev/glibc/bash/perl)"
echo "or the build host has a kernel or hardware problem..."
cleanup_and_exit 3
;;
Expand Down

0 comments on commit 5486f57

Please sign in to comment.