aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hjalmarsson <xake@rymdraket.net>2011-02-23 07:10:51 +0100
committerSebastian Pipping <sebastian@pipping.org>2011-02-24 10:27:10 +0100
commit7ae5e10474ef720a50b6ae01574036beaa017c38 (patch)
treeb5fe4d1325cf3de9939837552ad1105a65698481 /gen_initramfs.sh
parentBump version to 3.4.13 (diff)
downloadgenkernel-7ae5e10474ef720a50b6ae01574036beaa017c38.tar.gz
genkernel-7ae5e10474ef720a50b6ae01574036beaa017c38.tar.bz2
genkernel-7ae5e10474ef720a50b6ae01574036beaa017c38.zip
Introducing MDADM_CONFIG
Make it possible to choose a custom mdadm.conf for your ramdisk. If not set, no mdadm.conf will be copied, and ramdisk will auto-detect. This also fixes a regression where genkernel always tried to copy /etc/mdadm.conf to the ramdisk, failing if it was non-existant.
Diffstat (limited to 'gen_initramfs.sh')
-rwxr-xr-xgen_initramfs.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 582df2cc..2d017fda 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -342,8 +342,19 @@ append_mdadm(){
mkdir -p "${TEMP}/initramfs-mdadm-temp/sbin/"
if [ "${MDADM}" = '1' ]
then
- cp -a /etc/mdadm.conf "${TEMP}/initramfs-mdadm-temp/etc" \
- || gen_die "Could not copy mdadm.conf!"
+ if [ -n "${MDADM_CONFIG}" ]
+ then
+ if [ -f "${MDADM_CONFIG}" ]
+ then
+ cp -a "${MDADM_CONFIG}" "${TEMP}/initramfs-mdadm-temp/etc/mdadm.conf" \
+ || gen_die "Could not copy mdadm.conf!"
+ else
+ gen_die '${MDADM_CONFIG} does not exist!'
+ fi
+ else
+ print_info 1 ' MDADM: Skipping inclusion of mdadm.conf'
+ fi
+
if [ -e '/sbin/mdadm' ] && LC_ALL="C" ldd /sbin/mdadm | grep -q 'not a dynamic executable' \
&& [ -e '/sbin/mdmon' ] && LC_ALL="C" ldd /sbin/mdmon | grep -q 'not a dynamic executable'
then