Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Commit 2072aaa

Browse files
Work arounds
1 parent 24e676d commit 2072aaa

7 files changed

Lines changed: 59 additions & 12 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ RUN zypper in -y \
7272
vim \
7373
which
7474

75-
RUN curl -L https://github.com/rancher/rancherd/releases/download/v0.0.1-alpha04/rancherd-${ARCH} > /usr/bin/rancherd && \
75+
RUN curl -L https://github.com/rancher/rancherd/releases/download/v0.0.1-alpha05/rancherd-${ARCH} > /usr/bin/rancherd && \
7676
chmod +x /usr/bin/rancherd
7777

7878
ARG CACHEBUST

files/etc/cos/bootargs.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set kernel=/boot/vmlinuz
2+
if [ -n "$recoverylabel" ]; then
3+
set kernelcmd="console=tty1 console=ttyS0 root=live:LABEL=$recoverylabel rd.live.dir=/ rd.live.squashimg=$img panic=5"
4+
else
5+
set kernelcmd="console=tty1 console=ttyS0 root=LABEL=$label cos-img/filename=$img panic=5 security=selinux selinux=1"
6+
fi
7+
8+
set initramfs=/boot/initrd

files/etc/luet/luet.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ repositories:
1313
priority: 1
1414
verify: false
1515
urls:
16-
- "ibuildthecloud/releases-sle"
17-
#- "quay.io/costoolkit/releases-opensuse"
16+
- "quay.io/costoolkit/releases-opensuse"
1817

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=cOS system early rootfs setup
3+
DefaultDependencies=no
4+
After=initrd-root-fs.target
5+
Requires=initrd-root-fs.target
6+
Conflicts=initrd-switch-root.target
7+
8+
[Service]
9+
Type=oneshot
10+
ExecStartPre=/usr/bin/ln -sf -t / /sysroot/system
11+
ExecStart=/usr/bin/cos-setup rootfs
12+
13+
[Install]
14+
RequiredBy=initrd-fs.target
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[Unit]
2+
Description=Rancher Bootstrap
3+
Documentation=https://github.com/rancher/rancherd
4+
Wants=network-online.target
5+
After=network-online.target
6+
7+
[Install]
8+
WantedBy=multi-user.target
9+
10+
[Service]
11+
Type=oneshot
12+
EnvironmentFile=-/etc/default/%N
13+
EnvironmentFile=-/etc/sysconfig/%N
14+
KillMode=process
15+
# Having non-zero Limit*s causes performance problems due to accounting overhead
16+
# in the kernel. We recommend using cgroups to do container-local accounting.
17+
LimitNOFILE=1048576
18+
LimitNPROC=infinity
19+
LimitCORE=infinity
20+
TasksMax=infinity
21+
TimeoutStartSec=0
22+
ExecStart=/usr/bin/rancherd bootstrap

files/system/oem/00_ros-rootfs.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
name: "ROS Rootfs Layout Settings"
22
stages:
3-
rootfs.after:
3+
initramfs:
44
- if: '[ -z "$(blkid -L COS_SYSTEM || true)" ]'
55
commands:
66
- |
7-
set -x
8-
target=/sysroot/usr/local/.ros-state
7+
target=/usr/local/.ros-state
98
109
# Always want the latest update of systemd conf from the image
1110
mkdir -p ${target}/etc/systemd/
12-
rsync -a /sysroot/etc/systemd/ ${target}/etc/systemd/
11+
rsync -av /etc/systemd/ ${target}/etc/systemd/
1312
1413
# Only populate ssh conf once
1514
if [ ! -e ${target}/etc/ssh ]; then
1615
mkdir -p ${target}/etc/ssh/
17-
rsync -a /sysroot/etc/ssh/ ${target}/etc/ssh/
16+
rsync -a /etc/ssh/ ${target}/etc/ssh/
1817
fi
1918
19+
sed -i '/overlay \/home /d' /etc/fstab
20+
sed -i '/overlay \/opt /d' /etc/fstab
21+
nsenter -m -t 1 -- umount /sysroot/home
22+
nsenter -m -t 1 -- umount /sysroot/opt
23+
2024
# setup directories as persistent
2125
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
22-
mkdir -p ${target}/$i /sysroot/$i
23-
mount ${target}/$i /sysroot/$i -t none -o bind
26+
mkdir -p ${target}/$i /$i
27+
nsenter -m -t 1 -- mount /sysroot${target}/$i /sysroot/$i -t none -o bind
2428
done
2529
2630
# This is hidden so that if you run some selinux label checking or relabeling the bind
2731
# mount won't screw up things. If you have two files at different paths they will get
2832
# labeled with two different labels.
2933
mkdir -p ${target}/empty
30-
mount ${target}/empty ${target} -o bind,ro
34+
nsenter -m -t 1 -- mount /sysroot${target}/empty /sysroot${target} -o bind,ro
3135
3236
# ensure /var/log/journal exists so it's labeled correctly
33-
mkdir -p /sysroot/var/log/journal
37+
nsenter -m -t 1 -- mkdir -p /sysroot/var/log/journal
3438
initramfs.after:
3539
- if: '[ -z "$(blkid -L COS_SYSTEM || true)" ]'
3640
commands:

0 commit comments

Comments
 (0)