Skip to content

Commit

Permalink
Test old kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
adonis0147 committed Oct 22, 2024
1 parent 42089c5 commit a94f9a9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 101 deletions.
71 changes: 0 additions & 71 deletions .cirrus.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/qemu/downgrade-kernel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

curl -LO 'https://vault.centos.org/7.0.1406/updates/x86_64/Packages/linux-firmware-20140804-0.1.git6bce2b0.el7_0.noarch.rpm'
rpm -ivh --oldpackage linux-firmware-20140804-0.1.git6bce2b0.el7_0.noarch.rpm

curl -LO 'https://vault.centos.org/7.0.1406/updates/x86_64/Packages/kernel-3.10.0-123.1.2.el7.x86_64.rpm'
rpm -ivh --oldpackage kernel-3.10.0-123.1.2.el7.x86_64.rpm

reboot
48 changes: 18 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build Packages on Centos 7 (old kernel)

on: workflow_dispatch
on: push

jobs:
build:
Expand All @@ -12,12 +12,7 @@ jobs:

- name: Install prerequisites
run: |
sudo apt install qemu-system libvirt-daemon libvirt-daemon-system cloud-image-utils virtinst
sudo mkdir -p /etc/qemu
echo 'allow virbr0' >bridge.conf
sudo mv bridge.conf /etc/qemu/
sudo chmod u+s /usr/lib/qemu/qemu-bridge-helper
sudo apt install qemu-system cloud-image-utils
cd .github/qemu
Expand All @@ -26,32 +21,25 @@ jobs:
cloud-localds cloud-init.iso cloud-init/user-data.yaml cloud-init/meta-data.yaml
virt-install \
--name centos \
--osinfo centos7 \
--vcpus "$(nproc)" \
--memory 7168 \
--disk "$(pwd)"/cloud-init.iso,device=cdrom \
--disk "$(pwd)"/CentOS-7-x86_64-GenericCloud.qcow2,device=disk \
--network bridge=virbr0,model=virtio \
--nographic \
--noautoconsole \
--import
while true; do
content="$(sudo virsh net-dhcp-leases default)"
if [[ -n "$(echo "${content}" | sed -n '3,$ p')" ]]; then
break
fi
echo "${content}"
nohup qemu-system-x86_64 \
-accel tcg \
-smp "$(nproc)" \
-m 7G \
-drive if=virtio,format=qcow2,file=CentOS-7-x86_64-GenericCloud.qcow2 \
-cdrom cloud-init.iso \
-nic user,model=virtio-net-pci,hostfwd=tcp::2222-:22 \
-nographic &>/dev/null &
chmod 600 "$(pwd)"/cloud-init/ssh/id_rsa
while ! scp -o StrictHostKeyChecking=no -i "$(pwd)"/cloud-init/ssh/id_rsa -P 2222 "$(pwd)"/downgrade-kernel.sh [email protected]:~/; do
echo 'Retry...'
sleep 1
done
ssh -o StrictHostKeyChecking=no -i "$(pwd)"/cloud-init/ssh/id_rsa -p 2222 -n [email protected] 'sudo bash downgrade-kernel.sh'
- name: Build
run: |
ip="$(sudo virsh net-dhcp-leases default | sed -n '3,$ p' | awk '{print $5}')"
ip="${ip%/24}"
ref="${{ github.ref_name }}"
cat >build.sh <<EOF
Expand Down Expand Up @@ -103,10 +91,10 @@ jobs:
EOF
chmod 600 "$(pwd)"/.github/qemu/cloud-init/ssh/id_rsa
while ! scp -o StrictHostKeyChecking=no -i "$(pwd)"/.github/qemu/cloud-init/ssh/id_rsa build.sh centos@"${ip}":~/; do
while ! scp -o StrictHostKeyChecking=no -i "$(pwd)"/.github/qemu/cloud-init/ssh/id_rsa -P 2222 build.sh centos@127.0.0.1:~/; do
echo 'Retry...'
sleep 1
done
ssh -o StrictHostKeyChecking=no -i "$(pwd)"/.github/qemu/cloud-init/ssh/id_rsa -n centos@"${ip}" 'bash -x build.sh'
ssh -o StrictHostKeyChecking=no -i "$(pwd)"/.github/qemu/cloud-init/ssh/id_rsa -p 2222 -n centos@127.0.0.1 'bash -x build.sh'

0 comments on commit a94f9a9

Please sign in to comment.