[installer]: support new onie machine.conf format (#1468)

* [installer]: support new onie machine.conf format

onie_* variable are generated at runtime in /etc/machine.conf.
We can no longer copy the static machine.conf into sonic image.

Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
lguohan 2018-03-17 18:31:18 -07:00 committed by GitHub
parent 93f38de672
commit 15cd34f03c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -452,7 +452,13 @@ unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPT
if [ "$install_env" = "onie" ]; then
# Store machine description in target file system
cp /etc/machine.conf $demo_mnt
if [ -f /etc/machine-build.conf ]; then
# onie_ variable are generate at runtime.
# they are no longer hardcoded in /etc/machine.conf
set | grep ^onie_ > $demo_mnt/machine.conf
else
cp /etc/machine.conf $demo_mnt
fi
# Store installation log in target file system
rm -f $onie_initrd_tmp/tmp/onie-support*.tar.bz2