From 57124e85848a528e4919d134ce21a0bd8299b68d Mon Sep 17 00:00:00 2001 From: Han Gao Date: Mon, 2 Dec 2024 21:47:44 +0800 Subject: [PATCH] ci: add nvme boot Signed-off-by: Han Gao --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 741948b..0b16505 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -185,6 +185,21 @@ jobs: # move img to output mv -v "$BOOT_IMG" "$ROOT_IMG" ${GITHUB_WORKSPACE}/output/ + - name: Copy other file + run: | + cp -vf ${GITHUB_WORKSPACE}/config/partition_universal.json ${GITHUB_WORKSPACE}/output/ + + - name: Clean up (EMMC) + run: | + rm -rf ${GITHUB_WORKSPACE}/output/*.deb + + - name: 'Upload emmc img' + uses: actions/upload-artifact@v4 + with: + name: k1-img-emmc + path: output/* + retention-days: 30 + - name: genimage-sdcard run: | export SD_TARGET=${GITHUB_WORKSPACE}/config/genimage.cfg @@ -216,18 +231,27 @@ jobs: path: output/debian-k1-sdcard.img retention-days: 30 - - name: Copy other file + - name: Clean up (SDCARD) run: | - cp -vf ${GITHUB_WORKSPACE}/config/partition_universal.json ${GITHUB_WORKSPACE}/output/ + rm -rf ${GITHUB_WORKSPACE}/output/debian-k1-sdcard.img - - name: Clean up + - name: genimage-nvme run: | - rm -rf ${GITHUB_WORKSPACE}/output/*.deb - rm -rf ${GITHUB_WORKSPACE}/output/debian-k1-sdcard.img + export CHROOT_TARGET=${GITHUB_WORKSPACE}/rootfs - - name: 'Upload emmc img' + pushd ${GITHUB_WORKSPACE}/output + sudo mount "$ROOT_IMG" $CHROOT_TARGET + sudo mount "$BOOT_IMG" $CHROOT_TARGET/boot + sudo sed -i "s/mmcblk2/nvme0n1/g" $CHROOT_TARGET/etc/fstab + sudo sed -i "s/mmcblk2/nvme0n1/g" $CHROOT_TARGET/etc/default/u-boot + sudo sed -i "s/mmcblk2/nvme0n1/g" $CHROOT_TARGET/boot/extlinux/extlinux.conf + sudo umount -l $CHROOT_TARGET + popd + tree ${GITHUB_WORKSPACE}/output + + - name: 'Upload nvme img' uses: actions/upload-artifact@v4 with: - name: k1-img-emmc + name: k1-img-nvme path: output/* retention-days: 30