[build_debian]: install deps in rootfs instead of just extracting the packages (#280)

packages contains post-install that needs to be performed
This commit is contained in:
lguohan 2017-02-10 07:39:05 -08:00 committed by GitHub
parent 55acd9e9e3
commit 6119a58e4a
6 changed files with 21 additions and 7 deletions

4
.gitmodules vendored
View File

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

View File

@ -58,7 +58,7 @@ DEFAULT_USERINFO="Default admin user,,,"
## Prepare the file system directory ## Prepare the file system directory
if [[ -d $FILESYSTEM_ROOT ]]; then if [[ -d $FILESYSTEM_ROOT ]]; then
sudo rm -r $FILESYSTEM_ROOT || die "Failed to clean chroot directory" sudo rm -rf $FILESYSTEM_ROOT || die "Failed to clean chroot directory"
fi fi
mkdir -p $FILESYSTEM_ROOT mkdir -p $FILESYSTEM_ROOT
@ -272,6 +272,3 @@ pushd $FILESYSTEM_ROOT && sudo tar czf $OLDPWD/$FILESYSTEM_DOCKERFS -C var/lib/d
## Compress together with /boot and /var/lib/docker as an installer payload zip file ## Compress together with /boot and /var/lib/docker as an installer payload zip file
pushd $FILESYSTEM_ROOT && sudo zip $OLDPWD/$ONIE_INSTALLER_PAYLOAD -r boot/; popd pushd $FILESYSTEM_ROOT && sudo zip $OLDPWD/$ONIE_INSTALLER_PAYLOAD -r boot/; popd
sudo zip -g $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS sudo zip -g $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS
## Remove fsroot
sudo rm -rf $FILESYSTEM_ROOT

View File

@ -95,9 +95,24 @@ sudo mv sonic_version.yml $FILESYSTEM_ROOT/etc/sonic/
# Copy sudoers configuration file # Copy sudoers configuration file
sudo cp $IMAGE_CONFIGS/sudoers/sudoers $FILESYSTEM_ROOT/etc/ sudo cp $IMAGE_CONFIGS/sudoers/sudoers $FILESYSTEM_ROOT/etc/
## Install package without starting service
## ref: https://wiki.debian.org/chroot
sudo tee -a $FILESYSTEM_ROOT/usr/sbin/policy-rc.d > /dev/null <<EOF
#!/bin/sh
exit 101
EOF
sudo chmod a+x $FILESYSTEM_ROOT/usr/sbin/policy-rc.d
{% for deb in installer_debs.strip().split(' ') -%} {% for deb in installer_debs.strip().split(' ') -%}
if [ $sonic_asic_platform == "mellanox" ]; then
sudo dpkg --extract {{deb}} $FILESYSTEM_ROOT sudo dpkg --extract {{deb}} $FILESYSTEM_ROOT
else
sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
fi
{% endfor %} {% endfor %}
sudo rm -f $FILESYSTEM_ROOT/usr/sbin/policy-rc.d
## Run depmod command for target kernel modules ## Run depmod command for target kernel modules
sudo LANG=C chroot $FILESYSTEM_ROOT depmod -a {{kversion}} sudo LANG=C chroot $FILESYSTEM_ROOT depmod -a {{kversion}}
{% endif %} {% endif %}

View File

@ -11,5 +11,6 @@ SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM)
$(DOCKER_SYNCD_BRCM)_CONTAINER_NAME = syncd $(DOCKER_SYNCD_BRCM)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_BRCM)_RUN_OPT += --net=host --privileged -t $(DOCKER_SYNCD_BRCM)_RUN_OPT += --net=host --privileged -t
$(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd
$(DOCKER_SYNCD_BRCM)_RUN_OPT += --volumes-from database $(DOCKER_SYNCD_BRCM)_RUN_OPT += --volumes-from database
$(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

@ -1 +1 @@
Subproject commit 5a1871d8070b1fea0fbc30fcf91ff984ac6ec295 Subproject commit db1bf4b8be53d612a98d9468bebc3b3704ae42b1

View File

@ -297,6 +297,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform
export image_type="$($*_IMAGE_TYPE)" export image_type="$($*_IMAGE_TYPE)"
export sonicadmin_user="$(USERNAME)" export sonicadmin_user="$(USERNAME)"
export sonic_hwsku="$(CONFIGURED_SKU)" export sonic_hwsku="$(CONFIGURED_SKU)"
export sonic_asic_platform="$(CONFIGURED_PLATFORM)"
$(foreach docker, $($*_DOCKERS),\ $(foreach docker, $($*_DOCKERS),\
export docker_image="$(docker)" export docker_image="$(docker)"
export docker_image_name="$(basename $(docker))" export docker_image_name="$(basename $(docker))"