Support kernel upgrades via according /etc/kernel-img.conf configuration
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 99-finish-grml-build
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/config/scripts/GRMLBASE/99-finish-grml-build
3 # Purpose:       finalize grml chroot build
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 # Latest change: Mon Nov 12 11:15:56 CET 2007 [mika]
8 ################################################################################
9
10 set -u
11 set -e
12
13 # Restore usual Debian behaviour which has been changed
14 # for FAI via /etc/grml/fai/config/hooks/instsoft.GRMLBASE
15 if [ -r $target/etc/apt/apt.conf ] ; then
16    sed -i "s#^Acquire::http::Pipeline-Depth.*#// &#" $target/etc/apt/apt.conf
17    sed -i "s#^APT::Install-Recommends.*#// &#"       $target/etc/apt/apt.conf
18 fi
19
20 # Restore original state from softupdate:
21 if [ -r $target/etc/policy-rc.d.conf ] ; then
22    sed -i "s/EXITSTATUS='101'/EXITSTATUS='0'/" $target/etc/policy-rc.d.conf
23 fi
24
25 # Restore usual behaviour:
26 if [ -r $target/etc/kernel-img.conf ] ; then
27    if grep -q "silent_modules = Yes" $target/etc/kernel-img.conf ; then
28       sed -i "s/silent_modules = Yes/# &/" $target/etc/kernel-img.conf
29    fi
30 fi
31
32 # remove an existing /etc/debian_chroot file:
33 if [ -r $target/etc/debian_chroot ] ; then
34    rm -f $target/etc/debian_chroot
35 fi
36
37 # /etc/grml_cd makes the live system recognizable as a live system
38 touch $target/etc/grml_cd
39
40 ## END OF FILE #################################################################
41 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3