1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Update vmware iso

This commit is contained in:
Jason-ZW
2018-05-10 04:33:16 +00:00
parent 3b4153f538
commit 013e77fe9d
13 changed files with 28 additions and 115 deletions

View File

@@ -85,6 +85,7 @@ ARG OS_BASE_URL_arm64=https://github.com/rancher/os-base/releases/download/v2018
ARG SYSTEM_DOCKER_VERSION=17.06-ros4
ARG SYSTEM_DOCKER_URL_amd64=https://github.com/niusmallnan/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-amd64-${SYSTEM_DOCKER_VERSION}.tgz
ARG SYSTEM_DOCKER_URL_arm64=https://github.com/niusmallnan/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-arm64-${SYSTEM_DOCKER_VERSION}.tgz
ARG VMWARE_AUTOFORMAT=1
######################################################
# Set up environment and export all ARGS as ENV
@@ -123,7 +124,8 @@ ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
SELINUX_POLICY_URL=${SELINUX_POLICY_URL} \
SYSTEM_DOCKER_URL=SYSTEM_DOCKER_URL_${ARCH} \
SYSTEM_DOCKER_URL_amd64=${SYSTEM_DOCKER_URL_amd64} \
SYSTEM_DOCKER_URL_arm64=${SYSTEM_DOCKER_URL_arm64}
SYSTEM_DOCKER_URL_arm64=${SYSTEM_DOCKER_URL_arm64} \
VMWARE_AUTOFORMAT=${VMWARE_AUTOFORMAT}
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH
RUN mkdir -p ${DOWNLOADS}

View File

@@ -64,16 +64,8 @@ rpi64:
cd scripts/images/raspberry-pi-hypriot64/ \
&& ../../../.dapper
vmware:
rm -rf scripts/images/vmware/assets
mkdir -p scripts/images/vmware/assets/
cp -r dist/ scripts/images/vmware/assets/
cp -r build/ scripts/images/vmware/assets/
scripts/version > scripts/images/vmware/assets/version.txt
cd scripts/images/vmware/ \
&& $(shell cat Dockerfile.dapper | grep '^ARG KERNEL_VERSION_amd64=\S\+' | awk -F ' ' '{print $$NF}') \
$(shell cat Dockerfile.dapper | grep '^ARG DISTRIB_ID=\S\+' | awk -F ' ' '{print $$NF}') \
../../../.dapper
vmware:
INTEGRATION_TESTS=0 ./.dapper vmware-release
help:
@./scripts/help

View File

@@ -0,0 +1 @@
APPEND rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 rancher.autologin=ttyS1 rancher.state.autoformat=[/dev/sda,/dev/vda] rancher.state.dev=LABEL=RANCHER_STATE console=tty1 console=ttyS0 console=ttyS1 printk.devkmsg=on panic=10 ${APPEND}

View File

@@ -1 +0,0 @@
dist

View File

@@ -1,2 +0,0 @@
dist
assets

View File

@@ -1,31 +0,0 @@
FROM ubuntu:16.04
# FROM arm=armhf/ubuntu:16.04 arm64=arm64v8/ubuntu:16.04
ARG DAPPER_HOST_ARCH
ARG OS_SERVICE_VMTOOL=rancher/os-openvmtools:10.1.10-2
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
RUN apt-get update && \
apt-get install -y git cpio curl genisoimage isolinux wget xorriso xz-utils && \
rm -f /bin/sh && ln -s /bin/bash /bin/sh
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \
DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64 \
DOCKER_URL=DOCKER_URL_${ARCH} \
OS_SERVICE_VMTOOL=${OS_SERVICE_VMTOOL}
RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker
ENV DAPPER_ENV REPO TAG DRONE_TAG DISTRIB_ID KERNEL_VERSION_amd64
ENV DAPPER_SOURCE .
ENV DAPPER_OUTPUT ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_RUN_ARGS --privileged
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
ENV HOME ${DAPPER_SOURCE}
ENV KERNEL_VERSION=${KERNEL_VERSION_amd64}
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/build.sh"]

View File

@@ -1,9 +0,0 @@
Vmware Iso
===============
Build by running `dapper` in this folder and the build will produce `./dist/rancheros-vmware.iso`. The iso produced integration with "os-openvmtools".
Pre-request
===============
Need to run `make` or `make release` first, then run `make vmware`.

View File

@@ -1,59 +0,0 @@
#!/bin/bash
set -ex
cd $(dirname $0)/..
CD=$(pwd)
# prepare dapper needed.
rm -rf dist
mkdir -p dist/build
cp -r assets/build/initrd/ dist/build/
# prepare env needed.
DISTRO_INFO=$(cat assets/version.txt)
VERSION=$(echo -e "$DISTRO_INFO" | cut -f3 -d ' ')
COMMIT=$(echo -e "$DISTRO_INFO" | cut -f5 -d ' ')
INITRD=initrd-${VERSION}
ISO=$(echo ${DISTRIB_ID} | tr '[:upper:]' '[:lower:]')-vmware.iso
COMPRESS="xz --format=lzma -9 --memlimit-compress=80% -e"
# prepare vmware tools.
docker pull ${OS_SERVICE_VMTOOL}
docker save ${OS_SERVICE_VMTOOL} | xz -9 > dist/build/initrd/usr/share/ros/images-vmtools.tar
# package initrd.
cd dist/build/initrd/
if [ ! -f ${CD}assets/dist/artifacts/${INITRD} ]; then
echo "Skipping package-iso vmware build: ${INITRD} not found"
exit 1
fi
find | cpio -H newc -o | ${COMPRESS} > ${INITRD}
cd ${CD}
scp -r assets/dist/boot dist/
mkdir -p dist/rancheros
cp dist/build/initrd/${INITRD} dist/boot
cp assets/dist/artifacts/vmlinuz-${KERNEL_VERSION_amd64} dist/boot/
cp /usr/lib/ISOLINUX/isolinux.bin dist/boot/isolinux/
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 dist/boot/isolinux/
cp /usr/lib/syslinux/modules/bios/*.c32 dist/boot/isolinux/
cp assets/dist/artifacts/installer.tar dist/rancheros/
cp assets/dist/artifacts/Dockerfile.amd64 dist/rancheros/
if [ -f dist/rancheros/installer.tar.gz ]; then
rm -rf dist/rancheros/installer.tar.gz
fi
gzip -9 dist/rancheros/installer.tar
cd dist
rm -rf build/
xorriso \
-as mkisofs \
-l -J -R -V "${DISTRIB_ID}" \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
-o $ISO .

View File

@@ -32,7 +32,11 @@ mkdir -p ${DIST}/boot/isolinux/
cat scripts/isolinux.cfg | envsubst > ${DIST}/boot/isolinux/isolinux.cfg
cat scripts/isolinux_label.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/linux-current.cfg
#cat scripts/isolinux_label.cfg | LABEL=debug APPEND="rancher.debug=true" envsubst > ${DIST}/boot/linux-previous.cfg
cat scripts/global.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/global.cfg
if [ "$VMWARE_AUTOFORMAT" = 1 ] && [ -e ".make-vmware" ];then
cat scripts/global-vmware.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/global.cfg
else
cat scripts/global.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/global.cfg
fi
cp scripts/rancher.png ${DIST}/boot/

View File

@@ -4,6 +4,9 @@ set -ex
cd $(dirname $0)/..
source ./scripts/version
export REPO_VERSION=$VERSION
if [[ -z "$GIT_TAG" ]]; then
export REPO_VERSION=master
fi
export COMPRESS="xz --format=lzma -9 --memlimit-compress=80% -e"
./scripts/ci

View File

@@ -12,6 +12,11 @@ for i in $IMAGES; do
fi
done
if [ -e ".make-vmware" ]; then
docker pull rancher/os-openvmtools:10.2.5-1
IMAGES="$IMAGES rancher/os-openvmtools:10.2.5-1"
fi
echo "tar-images: docker save ${IMAGES} > build/images.tar"
docker save ${IMAGES} | xz > build/images.tar
echo "tar-images: DONE"

View File

@@ -16,7 +16,7 @@ if [ -z "$VERSION" ]; then
fi
INITRD=initrd-${VERSION}
export VERSION COMMIT INITRD
export VERSION COMMIT INITRD GIT_TAG
# Suffix
export SUFFIX=""

8
scripts/vmware-release Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -ex
cd $(dirname $0)/..
touch .make-vmware
./scripts/release