Various nits

This commit is contained in:
Ole Markus With 2020-02-22 19:39:34 +01:00
parent 7c84e7d962
commit bcafdca7da
1 changed files with 7 additions and 6 deletions

View File

@ -68,19 +68,20 @@ func (b *NetworkBuilder) Build(c *fi.ModelBuilderContext) error {
}
if networking.Cilium != nil {
// systemd v238 includes the bpffs mount by default; and gives an error "has a bad unit file setting" if we try to mount it again (see mount_point_is_api)
var alreadyMounted bool
// bpffs magic number
magic := uint32(0xCAFE4A11)
var fsdata unix.Statfs_t
err := unix.Statfs("/sys/fs/bpf", &fsdata)
if err != nil {
return fmt.Errorf("error checking for /sys/fs/bpf: %v", err)
} else {
alreadyMounted = int32(magic) == int32(fsdata.Type)
}
// systemd v238 includes the bpffs mount by default; and gives an error "has a bad unit file setting" if we try to mount it again (see mount_point_is_api)
var alreadyMounted bool
// bpffs magic number. See https://github.com/torvalds/linux/blob/v4.8/include/uapi/linux/magic.h#L80
magic := uint32(0xCAFE4A11)
alreadyMounted = int32(magic) == int32(fsdata.Type)
if !alreadyMounted {
unit := s(`
[Unit]