12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- echo Create initrd layout in $INITRD_DIR
- rm -rf ${INITRD_DIR}
- mkdir -p ${INITRD_DIR}/usr/{etc,lib,bin,share/ros}
- ./scripts/template
- cp -rf assets/selinux ${INITRD_DIR}/usr/etc
- cp build/images.tar ${INITRD_DIR}/usr/share/ros/
- cp bin/ros ${INITRD_DIR}/usr/bin/
- ln -s usr/bin/ros ${INITRD_DIR}/init
- ln -s bin ${INITRD_DIR}/usr/sbin
- ln -s usr/sbin ${INITRD_DIR}/sbin
- curl -SL ${!SYSTEM_DOCKER_URL} | tar --strip-components=1 -xzvf - -C ${INITRD_DIR}/usr/bin/
- # we have diabled the user-proxy so we get rid of system-docker-proxy
- rm -f ${INITRD_DIR}/usr/bin/system-docker-proxy
- cat <<HERE > ${INITRD_DIR}/usr/share/ros/os-release
- NAME="RancherOS"
- VERSION=${VERSION}
- ID=rancheros
- ID_LIKE=
- VERSION_ID=${VERSION}
- PRETTY_NAME="RancherOS ${VERSION}"
- HOME_URL="http://rancher.com/rancher-os/"
- SUPPORT_URL="https://forums.rancher.com/c/rancher-os"
- BUG_REPORT_URL="https://github.com/rancher/os/issues"
- BUILD_ID=
- HERE
- # cache os-services yml file
- if [ -e ".make-vmware" ]; then
- SERVICE_URL=${OS_SERVICES_REPO}/${REPO_VERSION}
- SERVICE_INDEX_URL="${SERVICE_URL}/index.yml"
- SERVICE_OPEN_VMTOOLS_URL="${SERVICE_URL}/o/open-vm-tools.yml"
- SERVICE_INDEX_URL_MD5=$(echo -n ${SERVICE_INDEX_URL}|md5sum|cut -d ' ' -f1)
- SERVICE_OPEN_VMTOOLS_URL_MD5=$(echo -n ${SERVICE_OPEN_VMTOOLS_URL}|md5sum|cut -d ' ' -f1)
- mkdir -p ${INITRD_DIR}/usr/share/ros/services-cache/
- wget -O ${INITRD_DIR}/usr/share/ros/services-cache/${SERVICE_INDEX_URL_MD5} ${SERVICE_INDEX_URL}
- wget -O ${INITRD_DIR}/usr/share/ros/services-cache/${SERVICE_OPEN_VMTOOLS_URL_MD5} ${SERVICE_OPEN_VMTOOLS_URL}
- fi
- # TODO: usr/lib dir is overwritten by the kernel modules and firmware
- ln -s ${INITRD_DIR}/usr/share/ros/os-release ${INITRD_DIR}/usr/lib/
- ln -s ${INITRD_DIR}/usr/share/ros/os-release ${INITRD_DIR}/usr/etc/
- # Support upgrades from old persistent consoles that bind mount these
- touch ${INITRD_DIR}/usr/bin/docker-containerd
- touch ${INITRD_DIR}/usr/bin/docker-containerd-shim
- touch ${INITRD_DIR}/usr/bin/docker
- if [ -e ${DOWNLOADS}/policy.29 ]; then
- mkdir -p ${INITRD_DIR}/usr/etc/selinux/ros/policy/
- cp ${DOWNLOADS}/policy.29 ${INITRD_DIR}/usr/etc/selinux/ros/policy/
- fi
- # make rancher/os-initrd image
- cat <<HERE > ${INITRD_DIR}/../Dockerfile.initrd
- FROM scratch
- COPY initrd/* /
- HERE
- name="os-initrd"
- tag="${OS_REPO}/${name}:${VERSION}${SUFFIX}"
- pushd .
- cd ${INITRD_DIR}/..
- docker build -t ${OS_REPO}/${name} -f Dockerfile.initrd .
- docker tag rancher/${name} ${tag}
- popd
|