-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Framework to plugin Organization specific scripts during ONIE Image b…
…uild (#951) * Framework to plugin Organization specific scripts * Framework to plugin Organization specific scripts * Framework to plugin Organization specific scripts * add getopt option to organization script
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
######################################################################### | ||
## This script is to automate Orignaization specific extensions # | ||
## such as Configuration & Scripts for features like AAA, ZTP, etc. # | ||
## to include in ONIE installer image # | ||
## # | ||
## USAGE: # | ||
## ./organization_extensions.sh -f<filesystem_root> -n<hostname> # | ||
## ./organization_extensions.sh \ # | ||
## --fsroot <filesystem_root> \ # | ||
## --hostname <hostname> # | ||
## PARAMETERS: # | ||
## -f FILESYSTEM_ROOT # | ||
## The location of the root file system # | ||
## -h HOSTNAME # | ||
## The hostname of the target system # | ||
######################################################################### | ||
|
||
## Initialize the arguments to default values. | ||
## The values get updated to user provided value, if supplied | ||
FILESYSTEM_ROOT=./fsroot | ||
HOSTNAME=sonic | ||
|
||
# read the options | ||
TEMP=`getopt -o f:h: --long fsroot:,hostname: -- "$@"` | ||
eval set -- "$TEMP" | ||
|
||
# extract options and their arguments into variables. | ||
while true ; do | ||
case "$1" in | ||
-f|--fsroot) | ||
case "$2" in | ||
"") shift 2 ;; | ||
*) FILESYSTEM_ROOT=$2 ; shift 2 ;; | ||
esac ;; | ||
-h|--hostname) | ||
case "$2" in | ||
"") shift 2 ;; | ||
*) HOSTNAME=$2 ; shift 2 ;; | ||
esac ;; | ||
--) shift ; break ;; | ||
*) echo "Internal error!" ; exit 1 ;; | ||
esac | ||
done | ||
|
||
echo "Executing SONIC Organization Extensions" | ||
|
||
## Place your Organization specific code / scipts here ... | ||
|
||
|
||
echo "SONIC Organization Extensions - Done" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters