Skip to content

Commit

Permalink
build kernels inside a chroot environment
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Jun 1, 2024
1 parent a3f351d commit 5347af1
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 741 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
- name: Create cache directories
run: |
mkdir -p local-repositories petbuild-sources petbuild-cache petbuild-output
ln -s `pwd`/local-repositories ../local-repositories
- name: Get cached local-repositories
uses: actions/cache@v3
with:
Expand All @@ -60,14 +59,6 @@ jobs:
restore-keys: |
local-repositories-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-
local-repositories-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-
- name: Prepare build environment
run: |
[ -f local-repositories/vercmp ] || (curl https://raw.githubusercontent.com/puppylinux-woof-CE/initrd_progs/master/pkg/w_apps_static/w_apps/vercmp.c | gcc -x c -o ../local-repositories/vercmp -)
sudo install -m 755 local-repositories/vercmp /usr/local/bin/vercmp
echo "dash dash/sh boolean false" | sudo debconf-set-selections
sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
sudo ln -s bash /bin/ash
[ "${{ inputs.compat-distro }}" != void ] || echo "LD_LIBRARY_PATH=/lib:/usr/lib:/lib64:/usr/lib64" >> $GITHUB_ENV
- name: merge2out
timeout-minutes: 5
run: |
Expand All @@ -90,7 +81,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends dc debootstrap librsvg2-bin zstd xml2 syslinux-utils extlinux
sudo apt-get install -y --no-install-recommends debootstrap
[ ${{ inputs.compat-distro }} != devuan ] || curl https://git.devuan.org/devuan/debootstrap/raw/branch/master/scripts/ceres | sudo tee /usr/share/debootstrap/scripts/`echo ${{ inputs.compat-distro-version }} | sed s/64$//`
- name: 0setup
timeout-minutes: 10
Expand Down Expand Up @@ -155,15 +146,9 @@ jobs:
- name: Build woof-CE.tar.gz
run: |
cd ../buildenv
cd woof-out_*
sudo mkdir -p kernel-kit/sources
sudo mv -f ../../woof-out_*/kernel-kit/output/linux-*.tar.xz kernel-kit/sources/
sudo mv -f ../../woof-out_*/kernel-kit/output/DOTconfig-* kernel-kit/
sudo mv -f ../../woof-out_*/kernel-kit/output/build.conf kernel-kit/
sudo mv ../../woof-out_*/petbuild-sources .
cd ..
sudo mv ../../woof-out_*/petbuild-sources ../../woof-out_*/local-repositories woof-out_*/
sudo tar -c -I "gzip -9" -f $GITHUB_WORKSPACE/woof-CE.tar.gz woof-out_*
sudo mv woof-out_*/petbuild-sources $GITHUB_WORKSPACE/
sudo mv woof-out_*/petbuild-sources woof-out_*/local-repositories $GITHUB_WORKSPACE/
- name: Move build output
run: |
for i in `ls ../woof-out_*/woof-output-*/*.img 2>/dev/null`; do sudo gzip -1 $i; done
Expand Down
61 changes: 13 additions & 48 deletions .github/workflows/dpup-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,32 @@ jobs:
build:
if: github.event_name != 'schedule' || (github.repository == 'vanilla-dpup/woof-CE' && github.ref == 'refs/heads/vanilladpup-11.0.x')
runs-on: ubuntu-22.04
container:
image: debian:${{ matrix.release }}-slim
volumes:
- /usr:/hostusr
continue-on-error: ${{ matrix.release == 'sid' }}
strategy:
matrix:
include:
- release: trixie
arch: x86_64
base: config.amd64_none_amd64.xz
- release: sid
arch: x86_64
base: config.amd64_none_amd64.xz
steps:
- uses: actions/checkout@v3
- name: Free space
run: sudo rm -rf /usr/local/lib/android /usr/share/dotnet # increase free space, we don't need these
- name: Install dependencies
run: |
rm -rf /hostusr/local/lib/android /hostusr/share/dotnet # increase free space, we don't need these
[ ${{ matrix.release }} = sid ] || echo "deb http://deb.debian.org/debian ${{ matrix.release }} main contrib non-free" > /etc/apt/sources.list
[ ${{ matrix.release }} = sid ] || echo "deb http://deb.debian.org/debian ${{ matrix.release }}-updates main contrib non-free" >> /etc/apt/sources.list
[ ${{ matrix.release }} = sid ] || echo "deb http://deb.debian.org/debian-security ${{ matrix.release }}-security main contrib non-free" >> /etc/apt/sources.list
[ ${{ matrix.arch }} != x86 ] || dpkg --add-architecture i386
apt-get update -qq
apt-get upgrade -y
apt-get install -y --no-install-recommends curl wget ca-certificates git file squashfs-tools xz-utils diffutils patch make flex bison python3 bc bzip2 kmod rsync libelf-dev libssl-dev dwarves gcc jq
apt-get install -y linux-source
[ ${{ matrix.arch }} != x86 ] || apt-get install -y --no-install-recommends gcc-multilib `dpkg --get-selections | grep -m1 ^linux-config- | awk '{print $1}' | sed s/amd64/i386/`
curl https://raw.githubusercontent.com/puppylinux-woof-CE/initrd_progs/master/pkg/w_apps_static/w_apps/vercmp.c | gcc -x c -o /usr/local/bin/vercmp -
echo "dash dash/sh boolean false" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
- name: Build kernel
run: |
cd kernel-kit
tar -xJf /usr/src/linux-source-*.tar.xz
cfg=`ls /usr/src/linux-config-*/${{ matrix.base }}`
xz -dc $cfg > /tmp/base
ver=`grep -Fm1 "Kernel Configuration" /tmp/base | cut -f 3 -d ' '`
mv -f linux-source-* linux-$ver
mkdir -p sources/kernels
tar -c linux-$ver | xz -9 > sources/kernels/linux-$ver.tar.xz
cd linux-$ver
./scripts/kconfig/merge_config.sh /tmp/base ../debian-diffconfigs/${{ matrix.release }}
mv -f .config ../DOTconfig-$ver-${{ matrix.arch }}
apt-get autoremove -y linux-source
cd ..
rm -rf linux-$ver
md5sum sources/kernels/linux-$ver.tar.xz | sed s~sources/kernels/~~ > sources/kernels/linux-$ver.tar.xz.md5.txt
echo "DOTconfig_file=DOTconfig-$ver-${{ matrix.arch }}" >> build.conf
echo "kernel_ver=$ver" >> build.conf
echo "package_name_suffix=kernel-kit" >> build.conf
echo "COMP=\"-comp zstd -Xcompression-level 19 -b 256K -no-exports -no-xattrs\"" >> build.conf
echo "AUTO=yes" >> build.conf
CREATE_KBUILD_SFS=yes ./build.sh
rm -rf kernel_sources-*
mkdir small-output
mv `ls sources/kernels/linux-$ver.tar.xz DOTconfig-$ver-${{ matrix.arch }} build.conf output/kbuild-*.sfs* output/*.tar* 2>/dev/null` small-output
rm -rf output
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends debootstrap
- name: merge2out
timeout-minutes: 5
run: sudo -E ./merge2out woof-distro/${{ matrix.arch }}/debian/${{ matrix.release }}64
- name: 1download
run: cd ../woof-out_* && sudo -E ./1download
- name: 2buildkernel
run: cd ../woof-out_* && sudo -E ./2buildkernel
- name: Move build output
run: sudo mv ../woof-out_*/kernel-kit/output $GITHUB_WORKSPACE/
- name: Upload kernel
uses: actions/upload-artifact@v3
with:
name: kernel-kit-output-usrmerge-debian-${{ matrix.release }}-${{ matrix.arch }}
path: kernel-kit/small-output
path: output
retention-days: 16
63 changes: 0 additions & 63 deletions kernel-kit/build.conf

This file was deleted.

Loading

0 comments on commit 5347af1

Please sign in to comment.