mirror of
https://github.com/rancher/os.git
synced 2025-07-07 20:08:37 +00:00
Merge pull request #860 from imikushin/rootfs-build-fix
Fix building rootfs for arm on amd64
This commit is contained in:
commit
c09b807991
@ -35,6 +35,7 @@ ARG TOOLCHAIN
|
|||||||
ENV TOOLCHAIN ${TOOLCHAIN}
|
ENV TOOLCHAIN ${TOOLCHAIN}
|
||||||
|
|
||||||
RUN if [ "${TOOLCHAIN}" != "" ] && ! which ${TOOLCHAIN}-gcc; then \
|
RUN if [ "${TOOLCHAIN}" != "" ] && ! which ${TOOLCHAIN}-gcc; then \
|
||||||
|
apt-get update && \
|
||||||
apt-get install -y gcc-${TOOLCHAIN} g++-${TOOLCHAIN} \
|
apt-get install -y gcc-${TOOLCHAIN} g++-${TOOLCHAIN} \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
5
Makefile
5
Makefile
@ -3,6 +3,7 @@ DEV_BUILD := 0
|
|||||||
HOST_ARCH := amd64
|
HOST_ARCH := amd64
|
||||||
ARCH := amd64
|
ARCH := amd64
|
||||||
SUFFIX := $(if $(filter-out amd64,$(ARCH)),_$(ARCH))
|
SUFFIX := $(if $(filter-out amd64,$(ARCH)),_$(ARCH))
|
||||||
|
HOST_SUFFIX := $(if $(filter-out amd64,$(HOST_ARCH)),_$(HOST_ARCH))
|
||||||
|
|
||||||
include build.conf
|
include build.conf
|
||||||
include build.conf.$(ARCH)
|
include build.conf.$(ARCH)
|
||||||
@ -55,7 +56,7 @@ build/kernel/:
|
|||||||
|
|
||||||
dist/artifacts/initrd: bin/ros assets/docker assets/selinux/policy.29 build/kernel/ build/images.tar assets/modules.tar.gz
|
dist/artifacts/initrd: bin/ros assets/docker assets/selinux/policy.29 build/kernel/ build/images.tar assets/modules.tar.gz
|
||||||
mkdir -p $(dir $@)
|
mkdir -p $(dir $@)
|
||||||
SUFFIX=$(SUFFIX) DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) \
|
HOST_SUFFIX=$(HOST_SUFFIX) SUFFIX=$(SUFFIX) DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) \
|
||||||
KERNEL_RELEASE=$(KERNEL_RELEASE) ARCH=$(ARCH) ./scripts/mk-initrd.sh $@
|
KERNEL_RELEASE=$(KERNEL_RELEASE) ARCH=$(ARCH) ./scripts/mk-initrd.sh $@
|
||||||
|
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ build/images.tar: build/host_ros build/os-config.yml
|
|||||||
|
|
||||||
dist/artifacts/rootfs.tar.gz: bin/ros assets/docker build/images.tar assets/selinux/policy.29 assets/modules.tar.gz
|
dist/artifacts/rootfs.tar.gz: bin/ros assets/docker build/images.tar assets/selinux/policy.29 assets/modules.tar.gz
|
||||||
mkdir -p $(dir $@)
|
mkdir -p $(dir $@)
|
||||||
SUFFIX=$(SUFFIX) DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) IS_ROOTFS=1 ./scripts/mk-initrd.sh $@
|
HOST_SUFFIX=$(HOST_SUFFIX) SUFFIX=$(SUFFIX) DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) IS_ROOTFS=1 ./scripts/mk-initrd.sh $@
|
||||||
|
|
||||||
|
|
||||||
dist/artifacts/iso-checksums.txt: dist/artifacts/rancheros.iso
|
dist/artifacts/iso-checksums.txt: dist/artifacts/rancheros.iso
|
||||||
|
@ -4,6 +4,7 @@ set -ex
|
|||||||
TARGET=$(pwd)/${1}
|
TARGET=$(pwd)/${1}
|
||||||
|
|
||||||
SUFFIX=${SUFFIX:-""}
|
SUFFIX=${SUFFIX:-""}
|
||||||
|
HOST_SUFFIX=${HOST_SUFFIX:-""}
|
||||||
DFS_IMAGE=${DFS_IMAGE:?"DFS_IMAGE not set"}
|
DFS_IMAGE=${DFS_IMAGE:?"DFS_IMAGE not set"}
|
||||||
IS_ROOTFS=${IS_ROOTFS:-0}
|
IS_ROOTFS=${IS_ROOTFS:-0}
|
||||||
|
|
||||||
@ -53,7 +54,7 @@ docker export ${DFS_ARCH} | tar xvf - -C ${INITRD_DIR} --exclude=usr/bin/dockerl
|
|||||||
usr
|
usr
|
||||||
|
|
||||||
if [ "$IS_ROOTFS" == "1" ]; then
|
if [ "$IS_ROOTFS" == "1" ]; then
|
||||||
DFS=$(docker run -d --privileged -v /lib/modules/$(uname -r):/lib/modules/$(uname -r) ${DFS_IMAGE}${SUFFIX})
|
DFS=$(docker run -d --privileged -v /lib/modules/$(uname -r):/lib/modules/$(uname -r) ${DFS_IMAGE}${HOST_SUFFIX})
|
||||||
trap "docker rm -fv ${DFS_ARCH} ${DFS}" EXIT
|
trap "docker rm -fv ${DFS_ARCH} ${DFS}" EXIT
|
||||||
docker exec -i ${DFS} docker load < ${BUILD}/images.tar
|
docker exec -i ${DFS} docker load < ${BUILD}/images.tar
|
||||||
docker stop ${DFS}
|
docker stop ${DFS}
|
||||||
|
Loading…
Reference in New Issue
Block a user