diff --git a/build_debian.sh b/build_debian.sh index ed5f38bb2bb2..4838d3c87796 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -192,6 +192,7 @@ echo '[INFO] Install docker' ## Install apparmor utils since they're missing and apparmor is enabled in the kernel ## Otherwise Docker will fail to start sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install apparmor +sudo cp files/image_config/ntp/ntp-apparmor $FILESYSTEM_ROOT/etc/apparmor.d/local/usr.sbin.ntpd sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install apt-transport-https \ ca-certificates \ curl \ diff --git a/files/image_config/ntp/ntp-apparmor b/files/image_config/ntp/ntp-apparmor new file mode 100644 index 000000000000..78edef66a51f --- /dev/null +++ b/files/image_config/ntp/ntp-apparmor @@ -0,0 +1,9 @@ +# Apparmor configuration +# /etc/apparmor.d/local/usr.sbin.ntpd + + # Allow read access to "rw" mount path of fs.squashfs + # Eg: /host/image-HEAD-sonic.../rw/usr/sbin + /**/{,s}bin/ r, + /**/usr/{,s}bin/ r, + /**/usr/local/{,s}bin/ r, +