build one aboot image on arista platform (#263)

This commit is contained in:
lguohan 2017-02-05 15:59:59 -08:00 committed by GitHub
parent 64f26beb42
commit 27a0b7c1fd
9 changed files with 64 additions and 15 deletions

3
.gitmodules vendored
View File

@ -50,3 +50,6 @@
[submodule "platform/broadcom/sonic-platform-modules-s6000"]
path = platform/broadcom/sonic-platform-modules-s6000
url = https://github.com/Azure/sonic-platform-modules-s6000
[submodule "sonic-platform-modules-arista"]
path = platform/broadcom/sonic-platform-modules-arista
url = https://github.com/lguohan/sonic-1

View File

@ -19,9 +19,10 @@
}
GIT_REVISION=$(git rev-parse --short HEAD)
mkdir -p `dirname $OUTPUT_ONIE_IMAGE`
sudo rm -f $OUTPUT_ONIE_IMAGE
if [ "$IMAGE_TYPE" = "onie" ]; then
echo "Build ONIE installer"
mkdir -p `dirname $OUTPUT_ONIE_IMAGE`
sudo rm -f $OUTPUT_ONIE_IMAGE
## Generate an ONIE installer image
## Note: Don't leave blank between lines. It is single line command.
./onie-mk-demo.sh $TARGET_PLATFORM $TARGET_MACHINE $TARGET_PLATFORM-$TARGET_MACHINE-$ONIEIMAGE_VERSION \
@ -29,15 +30,27 @@ if [ "$IMAGE_TYPE" = "onie" ]; then
$ONIE_INSTALLER_PAYLOAD
## Use 'aboot' as target machine category which includes Aboot as bootloader
elif [ "$IMAGE_TYPE" = "aboot" ]; then
## Add Aboot boot0 file into the image
cp $ONIE_INSTALLER_PAYLOAD $OUTPUT_ONIE_IMAGE
pushd files/Aboot && sudo zip -g $OLDPWD/$OUTPUT_ONIE_IMAGE boot0; popd
echo "Build Aboot installer"
mkdir -p `dirname $OUTPUT_ABOOT_IMAGE`
sudo rm -f $OUTPUT_ABOOT_IMAGE
sudo rm -f $ABOOT_BOOT_IMAGE
## Add main payload
cp $ONIE_INSTALLER_PAYLOAD $OUTPUT_ABOOT_IMAGE
## Add Aboot boot0 file
j2 -f env files/Aboot/boot0.j2 ./onie-image.conf > files/Aboot/boot0
pushd files/Aboot && zip -g $OLDPWD/$OUTPUT_ABOOT_IMAGE boot0; popd
pushd files/Aboot && zip -g $OLDPWD/$ABOOT_BOOT_IMAGE boot0; popd
echo "$GIT_REVISION" >> .imagehash
zip -g $OUTPUT_ONIE_IMAGE .imagehash
zip -g $OUTPUT_ABOOT_IMAGE .imagehash
zip -g $ABOOT_BOOT_IMAGE .imagehash
rm .imagehash
echo "SWI_VERSION=42.0.0" > version
zip -g $OUTPUT_ONIE_IMAGE version
zip -g $OUTPUT_ABOOT_IMAGE version
zip -g $ABOOT_BOOT_IMAGE version
rm version
zip -g $OUTPUT_ABOOT_IMAGE $ABOOT_BOOT_IMAGE
rm $ABOOT_BOOT_IMAGE
else
echo "Error: Non supported target platform: $TARGET_PLATFORM"
exit 1

View File

@ -44,17 +44,23 @@ extract_image() {
## Clean old directory for read-write layer
rm -rf "$target_path/rw"
## Clean docker directory
rm -rf "$target_path/var"
## Unzip the image
unzip -oq "$swipath" -x boot0 -d "$target_path"
## Clean old directory for docker
rm -rf "$target_path/var/lib/docker"
## Remove installer swi as it has lots of redundunt contents
rm -f $swipath
## Further extract docker archive
tar xf "$target_path/dockerfs.tar.gz" -C "$target_path"
## Further extract docker archive
tar xf "$target_path/{{ FILESYSTEM_DOCKERFS }}" -C "$target_path"
## clean up docker archive
rm -f "$target_path/dockerfs.tar.gz"
rm -f "$target_path/{{ FILESYSTEM_DOCKERFS }}"
## replace with boot swi
mv "$target_path/{{ ABOOT_BOOT_IMAGE }}" "$swipath"
}
write_machine_config() {

View File

@ -23,3 +23,9 @@ FILESYSTEM_DOCKERFS=dockerfs.tar.gz
## Output file name for onie installer
OUTPUT_ONIE_IMAGE=target/sonic-$TARGET_MACHINE.bin
## Output file name for aboot installer
OUTPUT_ABOOT_IMAGE=target/sonic-aboot-$TARGET_MACHINE.swi
## Aboot boot image name
ABOOT_BOOT_IMAGE=.sonic-boot.swi

View File

@ -0,0 +1,8 @@
# sonic broadcom one image installer
SONIC_ONE_ABOOT_IMAGE = sonic-aboot-broadcom.swi
$(SONIC_ONE_ABOOT_IMAGE)_MACHINE = broadcom
$(SONIC_ONE_ABOOT_IMAGE)_IMAGE_TYPE = aboot
$(SONIC_ONE_ABOOT_IMAGE)_DEPENDS += $(BRCM_OPENNSL_KERNEL) $(ARISTA_PLATFORM_MODULE)
$(SONIC_ONE_ABOOT_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
SONIC_INSTALLERS += $(SONIC_ONE_ABOOT_IMAGE)

View File

@ -0,0 +1,10 @@
# Arista Platform modules
ARISTA_PLATFORM_MODULE_VERSION = 1.0
export ARISTA_PLATFORM_MODULE_VERSION
ARISTA_PLATFORM_MODULE = sonic-platform-arista_$(ARISTA_PLATFORM_MODULE_VERSION)_amd64.deb
$(ARISTA_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-arista
$(ARISTA_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
SONIC_DPKG_DEBS += $(ARISTA_PLATFORM_MODULE)

View File

@ -1,9 +1,11 @@
include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/platform-modules-s6000.mk
include $(PLATFORM_PATH)/platform-modules-arista.mk
include $(PLATFORM_PATH)/docker-orchagent-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/one-aboot.mk
BCMCMD = bcmcmd
$(BCMCMD)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmcmd?sv=2015-04-05&sr=b&sig=X3bFApmsNFmcnWM9mSGRxBugPcg%2FgJCHh5hhSuV1M2c%3D&se=2030-08-23T14%3A41%3A56Z&sp=r"
@ -13,7 +15,7 @@ $(DSSERVE)_URL = "https://sonicstorage.blob.core.windows.net/packages/dsserve?sv
SONIC_ONLINE_FILES += $(BCMCMD) $(DSSERVE)
SONIC_ALL += $(SONIC_ONE_IMAGE)
SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT_IMAGE)
# Inject brcm sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV)

@ -0,0 +1 @@
Subproject commit 5a1871d8070b1fea0fbc30fcf91ff984ac6ec295

View File

@ -1,7 +1,7 @@
# sonic aboot installer
SONIC_GENERIC_ABOOT_IMAGE = sonic-aboot.bin
$(SONIC_GENERIC_ABOOT_IMAGE)_MACHINE = aboot
SONIC_GENERIC_ABOOT_IMAGE = sonic-aboot-generic.swi
$(SONIC_GENERIC_ABOOT_IMAGE)_MACHINE = generic
$(SONIC_GENERIC_ABOOT_IMAGE)_IMAGE_TYPE = aboot
$(SONIC_GENERIC_ABOOT_IMAGE)_DEPENDS =
$(SONIC_GENERIC_ABOOT_IMAGE)_DOCKERS =