Skip to content

Commit

Permalink
Adding ubuntu c3os image changes, also overlay files for different pr… (
Browse files Browse the repository at this point in the history
#104)

* Adding ubuntu c3os image changes, also overlay files for different provider support.

* Delete overlay directory

Signed-off-by: vipsharm <sharma.vipin@gmail.com>

* Update Earthfile

Signed-off-by: vipsharm <sharma.vipin@gmail.com>

* Revert "Delete overlay directory"

This reverts commit cf1fe38.

* Delete overlay/k8s directory

Signed-off-by: vipsharm <sharma.vipin@gmail.com>

* Update Dockerfile.ubuntu

Signed-off-by: vipsharm <sharma.vipin@gmail.com>

Signed-off-by: vipsharm <sharma.vipin@gmail.com>
  • Loading branch information
vipsharm authored Sep 9, 2022
1 parent b4e7a59 commit a6d28d0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
4 changes: 3 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ docker:
COPY overlay/files-opensuse-arm-rpi/ /
ELSE IF [ "$FLAVOR" = "opensuse-arm-rpi" ]
COPY overlay/files-opensuse-arm-rpi/ /
ELSE IF [ "$FLAVOR" = "ubuntu" ]
COPY overlay/files-ubuntu/ /
END

# Copy c3os binaries
Expand Down Expand Up @@ -410,4 +412,4 @@ run-qemu-tests:

ENV CLOUD_INIT=$CLOUD_CONFIG

RUN PATH=$PATH:$GOPATH/bin ginkgo --label-filter "$TEST_SUITE" --fail-fast -r ./tests/
RUN PATH=$PATH:$GOPATH/bin ginkgo --label-filter "$TEST_SUITE" --fail-fast -r ./tests/
59 changes: 30 additions & 29 deletions images/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=ubuntu:22.10
ARG BASE_IMAGE=ubuntu:20.04

FROM $BASE_IMAGE
ARG K3S_VERSION
Expand All @@ -10,41 +10,42 @@ RUN apt install -y software-properties-common
RUN add-apt-repository ppa:oibaf/test
RUN apt update
RUN apt install -y \
systemd \
grub-pc-bin \
grub-efi-amd64-bin \
grub2 \
grub2-common \
nohang \
grub2-common \
sudo \
iproute2 \
squashfs-tools \
parted dracut \
dracut-network dracut-live tar \
e2fsprogs \
dosfstools \
coreutils \
network-manager \
debianutils \
curl \
openssh-server \
nano \
gawk \
haveged \
rsync \
linux-image-generic && apt-get clean
systemd \
grub-pc-bin \
grub-efi-amd64-bin \
grub2 \
grub2-common \
nohang \
grub2-common \
sudo \
iproute2 \
squashfs-tools \
parted dracut \
dracut-network tar \
e2fsprogs \
dosfstools \
coreutils \
debianutils \
curl \
openssh-server \
nano \
gawk \
haveged \
rsync \
neovim \
linux-image-generic-hwe-20.04 && apt-get clean

RUN ln -s /usr/sbin/grub-install /usr/sbin/grub2-install
RUN ln -s /usr/bin/grub-editenv /usr/bin/grub2-editenv
RUN systemctl enable nohang-desktop.service
RUN systemctl enable systemd-networkd
RUN systemctl enable ssh
RUN systemctl enable NetworkManager.service
RUN echo "auto lo" > /etc/network/interfaces
RUN echo "iface lo inet loopback" >> /etc/network/interfaces

# Fixup sudo perms
RUN chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo

# Setup auto network on ubuntu
RUN sed -i 's/managed=false/managed=true/g' /etc/NetworkManager/NetworkManager.conf
RUN touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf

# Clear cache
RUN apt-get clean && rm -rf /var/cache/* && journalctl --vacuum-size=1K && rm /etc/machine-id && rm /var/lib/dbus/machine-id
11 changes: 11 additions & 0 deletions overlay/files-ubuntu/etc/cos/bootargs.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set kernel=/boot/vmlinuz
if [ -n "$recoverylabel" ]; then
# Removed console=ttyS0 (don't use it), and also rd.neetnet=1 which results in dupliate ips
# Added fancy vga=795 nomodeset
set kernelcmd="console=tty1 root=live:LABEL=$recoverylabel rd.live.dir=/ rd.live.squashimg=$img panic=5"
else
# set kernelcmd="console=tty1 root=LABEL=$label cos-img/filename=$img panic=5 security=selinux selinux=1 rd.cos.oemlabel=COS_OEM rd.neednet=0 vga=795 nomodeset"
set kernelcmd="console=tty1 root=LABEL=$label cos-img/filename=$img panic=5 security=selinux selinux=0 rd.cos.oemlabel=COS_OEM rd.neednet=0"
fi

set initramfs=/boot/initrd

0 comments on commit a6d28d0

Please sign in to comment.