There was incorrect sysctl set for build host instead of target image
to disable modules loading/unloading.
Fix this line and comment it - since it was never used and we need
modules loading support for Photon OS AMI
Change-Id: I55cc0da3b515fedf17f8792e20b8fd1f4f88667f
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3612
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Tested-by: Anish Swaminathan <anishs@vmware.com>
| ... | ... |
@@ -61,10 +61,7 @@ sed -i 's/net.ifnames=0//' /boot/grub/grub.cfg |
| 61 | 61 |
sed -i 's/$photon_cmdline/init=\/lib\/systemd\/systemd loglevel=3 ro console=ttyS0 earlyprintk=ttyS0/' /boot/grub/grub.cfg |
| 62 | 62 |
|
| 63 | 63 |
# Disable loading/unloading of modules |
| 64 |
-echo 1 > /proc/sys/kernel/modules_disabled |
|
| 64 |
+#echo "kernel.modules_disabled = 1" > /etc/sysctl.d/modules_disabled.conf |
|
| 65 | 65 |
|
| 66 | 66 |
# Remove kernel symbols |
| 67 |
-if [ -f /boot/system.map* ] |
|
| 68 |
- then |
|
| 69 |
- rm /boot/system.map* |
|
| 70 |
-fi |
|
| 71 | 67 |
\ No newline at end of file |
| 68 |
+rm -f /boot/System.map* |
| ... | ... |
@@ -76,14 +76,14 @@ echo "ServerAliveInterval 420" >> /etc/ssh/ssh_config |
| 76 | 76 |
# Disable root login |
| 77 | 77 |
usermod -L root |
| 78 | 78 |
|
| 79 |
-#disable ipv6 |
|
| 79 |
+# Disable ipv6 |
|
| 80 | 80 |
echo "net.ipv6.conf.all.disable_ipv6 = 1" > /etc/sysctl.d/ipv6-disable.conf |
| 81 | 81 |
|
| 82 | 82 |
# Disable loading/unloading of modules |
| 83 |
-echo 1 > /proc/sys/kernel/modules_disabled |
|
| 83 |
+#echo "kernel.modules_disabled = 1" > /etc/sysctl.d/modules_disabled.conf |
|
| 84 | 84 |
|
| 85 | 85 |
# Remove kernel symbols |
| 86 |
-rm /boot/system.map* |
|
| 86 |
+rm -f /boot/System.map* |
|
| 87 | 87 |
|
| 88 | 88 |
cat > /usr/bin/gcloud << "EOF" |
| 89 | 89 |
docker inspect google/cloud-sdk &> /dev/null |