Commit 494c77df authored by Natanael Copa's avatar Natanael Copa

setup-disk: rename bootdisk to mbrdisk

It is used for installing MBR and is only needed if there exist
a partition table.
parent 78c57f4e
...@@ -153,7 +153,7 @@ install_mounted_root() { ...@@ -153,7 +153,7 @@ install_mounted_root() {
boot_fs=$(find_mount_fs "$mnt_boot") boot_fs=$(find_mount_fs "$mnt_boot")
supported_boot_fs "$boot_fs" || return 1 supported_boot_fs "$boot_fs" || return 1
bootdisk=$(disk_from_part $bootdev) mbrdisk=$(disk_from_part $bootdev)
if [ -e "/sys/block/${rootdev#/dev/}/md" ]; then if [ -e "/sys/block/${rootdev#/dev/}/md" ]; then
local md=${rootdev#/dev/} local md=${rootdev#/dev/}
features="$features raid" features="$features raid"
...@@ -161,11 +161,13 @@ install_mounted_root() { ...@@ -161,11 +161,13 @@ install_mounted_root() {
raidmod=",$raidmod" raidmod=",$raidmod"
raidopt="-r" raidopt="-r"
# get a list of slaves # get a list of slaves
bootdisk= mbrdisk=
for i in /sys/block/$md/slaves/*; do for i in /sys/block/$md/slaves/*; do
j=${i##*/} j=${i##*/}
i=${j%[0-9]*} i=${j%[0-9]*}
bootdisk="$bootdisk /dev/${i}" if [ -b "/dev/$i" ]; then
mbrdisk="$mbrdisk /dev/${i}"
fi
done done
fi fi
if [ -n "$VERBOSE" ]; then if [ -n "$VERBOSE" ]; then
...@@ -173,7 +175,7 @@ install_mounted_root() { ...@@ -173,7 +175,7 @@ install_mounted_root() {
echo "Root filesystem: $root_fs" echo "Root filesystem: $root_fs"
echo "Boot device: $bootdev" echo "Boot device: $bootdev"
echo "Boot filesystem: $boot_fs" echo "Boot filesystem: $boot_fs"
echo "Boot disk(s): $bootdisk" echo "MBR disk(s): $mbrdisk"
fi fi
if [ -z "$APKOVL" ]; then if [ -z "$APKOVL" ]; then
...@@ -259,7 +261,7 @@ unmount_partitions() { ...@@ -259,7 +261,7 @@ unmount_partitions() {
fix_mbr_all_disks() { fix_mbr_all_disks() {
# fix mbr for all disk devices # fix mbr for all disk devices
for i in $bootdisk; do for i in $mbrdisk; do
local errmsg local errmsg
echo "Writing MBR to $i" echo "Writing MBR to $i"
errmsg=$(dd if="$MBR" of=$i 2>&1) \ errmsg=$(dd if="$MBR" of=$i 2>&1) \
......
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