Skip to content

Commit

Permalink
ci: add th1520 emmc image build
Browse files Browse the repository at this point in the history
Signed-off-by: Han Gao <[email protected]>
  • Loading branch information
RevySR committed Apr 29, 2024
1 parent a36f653 commit 76b02b5
Showing 1 changed file with 61 additions and 1 deletion.
62 changes: 61 additions & 1 deletion .github/workflows/th1520.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ env:
KBUILD_BUILD_HOST: ci-riscv-builder
KDEB_COMPRESS: none
KDEB_CHANGELOG_DIST: unstable
TH1520_IMAGE_BASE_URL: https://mirror.iscas.ac.cn/revyos/extra/images/lpi4amain
TH1520_IMAGE_DATE: 20240127
TH1520_BOOT: boot-lpi4amain-20240127_105111.ext4.zst
TH1520_ROOT: root-lpi4amain-20240127_105111.ext4.zst

jobs:
kernel:
Expand All @@ -40,7 +44,7 @@ jobs:
sudo apt install -y gdisk dosfstools g++-12-riscv64-linux-gnu build-essential \
libncurses-dev gawk flex bison openssl libssl-dev tree \
dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf device-tree-compiler \
devscripts debhelper pahole
devscripts debhelper pahole qemu-user-static binfmt-support zstd ninja
- name: Checkout source
uses: actions/checkout@v4
Expand Down Expand Up @@ -82,3 +86,59 @@ jobs:
name: ${{ matrix.name }}.tar.gz
path: artifact/*
retention-days: 90

- name: Checkout qemu
uses: actions/checkout@v4
with:
repository: revyos/qemu
path: qemu
ref: ab8f84892a89feea60f1bb24432ff58ce6d2885c # TODO: remove this line

- name: build qemu
run: |
pushd qemu
./configure \
--prefix=$HOME/qemu-install \
--static \
--target-list=riscv64-linux-user \
--disable-system \
--disable-pie \
--interp-prefix=/etc/qemu-binfmt/%M
make -j$(nproc)
make install
sudo cp -fv $HOME/qemu-install/bin/qemu-riscv64 /usr/bin/qemu-riscv64-static
popd
ls -al /usr/bin/qemu-riscv64-static
sudo dpkg-reconfigure binfmt-support
- name: Download th1520 boot/root
run: |
curl -OL boot.ext4.zst ${TH1520_IMAGE_BASE_URL}/${TH1520_IMAGE_DATE}/${TH1520_BOOT}
curl -OL root.ext4.zst ${TH1520_IMAGE_BASE_URL}/${TH1520_IMAGE_DATE}/${TH1520_ROOT}
- name: Reconfigure th1520 boot/root
run: |
export TIMESTAMP=$(date +%Y%m%d-%H%M%S)
zstd -d boot.ext4.zst
mv boot*.ext4 boot-lpi4amain-ci-${TIMESTAMP}.ext4
zstd -d root.ext4.zst
mv root*.ext4 root-lpi4amain-ci-${TIMESTAMP}.ext4
rm -rf boot.ext4.zst root.ext4.zst
mkdir -p mnt
sudo mount root-lpi4amain-ci-${TIMESTAMP}.ext4 mnt
sudo mount boot-lpi4amain-ci-${TIMESTAMP}.ext4 mnt/boot
chroot mnt sh -c 'apt remove -y linux-image* linux-headers*'
dcmd cp -v ${GITHUB_WORKSPACE}/artifact/*.changes mnt/root
chroot mnt sh -c 'dpkg -i /root/*.deb'
sudo umount -l mnt
zstd boot-lpi4amain-ci-${TIMESTAMP}.ext4
zstd root-lpi4amain-ci-${TIMESTAMP}.ext4
- name: 'Upload Artifact EMMC'
uses: actions/upload-artifact@v3
with:
retention-days: 30
name: th1520-${{ matrix.name }}
path: |
*.ext4.zst

0 comments on commit 76b02b5

Please sign in to comment.