| 1 |
# |
| 2 |
# preinstall specific functions. |
| 3 |
# |
| 4 |
################################################################ |
| 5 |
# |
| 6 |
# Copyright (c) 1995-2014 SUSE Linux Products GmbH |
| 7 |
# |
| 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. |
| 11 |
# |
| 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. |
| 16 |
# |
| 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 |
| 21 |
# |
| 22 |
################################################################ |
| 23 |
|
| 24 |
recipe_setup_preinstallimage() { |
| 25 |
# should never be called |
| 26 |
cleanup_and_exit 1 |
| 27 |
} |
| 28 |
|
| 29 |
recipe_prepare_preinstallimage() { |
| 30 |
: |
| 31 |
} |
| 32 |
|
| 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 |
| 37 |
TAR="tar" |
| 38 |
if test -x /usr/bin/bsdtar; then |
| 39 |
TAR="/usr/bin/bsdtar --format gnutar --chroot" |
| 40 |
fi |
| 41 |
TOPDIRS= |
| 42 |
for DIR in .* * ; do |
| 43 |
case "$DIR" in |
| 44 |
.|..) continue ;; |
| 45 |
.build.kernel.*) ;; # to be packaged |
| 46 |
.build.hostarch.*) ;; # to be packaged |
| 47 |
.build.initrd.*) ;; # to be packaged |
| 48 |
.build.console.*) ;; # to be packaged |
| 49 |
.build*) continue ;; |
| 50 |
.init_b_cache) continue ;; |
| 51 |
.preinstallimage*) continue ;; |
| 52 |
.srcfiles*) continue ;; |
| 53 |
.pkgs) continue ;; |
| 54 |
.rpm-cache) continue ;; |
| 55 |
installed-pkg) continue ;; |
| 56 |
proc|sys) continue ;; |
| 57 |
esac |
| 58 |
TOPDIRS="$TOPDIRS $DIR" |
| 59 |
done |
| 60 |
if ! $TAR -czf .preinstallimage.$$.tar.gz --one-file-system $TOPDIRS ; then |
| 61 |
cleanup_and_exit 1 |
| 62 |
fi |
| 63 |
echo "image created." |
| 64 |
TOPDIR=/usr/src/packages |
| 65 |
mkdir -p $BUILD_ROOT$TOPDIR/OTHER |
| 66 |
rm -f $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info |
| 67 |
for PKG in $BUILD_ROOT/.preinstall_image/* ; do |
| 68 |
PKG=${PKG##*/} |
| 69 |
read PKG_HDRMD5 PKGID < $BUILD_ROOT/.preinstall_image/$PKG |
| 70 |
test -n "$PKG_HDRMD5" || cleanup_and_exit 1 |
| 71 |
echo "$PKG_HDRMD5 $PKG" >> $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info |
| 72 |
done |
| 73 |
mv $BUILD_ROOT/.preinstallimage.$$.tar.gz $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.tar.gz |
| 74 |
rm -f $BUILD_ROOT/.build.packages |
| 75 |
ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages |
| 76 |
test -d "$SRCDIR" && cd "$SRCDIR" |
| 77 |
} |
| 78 |
|
| 79 |
recipe_resultdirs_preinstallimage() { |
| 80 |
: |
| 81 |
} |
| 82 |
|
| 83 |
recipe_cleanup_preinstallimage() { |
| 84 |
: |
| 85 |
} |
| 86 |
|