Skip to content

Commit

Permalink
initial commit for amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
hkbu-kennycheng committed Mar 14, 2024
0 parents commit 05c4570
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: build release
on: push
permissions: write-all

jobs:
build-amd64:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
tags: ${{ github.repository }}:latest
build-args: |
GH_TOKEN=${{ github.token }}
REPO=${{ github.repository }}
REF=${{ github.ref_name }}
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM gentoo/stage3:amd64-openrc

ARG KVER=6.6.21
ARG TARGET=bootx64.efi

RUN emerge-webrsync && echo 'ACCEPT_LICENSE="*"' >> /etc/portage/make.conf && \
echo 'FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox"' >> /etc/portage/make.conf && \
echo 'USE="${USE} symlink -firmware lzo lzma zstd"' >> /etc/portage/make.conf && \
echo "dev-util/github-cli **" > /etc/portage/package.accept_keywords/github-cli && \
emerge -vq genkernel gentoo-sources:$KVER github-cli squashfs-tools p7zip

RUN curl -L https://qa-reports.gentoo.org/output/service-keys.gpg | gpg --import && \
curl -L "https://distfiles.gentoo.org/releases/amd64/autobuilds/current-install-amd64-minimal/latest-install-amd64-minimal.txt" | gpg --verify -o - | grep iso | awk '{print "https://distfiles.gentoo.org/releases/amd64/autobuilds/current-install-amd64-minimal/" $1}' | xargs curl -L -o /tmp/install-minimal.iso && \
7z x /tmp/install-minimal.iso image.squashfs && \
rm -f /tmp/install-minimal.iso && \
unsquashfs -excludes image.squashfs 'lib/firmware/qcom/*' && \
rm -f image.squashfs && \
mkdir -p /tmp/overlay && \
mksquashfs squashfs-root /tmp/overlay/image.squashfs -noappend -comp xz && \
rm -rf squashfs-root

RUN curl -L https://raw.githubusercontent.com/gentoo/releng/master/releases/kconfig/amd64/amd64-6.6.13.config -o /usr/src/linux/.config && \
sed -i 's/# CONFIG_CMDLINE_BOOL is not set/CONFIG_CMDLINE_BOOL=y/' /usr/src/linux/.config && \
echo 'CONFIG_CMDLINE="root=/dev/ram0 init=/linuxrc overlayfs nodhcp looptype=squashfs loop=/image.squashfs cdroot"' >> /usr/src/linux/.config && \
sed -i 's/#ALLRAMDISKMODULES="no"/ALLRAMDISKMODULES="yes"/' /etc/genkernel.conf && \
sed -i 's/#MOUNTBOOT="yes"/MOUNTBOOT="no"/' /etc/genkernel.conf && \
sed -i 's/#INTEGRATED_INITRAMFS="no"/INTEGRATED_INITRAMFS="yes"/' /etc/genkernel.conf && \
sed -i 's/#INITRAMFS_OVERLAY=""/INITRAMFS_OVERLAY="\/tmp\/overlay"/' /etc/genkernel.conf && \
sed -i 's/#COMPRESS_INITRD_TYPE="best"/COMPRESS_INITRD_TYPE="xz"/' /etc/genkernel.conf

RUN genkernel all --oldconfig --kernel-filename=$TARGET --install

ARG GH_TOKEN
ARG REPO
ARG REF

RUN gh repo clone $REPO /git && cd /git && \
gh release create $REF --notes "kernel version $KVER" "/boot/${TARGET}#${TARGET}" "/boot/${TARGET}#bootia32.efi"

0 comments on commit 05c4570

Please sign in to comment.