mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Merge pull request #78 from Lewis-Kang/master
support installing NOS to where ONIE image resides while block device is not specified
This commit is contained in:
@@ -275,6 +275,15 @@ partition_gpt()
|
||||
installer_standard_gpt_install()
|
||||
{
|
||||
DEV=$1; shift
|
||||
|
||||
if [ -z $DEV ]; then
|
||||
# Install NOS to the same block device as ONIE image
|
||||
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 the block device to install NOS"
|
||||
exit 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