Commit 78c57f4e authored by Natanael Copa's avatar Natanael Copa

setup-disk: generate fstab early. support for verbose (-v)

parent 9208a618
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment