mirror of
https://github.com/rancher/os.git
synced 2025-09-17 07:30:42 +00:00
speed up the full build by swapping lzma with gzip if run with --dev flag
This commit is contained in:
5
Makefile
5
Makefile
@@ -1,5 +1,6 @@
|
||||
include build.conf
|
||||
FORCE_PULL := 0
|
||||
DEV_BUILD := 0
|
||||
|
||||
|
||||
compile: bin/rancheros
|
||||
@@ -24,7 +25,7 @@ bin/rancheros: ros-build-image
|
||||
|
||||
|
||||
build-all: ros-build-image
|
||||
./scripts/docker-run.sh make -f Makefile.docker FORCE_PULL=$(FORCE_PULL) $@
|
||||
./scripts/docker-run.sh make -f Makefile.docker DEV_BUILD=$(DEV_BUILD) FORCE_PULL=$(FORCE_PULL) $@
|
||||
|
||||
mkdir -p bin dist
|
||||
docker cp ros-build:/go/src/github.com/rancherio/os/bin/rancheros bin/
|
||||
@@ -32,7 +33,7 @@ build-all: ros-build-image
|
||||
|
||||
|
||||
installer: ros-build-image
|
||||
./scripts/docker-run.sh --rm make -f Makefile.docker FORCE_PULL=$(FORCE_PULL) $@
|
||||
./scripts/docker-run.sh --rm make -f Makefile.docker DEV_BUILD=$(DEV_BUILD) FORCE_PULL=$(FORCE_PULL) $@
|
||||
|
||||
|
||||
version:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
include build.conf
|
||||
FORCE_PULL := 0
|
||||
DEV_BUILD := 0
|
||||
|
||||
|
||||
bin/rancheros:
|
||||
@@ -33,7 +34,7 @@ $(BUILD)/images.tar: bin/rancheros
|
||||
|
||||
$(DIST)/artifacts/initrd: bin/rancheros assets/docker $(BUILD)/kernel/ $(BUILD)/images.tar
|
||||
mkdir -p $(dir $@)
|
||||
DFS_IMAGE=$(DFS_IMAGE) ./scripts/mk-initrd.sh
|
||||
DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) ./scripts/mk-initrd.sh
|
||||
|
||||
|
||||
$(DIST)/artifacts/rancheros.iso: minimal
|
||||
|
11
build.sh
11
build.sh
@@ -1,6 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ "$1" != "--dev" ]; then
|
||||
echo
|
||||
echo Running \"production\" build. Will use lzma to compress initrd, which is somewhat slow...
|
||||
echo Ctrl+C if you don\'t want this.
|
||||
echo
|
||||
echo For \"developer\" builds, run ./build.sh --dev
|
||||
echo
|
||||
make all
|
||||
else
|
||||
make DEV_BUILD=1 all
|
||||
fi
|
||||
|
||||
|
||||
ls -lh dist/artifacts
|
||||
|
@@ -9,4 +9,4 @@ fi
|
||||
|
||||
docker build -t ros-build-base -f Dockerfile.build-base .
|
||||
docker build -t ros-build -f Dockerfile.build .
|
||||
./scripts/docker-run.sh --name ros-ci make -f Makefile.docker minimal integration-tests
|
||||
./scripts/docker-run.sh --name ros-ci make -f Makefile.docker DEV_BUILD=1 minimal integration-tests
|
||||
|
@@ -27,4 +27,10 @@ docker export ${DFS} | tar xvf - -C ${INITRD_DIR} --exclude=usr/bin/dockerlaunc
|
||||
--exclude=usr/libexec/git-core \
|
||||
usr
|
||||
|
||||
cd ${INITRD_DIR} && find | cpio -H newc -o | lzma -c > ${DIST}/artifacts/initrd
|
||||
if [ "$DEV_BUILD" == "1" ]; then
|
||||
COMPRESS=gzip
|
||||
else
|
||||
COMPRESS=lzma
|
||||
fi
|
||||
|
||||
cd ${INITRD_DIR} && find | cpio -H newc -o | ${COMPRESS} > ${DIST}/artifacts/initrd
|
||||
|
@@ -84,7 +84,7 @@ if [ "$REBUILD" == "1" ]; then
|
||||
if [ ! -d ${INITRD_TMP} ]; then
|
||||
mkdir -p ${INITRD_TMP}
|
||||
pushd ${INITRD_TMP}
|
||||
xz -dc ${INITRD} | cpio -idmv
|
||||
xz -dfc ${INITRD} | gunzip -f | cpio -idm
|
||||
popd
|
||||
fi
|
||||
|
||||
|
@@ -5,6 +5,6 @@ cd $(dirname $0)/../../../..
|
||||
|
||||
cp ./tests/integration/assets/test_02/build.conf ./
|
||||
|
||||
make -f Makefile.docker minimal
|
||||
make -f Makefile.docker DEV_BUILD=1 minimal
|
||||
|
||||
exec ./scripts/run --qemu --no-rebuild --fresh
|
||||
|
Reference in New Issue
Block a user