3 # make sure we are being run in the right directory...
7 echo >&2 mkinitramfs must be run from the mdadm source directory.
10 if [ -f /bin/busybox ]
11 then : good, it exists
12 case `file /bin/busybox` in
13 *statically* ) : good ;;
14 * ) echo >&2 mkinitramfs: /bin/busybox is not statically linked: cannot proceed.
18 echo >&2 "mkinitramfs: /bin/busybox doesn't exist - please install it statically linked."
26 cp mdadm.static initramfs/bin/mdadm
27 cp /bin/busybox initramfs/bin/busybox
28 ln initramfs/bin/busybox initramfs/bin/sh
29 cat <<- END > initramfs/init
32 echo 'Auto-assembling boot md array'
34 mount -t proc proc /proc
36 then arg=--uuid=$rootuuid
37 elif [ -n "$mdminor" ]
38 then arg=--super-minor=$mdminor
39 else arg=--super-minor=0
42 mdadm -Acpartitions $arg --auto=part /dev/mda
44 mount /dev/mda1 /root || mount /dev/mda /root
47 exec chroot . /sbin/init < /dev/console > /dev/console 2>&1
49 chmod +x initramfs/init
52 find init bin | cpio -o -H newc | gzip --best