1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
# $Id$ |
3 |
|
|
4 |
: ${INSTALL_ROOT="/mnt/magellan"} |
: ${INSTALL_ROOT="/mnt/magellan"} |
5 |
KNOWN_DISKS="ROOT BOOT SWAP HOME TMP USER VAR SVR OPT" |
KNOWN_DISKS="ROOT BOOT SWAP HOME TMP USER VAR SVR OPT" |
11 |
local disk_fs |
local disk_fs |
12 |
local opts |
local opts |
13 |
local progress |
local progress |
14 |
|
local percent |
15 |
|
|
16 |
declare -i progress=0 |
declare -i progress=0 |
17 |
|
|
26 |
if [[ ! -z ${disk_fs} ]] |
if [[ ! -z ${disk_fs} ]] |
27 |
then |
then |
28 |
case ${disk_fs} in |
case ${disk_fs} in |
29 |
swap) mkswap ${disk_part} >&2;; |
swap) mkswap ${disk_part} &> /dev/null;; |
30 |
reiserfs) mkfs.${disk_fs} -f ${disk_part} >&2;; |
reiserfs) mkfs.${disk_fs} -f ${disk_part} &> /dev/null;; |
31 |
*) mkfs.${disk_fs} ${disk_part} >&2;; |
keep-as-is) echo "keeping as-is." ;; |
32 |
|
*) mkfs.${disk_fs} ${disk_part} &> /dev/null;; |
33 |
esac |
esac |
34 |
fi |
fi |
35 |
fi |
fi |
36 |
|
|
37 |
(( progress++ )) |
(( progress++ )) |
38 |
echo ${progress} 9 | awk '{print ($1 / $2 * 100) - 1}' |
percent=$(echo ${progress} 9 | awk '{print ($1 / $2 * 100) - 1}') |
39 |
|
if [[ ${GUITYPE} = ncurses ]] |
40 |
|
then |
41 |
|
# no floats in ncurses gui possible |
42 |
|
printf %.0f "${percent}" |
43 |
|
else |
44 |
|
echo "${percent}" |
45 |
|
fi |
46 |
done |
done |
47 |
|
|
48 |
echo "100" |
echo "100" |
113 |
--format | -f) format_disks ;; |
--format | -f) format_disks ;; |
114 |
--mount | -m ) mount_disks ;; |
--mount | -m ) mount_disks ;; |
115 |
--umount | -u ) umount_disks ;; |
--umount | -u ) umount_disks ;; |
116 |
*) echo "unkown option '$1'." ;; |
*) echo "unknown option '$1'." ;; |
117 |
|
esac |
118 |
|
|
119 |
|
case $2 in |
120 |
|
--ncurses) GUITYPE="ncurses" ;; |
121 |
|
--gtk) GUITYPE="gtk" ;; |
122 |
|
*) GUITYPE="gtk" ;; |
123 |
esac |
esac |