diff --git a/cmd/prebuild/main.go b/cmd/prebuild/main.go index 51bbca85..25e422cf 100644 --- a/cmd/prebuild/main.go +++ b/cmd/prebuild/main.go @@ -20,18 +20,18 @@ func init() { // Define the tasks applied by default prepare.Register( - "synchronise", - "ignore", - "merge", - "configure", - "setflags", - "overwrite", - "systemd-default", + "synchronise", // Initialize a new clean apparmor.d build directory + "ignore", // Ignore profiles and files from dist/ignore + "merge", // Merge profiles (from group/, profiles-*-*/) to a unified apparmor.d directory + "configure", // Set distribution specificities + "setflags", // Set flags as definied in dist/flags + "overwrite", // Overwrite dummy upstream profiles + "systemd-default", // Set systemd unit drop in files for dbus profiles ) // Build tasks applied by default builder.Register( - "userspace", // Resolve variable in the userspace profile + "userspace", // Resolve variable in the userspace profile "dev", // Temporary fix for #74, #80 & #235 ) @@ -65,9 +65,6 @@ func init() { /etc/apparmor.d/whonix-firewall ` } - if prebuild.ABI == 3 { - builder.Register("abi3") - } } func main() { diff --git a/pkg/prebuild/cli/cli.go b/pkg/prebuild/cli/cli.go index e629b46c..da19c117 100644 --- a/pkg/prebuild/cli/cli.go +++ b/pkg/prebuild/cli/cli.go @@ -86,21 +86,11 @@ func Prebuild() { builder.Register("enforce") } - switch abi { - case 3: - prebuild.ABI = 3 - builder.Register("abi3") - case 4: - prebuild.ABI = 4 - for i, b := range builder.Builds { - if b.Name() == "abi3" { - builder.Builds = append(builder.Builds[:i], builder.Builds[i+1:]...) - break - } - } - case nilABI: - default: - logging.Fatal("ABI %d not supported", abi) + if abi != nilABI { + prebuild.ABI = abi + } + if prebuild.ABI == 3 { + builder.Register("abi3") // Convert all profiles from abi 4.0 to abi 3.0 } if file != "" { diff --git a/pkg/prebuild/prepare/merge.go b/pkg/prebuild/prepare/merge.go index 75945b81..d2c72000 100644 --- a/pkg/prebuild/prepare/merge.go +++ b/pkg/prebuild/prepare/merge.go @@ -20,7 +20,7 @@ func init() { RegisterTask(&Merge{ Base: prebuild.Base{ Keyword: "merge", - Msg: "Merge all profiles into a unified apparmor.d directory", + Msg: "Merge profiles (from group/, profiles-*-*/) to a unified apparmor.d directory", }, }) }