From f9f53f7e6c2525341cb4aebe8cde87884dd34962 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 28 Dec 2010 22:09:56 +0000 Subject: [PATCH] Weitergekommen git-svn-id: http://svn.brehm-online.com/svn/my-stuff/initramfs/trunk@164 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa --- create_initramfs.sh | 28 ++++++++++++++++++++++++++-- makefile.tmpl => makefile-core.tmpl | 0 2 files changed, 26 insertions(+), 2 deletions(-) rename makefile.tmpl => makefile-core.tmpl (100%) diff --git a/create_initramfs.sh b/create_initramfs.sh index 78747ec..e9f4397 100755 --- a/create_initramfs.sh +++ b/create_initramfs.sh @@ -1,9 +1,9 @@ #!/bin/bash set -e -set -x USER=frank +MODULES_DIR="/lib/modules" echo_action() { action="$1" @@ -30,9 +30,33 @@ esac TARG_LAST=${TARG}-last -echo "Creating initramfs ..." cd $( dirname $0 ) || exit 1 +echo "Creating makefile.tmpl ..." +cp makefile-core.tmpl makefile.tmpl + +COUNTER=0 + +mdir="${MODULES_DIR}"/"${KERNEL_VERSION}" + +# Clean file and write header +for n in $( find "${mdir}" ) ; do + [ -d $n ] && echo "dir $n 700 0 0" + [ -f $n ] && { + echo "file $n $n 600 0 0" + # Test extension to count modules + [ "${n##*.}" = "ko" ] && : $((COUNTER++)) + } +done >> makefile.tmpl + +cat << EOF + +$COUNTER modules found for $KERNEL_VERSION + +EOF + +echo "Creating initramfs ..." + uid=$( id -u ) username=$( id -un ) gid=$( id -g ) diff --git a/makefile.tmpl b/makefile-core.tmpl similarity index 100% rename from makefile.tmpl rename to makefile-core.tmpl -- 2.39.5