Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcdc9ca432 | ||
|
|
719722a466 | ||
|
|
628e6ab052 | ||
|
|
4b9e8ac145 | ||
|
|
b3d0b298c5 | ||
|
|
93431c9dbd | ||
|
|
2ec7f4fc9e | ||
|
|
a58d390ea5 | ||
|
|
2ed9befdf2 | ||
|
|
397977b0af | ||
|
|
7c84c5f7e4 |
@@ -60,7 +60,7 @@ ARG DISTRIB_ID=RancherOS
|
||||
|
||||
ARG SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.3/policy.29
|
||||
|
||||
ARG KERNEL_VERSION=4.14.138-rancher
|
||||
ARG KERNEL_VERSION=4.14.176-rancher
|
||||
ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-x86.tar.gz
|
||||
ARG KERNEL_URL_arm64=https://github.com/rancher/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-arm64.tar.gz
|
||||
|
||||
@@ -85,7 +85,7 @@ ARG SYSTEM_DOCKER_VERSION=17.06-ros6
|
||||
ARG SYSTEM_DOCKER_URL_amd64=https://github.com/rancher/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-amd64-${SYSTEM_DOCKER_VERSION}.tgz
|
||||
ARG SYSTEM_DOCKER_URL_arm64=https://github.com/rancher/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-arm64-${SYSTEM_DOCKER_VERSION}.tgz
|
||||
|
||||
ARG USER_DOCKER_VERSION=19.03.15
|
||||
ARG USER_DOCKER_VERSION=19.03.8
|
||||
ARG USER_DOCKER_ENGINE_VERSION=docker-${USER_DOCKER_VERSION}
|
||||
|
||||
ARG AZURE_SERVICE=false
|
||||
@@ -158,9 +158,7 @@ RUN curl -fL ${!BUILD_DOCKER_URL} > /usr/bin/docker && \
|
||||
chmod +x /usr/bin/docker
|
||||
|
||||
# Install dapper
|
||||
# sidestep https://github.com/rancher/dapper/issues/92 with v0.5.4
|
||||
ARG DAPPER_VERSION="v0.5.4"
|
||||
RUN curl -sL https://github.com/rancher/dapper/releases/download/${DAPPER_VERSION}/dapper-$(uname -s)-$(uname -m) > /usr/bin/dapper && \
|
||||
RUN curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m | sed 's/arm.*/arm/'` > /usr/bin/dapper && \
|
||||
chmod +x /usr/bin/dapper
|
||||
|
||||
RUN cd ${DOWNLOADS} && \
|
||||
|
||||
@@ -214,7 +214,7 @@ func shutdown(c *cli.Context) error {
|
||||
// cannot contain slashes.
|
||||
appName := filepath.Base(c.App.Name)
|
||||
if appName == "shutdown" && timeArg != "" {
|
||||
if timeArg != "now" {
|
||||
if timeArg != "now" && timeArg != "+0" {
|
||||
err := fmt.Errorf("Sorry, can't parse '%s' as time value (only 'now' supported)", timeArg)
|
||||
log.Error(err)
|
||||
return err
|
||||
|
||||
85
scripts/tools/flush_crt_nbd.sh
Normal file
85
scripts/tools/flush_crt_nbd.sh
Normal file
@@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
|
||||
# How to use:
|
||||
# make shell-bind
|
||||
# cd scripts/tools/
|
||||
# wget https://link/rancheros-xxx.img
|
||||
# wget http://link/custom.crt
|
||||
#
|
||||
# ./flush_crt_nbd.sh --img rancheros-openstack.img --cert custom.crt
|
||||
# # or
|
||||
# ./flush_crt_nbd.sh --initrd initrd-xxxx --cert custom.crt
|
||||
#
|
||||
# exit
|
||||
# ls ./build/
|
||||
#
|
||||
|
||||
set -ex
|
||||
|
||||
BASE_DIR=/tmp
|
||||
ORIGIN_DIR=/tmp/origin
|
||||
WORK_DIR=/tmp/work
|
||||
|
||||
mkdir -p ${ORIGIN_DIR} ${WORK_DIR} ${DAPPER_SOURCE}/build
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case $1 in
|
||||
--initrd)
|
||||
shift 1
|
||||
INITRD_FILE=$(readlink -f $1)
|
||||
;;
|
||||
--img)
|
||||
shift 1
|
||||
IMG_FILE=$(readlink -f $1)
|
||||
;;
|
||||
--cert)
|
||||
shift 1
|
||||
CERT_FILE=$(readlink -f $1)
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
|
||||
function rebuild_initrd() {
|
||||
local initrd_name=$1
|
||||
local output_dir=$2
|
||||
|
||||
# update and rebuild the initrd
|
||||
pushd ${WORK_DIR}
|
||||
mv initrd-* ${initrd_name}.gz
|
||||
gzip -d ${initrd_name}.gz
|
||||
cpio -i -F ${initrd_name}
|
||||
rm -f ${initrd_name}
|
||||
cat ${CERT_FILE} >> ${WORK_DIR}/usr/etc/ssl/certs/ca-certificates.crt
|
||||
find | cpio -H newc -o | gzip -9 > ${output_dir}/${initrd_name}
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
if [ ! -z ${INITRD_FILE} ]; then
|
||||
cp ${INITRD_FILE} ${WORK_DIR}/
|
||||
rebuild_initrd $(basename ${INITRD_FILE}) ${DAPPER_SOURCE}/build/
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# copy the iso content
|
||||
cp -a ${IMG_FILE} ${IMG_FILE}_new
|
||||
qemu-nbd -c /dev/nbd0 --partition=1 ${IMG_FILE}_new
|
||||
mount /dev/nbd0 ${ORIGIN_DIR}
|
||||
|
||||
# copy the initrd file
|
||||
INITRD_NAME=$(basename ${ORIGIN_DIR}/boot/initrd-*)
|
||||
cp ${ORIGIN_DIR}/boot/initrd-* ${WORK_DIR}/
|
||||
|
||||
rebuild_initrd ${INITRD_NAME} ${ORIGIN_DIR}/boot
|
||||
|
||||
# copy out
|
||||
umount ${ORIGIN_DIR}
|
||||
qemu-nbd -d /dev/nbd0
|
||||
mv ${IMG_FILE}_new ${DAPPER_SOURCE}/build/$(basename ${IMG_FILE})
|
||||
|
||||
# cleanup
|
||||
rm -rf ${WORK_DIR}/
|
||||
Reference in New Issue
Block a user