Rework apt.conf handling in instsoft/updatebase (provide /etc/apt/apt.conf.d/15grml...
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 10-build-initramfs
1 #!/bin/bash
2 # Filename:      /etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs
3 # Purpose:       configure live-initramfs and build initramfs for booting
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 ################################################################################
8
9 set -e
10
11 fcopy /usr/share/initramfs-tools/scripts/init-top/grml
12
13 FILE=$(ls -1 $target/boot/vmlinuz-* 2>/dev/null| sort -r | head -1)
14 KERNELVERSION=$(echo "${FILE##$target/boot/vmlinuz-}")
15
16 if [ -z "$KERNELVERSION" ] ; then
17    echo "Error: No kernel found, can not create initramfs. Exiting.">&2
18    exit 1
19 fi
20
21 if [ -f $target/usr/share/initramfs-tools/scripts/live ] ; then
22    $ROOTCMD update-initramfs -c -t -k $KERNELVERSION
23 else
24    echo "Error: live-initramfs does not seem to be present, can not create initramfs. Exiting.">&2
25    exit 1
26 fi
27
28 ## END OF FILE #################################################################
29 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3