diff --git a/hooks/centos-4/90-make-fstab b/hooks/centos-4/90-make-fstab index 74a6267..7728b34 120000 --- a/hooks/centos-4/90-make-fstab +++ b/hooks/centos-4/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-rpm \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/centos-5/90-make-fstab b/hooks/centos-5/90-make-fstab index 74a6267..7728b34 120000 --- a/hooks/centos-5/90-make-fstab +++ b/hooks/centos-5/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-rpm \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/common/90-make-fstab-deb b/hooks/common/90-make-fstab similarity index 86% rename from hooks/common/90-make-fstab-deb rename to hooks/common/90-make-fstab index 42d775d..cf32731 100755 --- a/hooks/common/90-make-fstab-deb +++ b/hooks/common/90-make-fstab @@ -29,6 +29,7 @@ fi # logMessage Script $0 starting +logMessage Filesystem options are ${options} # # Find the root device. @@ -99,21 +100,6 @@ for part in `seq 1 ${NUMPARTITIONS}`; do done -# -# Finally we can install any required packages for the given root -# filesystem -# -if [ $has_xfs -eq 1 ]; then - installDebianPackage ${prefix} xfsprogs -fi -if [ $has_reiserfs -eq 1 ]; then - installDebianPackage ${prefix} reiserfsprogs -fi -if [ $has_btrfs -eq 1 ]; then - installDebianPackage ${prefix} btrfs-tools -fi - - # # Log our finish # diff --git a/hooks/common/90-make-fstab-rpm b/hooks/common/90-make-fstab-rpm deleted file mode 100755 index 278d1de..0000000 --- a/hooks/common/90-make-fstab-rpm +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh -# -# This script is responsible for setting up /etc/fstab upon the -# new instance. -# -# This should be a simple job, but it is complicated by some of the -# differences between filesystems - some root filesystems will require -# the installation of new packages, and we have to handle that here. -# -# Steve -# -- -# http://www.steve.org.uk/ - - -prefix=$1 - -# -# Source our common functions -# -if [ -e /usr/lib/xen-tools/common.sh ]; then - . /usr/lib/xen-tools/common.sh -else - . ./hooks/common.sh -fi - - -# -# Log our start -# -logMessage Script $0 starting - - -logMessage Filesystem options are ${options} - - -# -# Find the root device. -# -# 1. default to xvda. -# -# 2. If --ide is specified use hda. -# -# 3. If --scsi is specified use sda. -# -# 4. Otherwise use a named $disk_device -# -device=xvda -if [ "${ide}" ]; then - device=hda -elif [ "${scsi}" ]; then - device=sda -else - if [ ! -z "${disk_device}" ]; then - device=`basename $disk_device` - fi -fi - -logMessage "Root device is /dev/$device" - - -# -# Now we have the options we can create the fstab. -# -has_xfs=0 -has_reiserfs=0 -has_btrfs=0 -cat < ${prefix}/etc/fstab -# /etc/fstab: static file system information. -# -# -proc /proc proc defaults 0 0 -devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0 -E_O_FSTAB -for part in `seq 1 ${NUMPARTITIONS}`; do - eval "PARTITION=\"\${PARTITION${part}}\"" - OLDIFS="${IFS}" - IFS=: - x=0 - for partdata in ${PARTITION}; do - eval "partdata${x}=\"${partdata}\"" - x=$(( $x+1 )) - done - IFS="${OLDIFS}" - - case "${partdata2}" in - xfs) - has_xfs=1 - ;; - reiserfs) - has_reiserfs=1 - ;; - btrfs) - has_btrfs=1 - ;; - esac - - if [ "${partdata2}" = "swap" ]; then - echo "/dev/${device}${part} none swap sw 0 0" >> ${prefix}/etc/fstab - else - echo "/dev/${device}${part} ${partdata3} ${partdata2} ${partdata4} 0 1" >> ${prefix}/etc/fstab - fi -done - - -# -# Finally we can install any required packages for the given root -# filesystem -# -#if [ $has_xfs -eq 1 ]; then -# installDebianPackage ${prefix} xfsprogs -#fi -#if [ $has_reiserfs -eq 1 ]; then -# installDebianPackage ${prefix} reiserfsprogs -#fi -#if [ $has_btrfs -eq 1 ]; then -# installDebianPackage ${prefix} btrfs-tools -#fi - - -# -# Log our finish -# -logMessage Script $0 finished diff --git a/hooks/common/91-install-fs-tools b/hooks/common/91-install-fs-tools new file mode 100755 index 0000000..c8bcd58 --- /dev/null +++ b/hooks/common/91-install-fs-tools @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Some root filesystems will require the installation of new packages +# +# Steve +# -- +# http://www.steve.org.uk/ + + +prefix=$1 + +# +# Source our common functions +# +if [ -e /usr/lib/xen-tools/common.sh ]; then + . /usr/lib/xen-tools/common.sh +else + . ./hooks/common.sh +fi + + +# +# Log our start +# +logMessage Script $0 starting + + +# +# Install any required packages for the given root filesystem +# +if [ $has_xfs -eq 1 ]; then + installDebianPackage ${prefix} xfsprogs +fi +if [ $has_reiserfs -eq 1 ]; then + installDebianPackage ${prefix} reiserfsprogs +fi +if [ $has_btrfs -eq 1 ]; then + installDebianPackage ${prefix} btrfs-tools +fi + + +# +# Log our finish +# +logMessage Script $0 finished diff --git a/hooks/dapper/90-make-fstab b/hooks/dapper/90-make-fstab index a9b306a..7728b34 120000 --- a/hooks/dapper/90-make-fstab +++ b/hooks/dapper/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-deb \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/dapper/91-install-fs-tools b/hooks/dapper/91-install-fs-tools new file mode 120000 index 0000000..ac7f209 --- /dev/null +++ b/hooks/dapper/91-install-fs-tools @@ -0,0 +1 @@ +../common/91-install-fs-tools \ No newline at end of file diff --git a/hooks/debian/90-make-fstab b/hooks/debian/90-make-fstab index a9b306a..7728b34 120000 --- a/hooks/debian/90-make-fstab +++ b/hooks/debian/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-deb \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/debian/91-install-fs-tools b/hooks/debian/91-install-fs-tools new file mode 120000 index 0000000..ac7f209 --- /dev/null +++ b/hooks/debian/91-install-fs-tools @@ -0,0 +1 @@ +../common/91-install-fs-tools \ No newline at end of file diff --git a/hooks/edgy/90-make-fstab b/hooks/edgy/90-make-fstab index a9b306a..7728b34 120000 --- a/hooks/edgy/90-make-fstab +++ b/hooks/edgy/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-deb \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/edgy/91-install-fs-tools b/hooks/edgy/91-install-fs-tools new file mode 120000 index 0000000..ac7f209 --- /dev/null +++ b/hooks/edgy/91-install-fs-tools @@ -0,0 +1 @@ +../common/91-install-fs-tools \ No newline at end of file diff --git a/hooks/fedora-core-6/90-make-fstab b/hooks/fedora-core-6/90-make-fstab index 74a6267..7728b34 120000 --- a/hooks/fedora-core-6/90-make-fstab +++ b/hooks/fedora-core-6/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-rpm \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/gentoo/90-make-fstab b/hooks/gentoo/90-make-fstab index 74a6267..7728b34 120000 --- a/hooks/gentoo/90-make-fstab +++ b/hooks/gentoo/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-rpm \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/intrepid/90-make-fstab b/hooks/intrepid/90-make-fstab index a9b306a..7728b34 120000 --- a/hooks/intrepid/90-make-fstab +++ b/hooks/intrepid/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-deb \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/intrepid/91-install-fs-tools b/hooks/intrepid/91-install-fs-tools new file mode 120000 index 0000000..ac7f209 --- /dev/null +++ b/hooks/intrepid/91-install-fs-tools @@ -0,0 +1 @@ +../common/91-install-fs-tools \ No newline at end of file diff --git a/hooks/karmic/90-make-fstab b/hooks/karmic/90-make-fstab index a9b306a..7728b34 120000 --- a/hooks/karmic/90-make-fstab +++ b/hooks/karmic/90-make-fstab @@ -1 +1 @@ -../common/90-make-fstab-deb \ No newline at end of file +../common/90-make-fstab \ No newline at end of file diff --git a/hooks/karmic/91-install-fs-tools b/hooks/karmic/91-install-fs-tools new file mode 120000 index 0000000..ac7f209 --- /dev/null +++ b/hooks/karmic/91-install-fs-tools @@ -0,0 +1 @@ +../common/91-install-fs-tools \ No newline at end of file