tests(packer): enable apparmor debug in tests image.

This commit is contained in:
Alexandre Pujol 2024-10-01 17:49:43 +01:00
parent 8730c09b96
commit 08a6f8fb0b
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
6 changed files with 20 additions and 8 deletions

View File

@ -2,7 +2,7 @@
defaults: defaults:
uefi: true uefi: true
ram: '6144' ram: '4096'
cpu: '6' cpu: '6'
boxes: boxes:
@ -14,6 +14,10 @@ boxes:
box: aa-archlinux-kde box: aa-archlinux-kde
uefi: false uefi: false
- name: arch-xfce
box: aa-archlinux-xfce
uefi: false
- name: arch-server - name: arch-server
box: aa-archlinux-server box: aa-archlinux-server
uefi: false uefi: false

View File

@ -77,7 +77,7 @@ write_files:
- path: /etc/default/grub - path: /etc/default/grub
append: true append: true
content: | content: |
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT lsm=landlock,lockdown,yama,integrity,apparmor,bpf" GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT lsm=landlock,lockdown,yama,integrity,apparmor,bpf apparmor.debug=1"
# Set some bash aliases # Set some bash aliases
- path: /etc/skel/.bashrc - path: /etc/skel/.bashrc

View File

@ -79,7 +79,7 @@ write_files:
- path: /etc/default/grub - path: /etc/default/grub
append: true append: true
content: | content: |
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT lsm=landlock,lockdown,yama,integrity,apparmor,bpf" GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT lsm=landlock,lockdown,yama,integrity,apparmor,bpf apparmor.debug=1"
# Set some bash aliases # Set some bash aliases
- path: /etc/skel/.bashrc - path: /etc/skel/.bashrc

View File

@ -56,7 +56,7 @@ write_files:
- path: /etc/default/grub - path: /etc/default/grub
append: true append: true
content: | content: |
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT lsm=landlock,lockdown,yama,integrity,apparmor,bpf" GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT lsm=landlock,lockdown,yama,integrity,apparmor,bpf apparmor.debug=1"
# Set some bash aliases # Set some bash aliases
- path: /etc/skel/.bashrc - path: /etc/skel/.bashrc

View File

@ -24,8 +24,13 @@ main() {
install -Dm0755 $SRC/aa-log-clean /usr/bin/aa-log-clean install -Dm0755 $SRC/aa-log-clean /usr/bin/aa-log-clean
cat $SRC/parser.conf >>/etc/apparmor/parser.conf cat $SRC/parser.conf >>/etc/apparmor/parser.conf
chown -R "$SUDO_USER:$SUDO_USER" "/home/$SUDO_USER/.config/" chown -R "$SUDO_USER:$SUDO_USER" "/home/$SUDO_USER/.config/"
case "$DISTRIBUTION" in case "$DISTRIBUTION" in
arch) pacman --noconfirm -U $SRC/*.pkg.tar.zst ;; arch)
pacman --noconfirm -U $SRC/*.pkg.tar.zst
systemctl start apparmor.service
;;
debian | ubuntu) debian | ubuntu)
apt-get update -y apt-get update -y
apt-get install -y apparmor-profiles build-essential config-package-dev \ apt-get install -y apparmor-profiles build-essential config-package-dev \
@ -34,8 +39,9 @@ main() {
;; ;;
opensuse*) opensuse*)
mv "/home/$SUDO_USER/.bash_aliases" "/home/$SUDO_USER/.alias"
zypper install -y bash-completion git go htop make rsync vim zypper install -y bash-completion git go htop make rsync vim
sudo rpm -i $SRC/*.rpm rpm -i $SRC/*.rpm
;; ;;
esac esac

View File

@ -19,12 +19,14 @@ package_update: true
package_upgrade: true package_upgrade: true
package_reboot_if_required: false package_reboot_if_required: false
packages: packages:
- apparmor-profiles
- bash-completion - bash-completion
- distribution-release
- git - git
- go - golang-packaging
- htop - htop
- make - make
- rsync - rpmbuild
- vim - vim
write_files: write_files: