Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Alpine 3.12 #72

Merged
merged 34 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
09c3aa2
Upgrade x86_64 Alpine containers to 3.12
mmlb Aug 5, 2020
ca900b4
installer/alpine: Fix whitespace
mmlb Aug 17, 2020
2510506
installer/alpine: Update kernel to latest LTS.
mmlb Jul 17, 2020
92cb569
installer/alpine: Install linux-firmware from aports checkout
mmlb Aug 5, 2020
63881e0
installer/alpine: Install kexec-tools from aports checkout
mmlb Aug 5, 2020
ef32119
installer/alpine: Enable IONIC (pensando) driver
mmlb Aug 5, 2020
9311d2a
installer/alpine: Install eclypsium package just like the others
mmlb Aug 5, 2020
1ab00e0
installer/alpine: Build each apk in separate RUN
mmlb Aug 17, 2020
7d00552
installer/alpine: Install only the wanted packages all at once
mmlb Aug 17, 2020
1d2e25a
installer/alpine: Build kexec-tools after the other builds
mmlb Aug 18, 2020
d64dcb9
installer/alpine: Setup local repo from abuild output
mmlb Aug 17, 2020
58aac79
Add init-vanilla-3.12 from mkintfs 3.4.5 source
splaspood Jul 21, 2020
8e2735f
Add init-x86_64.next
mmlb Jul 31, 2020
dca3503
init.next: Fix curly brace use withing variable pattern substitution
mmlb Jul 31, 2020
1b147c1
init.next: Add --no-progress to all apk add commands
mmlb Jul 31, 2020
1c956c5
init.next: Explicitly mount cgroup fs
mmlb Jul 31, 2020
772bec7
init.next: Implement packet_bootdev_mac handling via new BOOTIF feature
mmlb Jul 31, 2020
f4e34c1
init.next: Retry nic reset and dhcp config a few times
mmlb Jul 31, 2020
c24129f
init.next: Handle mulitiple repos in ALPINE_REPO
mmlb Jul 31, 2020
ef13a24
init.next: Add required packet args
mmlb Aug 4, 2020
af0285c
init.next: Add packet_state handling
mmlb Aug 4, 2020
75da558
init.next: Add packet_base_url to myopts
mmlb Aug 4, 2020
ae0fcb1
init.next: Fetch and install $packet_action scripts
mmlb Aug 4, 2020
76b8ee8
init.next: Setup KOPT_modules for eclypsium at deprovisioning time
mmlb Aug 4, 2020
3fa701d
init.next: Unconditionally run apk with --no-network
mmlb Aug 17, 2020
2927d28
init.next: Setup apk so it uses the embedded cached packages
mmlb Aug 17, 2020
a018880
init.next: Configure apk to use our local repo
mmlb Aug 17, 2020
14a321e
init.next: Set KOPT_pkgs with packages we need installed
mmlb Aug 5, 2020
7e4e7d5
installer/alpine: Replace init-x86_64 with init-x86_64.next
mmlb Aug 5, 2020
ef35f88
Add freshly built Alpine 3.12 boot files
mmlb Aug 3, 2020
e282197
Fix apk packages alignment
mmlb Aug 11, 2020
4c82d76
ci: Use lshw from 3.11
mmlb Aug 11, 2020
0ec277c
osie-runner: Use pip directly from upstream instead of packaged by Al…
mmlb Aug 11, 2020
c713fe9
Merge branch 'master' into alpine-3.12
mergify[bot] Aug 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 41 additions & 35 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
# vim: set expandtab shiftwidth=4 softtabstop=4:
FROM alpine:3.10
FROM alpine:3.12

RUN apk add --no-cache --no-progress --update --upgrade \
bash \
bridge-utils \
coreutils \
cpio \
curl \
diffutils \
dnsmasq \
docker \
eudev \
file \
findutils \
git \
go \
gptfdisk \
iptables \
jq \
libarchive-tools \
lshw \
make \
musl-dev \
ovmf \
pigz \
py2-pip \
qemu-system-aarch64 \
qemu-system-x86_64 \
rsync \
socat \
util-linux \
python3 \
python3-dev \
gcc \
&& apk add --no-cache --update --upgrade \
bash \
bridge-utils \
coreutils \
cpio \
curl \
diffutils \
dnsmasq \
docker \
eudev \
file \
findutils \
gcc \
git \
go \
gptfdisk \
iptables \
jq \
libarchive-tools \
make \
musl-dev \
ovmf \
pigz \
py3-pip \
python3 \
python3-dev \
qemu-system-aarch64 \
qemu-system-x86_64 \
rsync \
socat \
util-linux \
&& \
mv /etc/apk/repositories /etc/apk/repositories.old && \
apk add --no-cache --update --upgrade \
--repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be changed to v3.12 (maybe do a global search and replace just to check whether this does not appear elsewhere).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this is to get lshw from 3.11 explicitly. v3.12's lshw doesn't output correct json. I have not been able to track down the commit that broke lshw.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see :-(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its only used in tests so not a big deal imo. Looks like upstream has fixed the json output though so I'll look into PR'ing patches to aports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/community \
lshw \
&& \
mv /etc/apk/repositories.old /etc/apk/repositories && \
apk add --no-cache --update --upgrade \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
cfssl \
;
Expand All @@ -56,8 +63,7 @@ RUN curl -fL https://github.com/mvdan/sh/releases/download/v2.3.0/shfmt_v2.3.0_l
echo 'eef540565962cf1f5432c7e3cf212c333e096f9f481d6d441197c1cf878746d0 /bin/shfmt' | sha256sum -c && \
chmod +x /bin/shfmt

RUN pip install click packet-python==1.38.2 && \
pip3 install click j2cli packet-python==1.38.2 && \
RUN pip3 install click j2cli packet-python==1.38.2 && \
pip3 install coverage

RUN curl -L https://github.com/git-lfs/git-lfs/releases/download/v2.5.1/git-lfs-linux-amd64-v2.5.1.tar.gz >/tmp/git-lfs.tar.gz && \
Expand Down
76 changes: 49 additions & 27 deletions installer/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM alpine:3.7
FROM alpine:3.12

ENTRYPOINT [ "/build.sh" ]
VOLUME /assets

RUN mkdir -p /etc/apk/cache && \
RUN true && \
# Setup a cache dir so apk will cache the apks
mkdir -p /etc/apk/cache && \
apk add --update --upgrade \
alpine-base \
curl \
Expand All @@ -16,12 +18,9 @@ RUN mkdir -p /etc/apk/cache && \
squashfs-tools \
tcpdump \
&& \
apk add --no-scripts --update --upgrade --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
kexec-tools \
&& \
# A cache sync ensure all the deps are cached, even if the dep was pre-installed already and thus not needed to be fetched
apk cache sync && \
mv /etc/apk/cache /cache && \
apk add --no-scripts --no-cache --update --upgrade \
apk add --no-scripts --no-cache --update --upgrade --cache-dir /tmp/non-persisted-apk-cache-dir \
abuild \
alpine-sdk \
build-base \
Expand All @@ -30,35 +29,38 @@ RUN mkdir -p /etc/apk/cache && \
linux-headers \
sudo \
&& \
# remove edge when linux-vanilla is > 4.14.8 and has the nfp driver enabled,
# likely alpine v3.8
apk add --no-scripts --no-cache --update --upgrade --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
linux-firmware \
&& \
adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder && \
echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
apk update

USER builder
WORKDIR /home/builder

ENV COMMIT bb52b0d3f60cd75197ef218362f193378dfd869d
ENV FLAVOR vanilla
ENV KERNEL 4.14.55
ENV COMMIT 69b95a3d1dd1627416f45bcbfb93c6f2d5f0d68b
ENV FLAVOR lts
ENV KERNEL 5.4.52
# make sure PKGREL is +1 what is in APKGBUILD
ENV PKGREL 1

RUN true && \
# Setup self-signed keys to sign the built packages \
abuild-keygen -a -i -n && \
# Setup self-signed keys to sign the built packages
RUN abuild-keygen -a -i -n && \
# Fetch alpine package tree \
curl -fL https://github.com/alpinelinux/aports/archive/$COMMIT.tar.gz | tar -zxf - && \
mv aports-$COMMIT aports && \
# Build customized linux-$FLAVOR package \
cd aports/main/linux-$FLAVOR && \
mv aports-$COMMIT aports

# Install pinned linux-firmware package
RUN cd aports/main/linux-firmware && \
abuild checksum && \
MAKEFLAGS=-j$(nproc) abuild -r && \
abuild clean && \
sudo apk add --no-scripts --no-cache --update --upgrade --cache-dir /tmp/non-persisted-apk-cache-dir \
/home/builder/packages/main/x86_64/linux-firmware*.apk

# Install customized linux-$FLAVOR package \
RUN cd aports/main/linux-$FLAVOR && \
sed -i APKBUILD \
-e 's/silentoldconfig/olddefconfig/g' \
-e "/^pkgrel=/ s/=.*/=$PKGREL/" && \
-e "/^pkgrel=/ s/=.*/=$PKGREL/" && \
# we only want to build the config-$FLAVOR.x86_64 kernel, so we need remove to any lines that look like config.*x86_64 but is not config-$FLAVOR.x86_46 \
# explanation: \
# /config.*x86_64/! p :: if line does *not* match config.*x86_64 (on account of the trailing ! after /.../) print it \
Expand All @@ -67,19 +69,20 @@ RUN true && \
sed -i APKBUILD -n \
-e '/config.*x86_64/! p; /config.*x86_64/ { /config-'$FLAVOR'.x86_64/ p }' && \
echo 'CONFIG_KEXEC=y' >> config-$FLAVOR.x86_64 && \
echo 'CONFIG_IONIC=y' >> config-$FLAVOR.x86_64 && \
abuild checksum && \
MAKEFLAGS=-j$(nproc) abuild -r && \
abuild clean && \
# Install the customized linux-vanilla package
sudo apk add --no-scripts --update --upgrade /home/builder/packages/main/x86_64/linux-$FLAVOR*.apk
sudo apk add --no-scripts --no-cache --update --upgrade --cache-dir /tmp/non-persisted-apk-cache-dir \
/home/builder/packages/main/x86_64/linux-$FLAVOR*.apk

ARG ECLYPSIUM_DRIVER_VERSION=2.0.0
ARG ECLYPSIUM_DRIVER_SHA512=b9cfebc3b0abd834d73f025f925d896bea8d9dac2a3c3605980a94a35cd188db159ca165e5884863f5bd4a94d39861ecdf998cf8e99ea89d6f093a7bc64b5347
ARG ECLYPSIUM_DRIVER_FILENAME=eclypsiumdriver-alpine-${ECLYPSIUM_DRIVER_VERSION}.tgz

COPY ${ECLYPSIUM_DRIVER_FILENAME} /home/builder/

# Download the eclypsium driver abuild and build it
# Install the eclypsium driver
RUN echo "${ECLYPSIUM_DRIVER_SHA512} ${ECLYPSIUM_DRIVER_FILENAME}" | sha512sum -c && \
tar -zxvf ${ECLYPSIUM_DRIVER_FILENAME} && \
cd aports/non-free/eclypsiumdriver && \
Expand All @@ -90,9 +93,28 @@ RUN echo "${ECLYPSIUM_DRIVER_SHA512} ${ECLYPSIUM_DRIVER_FILENAME}" | sha512sum
abuild checksum && \
MAKEFLAGS=-j$(nproc) abuild -r && \
abuild clean && \
sudo apk add --no-scripts --no-cache --update --upgrade /home/builder/packages/non-free/x86_64/eclypsium*.apk
sudo apk add --no-scripts --no-cache --update --upgrade --cache-dir /tmp/non-persisted-apk-cache-dir \
/home/builder/packages/non-free/x86_64/eclypsium*.apk

# Remove built and installed packages, these never get installed at runtime
RUN rm -rf /home/builder/packages/*


# Build packages we want to install at osie runtime from this aports checkout #
###############################################################################

# Build pinned kexec-tools package
RUN cd aports/testing/kexec-tools && \
abuild checksum && \
MAKEFLAGS=-j$(nproc) abuild -r && \
abuild clean

USER root
RUN sudo mv /cache /etc/apk/cache
RUN true && \
# Setup our own repos
mkdir -p /etc/apk/repos && \
cp -a /home/builder/packages/* /etc/apk/repos && \
# Clear out installed file since it was empty before
truncate -s0 /etc/apk/cache/installed

COPY build.sh /build.sh
4 changes: 2 additions & 2 deletions installer/alpine/assets-x86_64/initramfs
Git LFS file not shown
4 changes: 2 additions & 2 deletions installer/alpine/assets-x86_64/modloop
Git LFS file not shown
4 changes: 2 additions & 2 deletions installer/alpine/assets-x86_64/vmlinuz
Git LFS file not shown
1 change: 1 addition & 0 deletions installer/alpine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build_initramfs() {

cat >/etc/mkinitfs/features.d/packetrepo.files <<-EOF
/etc/apk/cache/*
/etc/apk/repos/*
EOF

cat <<-EOF | sort -u >/etc/mkinitfs/features.d/virtio.modules.tmp
Expand Down
Loading