Magellan Linux

Annotation of /trunk/installer/include/prepare_fstab.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 773 - (hide annotations) (download) (as text)
Wed Sep 24 10:54:00 2008 UTC (15 years, 7 months ago) by niro
File MIME type: application/x-sh
File size: 1239 byte(s)
-moved helper-scripts into include/ directory

1 niro 773 #!/bin/bash
2    
3     : ${INSTALL_ROOT="/mnt/magellan"}
4     KNOWN_DISKS="ROOT BOOT SWAP HOME TMP USER VAR SVR OPT"
5    
6     # root device
7     sed -i "s:^/dev/ROOT.*:${PARTITION_DISK_ROOT} / ${PARTITION_FS_ROOT} defaults,noatime 0 0:" ${INSTALL_ROOT}/etc/fstab
8     # swap device
9     sed -i "s:^/dev/SWAP.*:${PARTITION_DISK_SWAP} swap swap pri=1 0 0:" ${INSTALL_ROOT}/etc/fstab
10    
11     # boot
12     if [[ -z ${PARTITION_DISK_BOOT} ]]
13     then
14     # delete the entry
15     sed -i 's/\/dev\/ROOT.*/d' ${INSTALL_ROOT}/etc/fstab
16     else
17     sed -i "s:^/dev/BOOT.*:${PARTITION_DISK_BOOT} /boot ${PARTITION_FS_BOOT} noauto,noatime 1 1:" ${INSTALL_ROOT}/etc/fstab
18     fi
19    
20     # then all other
21     for disk in ${KNOWN_DISKS}
22     do
23     case ${disk} in
24     HOME) dest=/home ;;
25     TMP) dest=/tmp ;;
26     USER) dest=/usr ;;
27     VAR) dest=/var ;;
28     SVR) dest=/svr ;;
29     OPT) dest=/opt ;;
30     *) continue ;;
31     esac
32    
33     disk_part=$(eval echo \$PARTITION_DISK_${disk})
34     disk_fs=$(eval echo \$PARTITION_FS_${disk})
35    
36     if [[ ! -z ${disk_part} ]]
37     then
38     if [[ -z $(grep ^${disk_part} ${INSTALL_ROOT}/etc/fstab) ]]
39     then
40     echo "${disk_part} ${dest} ${disk_fs} defaults,noatime 0 0" >> ${INSTALL_ROOT}/etc/fstab
41     else
42     sed -i "s:^${disk_part}.*:${disk_part} ${dest} ${disk_fs} defaults,noatime 0 0:" ${INSTALL_ROOT}/etc/fstab
43     fi
44     fi
45     done

Properties

Name Value
svn:executable *