3 # This is a template for a livebuild_pre_run script. These scripts are
4 # executed by build_livebuild.sh in the chroot environment.
7 ################################################################
9 # Copyright (c) 1995-2014 SUSE Linux Products GmbH
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License version 2 or 3 as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program (see the file COPYING); if not, write to the
22 # Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 ################################################################
29 # debootstrap in Debian 7.0 does not like dash
31 if [ -x /usr/sbin/debootstrap ] ; then
32 sed -i 's|^#!/bin/sh|#!/bin/bash|' /usr/sbin/debootstrap
36 fix_lb_bootstrap_archive-keys()
38 if [ -e /usr/lib/live/build/bootstrap_archive-keys ] ; then
39 sed -i '/apt-get update/{ s/^/#/ }' \
40 /usr/lib/live/build/bootstrap_archive-keys
48 : ${TOPDIR:=/usr/src/packages}
50 # Distribution and live-build specific hooks
52 fix_lb_bootstrap_archive-keys
54 # Expand configuration based on defaults
55 cd $TOPDIR/LIVEBUILD_ROOT && lb config || exit 1
57 # Replace all occurances of LB_MIRROR with local repository
58 sed -i "s|^\(LB_MIRROR_[^=]\+=\).*|\1\"file:$TOPDIR/SOURCES/repos/\"|" \
59 $TOPDIR/LIVEBUILD_ROOT/config/bootstrap
60 sed -i "s|^\(LB_PARENT_MIRROR_[^=]\+=\).*|\1\"file:$TOPDIR/SOURCES/repos/\"|" \
61 $TOPDIR/LIVEBUILD_ROOT/config/bootstrap
63 # Prevent debootstrap from cleaning our cache
64 sed -i 's|^\(LB_CACHE_PACKAGES=\).*|\1"false"|' \
65 $TOPDIR/LIVEBUILD_ROOT/config/common
67 # Disable GPG checking
68 sed -i 's|^\(LB_APT_SECURE=\).*|\1"false"|' \
69 $TOPDIR/LIVEBUILD_ROOT/config/common