Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Make sure gpio exported before apparmor setup #2
Closed
Jump to file or symbol
Failed to load files and symbols.
| @@ -104,21 +104,21 @@ func (iface *GpioInterface) ConnectedPlugSnippet(plug *interfaces.Plug, slot *in | ||
| // PermanentSlotSnippet - no slot snippets provided | ||
| func (iface *GpioInterface) PermanentSlotSnippet(slot *interfaces.Slot, securitySystem interfaces.SecuritySystem) ([]byte, error) { | ||
| - return nil, nil | ||
| -} | ||
| - | ||
| -// ConnectedSlotSnippet - no slot snippets provided | ||
| -func (iface *GpioInterface) ConnectedSlotSnippet(plug *interfaces.Plug, slot *interfaces.Slot, securitySystem interfaces.SecuritySystem) ([]byte, error) { | ||
| switch securitySystem { | ||
| case interfaces.SecurityUDev: | ||
| // NOTE: nothing unexports this GPIO when the slot is disconnected but | ||
| // AFAIK this doesn't hurt. | ||
| - snippet := fmt.Sprintf(`ACTION=="add", SUBSYSTEM=="gpio", RUN+="/bin/echo %v > /syc/class/gpio/export"`, slot.Attrs["number"]) | ||
| + snippet := fmt.Sprintf(`SUBSYSTEM=="gpio", RUN+="/bin/sh -c '/bin/echo %v > /sys/class/gpio/export'"`, slot.Attrs["number"]) | ||
jocave
|
||
| return []byte(snippet), nil | ||
| } | ||
| return nil, nil | ||
| } | ||
| +// ConnectedSlotSnippet - no slot snippets provided | ||
| +func (iface *GpioInterface) ConnectedSlotSnippet(plug *interfaces.Plug, slot *interfaces.Slot, securitySystem interfaces.SecuritySystem) ([]byte, error) { | ||
| + return nil, nil | ||
| +} | ||
| + | ||
| // AutoConnect returns whether interface should be auto-connected by default | ||
| func (iface *GpioInterface) AutoConnect() bool { | ||
| return false | ||
Moving to PermanentSlotSnippet is fine. It'll be the core or gadget snap that is the providing side, so no big deal moving the exports IMO.