Skip to content

Commit

Permalink
[build] RFS split improvements
Browse files Browse the repository at this point in the history
* add more files to RFS_DEB_FILES
* improved umount in build_debian.sh (taken from #16672)
* explicit RFS_SPLIT_LAST_STAGE=n when building the first stage

Signed-off-by: Yakiv Huryk <[email protected]>
  • Loading branch information
Yakiv-Huryk committed Oct 2, 2023
1 parent 122cd6b commit b6f9006
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Makefile.cache
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@ endef

RFS_DEP_FILES := $(wildcard \
$(addprefix scripts/, build_debian_base_system.sh prepare_debian_image_buildinfo.sh build_mirror_config.sh) \
$(wildcard files/initramfs-tools/*) \
$(shell git ls-files files/initramfs-tools) \
$(shell git ls-files files/image_config) \
$(shell git ls-files files/apparmor) \
$(shell git ls-files files/apt) \
$(wildcard files/sshd/*) \
$(wildcard files/dhcp/*) \
src/sonic-build-hooks/buildinfo/trusted.gpg.d \
Expand Down
3 changes: 1 addition & 2 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,7 @@ if [[ $RFS_SPLIT_FIRST_STAGE == y ]]; then
## Kill the processes
sudo LANG=C chroot $FILESYSTEM_ROOT fuser -km /proc || true
## Wait fuser fully kill the processes
sleep 15
sudo LANG=C chroot $FILESYSTEM_ROOT umount /proc
sudo timeout 15s bash -c 'until LANG=C chroot $0 umount /proc; do sleep 1; done' $FILESYSTEM_ROOT || true

sudo rm -f $TARGET_PATH/$RFS_SQUASHFS_NAME
sudo mksquashfs $FILESYSTEM_ROOT $TARGET_PATH/$RFS_SQUASHFS_NAME -Xcompression-level 1
Expand Down
1 change: 1 addition & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_RFS_TARGETS)) : $(TARGET_PATH)/% : \
export sonicadmin_user="$(USERNAME)"
export sonic_asic_platform="$(patsubst %-$(CONFIGURED_ARCH),%,$(CONFIGURED_PLATFORM))"
export RFS_SPLIT_FIRST_STAGE=y
export RFS_SPLIT_LAST_STAGE=n

j2 -f env files/initramfs-tools/union-mount.j2 onie-image.conf > files/initramfs-tools/union-mount
j2 -f env files/initramfs-tools/arista-convertfs.j2 onie-image.conf > files/initramfs-tools/arista-convertfs
Expand Down

0 comments on commit b6f9006

Please sign in to comment.