2 # preinstall specific functions.
4 ################################################################
6 # Copyright (c) 1995-2014 SUSE Linux Products GmbH
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2 or 3 as
10 # published by the Free Software Foundation.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program (see the file COPYING); if not, write to the
19 # Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 ################################################################
24 recipe_setup_preinstallimage() {
25 # should never be called
29 recipe_prepare_preinstallimage() {
33 recipe_build_preinstallimage() {
34 echo "creating preinstall image..."
35 test -d "$BUILD_ROOT/.preinstall_image" || cleanup_and_exit 1
36 cd $BUILD_ROOT || cleanup_and_exit 1
38 if test -x /usr/bin/bsdtar; then
39 TAR="/usr/bin/bsdtar --format gnutar --chroot"
45 .build.kernel*) ;; # to be packaged
46 .build.initrd*) ;; # to be packaged
48 .preinstallimage*) continue ;;
49 .srcfiles*) continue ;;
51 .rpm-cache) continue ;;
52 installed-pkg) continue ;;
55 TOPDIRS="$TOPDIRS $DIR"
57 if ! $TAR -czf .preinstallimage.$$.tar.gz --one-file-system $TOPDIRS ; then
61 TOPDIR=/usr/src/packages
62 mkdir -p $BUILD_ROOT$TOPDIR/OTHER
63 rm -f $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info
64 for PKG in $BUILD_ROOT/.preinstall_image/* ; do
66 read PKG_HDRMD5 PKGID < $BUILD_ROOT/.preinstall_image/$PKG
67 test -n "$PKG_HDRMD5" || cleanup_and_exit 1
68 echo "$PKG_HDRMD5 $PKG" >> $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info
70 mv $BUILD_ROOT/.preinstallimage.$$.tar.gz $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.tar.gz
71 rm -f $BUILD_ROOT/.build.packages
72 ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
73 test -d "$SRCDIR" && cd "$SRCDIR"
76 recipe_resultdirs_preinstallimage() {