
Signed-off-by: Zhang Dewan <513619464@qq.com> --- lib/bootstrap.sh | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh index 417c8662a..124b872bd 100755 --- a/lib/bootstrap.sh +++ b/lib/bootstrap.sh @@ -57,6 +57,27 @@ mount_tmpfs() mount -t tmpfs -o mode=1777 tmp /tmp } +resize_virtual_rootfs() +{ + # tmpfs and rootfs default use 50% memory: + # + # root@taishan200-2280-2s48p-256g--a13 ~# mount | head -n 1 + # rootfs on / type rootfs (rw,size=133395136k,nr_inodes=2084299) + # + # root@taishan200-2280-2s48p-256g--a13 ~# df -h / + # Filesystem Size Used Avail Use% Mounted on + # rootfs 128G 114G 14G 90% / + # + # this maybe cause the docker no space error. + + if mount | head -n 1 | grep "type rootfs" > /dev/null + then + echo "Set the rootfs to 90% memory" + mount -o remount,rw,size=90% rootfs / + fi + +} + get_net_devices() { local net_devices @@ -88,10 +109,6 @@ net_devices_link() test_ping() { - has_cmd ping || { - echo "command not found: ping, skip ping test." - return 0 - } ping -c 1 -w 1 $LKP_SERVER > /dev/null } @@ -411,7 +428,6 @@ install_rpms() [ -d /opt/rpms ] || return echo "install $(ls /opt/rpms/*.rpm)" rpm -ivh --force --ignoresize /opt/rpms/*.rpm - rm -f /opt/rpms/*.rpm } try_get_and_set_distro() @@ -737,6 +753,7 @@ boot_init() mount_kernel_fs mount_tmpfs + resize_virtual_rootfs redirect_stdout_stderr echo 'Kernel tests: Boot OK!' -- 2.23.0