-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42089c5
commit 3065bfb
Showing
3 changed files
with
29 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|
@@ -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' || true | ||
- 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 | ||
|
@@ -77,6 +65,8 @@ jobs: | |
devel/downloads/download_packages.sh | ||
sed -i '/function install_perl/,/^}/ s/make$/make -j "\\\$(nproc)"/' devel/scripts/install.sh | ||
# Don't install llvm | ||
sed -i '/function install_packages/,/^}/ s/llvm//' devel/scripts/install.sh | ||
|
@@ -103,10 +93,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' | ||