diff -r 4ad317429111 -r e82e67a38b9c install.sh --- a/install.sh Sun Apr 2 15:16:53 2006 +++ b/install.sh Mon Apr 3 13:26:22 2006 @@ -44,6 +44,25 @@ (cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf - rm -rf "$tmp" +if [ -x "$(which mkinitrd)" ] && [ -x "$(which depmod)" ] && [ $dst == '/' ]; then + cd $src/lib/modules + for i in *; do + cd ->/dev/null + cd $dst/boot + echo " - attempting to create initrd-$i.img..." + depmod $i + if $dst/etc/xen/scripts/mkinitrd-wrapper -o initrd-$i.img -v $i; then + ln -s -f initrd-$i.img initrd-2.6-xen.img + echo " - success." + else + echo " - failed. You may need to create an initrd manually." + fi + done + cd ->/dev/null +else + echo " - you may need to create an initrd manually." +fi + echo "All done." echo "Checking to see whether prerequisite tools are installed..." diff -r 4ad317429111 -r e82e67a38b9c tools/examples/Makefile --- a/tools/examples/Makefile Sun Apr 2 15:16:53 2006 +++ b/tools/examples/Makefile Mon Apr 3 13:26:22 2006 @@ -28,6 +28,7 @@ XEN_SCRIPTS += block-enbd block-nbd XEN_SCRIPTS += vtpm vtpm-delete XEN_SCRIPTS += xen-hotplug-cleanup +XEN_SCRIPTS += mkinitrd-wrapper XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh diff -r 4ad317429111 -r e82e67a38b9c tools/examples/mkinitrd-wrapper --- /dev/null Sun Apr 2 15:16:53 2006 +++ b/tools/examples/mkinitrd-wrapper Mon Apr 3 13:26:22 2006 @@ -0,0 +1,56 @@ +#!/bin/sh + +set -e + +usage() +{ + cat >&2 << EOF + +Usage: $0 -o output_file -v version_string + +Call the distro mkinitrd using the distro-specific syntax. + +Options: + -o output_file The pathname of the created initrd file. + -v version_string The version of the kernel for which to create the initrd. +EOF + exit 1 +} + +while getopts "o:v:" flag; do + case $flag in + o) + output_file="${OPTARG}" + got_output_file=yes + ;; + v) + version_string="${OPTARG}" + got_version_string=yes + ;; + *) + usage + ;; + esac +done + +shift $(($OPTIND - 1)) + +if ! [ $got_output_file ] || ! [ $got_version_string ] || [ $# -gt 0 ]; then + usage +fi + +if [ -e /etc/debian_version ]; then + distro="debian-derived" +else + distro="unknown" +fi + +case $distro in +"debian-derived") + mkinitrd -o $output_file $version_string + ;; +"unknown") + echo "Sorry don't know how to call mkinitrd on your distro." + exit 1 + ;; +esac