[build]: Fix marvell-armhf build hung issue (#10156) (#10229)

Why I did it
The marvel-armhf build is hung, it does not exit after waiting for a long time.
It is caused by the process /etc/entropy.py which is started by the postinst script in target/debs/buster/sonic-platform-nokia-7215_1.0_armhf.deb
This commit is contained in:
xumia 2022-03-15 10:03:54 +08:00 committed by Judy Joseph
parent 26079ac8f9
commit 9999b9cf63

View File

@ -653,6 +653,11 @@ clean_proc() {
} }
trap_push clean_proc trap_push clean_proc
sudo mount proc /proc -t proc || true sudo mount proc /proc -t proc || true
if [[ $CONFIGURED_ARCH == armhf ]]; then
# A workaround to fix the armhf build hung issue, caused by sonic-platform-nokia-7215_1.0_armhf.deb post installation script
ps -eo pid,cmd | grep python | grep "/etc/entropy.py" | awk '{print $1}' | xargs sudo kill -9 2>/dev/null || true
fi
sudo mkdir $FILESYSTEM_ROOT/target sudo mkdir $FILESYSTEM_ROOT/target
sudo mount --bind target $FILESYSTEM_ROOT/target sudo mount --bind target $FILESYSTEM_ROOT/target
sudo LANG=C DOCKER_HOST="$DOCKER_HOST" chroot $FILESYSTEM_ROOT docker info sudo LANG=C DOCKER_HOST="$DOCKER_HOST" chroot $FILESYSTEM_ROOT docker info