X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F10-build-initramfs;h=b85fc80b80fd4b895aa49e26dd88c8c53bed5c39;hb=f3b335ea;hp=9777a52a2ef0fad8791fe3808d9ea236d2641313;hpb=4d3cdad3f1578e31f57c6d5b62b1fe4af4267657;p=grml-live.git diff --git a/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs b/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs index 9777a52..b85fc80 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs +++ b/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs @@ -1,45 +1,24 @@ -#!/bin/sh -# Filename: /etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs +#!/bin/bash +# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/10-build-initramfs # Purpose: configure live-initramfs and build initramfs for booting # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. ################################################################################ +set -u set -e -if ! [ -f "$target/etc/live.conf" ] ; then - echo "Warning: $target/etc/live.conf does not exist yet," - echo " ... installing /etc/grml/fai/live-initramfs/live.conf" - cp /etc/grml/fai/live-initramfs/live.conf "$target/etc/live.conf" -fi - -if [ -f /etc/grml/fai/live-initramfs/grml-script.init-top ] ; then - cp /etc/grml/fai/live-initramfs/grml-script.init-top "$target/usr/share/initramfs-tools/scripts/init-top/grml" -else - echo "Warning: /etc/grml/fai/live-initramfs/grml-script.init-top could not be read" -fi +fcopy /usr/share/initramfs-tools/scripts/init-top/grml +fcopy /etc/initramfs-tools/hooks/000-udev-shutup +fcopy /etc/initramfs-tools/conf.d/xz-compress -FILE=$(ls -1 $target/boot/vmlinuz-* 2>/dev/null| sort -r | head -1) -KERNELVERSION=$(echo "${FILE##$target/boot/vmlinuz-}") - -# make sure mdadm isn't executed in initrd: -#if [ -f "$target"/etc/default/mdadm ] ; then -# sed -i "s/START_DAEMON=.*/START_DAEMON=false/" "$target"/etc/default/mdadm -# sed -i "s/INITRDSTART=.*/INITRDSTART=none/" "$target"/etc/default/mdadm -#fi - -if [ -z "$KERNELVERSION" ] ; then - echo "Error: No kernel found, can not create initramfs. Exiting.">&2 - exit 1 +if ! [ -f $target/usr/share/initramfs-tools/scripts/live ] ; then + echo "Error: live-boot/-initramfs does not seem to be present, can not create initramfs. Exiting.">&2 + exit 1 fi -if [ -f $target/usr/share/initramfs-tools/scripts/live ] ; then - $ROOTCMD update-initramfs -c -t -k $KERNELVERSION -else - echo "Error: live-initramfs does not seem to be present, can not create initramfs. Exiting.">&2 - exit 1 -fi +# The initramfs itself will be created through grml-live script itself. ## END OF FILE ################################################################# -# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3 +# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2