Changed ACS references to SONiC in image, added timestamp to base image volume label
This commit is contained in:
parent
d5d7168f10
commit
4843e0671f
8
Makefile
8
Makefile
@ -102,14 +102,14 @@ target/docker-database.gz: target/docker-base.gz
|
|||||||
docker load < $<
|
docker load < $<
|
||||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||||
|
|
||||||
target/acs-generic.bin: deps/linux-image-3.16.0-4-amd64_3.16.7-ckt11-2+acs8u2_amd64.deb deps/initramfs-tools_0.120_all.deb
|
target/sonic-generic.bin: deps/linux-image-3.16.0-4-amd64_3.16.7-ckt11-2+acs8u2_amd64.deb deps/initramfs-tools_0.120_all.deb
|
||||||
./build_debian.sh "$(USERNAME)" "$(PASSWORD_ENCRYPTED)" && TARGET_MACHINE=generic ./build_image.sh
|
./build_debian.sh "$(USERNAME)" "$(PASSWORD_ENCRYPTED)" && TARGET_MACHINE=generic ./build_image.sh
|
||||||
|
|
||||||
target/acs-aboot.bin: deps/linux-image-3.16.0-4-amd64_3.16.7-ckt11-2+acs8u2_amd64.deb deps/initramfs-tools_0.120_all.deb
|
target/sonic-aboot.bin: deps/linux-image-3.16.0-4-amd64_3.16.7-ckt11-2+acs8u2_amd64.deb deps/initramfs-tools_0.120_all.deb
|
||||||
./build_debian.sh "$(USERNAME)" "$(PASSWORD_ENCRYPTED)" && TARGET_MACHINE=aboot ./build_image.sh
|
./build_debian.sh "$(USERNAME)" "$(PASSWORD_ENCRYPTED)" && TARGET_MACHINE=aboot ./build_image.sh
|
||||||
|
|
||||||
## Note: docker-fpm.gz must be the last to build the implicit dependency fpmsyncd
|
## Note: docker-fpm.gz must be the last to build the implicit dependency fpmsyncd
|
||||||
brcm-all: target/acs-generic.bin $(addprefix target/,docker-syncd.gz docker-orchagent.gz docker-fpm.gz docker-database.gz)
|
brcm-all: target/sonic-generic.bin $(addprefix target/,docker-syncd.gz docker-orchagent.gz docker-fpm.gz docker-database.gz)
|
||||||
|
|
||||||
## Note: docker-fpm.gz must be the last to build the implicit dependency fpmsyncd
|
## Note: docker-fpm.gz must be the last to build the implicit dependency fpmsyncd
|
||||||
mlnx-all: target/acs-generic.bin $(addprefix target/,docker-syncd-mlnx.gz docker-orchagent-mlnx.gz docker-fpm.gz docker-database.gz)
|
mlnx-all: target/sonic-generic.bin $(addprefix target/,docker-syncd-mlnx.gz docker-orchagent-mlnx.gz docker-fpm.gz docker-database.gz)
|
||||||
|
@ -35,7 +35,7 @@ For example, the user name is 'admin' and the password is 'YourPaSsWoRd'. To bui
|
|||||||
The root is disabled, but the created user could sudo.
|
The root is disabled, but the created user could sudo.
|
||||||
|
|
||||||
The target directory is ./target, containing the NOS installer image and docker images.
|
The target directory is ./target, containing the NOS installer image and docker images.
|
||||||
- acs-generic.bin: SONiC switch installer image (ONIE compatiable)
|
- sonic-generic.bin: SONiC switch installer image (ONIE compatiable)
|
||||||
- docker-base.gz: base docker image where others are built from (gzip tar archive)
|
- docker-base.gz: base docker image where others are built from (gzip tar archive)
|
||||||
- docker-fpm.gz: docker image for quagga with fpm module enabled (gzip tar archive)
|
- docker-fpm.gz: docker image for quagga with fpm module enabled (gzip tar archive)
|
||||||
- docker-orchagent.gz: docker image for SWitch State Service (SWSS)
|
- docker-orchagent.gz: docker image for SWitch State Service (SWSS)
|
||||||
|
@ -109,7 +109,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c 'cd /dev && MAKEDEV generic'
|
|||||||
## However, 'dpkg -i' plus 'apt-get install -f' will ignore the recommended dependency. So
|
## However, 'dpkg -i' plus 'apt-get install -f' will ignore the recommended dependency. So
|
||||||
## we install busybox explicitly
|
## we install busybox explicitly
|
||||||
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install busybox
|
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install busybox
|
||||||
echo '[INFO] Install ACS linux kernel image'
|
echo '[INFO] Install SONiC linux kernel image'
|
||||||
## Note: duplicate apt-get command to ensure every line return zero
|
## Note: duplicate apt-get command to ensure every line return zero
|
||||||
sudo dpkg --root=$FILESYSTEM_ROOT -i deps/initramfs-tools_*.deb || \
|
sudo dpkg --root=$FILESYSTEM_ROOT -i deps/initramfs-tools_*.deb || \
|
||||||
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
|
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
## This script is to automate the preparation for docker images for ACS.
|
## This script is to automate the preparation for docker images for SONiC.
|
||||||
## If registry server and port provided, the images will be pushed there.
|
## If registry server and port provided, the images will be pushed there.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -111,9 +111,10 @@ demo_type="%%DEMO_TYPE%%"
|
|||||||
# The build system prepares this script by replacing %%GIT_REVISION%%
|
# The build system prepares this script by replacing %%GIT_REVISION%%
|
||||||
# with git revision hash as a version identifier
|
# with git revision hash as a version identifier
|
||||||
git_revision="%%GIT_REVISION%%"
|
git_revision="%%GIT_REVISION%%"
|
||||||
|
timestamp="$(date -u +%Y%m%d)"
|
||||||
|
|
||||||
demo_volume_label="ACS-${demo_type}"
|
demo_volume_label="SONiC-${demo_type}"
|
||||||
demo_volume_revision_label="ACS-${demo_type}-${git_revision}"
|
demo_volume_revision_label="SONiC-${demo_type}-${timestamp}-${git_revision}"
|
||||||
|
|
||||||
# auto-detect whether BIOS or UEFI
|
# auto-detect whether BIOS or UEFI
|
||||||
if [ -d "/sys/firmware/efi/efivars" ] ; then
|
if [ -d "/sys/firmware/efi/efivars" ] ; then
|
||||||
@ -143,6 +144,8 @@ fi
|
|||||||
#
|
#
|
||||||
# Returns the created partition number in $demo_part
|
# Returns the created partition number in $demo_part
|
||||||
demo_part=""
|
demo_part=""
|
||||||
|
# TODO: remove reference to "ACS-OS" after all baseimages are upgraded
|
||||||
|
legacy_volume_label="ACS_OS"
|
||||||
create_demo_gpt_partition()
|
create_demo_gpt_partition()
|
||||||
{
|
{
|
||||||
blk_dev="$1"
|
blk_dev="$1"
|
||||||
@ -153,7 +156,7 @@ create_demo_gpt_partition()
|
|||||||
mkfifo -m 600 "$tmpfifo"
|
mkfifo -m 600 "$tmpfifo"
|
||||||
|
|
||||||
# See if demo partition already exists
|
# See if demo partition already exists
|
||||||
demo_part=$(sgdisk -p $blk_dev | grep "$demo_volume_label" | awk '{print $1}')
|
demo_part=$(sgdisk -p $blk_dev | grep -e "$demo_volume_label" -e "$legacy_volume_label" | awk '{print $1}')
|
||||||
if [ -n "$demo_part" ] ; then
|
if [ -n "$demo_part" ] ; then
|
||||||
# delete existing partitions
|
# delete existing partitions
|
||||||
# if there are multiple partitions matched, we should delete each one, except the current OS's
|
# if there are multiple partitions matched, we should delete each one, except the current OS's
|
||||||
@ -225,7 +228,7 @@ create_demo_msdos_partition()
|
|||||||
|
|
||||||
# See if demo partition already exists -- look for the filesystem
|
# See if demo partition already exists -- look for the filesystem
|
||||||
# label.
|
# label.
|
||||||
part_info="$(blkid | grep $demo_volume_label | awk -F: '{print $1}')"
|
part_info="$(blkid | grep -e "$demo_volume_label" -e "$legacy_volume_label" | awk -F: '{print $1}')"
|
||||||
if [ -n "$part_info" ] ; then
|
if [ -n "$part_info" ] ; then
|
||||||
# delete existing partition
|
# delete existing partition
|
||||||
demo_part="$(echo -n $part_info | sed -e s#${blk_dev}##)"
|
demo_part="$(echo -n $part_info | sed -e s#${blk_dev}##)"
|
||||||
@ -268,7 +271,7 @@ create_demo_uefi_partition()
|
|||||||
create_demo_gpt_partition "$1"
|
create_demo_gpt_partition "$1"
|
||||||
|
|
||||||
# erase any related EFI BootOrder variables from NVRAM.
|
# erase any related EFI BootOrder variables from NVRAM.
|
||||||
for b in $(efibootmgr | grep "$demo_volume_label" | awk '{ print $1 }') ; do
|
for b in $(efibootmgr | grep -e "$demo_volume_label" -e "$legacy_volume_label" | awk '{ print $1 }') ; do
|
||||||
local num=${b#Boot}
|
local num=${b#Boot}
|
||||||
# Remove trailing '*'
|
# Remove trailing '*'
|
||||||
num=${num%\*}
|
num=${num%\*}
|
||||||
|
@ -19,4 +19,4 @@ FILESYSTEM_SQUASHFS=fs.squashfs
|
|||||||
ONIE_INSTALLER_PAYLOAD=fs.zip
|
ONIE_INSTALLER_PAYLOAD=fs.zip
|
||||||
|
|
||||||
## Output file name for onie installer
|
## Output file name for onie installer
|
||||||
OUTPUT_ONIE_IMAGE=target/acs-$TARGET_MACHINE.bin
|
OUTPUT_ONIE_IMAGE=target/sonic-$TARGET_MACHINE.bin
|
||||||
|
Loading…
Reference in New Issue
Block a user