mirror of
https://github.com/rancher/os.git
synced 2025-08-10 02:58:15 +00:00
Work arounds
This commit is contained in:
parent
24e676d156
commit
2072aaad9c
@ -72,7 +72,7 @@ RUN zypper in -y \
|
|||||||
vim \
|
vim \
|
||||||
which
|
which
|
||||||
|
|
||||||
RUN curl -L https://github.com/rancher/rancherd/releases/download/v0.0.1-alpha04/rancherd-${ARCH} > /usr/bin/rancherd && \
|
RUN curl -L https://github.com/rancher/rancherd/releases/download/v0.0.1-alpha05/rancherd-${ARCH} > /usr/bin/rancherd && \
|
||||||
chmod +x /usr/bin/rancherd
|
chmod +x /usr/bin/rancherd
|
||||||
|
|
||||||
ARG CACHEBUST
|
ARG CACHEBUST
|
||||||
|
8
files/etc/cos/bootargs.cfg
Normal file
8
files/etc/cos/bootargs.cfg
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
set kernel=/boot/vmlinuz
|
||||||
|
if [ -n "$recoverylabel" ]; then
|
||||||
|
set kernelcmd="console=tty1 console=ttyS0 root=live:LABEL=$recoverylabel rd.live.dir=/ rd.live.squashimg=$img panic=5"
|
||||||
|
else
|
||||||
|
set kernelcmd="console=tty1 console=ttyS0 root=LABEL=$label cos-img/filename=$img panic=5 security=selinux selinux=1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
set initramfs=/boot/initrd
|
@ -13,6 +13,5 @@ repositories:
|
|||||||
priority: 1
|
priority: 1
|
||||||
verify: false
|
verify: false
|
||||||
urls:
|
urls:
|
||||||
- "ibuildthecloud/releases-sle"
|
- "quay.io/costoolkit/releases-opensuse"
|
||||||
#- "quay.io/costoolkit/releases-opensuse"
|
|
||||||
|
|
||||||
|
14
files/lib/systemd/system/cos-setup-rootfs.service
Normal file
14
files/lib/systemd/system/cos-setup-rootfs.service
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=cOS system early rootfs setup
|
||||||
|
DefaultDependencies=no
|
||||||
|
After=initrd-root-fs.target
|
||||||
|
Requires=initrd-root-fs.target
|
||||||
|
Conflicts=initrd-switch-root.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStartPre=/usr/bin/ln -sf -t / /sysroot/system
|
||||||
|
ExecStart=/usr/bin/cos-setup rootfs
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
RequiredBy=initrd-fs.target
|
22
files/lib/systemd/system/rancherd.service
Normal file
22
files/lib/systemd/system/rancherd.service
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Rancher Bootstrap
|
||||||
|
Documentation=https://github.com/rancher/rancherd
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
EnvironmentFile=-/etc/default/%N
|
||||||
|
EnvironmentFile=-/etc/sysconfig/%N
|
||||||
|
KillMode=process
|
||||||
|
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
||||||
|
# in the kernel. We recommend using cgroups to do container-local accounting.
|
||||||
|
LimitNOFILE=1048576
|
||||||
|
LimitNPROC=infinity
|
||||||
|
LimitCORE=infinity
|
||||||
|
TasksMax=infinity
|
||||||
|
TimeoutStartSec=0
|
||||||
|
ExecStart=/usr/bin/rancherd bootstrap
|
@ -1,36 +1,40 @@
|
|||||||
name: "ROS Rootfs Layout Settings"
|
name: "ROS Rootfs Layout Settings"
|
||||||
stages:
|
stages:
|
||||||
rootfs.after:
|
initramfs:
|
||||||
- if: '[ -z "$(blkid -L COS_SYSTEM || true)" ]'
|
- if: '[ -z "$(blkid -L COS_SYSTEM || true)" ]'
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
set -x
|
target=/usr/local/.ros-state
|
||||||
target=/sysroot/usr/local/.ros-state
|
|
||||||
|
|
||||||
# Always want the latest update of systemd conf from the image
|
# Always want the latest update of systemd conf from the image
|
||||||
mkdir -p ${target}/etc/systemd/
|
mkdir -p ${target}/etc/systemd/
|
||||||
rsync -a /sysroot/etc/systemd/ ${target}/etc/systemd/
|
rsync -av /etc/systemd/ ${target}/etc/systemd/
|
||||||
|
|
||||||
# Only populate ssh conf once
|
# Only populate ssh conf once
|
||||||
if [ ! -e ${target}/etc/ssh ]; then
|
if [ ! -e ${target}/etc/ssh ]; then
|
||||||
mkdir -p ${target}/etc/ssh/
|
mkdir -p ${target}/etc/ssh/
|
||||||
rsync -a /sysroot/etc/ssh/ ${target}/etc/ssh/
|
rsync -a /etc/ssh/ ${target}/etc/ssh/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sed -i '/overlay \/home /d' /etc/fstab
|
||||||
|
sed -i '/overlay \/opt /d' /etc/fstab
|
||||||
|
nsenter -m -t 1 -- umount /sysroot/home
|
||||||
|
nsenter -m -t 1 -- umount /sysroot/opt
|
||||||
|
|
||||||
# setup directories as persistent
|
# setup directories as persistent
|
||||||
for i in root opt home var/lib/rancher var/lib/kubelet etc/systemd etc/rancher etc/ssh usr/libexec var/log var/lib/wicked; do
|
for i in root opt home var/lib/rancher var/lib/kubelet etc/systemd etc/rancher etc/ssh usr/libexec var/log var/lib/wicked; do
|
||||||
mkdir -p ${target}/$i /sysroot/$i
|
mkdir -p ${target}/$i /$i
|
||||||
mount ${target}/$i /sysroot/$i -t none -o bind
|
nsenter -m -t 1 -- mount /sysroot${target}/$i /sysroot/$i -t none -o bind
|
||||||
done
|
done
|
||||||
|
|
||||||
# This is hidden so that if you run some selinux label checking or relabeling the bind
|
# This is hidden so that if you run some selinux label checking or relabeling the bind
|
||||||
# mount won't screw up things. If you have two files at different paths they will get
|
# mount won't screw up things. If you have two files at different paths they will get
|
||||||
# labeled with two different labels.
|
# labeled with two different labels.
|
||||||
mkdir -p ${target}/empty
|
mkdir -p ${target}/empty
|
||||||
mount ${target}/empty ${target} -o bind,ro
|
nsenter -m -t 1 -- mount /sysroot${target}/empty /sysroot${target} -o bind,ro
|
||||||
|
|
||||||
# ensure /var/log/journal exists so it's labeled correctly
|
# ensure /var/log/journal exists so it's labeled correctly
|
||||||
mkdir -p /sysroot/var/log/journal
|
nsenter -m -t 1 -- mkdir -p /sysroot/var/log/journal
|
||||||
initramfs.after:
|
initramfs.after:
|
||||||
- if: '[ -z "$(blkid -L COS_SYSTEM || true)" ]'
|
- if: '[ -z "$(blkid -L COS_SYSTEM || true)" ]'
|
||||||
commands:
|
commands:
|
||||||
|
Loading…
Reference in New Issue
Block a user