summaryrefslogtreecommitdiff
path: root/setup-disk.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-01-12 19:13:44 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-01-12 19:13:44 +0000
commit78c57f4e1f532ef7daf6c21ceec5f15d9b796c8a (patch)
tree9cc5277f44bbfd6af0414a566d3be9175502364f /setup-disk.in
parent9208a618b8bd16f19bb3e9cab1f40b0009008adc (diff)
downloadalpine-conf-78c57f4e1f532ef7daf6c21ceec5f15d9b796c8a.zip
setup-disk: generate fstab early. support for verbose (-v)
Diffstat (limited to 'setup-disk.in')
-rw-r--r--setup-disk.in34
1 files changed, 22 insertions, 12 deletions
diff --git a/setup-disk.in b/setup-disk.in
index a5c91a3..ee01101 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -168,6 +168,13 @@ install_mounted_root() {
bootdisk="$bootdisk /dev/${i}"
done
fi
+ if [ -n "$VERBOSE" ]; then
+ echo "Root device: $rootdev"
+ echo "Root filesystem: $root_fs"
+ echo "Boot device: $bootdev"
+ echo "Boot filesystem: $boot_fs"
+ echo "Boot disk(s): $bootdisk"
+ fi
if [ -z "$APKOVL" ]; then
ovlfiles=/tmp/ovlfiles
@@ -176,6 +183,18 @@ install_mounted_root() {
echo "Restoring backup from $APKOVL to $rootdev..."
unpack_apkovl "$APKOVL" "$mnt" || return 1
fi
+
+ # generate the fstab
+ if [ -f "$mnt"/etc/fstab ]; then
+ mv "$mnt"/etc/fstab "$mnt"/etc/fstab.old
+ fi
+ enumerate_fstab "$mnt" >> "$mnt"/etc/fstab
+ cat >>"$mnt"/etc/fstab <<EOF
+/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
+/dev/fd0 /media/floppy vfat noauto 0 0
+/dev/usbdisk /media/usb vfat noauto 0 0
+EOF
+
# remove the installed db in case its there so we force re-install
rm -f "$mnt"/var/lib/apk/installed
echon "Installing system on $rootdev: "
@@ -183,6 +202,7 @@ install_mounted_root() {
mkdir -p "$mnt"/etc/apk/keys/
cp /etc/apk/keys/* "$mnt"/etc/apk/keys/
+
local apkflags="--quiet --progress --update-cache --clean-protected"
local pkgs=$(cat "$mnt"/var/lib/apk/world)
pkgs="$pkgs acct linux-$KERNEL_FLAVOR alpine-base"
@@ -225,17 +245,6 @@ label $KERNEL_FLAVOR
EOF
fi
- # generate the fstab
- if [ -f "$mnt"/etc/fstab ]; then
- mv "$mnt"/etc/fstab "$mnt"/etc/fstab.old
- fi
- enumerate_fstab "$mnt" >> "$mnt"/etc/fstab
- cat >>"$mnt"/etc/fstab <<EOF
-/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
-/dev/fd0 /media/floppy vfat noauto 0 0
-/dev/usbdisk /media/usb vfat noauto 0 0
-EOF
-
# install extlinux
apk add -q syslinux
is_xen || extlinux -i $raidopt "$mnt"/boot/
@@ -462,11 +471,12 @@ case "$(uname -r)" in
esac
# Parse args
-while getopts "hk:o:r" opt; do
+while getopts "hk:o:rv" opt; do
case $opt in
k) KERNEL_FLAVOR="$OPTARG";;
r) USE_RAID=1;;
o) APKOVL="$OPTARG";;
+ v) VERBOSE=1;;
*) usage;;
esac
done