Skip to content

Commit 67275ad

Browse files
committed
feat(cnb): sync to cnb
Signed-off-by: aLinChe <1129332011@qq.com>
1 parent abb3a72 commit 67275ad

4 files changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/sync-to-cnb.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Sync to CNB
2+
on:
3+
push:
4+
branches: [ master ] # 指定在推送到master分支时触发
5+
6+
jobs:
7+
sync:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Configure Git and Push to CNB
14+
run: |
15+
git remote add cnb https://${{ secrets.CNB_USERNAME }}:${{ secrets.CNB_TOKEN }}@cnb.cool/aLinChe/Linux-minimal.git
16+
git push cnb master:master --force

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
*.app
3333

3434
.*
35+
!/.github/**
3536
/build
3637
mnt
3738
rootfs/*

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ $(TARGET): $(OBJS)
6868

6969
MAKEFLAGS += --no-print-directory
7070

71-
.PHONY: default build user initramfs
71+
.PHONY: default build user initramfs make_diskimage
7272
.PHONY: run run-nographic run-bridge debug
7373
.PHONY: clean info help
7474

@@ -96,6 +96,9 @@ initramfs: $(TARGET)
9696
> ../$(BUILD_DIR)/initramfs.cpio.gz
9797
@echo "===== initramfs 已成功生成至 $(BUILD_DIR)/initramfs.cpio.gz ====="
9898

99+
make_diskimage: build
100+
sh -c "bash ./tools/run-qemu.sh --arch $(ARCH) --make_diskimage"
101+
99102
run:
100103
sh -c "bash ./tools/run-qemu.sh --arch $(ARCH) --display window --bios uefi --ext4"
101104

tools/run-qemu.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ QEMU_NOGRAPHIC=false
1515
BIOS_TYPE=""
1616
TAP_DEV="tap0"
1717

18+
ONLYMAKEIMAGE=false
19+
1820
while true; do
1921
case "$1" in
2022
--arch)
@@ -89,6 +91,10 @@ while true; do
8991
fi
9092
APPEND_PARAMS+=" ${CMDLINE} "
9193
shift 1;;
94+
--make_diskimage)
95+
ONLYMAKEIMAGE=true
96+
shift 1
97+
break;;
9298
*) break
9399
esac
94100
done
@@ -291,4 +297,10 @@ main() {
291297
run_qemu
292298
}
293299

300+
if [ ${ONLYMAKEIMAGE} == true ]; then
301+
prepare_disk_image
302+
write_disk_image
303+
exit 0
304+
fi
305+
294306
main

0 commit comments

Comments
 (0)