diff options
author | Michael Schroeder <mls@suse.de> | 2014-03-19 13:30:03 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-03-19 13:30:03 +0100 |
commit | 27a978fd3e3d2159278ecbe1a6800fe97d83c5b8 (patch) | |
tree | 572d2564ac392d904e90b6f26fb6098813177fde /build-recipe-preinstallimage | |
parent | ea1d5415c05ff1a3bf4b540b769eeb199ef81690 (diff) |
refactor recipe handling
Diffstat (limited to 'build-recipe-preinstallimage')
-rw-r--r-- | build-recipe-preinstallimage | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/build-recipe-preinstallimage b/build-recipe-preinstallimage new file mode 100644 index 0000000..c6690f3 --- /dev/null +++ b/build-recipe-preinstallimage @@ -0,0 +1,59 @@ +# +# preinstall specific functions. +# +# (C) 2014 SUSE, Inc +# + +recipe_setup_preinstallimage() { + # should never be called + cleanup_and_exit 1 +} + +recipe_prepare_preinstallimage() { + : +} + +recipe_build_preinstallimage() { + echo "creating preinstall image..." + test -d "$BUILD_ROOT/.preinstall_image" || cleanup_and_exit 1 + cd $BUILD_ROOT || cleanup_and_exit 1 + TAR="tar" + if test -x /usr/bin/bsdtar; then + TAR="/usr/bin/bsdtar --format gnutar --chroot" + fi + TOPDIRS= + for DIR in .* * ; do + case "$DIR" in + .|..) continue ;; + .build.kernel*) ;; # to be packaged + .build.initrd*) ;; # to be packaged + .build*) continue ;; + .preinstallimage*) continue ;; + .srcfiles*) continue ;; + .pkgs) continue ;; + .rpm-cache) continue ;; + installed-pkg) continue ;; + proc|sys) continue ;; + esac + TOPDIRS="$TOPDIRS $DIR" + done + if ! $TAR -czf .preinstallimage.$$.tar.gz --one-file-system $TOPDIRS ; then + cleanup_and_exit 1 + fi + echo "image created." + TOPDIR=/usr/src/packages + mkdir -p $BUILD_ROOT$TOPDIR/OTHER + rm -f $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info + for PKG in $BUILD_ROOT/.preinstall_image/* ; do + PKG=${PKG##*/} + read PKG_HDRMD5 PKGID < $BUILD_ROOT/.preinstall_image/$PKG + test -n "$PKG_HDRMD5" || cleanup_and_exit 1 + echo "$PKG_HDRMD5 $PKG" >> $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info + done + mv $BUILD_ROOT/.preinstallimage.$$.tar.gz $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.tar.gz + rm -f $BUILD_ROOT/.build.packages + ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages + test -d "$SRCDIR" && cd "$SRCDIR" +} + + |