Commit 3c0f5d01 authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-disk: use SYSROOT env var instead of hardcoded /mnt

parent fd9c9852
...@@ -8,6 +8,9 @@ ROOTFS=${ROOTFS:-ext4} ...@@ -8,6 +8,9 @@ ROOTFS=${ROOTFS:-ext4}
BOOTFS=${BOOTFS:-ext4} BOOTFS=${BOOTFS:-ext4}
VARFS=${VARFS:-ext4} VARFS=${VARFS:-ext4}
# default location for mounted root
SYSROOT=${SYSROOT:-/mnt}
in_list() { in_list() {
local i="$1" local i="$1"
shift shift
...@@ -669,16 +672,16 @@ data_only_disk_install() { ...@@ -669,16 +672,16 @@ data_only_disk_install() {
setup_root() { setup_root() {
local root_dev="$1" boot_dev="$2" local root_dev="$1" boot_dev="$2"
mkfs.$ROOTFS -q "$root_dev" mkfs.$ROOTFS -q "$root_dev"
mkdir -p /mnt mkdir -p "$SYSROOT"
mount -t $ROOTFS $root_dev /mnt || return 1 mount -t $ROOTFS $root_dev "$SYSROOT" || return 1
if [ -n "$boot_dev" ]; then if [ -n "$boot_dev" ]; then
mkdir -p /mnt/boot mkdir -p "$SYSROOT"/boot
mount -t $BOOTFS $boot_dev /mnt/boot || return 1 mount -t $BOOTFS $boot_dev "$SYSROOT"/boot || return 1
fi fi
setup_mdadm_conf setup_mdadm_conf
install_mounted_root /mnt || return 1 install_mounted_root "$SYSROOT" || return 1
unmount_partitions /mnt unmount_partitions "$SYSROOT"
swapoff -a swapoff -a
echo "" echo ""
......
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