#!/bin/sh # # create raw initrd image # if [ $# -ne 1 ]; then echo "Usage: $0 " exit 1 fi version=$1 path=/opt2/fedora/arm initrd_dir=$path/initrd if [ ! -d $initrd_dir/lib/modules/$version ]; then echo "modules for $version doesn't exist" exit 2 fi if [ ! -f $path/init.template ]; then echo "init template doesn't exist" exit 2 fi echo "Updating modules configuration" depmod -a -b $path $version echo "Writing sda1 SATA initrd" sed -e 's/@rootdev@/\/dev\/sda1/' \ -e 's/@want_sata@//g' \ -e 's/@want_usb@/#/g' \ -e 's/@want_sdmmc@/#/g' \ $path/init.template > $initrd_dir/init ( cd $initrd_dir ; find . | cpio -oc | gzip -c -9 >| $path/initrd-$version-sda1-sata.img ) echo "Writing LVM SATA initrd" sed -e 's/@rootdev@/\/dev\/Linux\/Root/' \ -e 's/@want_sata@//g' \ -e 's/@want_usb@/#/g' \ -e 's/@want_sdmmc@/#/g' \ $path/init.template > $initrd_dir/init ( cd $initrd_dir ; find . | cpio -oc | gzip -c -9 >| $path/initrd-$version-lvm-sata.img ) echo "Writing SD/MMC initrd" sed -e 's/@rootdev@/\/dev\/mmcblk0p1/' \ -e 's/@want_sata@/#/g' \ -e 's/@want_usb@/#/g' \ -e 's/@want_sdmmc@//g' \ $path/init.template > $initrd_dir/init ( cd $initrd_dir ; find . | cpio -oc | gzip -c -9 >| $path/initrd-$version-sdmmc.img )