mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
support installing NOS to where ONIE image resides while block device is not specified
this fixes the issue when an external USB disk is inserted before powering on the switch that may change the device name of the expected installation destination (e.g. /dev/sdb becomes /dev/sdc)
This commit is contained in:
@@ -275,6 +275,15 @@ partition_gpt()
|
||||
installer_standard_gpt_install()
|
||||
{
|
||||
DEV=$1; shift
|
||||
|
||||
if [ -z $DEV ]; then
|
||||
# Install on the same block device as ONIE
|
||||
DEV=$(blkid | grep ONIE-BOOT | awk '{print $1}' | sed -e 's/[1-9][0-9]*:.*$//' | sed -e 's/\([0-9]\)\(p\)/\1/' | head -n 1)
|
||||
[ -b "$DEV" ] || {
|
||||
echo "Error: Unable to determine block device of ONIE install"
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
|
||||
visit_parted $DEV do_handle_disk do_handle_partitions || return 1
|
||||
partition_gpt $(get_free_space) || return 1
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
platform_installer() {
|
||||
# Standard isntallation to an available GPT partition
|
||||
installer_standard_gpt_install /dev/sdb
|
||||
installer_standard_gpt_install
|
||||
}
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
platform_installer() {
|
||||
# Standard isntallation to an available GPT partition
|
||||
installer_standard_gpt_install /dev/sdb
|
||||
installer_standard_gpt_install
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user