From 878b47192bc92fcfe78f34134a8aea70afc161f5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Apr 2007 01:25:53 +0200 Subject: Add support for a blacklist boot parameter. disallows modules loading inside of the initramfs. --- debian/changelog | 5 ++++- init | 4 ++++ initramfs-tools.8 | 5 +++++ scripts/init-premount/blacklist | 25 +++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 scripts/init-premount/blacklist diff --git a/debian/changelog b/debian/changelog index f224405..d86408d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,11 +4,14 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * scripts/functions: reduce_satisfied() needs to ignore the same set as set_initlist() otherwise an script having a prereqs on a non-executable boot script may cause circular panic. (closes: 418509) + * Add blacklist boot param, disabling the load of specific modules inside + the initramfs. Still needs to be passed via tmpfs to the rootfs. [ David Härdeman ] * Add support for loading keymaps. (closes: 337663) - -- David Härdeman Thu, 12 Apr 2007 21:28:45 +0200 + + -- maximilian attems Fri, 13 Apr 2007 01:22:56 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/init b/init index 00e0dcf..b115cd1 100755 --- a/init +++ b/init @@ -50,6 +50,7 @@ export debug= export cryptopts=${CRYPTOPTS} export ROOTDELAY= export panic= +export blacklist= # Parse command line options for x in $(cat /proc/cmdline); do @@ -125,6 +126,9 @@ for x in $(cat /proc/cmdline); do break) break=premount ;; + blacklist=*) + blacklist=${x#blacklist=} + ;; esac done diff --git a/initramfs-tools.8 b/initramfs-tools.8 index c102de0..526899f 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -89,6 +89,11 @@ mounts the rootfs read-only. \fB \fI rw mounts the rootfs read-write. +.TP +\fB \fI blacklist +disables load of specific modules. +Use blacklist=module1,module2,module3 bootparameter. + .TP \fB \fI panic sets an timeout on panic. Currently only zero value supported. diff --git a/scripts/init-premount/blacklist b/scripts/init-premount/blacklist new file mode 100755 index 0000000..1dd9dbc --- /dev/null +++ b/scripts/init-premount/blacklist @@ -0,0 +1,25 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# sanity check +[ -z "${blacklist}" ] && exit 0 + +# write blacklist to modprobe.d +IFS=',' +for b in ${blacklist}; do + echo "blacklist $b" >> /etc/modprobe.d/initramfs +done -- cgit v1.2.3