2 # Filename: ${GRML_FAI_CONFIG}/hooks/updatebase.GRMLBASE
3 # Purpose: Updates the base packages of the system, prepare chroot for instsoft
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
13 # visualize chroot inside zsh:
14 echo grml_chroot > $target/etc/debian_chroot
16 echo "$HOSTNAME" > $target/etc/hostname
18 if [ -n "${APT_PROXY:-}" ] ; then
19 cat > $target/etc/apt/apt.conf.d/90grml-apt-proxy.conf <<EOF
20 Acquire::http { Proxy "$APT_PROXY"; };
24 if [ "$FAI_ACTION" = "softupdate" ] ; then
25 echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
27 # otherwise we're running 'aptitude update' even on with -b option
30 ## based on FAI's lib/updatebase:
31 # some packages must access /proc even in chroot environment
32 if ! [ -d $FAI_ROOT/proc/1 ] ; then
33 mount -t proc proc $FAI_ROOT/proc || true
35 # some packages must access /sys even in chroot environment
36 if ! [ -d $FAI_ROOT/sys/kernel ] ; then
37 mount -t sysfs sysfs $FAI_ROOT/sys
39 # if we are using udev, also mount it into $FAI_ROOT
40 if [ -f /etc/init.d/udev ] ; then
41 mount --bind /dev $FAI_ROOT/dev || true
44 if [ -d $FAI_ROOT/run ] ; then
45 mount -t tmpfs tmpfs $FAI_ROOT/run
46 mkdir $FAI_ROOT/run/lock
49 mount -t devpts devpts $FAI_ROOT/dev/pts || true
51 # skip the task if we want to build a new ISO only,
52 # this means we do NOT update any packages
53 if [ -n "$BUILD_ONLY" ] ; then
54 skiptask instsoft || true
58 if [ -n "$BOOTSTRAP_ONLY" ] ; then
59 echo "Skipping task configure in hooks/updatebase.GRMLBASE as BOOTSTRAP_ONLY environment is set."
63 # work around #632624: udev fails to install on systems with old kernel versions
64 if ! [ -e ${target}/etc/udev/kernel-upgrade ] ; then
65 echo "Working around udev package bug, creating /etc/udev/kernel-upgrade"
66 echo "# installed via updatebase.GRMLBASE" > ${target}/etc/udev/kernel-upgrade
69 # install all apt related files
70 fcopy -B -v -r /etc/apt
72 # install Grml gpg key:
73 $ROOTCMD apt-key add /etc/apt/grml.key
75 ## END OF FILE #################################################################
76 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2