mirror of
https://github.com/rancher/os.git
synced 2025-09-21 18:40:27 +00:00
- Use burmilla GitHub repos - Release under burmilla Docker Hub - GitHub action for create releases - Updated boot image and login banner - Use Debian as default console - Updated system-cron to v0.5.0 - Updated services to latest versions - Bump up kernel to 4.14.206 - Include burmilla/os-debianconsole:v1.9.0 to initrd
34 lines
657 B
Go
34 lines
657 B
Go
package sharedroot
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/burmilla/os/config"
|
|
"github.com/burmilla/os/pkg/init/fsmount"
|
|
|
|
"github.com/docker/docker/pkg/mount"
|
|
)
|
|
|
|
func Setup(c *config.CloudConfig) (*config.CloudConfig, error) {
|
|
if c.Rancher.NoSharedRoot {
|
|
return c, nil
|
|
}
|
|
|
|
if fsmount.IsInitrd() {
|
|
for _, i := range []string{"/mnt", "/media", "/var/lib/system-docker"} {
|
|
if err := os.MkdirAll(i, 0755); err != nil {
|
|
return c, err
|
|
}
|
|
if err := mount.Mount("tmpfs", i, "tmpfs", "rw"); err != nil {
|
|
return c, err
|
|
}
|
|
if err := mount.MakeShared(i); err != nil {
|
|
return c, err
|
|
}
|
|
}
|
|
return c, nil
|
|
}
|
|
|
|
return c, mount.MakeShared("/")
|
|
}
|