From 99af88246c2de71aa799de2b63f9d9ccac41634f Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Sun, 27 Sep 2009 13:58:22 -0700 Subject: [PATCH] Add scripts/update-initramfs and use it Some distributions may ship b44 and ssb on the initramfs for netboot. To help with this we need to update the initrafms for those distributions. Signed-off-by: Luis R. Rodriguez --- Makefile | 1 + scripts/update-initramfs | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 scripts/update-initramfs diff --git a/Makefile b/Makefile index ab97de0591a2..c7333a293bda 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,7 @@ install: uninstall install-modules install-scripts install-modules: modules $(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \ modules_install + @./scripts/update-initramfs install-scripts: @# All the scripts we can use diff --git a/scripts/update-initramfs b/scripts/update-initramfs new file mode 100755 index 000000000000..412d885f442b --- /dev/null +++ b/scripts/update-initramfs @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2009 Luis R. Rodriguez +# +# Since we provide ssb, the Ethernet module b44 some people may +# rely on it to netboot, so update the initrafms for each +# distribution. +# +# Note that in the future people may want to wireless-boot +# so this will help with that as well. + +LSB_RED_ID=$(/usr/bin/lsb_release -i -s) + +KLIB=/lib/modules/2.6.31-wl/build +ver=$(echo $KLIB | awk -F "/lib/modules/" '{print $2}' | awk -F"/" '{print $1}') +dir=/boot/ + +case $LSB_RED_ID in +"Ubuntu") + echo "Updating Ubuntu's initramfs for $ver under $dir ..." + mkinitramfs -o $dir/initrd.img-$ver $ver + echo "Will now run update-grub to ensure grub will find the new initramfs ..." + update-grub + ;; +*) + echo "Warning:" + echo "You may or may not need to update your initframfs, you should if" + echo "any of the modules installed are part of your initramfs. To add" + echo "support for your distribution to do this automatically send a" + echo "patch against $0. If your distribution does not require this" + echo "send a patch against the '/usr/bin/lsb_release -i -s': $LSB_RED_ID" + echo "tag for your distribution to avoid this warning." + ;; +esac -- 2.30.2