Skip to content

Commit

Permalink
🐛 Setup / as shared mount on alpine (#445)
Browse files Browse the repository at this point in the history
* 🐛 Setup / as shared mount on alpine

Since this is not handled in the boot process, we do this in our devoted file to setup the rootfs configuration

Signed-off-by: Ettore Di Giacinto <[email protected]>

* 🐧 Correctly detect alpine flavors

Signed-off-by: Ettore Di Giacinto <[email protected]>

Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Nov 25, 2022
1 parent 35f09dc commit 2f61a90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions overlay/files-alpine/system/oem/23_rootfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ stages:
boot.before:
- commands:
- mount -o mode=1777,nosuid,nodev -t tmpfs tmpfs /tmp
- mount --make-rshared /
2 changes: 1 addition & 1 deletion pkg/utils/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Flavor() string {

func IsOpenRCBased() bool {
f := Flavor()
return f == "alpine" || f == "alpine-arm-rpi"
return strings.Contains(f, "alpine")
}

func GetInterfaceIP(in string) string {
Expand Down
6 changes: 6 additions & 0 deletions tests/autoinstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ var _ = Describe("kairos autoinstall test", Label("autoinstall-test"), func() {
Expect(out).To(ContainSubstring("/var/lib/longhorn"))
})

It("has rootfs shared mount", func() {
out, err := Sudo(`cat /proc/1/mountinfo | grep ' / / '`)
Expect(err).ToNot(HaveOccurred(), out)
Expect(out).To(ContainSubstring("shared"))
})

It("has corresponding state", func() {
out, err := Sudo("kairos-agent state")
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 2f61a90

Please sign in to comment.