From a94f9a945748260fe688da7f99b7f6b75121b265 Mon Sep 17 00:00:00 2001 From: Adonis Ling Date: Tue, 22 Oct 2024 20:00:23 +0800 Subject: [PATCH] Test old kernel --- .cirrus.yml | 71 -------------------------------- .github/qemu/downgrade-kernel.sh | 9 ++++ .github/workflows/build.yml | 48 ++++++++------------- 3 files changed, 27 insertions(+), 101 deletions(-) delete mode 100644 .cirrus.yml create mode 100755 .github/qemu/downgrade-kernel.sh diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index a87182b..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,71 +0,0 @@ -build_packages_task: - only_if: ${CIRRUS_TAG} == '' - timeout_in: 120m - - compute_engine_instance: - platform: linux - cpu: 4 - memory: 8G - image_project: cirrus-images - matrix: - - name: 'Linux x86_64' - image: family/docker-builder - - name: 'Linux aarch64' - image: family/docker-builder-arm64 - architecture: arm64 - - clone_script: | - git clone -b "${CIRRUS_BRANCH}" https://github.com/adonis0147/devel-env - cd devel-env - git fetch --tags - - prepare_script: | - uname -a - - cd devel-env - - while read -r tag; do - url="https://github.com/adonis0147/devel-env/releases/download/${tag}/install_toolchain_$(uname -m).sh" - if curl --silent --head --fail -L "${url}" -o /dev/null; then - break - fi - done < <(git tag --sort=creatordate | tac) - - echo "Download the toolchain from ${url}" - curl -L "${url}" -o devel/scripts/install_toolchain.sh - chmod a+x devel/scripts/install_toolchain.sh - - devel/downloads/download_packages.sh - - # Don't install llvm - sed -i '/function install_packages/,/^}/ s/llvm//' devel/scripts/install.sh - - if [[ "$(uname -m)" != 'x86_64' ]]; then - # Don't install neovim - sed -i '/function install_packages/,/^}/ s/neovim//' devel/scripts/install.sh - fi - - # Don't install zsh - sed -i '/function install_packages/,/^}/ s/zsh//' devel/scripts/install.sh - - script: | - if [[ "$(uname -m)" == 'x86_64' ]]; then - cmd="sed -i -e 's|mirrorlist=|#mirrorlist=|' -e 's|#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=https://vault.centos.org/7.9.2009|' /etc/yum.repos.d/CentOS-Base.repo" - else - cmd="sed -i -e 's|mirrorlist=|#mirrorlist=|' -e 's|#baseurl=http://mirror.centos.org/altarch|baseurl=https://vault.centos.org/altarch|' /etc/yum.repos.d/CentOS-Base.repo" - fi - - cat >>Dockerfile <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 centos@127.0.0.1:~/; do + echo 'Retry...' sleep 1 done + ssh -o StrictHostKeyChecking=no -i "$(pwd)"/cloud-init/ssh/id_rsa -p 2222 -n centos@127.0.0.1 '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 <