summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-05 12:52:05 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-05 12:52:05 +0000
commit3c0f5d01aa9d5ab11612436bd56f981968dc186a (patch)
tree878fc12c388f2410ccb8bb118fc149271f93b2bd
parentfd9c9852aee4c6e07635f340a12eba96ba4fc144 (diff)
downloadalpine-conf-3c0f5d01aa9d5ab11612436bd56f981968dc186a.zip
setup-disk: use SYSROOT env var instead of hardcoded /mnt
-rw-r--r--setup-disk.in15
1 files changed, 9 insertions, 6 deletions
diff --git a/setup-disk.in b/setup-disk.in
index d80b843..d527d75 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -8,6 +8,9 @@ ROOTFS=${ROOTFS:-ext4}
BOOTFS=${BOOTFS:-ext4}
VARFS=${VARFS:-ext4}
+# default location for mounted root
+SYSROOT=${SYSROOT:-/mnt}
+
in_list() {
local i="$1"
shift
@@ -669,16 +672,16 @@ data_only_disk_install() {
setup_root() {
local root_dev="$1" boot_dev="$2"
mkfs.$ROOTFS -q "$root_dev"
- mkdir -p /mnt
- mount -t $ROOTFS $root_dev /mnt || return 1
+ mkdir -p "$SYSROOT"
+ mount -t $ROOTFS $root_dev "$SYSROOT" || return 1
if [ -n "$boot_dev" ]; then
- mkdir -p /mnt/boot
- mount -t $BOOTFS $boot_dev /mnt/boot || return 1
+ mkdir -p "$SYSROOT"/boot
+ mount -t $BOOTFS $boot_dev "$SYSROOT"/boot || return 1
fi
setup_mdadm_conf
- install_mounted_root /mnt || return 1
- unmount_partitions /mnt
+ install_mounted_root "$SYSROOT" || return 1
+ unmount_partitions "$SYSROOT"
swapoff -a
echo ""