File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717# This script is used to do extra initialization on GCI.
1818
19+ # set up cgroupv2 based on flag CONTAINERD_CGROUPV2 in containerd-env
20+ CONTAINERD_HOME=" /home/containerd"
21+ CONTAINERD_ENV_METADATA=" containerd-env"
22+
23+ if [ -f " ${CONTAINERD_HOME} /${CONTAINERD_ENV_METADATA} " ]; then
24+ source " ${CONTAINERD_HOME} /${CONTAINERD_ENV_METADATA} "
25+ fi
26+
27+ if [ " ${CONTAINERD_CGROUPV2:- " false" } " == " true" ]; then
28+ # check cos image
29+ if uname -a | grep -q cos; then
30+ if ! grep -q ' systemd.unified_cgroup_hierarchy=true' /proc/cmdline; then
31+ echo " Setting up cgroupv2"
32+
33+ mount_path=" /tmp/esp"
34+ mkdir -p " ${mount_path} "
35+ esp_partition=" /dev/sda12"
36+ mount " ${esp_partition} " " ${mount_path} "
37+ sed -i ' s/systemd.unified_cgroup_hierarchy=false/systemd.unified_cgroup_hierarchy=true/g' " ${mount_path} /efi/boot/grub.cfg"
38+ umount " ${mount_path} "
39+ rmdir " ${mount_path} "
40+
41+ echo " Reconfigured grub; rebooting..."
42+ reboot
43+ fi
44+ fi
45+ fi
46+
1947mount /tmp /tmp -o remount,exec,suid
2048# TODO(random-liu): Stop docker and remove this docker thing.
2149usermod -a -G docker jenkins
You can’t perform that action at this time.
0 commit comments