forked from rancher/os
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathenv.go
More file actions
29 lines (23 loc) · 691 Bytes
/
env.go
File metadata and controls
29 lines (23 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package env
import (
"os"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/init/fsmount"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util/network"
)
func Init(c *config.CloudConfig) (*config.CloudConfig, error) {
os.Setenv("PATH", "/sbin:/usr/sbin:/usr/bin")
if fsmount.IsInitrd() {
log.Debug("Booting off an in-memory filesystem")
// Magic setting to tell Docker to do switch_root and not pivot_root
os.Setenv("DOCKER_RAMDISK", "true")
} else {
log.Debug("Booting off a persistent filesystem")
}
return c, nil
}
func Proxy(cfg *config.CloudConfig) (*config.CloudConfig, error) {
network.SetProxyEnvironmentVariables()
return cfg, nil
}