mirror of
https://github.com/rancher/os.git
synced 2025-09-01 06:40:31 +00:00
custom kernel and docker-from-scratch
This commit is contained in:
@@ -1,49 +1,45 @@
|
|||||||
|
|
||||||
DOCKER_BINARY_URL := https://github.com/rancher/docker/releases/download/v1.8.0-rc2-ros/docker-1.8.0-rc2
|
|
||||||
|
|
||||||
include common.make
|
include common.make
|
||||||
|
|
||||||
|
DOCKER_BINARY_URL := https://github.com/rancher/docker/releases/download/v1.8.0-rc2-ros/docker-1.8.0-rc2
|
||||||
|
KERNEL_URL := https://github.com/rancher/os-kernel/releases/download/Ubuntu-3.19.0-26.27/linux-3.19.8-ckt4-rancher-x86.tar.gz
|
||||||
|
DFS_IMAGE := rancher/docker:1.8.0-rc2
|
||||||
|
|
||||||
bin/rancheros:
|
bin/rancheros:
|
||||||
mkdir -p bin
|
mkdir -p $(dir $@)
|
||||||
godep go build -tags netgo -installsuffix netgo -ldflags "-X github.com/rancherio/os/config.VERSION $(VERSION) -linkmode external -extldflags -static" -o $@
|
godep go build -tags netgo -installsuffix netgo -ldflags "-X github.com/rancherio/os/config.VERSION $(VERSION) -linkmode external -extldflags -static" -o $@
|
||||||
strip --strip-all $@
|
strip --strip-all $@
|
||||||
|
|
||||||
|
|
||||||
pwd := $(shell pwd)
|
pwd := $(shell pwd)
|
||||||
include scripts/build-common
|
include scripts/build-common
|
||||||
CD := $(BUILD)/cd
|
|
||||||
|
|
||||||
|
|
||||||
assets/docker:
|
assets/docker:
|
||||||
mkdir -p assets
|
mkdir -p $(dir $@)
|
||||||
curl -L "$(DOCKER_BINARY_URL)" > $@
|
curl -L "$(DOCKER_BINARY_URL)" > $@
|
||||||
chmod +x $@
|
chmod +x $@
|
||||||
|
|
||||||
|
|
||||||
copy-images:
|
$(DIST)/artifacts/vmlinuz: $(BUILD)/kernel/
|
||||||
./scripts/copy-images
|
mkdir -p $(dir $@)
|
||||||
|
mv $(BUILD)/kernel/boot/vmlinuz* $@
|
||||||
|
|
||||||
|
|
||||||
$(DIST)/artifacts/vmlinuz: copy-images
|
$(BUILD)/kernel/:
|
||||||
mkdir -p $(DIST)/artifacts
|
mkdir -p $@ && curl -L "$(KERNEL_URL)" | tar -xzf - -C $@ --strip=0
|
||||||
mv $(BUILD)/kernel/vmlinuz $@
|
|
||||||
|
|
||||||
|
|
||||||
INITRD_DIR := $(BUILD)/initrd
|
$(BUILD)/images.tar: bin/rancheros
|
||||||
|
FORCE_PULL=$(FORCE_PULL) ./scripts/mk-images-tar.sh
|
||||||
|
|
||||||
|
|
||||||
$(BUILD)/images.tar: bin/rancheros os-config.yml
|
$(DIST)/artifacts/initrd: bin/rancheros assets/docker $(BUILD)/kernel/ $(BUILD)/images.tar
|
||||||
FORCE_PULL=$(FORCE_PULL) BUILD=$(BUILD) ./scripts/mk-images-tar.sh
|
mkdir -p $(dir $@)
|
||||||
|
DFS_IMAGE=$(DFS_IMAGE) ./scripts/mk-initrd.sh
|
||||||
|
|
||||||
|
|
||||||
$(DIST)/artifacts/initrd: bin/rancheros assets/docker copy-images $(BUILD)/images.tar
|
$(DIST)/artifacts/rancheros.iso: $(DIST)/artifacts/initrd $(DIST)/artifacts/vmlinuz
|
||||||
mkdir -p $(DIST)/artifacts
|
./scripts/mk-rancheros-iso.sh
|
||||||
INITRD_DIR=$(INITRD_DIR) ./scripts/mk-initrd.sh
|
|
||||||
|
|
||||||
|
|
||||||
$(DIST)/artifacts/rancheros.iso: $(DIST)/artifacts/initrd
|
|
||||||
CD=$(CD) ./scripts/mk-rancheros-iso.sh
|
|
||||||
|
|
||||||
|
|
||||||
$(DIST)/artifacts/iso-checksums.txt: $(DIST)/artifacts/rancheros.iso
|
$(DIST)/artifacts/iso-checksums.txt: $(DIST)/artifacts/rancheros.iso
|
||||||
@@ -62,4 +58,4 @@ build-all: \
|
|||||||
$(DIST)/artifacts/iso-checksums.txt
|
$(DIST)/artifacts/iso-checksums.txt
|
||||||
|
|
||||||
|
|
||||||
.PHONY: build-all version copy-images os-config.yml
|
.PHONY: build-all version
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
cd $(dirname $0)/..
|
cd $(dirname $0)/..
|
||||||
|
. scripts/build-common
|
||||||
|
|
||||||
ln -sf bin/rancheros ./ros
|
ln -sf bin/rancheros ./ros
|
||||||
|
|
||||||
|
@@ -4,6 +4,8 @@ set -ex
|
|||||||
cd $(dirname $0)/..
|
cd $(dirname $0)/..
|
||||||
. scripts/build-common
|
. scripts/build-common
|
||||||
|
|
||||||
|
INITRD_DIR=${BUILD}/initrd
|
||||||
|
|
||||||
rm -rf ${INITRD_DIR}/{usr,init}
|
rm -rf ${INITRD_DIR}/{usr,init}
|
||||||
mkdir -p ${INITRD_DIR}/usr/{bin,share/ros}
|
mkdir -p ${INITRD_DIR}/usr/{bin,share/ros}
|
||||||
|
|
||||||
@@ -15,7 +17,7 @@ cp bin/rancheros ${INITRD_DIR}/usr/bin/ros
|
|||||||
ln -s usr/bin/ros ${INITRD_DIR}/init
|
ln -s usr/bin/ros ${INITRD_DIR}/init
|
||||||
ln -s bin ${INITRD_DIR}/usr/sbin
|
ln -s bin ${INITRD_DIR}/usr/sbin
|
||||||
|
|
||||||
DFS=$(docker create rancher/docker:1.8.0-rc2)
|
DFS=$(docker create ${DFS_IMAGE})
|
||||||
trap "docker rm -fv ${DFS}" EXIT
|
trap "docker rm -fv ${DFS}" EXIT
|
||||||
docker export ${DFS} | tar xvf - -C ${INITRD_DIR} --exclude=usr/bin/dockerlaunch \
|
docker export ${DFS} | tar xvf - -C ${INITRD_DIR} --exclude=usr/bin/dockerlaunch \
|
||||||
--exclude=usr/bin/docker \
|
--exclude=usr/bin/docker \
|
||||||
|
@@ -4,6 +4,8 @@ set -ex
|
|||||||
cd $(dirname $0)/..
|
cd $(dirname $0)/..
|
||||||
. scripts/build-common
|
. scripts/build-common
|
||||||
|
|
||||||
|
CD=${BUILD}/cd
|
||||||
|
|
||||||
mkdir -p ${CD}/boot/isolinux
|
mkdir -p ${CD}/boot/isolinux
|
||||||
|
|
||||||
cp ${DIST}/artifacts/initrd ${CD}/boot
|
cp ${DIST}/artifacts/initrd ${CD}/boot
|
||||||
|
Reference in New Issue
Block a user