1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

Merge power funcs and fix build issues

This commit is contained in:
Darren Shepherd
2015-02-16 22:09:26 -07:00
parent d656da6a26
commit 76e5cf8d50
5 changed files with 14 additions and 19 deletions

View File

@@ -55,9 +55,6 @@ var (
"/sbin/modprobe": "/busybox",
"/var/run": "/run",
DOCKER: "/docker",
"/sbin/poweroff": "/init",
"/sbin/halt": "/init",
"/sbin/reboot": "/init",
}
)

View File

@@ -5,13 +5,12 @@ import (
"errors"
"os"
"strconv"
"syscall"
"strings"
"syscall"
"github.com/fsouza/go-dockerclient"
)
const (
dockerPath = "unix:///var/run/system-docker.sock"
dockerCGroupsFile = "/proc/self/cgroup"
@@ -116,7 +115,6 @@ func shutDownContainers() error {
return nil
}
func getCurrentContainerId() (string, error) {
file, err := os.Open(dockerCGroupsFile)
@@ -131,7 +129,7 @@ func getCurrentContainerId() (string, error) {
line := fileReader.Text()
parts := strings.Split(line, "/")
while len(parts) != 3 {
for len(parts) != 3 {
if !fileReader.Scan() {
return "", errors.New("Found no docker cgroups")
}
@@ -148,4 +146,3 @@ func getCurrentContainerId() (string, error) {
return parts[len(parts)-1:][0], nil
}

View File

@@ -5,7 +5,7 @@ set -x
cd $(dirname $0)/..
apt-get update
apt-get install -y curl rsync build-essential syslinux xorriso libblkid-dev
apt-get install -y curl rsync build-essential syslinux xorriso libblkid-dev libmount-dev libselinux1-dev
curl -sL https://github.com/ibuildthecloud/docker/releases/download/v1.5.0-rancher-2/docker-1.5.0 > /usr/bin/docker

View File

@@ -1,3 +1,4 @@
FROM base
RUN rm /sbin/poweroff /sbin/reboot /sbin/halt
COPY scripts/dockerimages/scripts/console.sh /
CMD ["/console.sh"]

View File

@@ -1,7 +1,7 @@
package util
/*
#cgo LDFLAGS: -lmount -lblkid -luuid
#cgo LDFLAGS: -lmount -lblkid -luuid -lselinux
#include<blkid/blkid.h>
#include<libmount/libmount.h>
#include<stdlib.h>