Skip to content

Commit

Permalink
Adjust kernel compilation space
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Mar 4, 2024
1 parent 4f598f7 commit 26e5101
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/compile-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,55 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
docker rmi $(docker images -q) 2>/dev/null
[[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}"
sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android 2>/dev/null
sudo swapoff -a
sudo rm -f /swapfile /mnt/swapfile
sudo -E apt-get -y update
sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true
sudo -E apt-get -y install $(curl -fsSL https://is.gd/depend_ubuntu2204_armbian)
sudo -E systemctl daemon-reload
#sudo -E apt-get -y full-upgrade
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile}
sudo rm -rf ~/{.cargo,.dotnet,.rustup}
sudo timedatectl set-timezone "${TZ}"
echo "status=success" >> ${GITHUB_OUTPUT}
- name: Create simulated physical disk
id: disk
run: |
mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1)
root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4)
sudo truncate -s "${mnt_size}"G /mnt/mnt.img
sudo truncate -s "${root_size}"G /root.img
sudo losetup /dev/loop6 /mnt/mnt.img
sudo losetup /dev/loop7 /root.img
sudo pvcreate /dev/loop6
sudo pvcreate /dev/loop7
sudo vgcreate github /dev/loop6 /dev/loop7
sudo lvcreate -n runner -l 100%FREE github
sudo mkfs.xfs /dev/github/runner
sudo mkdir -p /builder
sudo mount /dev/github/runner /builder
sudo chown -R runner.runner /builder
df -Th
- name: Create a mapped directory
id: mapped
working-directory: /builder
run: |
df -hT ${PWD}
mkdir -p /builder/{kernel,output}
ln -sf /builder/kernel /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/kernel
ln -sf /builder/output /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/output
echo "status=success" >> ${GITHUB_OUTPUT}
- name: Compile the kernel [ ${{ inputs.kernel_version }} ]
uses: ophub/amlogic-s9xxx-armbian@main
if: ${{ steps.init.outputs.status }} == 'success' && !cancelled()
if: ${{ steps.mapped.outputs.status }} == 'success' && !cancelled()
with:
build_target: kernel
kernel_source: ${{ inputs.kernel_source }}
Expand Down

0 comments on commit 26e5101

Please sign in to comment.