1 recipe_setup_simpleimage() {
2 TOPDIR=/usr/src/packages
3 rm -rf "$BUILD_ROOT$TOPDIR"
4 for i in OTHER SOURCES LIVEBUILD_ROOT ; do
5 mkdir -p "$BUILD_ROOT$TOPDIR/$i"
7 chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
8 if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
9 mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
11 cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
15 recipe_prepare_simpleimage() {
19 recipe_build_simpleimage() {
20 TOPDIR=/usr/src/packages
22 echo "creating simple image..."
23 cd $BUILD_ROOT || cleanup_and_exit 1
24 export SRCDIR="$TOPDIR/SOURCES"
26 NAME="`sed -n 's|Name:[[:blank:]]*||p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`"
27 [ -n "$NAME" ] || NAME="simpleimage"
28 VERSION="`sed -n 's|Version:[[:blank:]]*||p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`"
29 [ -n "$VERSION" ] || VERSION="`date -u +%y.%m.%d-%H.%M.%S`"
32 [ -x $BUILD_ROOT/bin/bash ] && SHELL="/bin/bash"
33 if [ "`grep '^%build$' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`" ]; then
34 echo "Running integration script..."
35 sed -n '/%build/,$ p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage | tail -n +2 | chroot $BUILD_ROOT $SHELL -x || cleanup_and_exit 1
36 echo "Integration script finished."
39 echo "Compresing the final image, this can take a while..."
42 if test -x /usr/bin/bsdtar; then
43 TAR="/usr/bin/bsdtar --format gnutar --chroot"
50 .simpleimage*) continue ;;
51 .srcfiles*) continue ;;
53 .rpm-cache) continue ;;
55 installed-pkg) continue ;;
58 TOPDIRS="$TOPDIRS $DIR"
60 rm -rf "$BUILD_ROOT$TOPDIR"
61 mkdir -p .tmp/{proc,sys}
62 if ! $TAR -cvzf .simpleimage.tar.gz --one-file-system $TOPDIRS -C .tmp proc sys; then
65 if [ -x "`which mksquashfs 2> /dev/null`" ]; then
67 echo "Tarball done, creating squashfs image as well"
69 mksquashfs $TOPDIRS .tmp/proc .tmp/sys .simpleimage.squashfs -info -keep-as-directory -no-progress || cleanup_and_exit 1
71 echo "simple image created."
73 DEST="$BUILD_ROOT$TOPDIR/OTHER"
75 mv $BUILD_ROOT/.simpleimage.tar.gz $DEST/$NAME-${VERSION}_${BUILD_ARCH%%:*}.tar.gz
76 if [ -r .simpleimage.squashfs ]; then
77 mv $BUILD_ROOT/.simpleimage.squashfs $DEST/$NAME-${VERSION}_${BUILD_ARCH%%:*}.squashfs
79 rm -f $BUILD_ROOT/.build.packages
80 ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
81 test -d "$SRCDIR" && cd "$SRCDIR"
85 recipe_resultdirs_simpleimage() {