]> Frank Brehm's Git Trees - my-stuff/initramfs.git/commitdiff
Weitergekommen
authorFrank Brehm <frank@brehm-online.com>
Tue, 28 Dec 2010 22:09:56 +0000 (22:09 +0000)
committerFrank Brehm <frank@brehm-online.com>
Tue, 28 Dec 2010 22:09:56 +0000 (22:09 +0000)
git-svn-id: http://svn.brehm-online.com/svn/my-stuff/initramfs/trunk@164 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa

create_initramfs.sh
makefile-core.tmpl [new file with mode: 0644]
makefile.tmpl [deleted file]

index 78747ecdbfed84f4a5faa44a2d0d13838cd19838..e9f439717cec99753bf1af231ae816d204ce3ea4 100755 (executable)
@@ -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-core.tmpl b/makefile-core.tmpl
new file mode 100644 (file)
index 0000000..a0e63ad
--- /dev/null
@@ -0,0 +1,72 @@
+# -*- mode: conf -*-
+# init script (damn important!!!)
+file /init ${package}/init.sh 755 0 0
+
+# directory structure
+dir /proc 755 0 0
+dir /sys 755 0 0
+dir /dev 755 0 0
+dir /lib 755 0 0
+dir /bin 755 0 0
+dir /sbin 755 0 0
+dir /mnt 755 0 0
+dir /etc 755 0 0
+dir /usr 755 0 0
+dir /usr/share 755 0 0
+
+# basic tools
+file /bin/busybox /bin/busybox 755 0 0
+slink /sbin/mdev /bin/busybox 755 0 0
+
+# lvm support
+dir /dev/mapper 755 0 0
+file /sbin/lvm /sbin/lvm.static 755 0 0
+dir /etc/lvm 755 0 0
+file /etc/lvm/lvm.conf /etc/lvm/lvm.conf 644 0 0
+
+# framebuffer support
+#file /sbin/v86d /sbin/v86d 755 0 0
+
+# cryptsetup support
+#file /sbin/cryptsetup /sbin/cryptsetup 755 0 0
+
+# console font
+dir /usr/share/consolefonts 755 0 0
+file /usr/share/consolefonts/ter-v16n.psf.gz /usr/share/consolefonts/ter-v16n.psf.gz 644 0 0
+
+# keymap
+file /etc/keymap ${package}/keymap 644 0 0
+
+# uswsusp support
+#file /sbin/resume /usr/lib/suspend/resume 755 0 0
+#file /etc/suspend.conf /etc/suspend.conf 644 0 0
+
+# splash support
+#dir /lib/splash 644 0 0
+#dir /lib/splash/sys 644 0 0
+#dir /lib/splash/proc 644 0 0
+#file /sbin/fbcondecor_helper /sbin/fbcondecor_helper 755 0 0
+#slink /sbin/splash_helper /sbin/fbcondecor_helper 755 0 0
+#file /etc/initrd.splash /usr/share/splashutils/initrd.splash 644 0 0
+
+# splash theme
+#dir /etc/splash 755 0 0
+#dir /etc/splash/natural_gentoo 755 0 0
+#file /etc/splash/natural_gentoo/1280x800.cfg /etc/splash/natural_gentoo/1280x800.cfg 644 0 0
+#dir /etc/splash/natural_gentoo/images 755 0 0
+#file /etc/splash/natural_gentoo/images/silent-1280x800.jpg /etc/splash/natural_gentoo/images/silent-1280x800.jpg 644 0 0
+#file /etc/splash/natural_gentoo/images/verbose-1280x800.jpg /etc/splash/natural_gentoo/images/verbose-1280x800.jpg 644 0 0
+
+# important device files
+nod /dev/mem 600 0 0 c 1 1
+nod /dev/null 666 0 0 c 1 3
+nod /dev/zero 600 0 0 c 1 5
+nod /dev/console 600 0 0 c 5 1
+nod /dev/tty0 620 0 0 c 4 0
+nod /dev/tty1 600 0 0 c 4 1
+
+# device directories
+dir /dev/fb 755 0 0
+dir /dev/misc 755 0 0
+dir /dev/vc 755 0 0
+
diff --git a/makefile.tmpl b/makefile.tmpl
deleted file mode 100644 (file)
index a0e63ad..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- mode: conf -*-
-# init script (damn important!!!)
-file /init ${package}/init.sh 755 0 0
-
-# directory structure
-dir /proc 755 0 0
-dir /sys 755 0 0
-dir /dev 755 0 0
-dir /lib 755 0 0
-dir /bin 755 0 0
-dir /sbin 755 0 0
-dir /mnt 755 0 0
-dir /etc 755 0 0
-dir /usr 755 0 0
-dir /usr/share 755 0 0
-
-# basic tools
-file /bin/busybox /bin/busybox 755 0 0
-slink /sbin/mdev /bin/busybox 755 0 0
-
-# lvm support
-dir /dev/mapper 755 0 0
-file /sbin/lvm /sbin/lvm.static 755 0 0
-dir /etc/lvm 755 0 0
-file /etc/lvm/lvm.conf /etc/lvm/lvm.conf 644 0 0
-
-# framebuffer support
-#file /sbin/v86d /sbin/v86d 755 0 0
-
-# cryptsetup support
-#file /sbin/cryptsetup /sbin/cryptsetup 755 0 0
-
-# console font
-dir /usr/share/consolefonts 755 0 0
-file /usr/share/consolefonts/ter-v16n.psf.gz /usr/share/consolefonts/ter-v16n.psf.gz 644 0 0
-
-# keymap
-file /etc/keymap ${package}/keymap 644 0 0
-
-# uswsusp support
-#file /sbin/resume /usr/lib/suspend/resume 755 0 0
-#file /etc/suspend.conf /etc/suspend.conf 644 0 0
-
-# splash support
-#dir /lib/splash 644 0 0
-#dir /lib/splash/sys 644 0 0
-#dir /lib/splash/proc 644 0 0
-#file /sbin/fbcondecor_helper /sbin/fbcondecor_helper 755 0 0
-#slink /sbin/splash_helper /sbin/fbcondecor_helper 755 0 0
-#file /etc/initrd.splash /usr/share/splashutils/initrd.splash 644 0 0
-
-# splash theme
-#dir /etc/splash 755 0 0
-#dir /etc/splash/natural_gentoo 755 0 0
-#file /etc/splash/natural_gentoo/1280x800.cfg /etc/splash/natural_gentoo/1280x800.cfg 644 0 0
-#dir /etc/splash/natural_gentoo/images 755 0 0
-#file /etc/splash/natural_gentoo/images/silent-1280x800.jpg /etc/splash/natural_gentoo/images/silent-1280x800.jpg 644 0 0
-#file /etc/splash/natural_gentoo/images/verbose-1280x800.jpg /etc/splash/natural_gentoo/images/verbose-1280x800.jpg 644 0 0
-
-# important device files
-nod /dev/mem 600 0 0 c 1 1
-nod /dev/null 666 0 0 c 1 3
-nod /dev/zero 600 0 0 c 1 5
-nod /dev/console 600 0 0 c 5 1
-nod /dev/tty0 620 0 0 c 4 0
-nod /dev/tty1 600 0 0 c 4 1
-
-# device directories
-dir /dev/fb 755 0 0
-dir /dev/misc 755 0 0
-dir /dev/vc 755 0 0
-