source: trunk/packages/invirt-autoinstaller/common/usr/lib/xen-tools/debian.d/91-make-fstab @ 1497

Last change on this file since 1497 was 1497, checked in by broder, 16 years ago

sipb-xen-autoinstaller -> invirt-autoinstaller

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/sh
2
3# This is a copy of 90-make-fstab, with a bug fixed.
4# It should be removed once the bug is fixed upstream.
5
6#
7#  This script is responsible for setting up /etc/fstab upon the
8# new instance.
9#
10#  This should be a simple job, but it is complicated by some of the
11# differences between filesystems - some root filesystems will require
12# the installation of new packages, and we have to handle that here.
13#
14# Steve
15# --
16# http://www.steve.org.uk/
17
18
19prefix=$1
20
21#
22#  Source our common functions
23#
24if [ -e /usr/lib/xen-tools/common.sh ]; then
25    . /usr/lib/xen-tools/common.sh
26else
27    . ./hooks/common.sh
28fi
29
30
31#
32# Log our start
33#
34logMessage Script $0 starting
35
36
37#
38# Make sure we use ide style device names if required
39#
40device=sda
41if [ "${ide}" ]; then
42    device=hda
43fi
44
45#
46#  Now we have the options we can create the fstab.
47#
48has_xfs=0
49has_reiserfs=0
50cat <<E_O_FSTAB > ${prefix}/etc/fstab
51# /etc/fstab: static file system information.
52#
53# <file system> <mount point>   <type>  <options>       <dump>  <pass>
54proc            /proc           proc    defaults        0       0
55E_O_FSTAB
56for part in `seq 1 ${NUMPARTITIONS}`; do
57    eval "PARTITION=\"\${PARTITION${part}}\""
58    OLDIFS="${IFS}"
59    IFS=:
60    x=0
61    for partdata in ${PARTITION}; do
62        eval "partdata${x}=\"${partdata}\""
63        x=$(( $x+1 ))
64    done
65    IFS="${OLDIFS}"
66   
67    case "${partdata2}" in
68        xfs)
69            has_xfs=1
70            ;;
71        reiserfs)
72            has_reiserfs=1
73            ;;
74    esac
75   
76    if [ "${partdata2}" = "swap" ]; then
77        echo "${partdata7} none swap sw 0 0" >> ${prefix}/etc/fstab
78    else
79        echo "${partdata7} ${partdata3} ${partdata2} ${partdata4} 0 1" >> ${prefix}/etc/fstab
80    fi
81done
82
83
84#
85#  Finally we can install any required packages for the given root
86# filesystem
87#
88if [ $has_xfs -eq 1 ]; then
89    installDebianPackage ${prefix} xfsprogs
90fi
91if [ $has_reiserfs -eq 1 ]; then
92    installDebianPackage ${prefix} reiserfsprogs
93fi
94
95
96#
97#  Log our finish
98#
99logMessage Script $0 finished
Note: See TracBrowser for help on using the repository browser.