build: improve support for aa 5.0

This commit is contained in:
Alexandre Pujol 2025-08-29 20:48:01 +02:00
parent 2bb42bfca2
commit 57251820e1
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
2 changed files with 13 additions and 2 deletions

View file

@ -6,6 +6,7 @@ package prepare
import (
"fmt"
"strings"
"github.com/roddhjav/apparmor.d/pkg/prebuild"
)
@ -92,6 +93,15 @@ func (p Configure) Apply() ([]string, error) {
if err := removeFiles(remove); err != nil {
return res, err
}
// @{pci_bus} was upstreamed in 5.0
path := prebuild.RootApparmord.Join("tunables/multiarch.d/system")
out, err := path.ReadFileAsString()
if err != nil {
return res, err
}
out = strings.ReplaceAll(out, "@{pci_bus}=pci@{hex4}:@{hex2}", "")
return res, path.WriteFile([]byte(out))
}
return res, nil
}