10 Star 16 Fork 5

Nuclei-Software / nuclei-linux-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.gitlab-ci.yml 15.37 KB
一键复制 编辑 原始数据 按行查看 历史
variables:
GIT_SUBMODULE_STRATEGY: recursive
GET_SOURCES_ATTEMPTS: 5
GIT_STRATEGY: fetch
FF_USE_FASTZIP: "true"
SHARELOC: "/home/xl_ci/linuxsdk/"
workflow:
rules:
- if: $CI_COMMIT_MESSAGE =~ /draft|wip|stash/i
when: never
- if: $CI_COMMIT_BRANCH =~ /master|develop|dev_nuclei*|feature\/.|/
- if: $CI_COMMIT_BRANCH == "dev_nuclei_next" && $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /master|develop|dev_nuclei*/ && $CI_PIPELINE_SOURCE == "merge_request_event"
before_script:
- source /home/share/devtools/env.sh
stages:
- build
- run
- manual
cache:
paths:
- buildroot/dl
## Job template for build linux sdk
.build_linux_sdk_template: &build_linux_sdk_job_def
interruptible: true
only:
changes:
- conf/**/*
- .github/**/*
- Makefile*
- .gitlab-ci.yml
- buildroot
- opensbi
- freeloader
- linux
- u-boot
artifacts:
name: "bootimages-${SOC}-${CORE}-${BOOT_MODE}-${CI_COMMIT_SHA::8}"
paths:
- work/${SOC}/
- build_*.log.*
expire_in: 2 day
tags:
- env::shell
- net::outside
- user::xl_ci
script:
- echo ">>Clean previous build workspace"
- make clean
- echo ">>Show help message for $SOC - $CORE - $BOOT_MODE"
- make help
- echo ">>Build buildroot_initramfs_sysroot for $CORE"
- |
make -j buildroot_initramfs_sysroot > >(tee build_sysroot.log |grep '>>>') || {
echo 'Show last 200 lines of build log'
tail -n 200 build_sysroot.log
xz -f -z build_sysroot.log
exit 1
}
- xz -f -z build_sysroot.log
- echo ">>Build multiple prefetch freeloader for $SOC - $CORE - $BOOT_MODE"
- |
export MAKEOPTS="SOC=$SOC CORE=$CORE BOOT_MODE=${BOOT_MODE}"
export SELVAR0="CPU_HZ"
export VARLIST0="16000000,50000000,100000000"
export SELVAR1="SPFL1DCTRL1"
export VARLIST1="0x0,0x1f,0xf,0x3f"
bash .github/build_multiple_freeloader.sh > >(tee build_pref_freeloader.log) || {
xz -f -z build_pref_freeloader.log
exit 1
}
unset MAKEOPTS SELVAR0 VARLIST0 SELVAR1 VARLIST1
- echo ">>Build multiple cache settings freeloader for $SOC - $CORE - $BOOT_MODE"
- |
export MAKEOPTS="SOC=$SOC CORE=$CORE BOOT_MODE=${BOOT_MODE}"
export SELVAR0="CPU_HZ"
export VARLIST0="16000000,50000000,100000000"
export SELVAR1="CACHE_CTRL"
export VARLIST1="0x100C1,0x10001"
bash .github/build_multiple_freeloader.sh > >(tee build_cache_freeloader.log) || {
xz -f -z build_cache_freeloader.log
exit 1
}
unset MAKEOPTS SELVAR0 VARLIST0 SELVAR1 VARLIST1
- xz -f -z build_cache_freeloader.log
- echo ">>Build simulation freeloader for $SOC - $CORE - $BOOT_MODE"
- |
export MAKEOPTS="SOC=$SOC CORE=$CORE BOOT_MODE=${BOOT_MODE}"
export SELVAR0="SIMULATION"
export VARLIST0="1"
export SELVAR1="SPFL1DCTRL1"
export VARLIST1="0x0,0x1f,0xf,0x3f"
bash .github/build_multiple_freeloader.sh > >(tee build_simu_freeloader.log) || {
xz -f -z build_simu_freeloader.log
exit 1
}
unset MAKEOPTS SELVAR0 VARLIST0 SELVAR1 VARLIST1
- xz -f -z build_simu_freeloader.log
- echo ">>Build simulation freeloader console=hvc0 for $SOC - $CORE - $BOOT_MODE"
- |
export MAKEOPTS="SOC=$SOC CORE=$CORE BOOT_MODE=${BOOT_MODE} HVC_CONSOLE=y"
export SELVAR0="SIMULATION"
export VARLIST0="1"
export SELVAR1="SPFL1DCTRL1"
export VARLIST1="0x0,0x1f,0xf,0x3f"
bash .github/build_multiple_freeloader.sh > >(tee build_simu_hvc_freeloader.log) || {
xz -f -z build_simu_hvc_freeloader.log
exit 1
}
unset MAKEOPTS SELVAR0 VARLIST0 SELVAR1 VARLIST1
- xz -f -z build_simu_hvc_freeloader.log
- echo ">>Build freeloader for $SOC - $CORE - $BOOT_MODE"
- |
echo ">>>Build freeloader for default MHz"
make freeloader > >(tee build_freeloader.log) || {
xz -f -z build_freeloader.log
exit 1
}
- xz -f -z build_freeloader.log
- echo ">>Build and generate boot images for $SOC - $CORE - $BOOT_MODE"
- |
make preboot && make -j bootimages > >(tee build_bootimages.log) || {
xz -f -z build_bootimages.log
exit 1
}
- xz -f -z build_bootimages.log
- |
echo ">>Build and generate qemu images for $SOC - $CORE - $BOOT_MODE"
#echo ">>> Apply workaround: change TIMERCLK_FREQ from 32768 to 1000000"
#sed -i "s/32768/1000000/" conf/$SOC/*.dts
#export TIMER_HZ=1000000
make freeloader
QEMU_FREELOADER=work/$SOC/freeloader_qemu.elf
cp work/$SOC/freeloader/freeloader.elf $QEMU_FREELOADER
make -j DISK_SIZE=128 gendisk > >(tee build_qemu_disk.log) || {
xz -f -z build_qemu_disk.log
exit 1
}
echo ">>> Reset workaround and source code, and rebuilt freeloader and boot images"
git reset --hard
make genboot
xz -f -z build_qemu_disk.log
unset TIMER_HZ
- |
RUNQEMUSH=work/$SOC/run_qemu.sh
echo "qemu-system-riscv64 -M nuclei_${SOC},download=flashxip -cpu nuclei-ux900fd,ext=$ARCH_EXT -smp 8 -m 2G -bios freeloader_qemu.elf -nographic -drive file=disk.img,if=sd,format=raw" > $RUNQEMUSH
chmod +x $RUNQEMUSH
- |
if [ "x$SOC" == "xdemosoc" ] ; then
echo ">>Will build xlspike simulation images only for demosoc"
echo ">>Build simulation target for $SOC - $CORE - $BOOT_MODE"
make presim && make -j opensbi_sim > >(tee build_opensbi_payload.log) || {
xz -f -z build_opensbi_payload.log
exit 1
}
cp -f work/${SOC}/opensbi/platform/nuclei/${SOC}/firmware/fw_payload.elf work/${SOC}/fw_payload_xlspike.elf
xz -f -z build_opensbi_payload.log
fi
- |
genbootzip=work/${SOC}/genboot_artifacts_${CI_COMMIT_SHA::8}.zip
echo "Zip all generated boot images and freeloader elfs to ${genbootzip}"
rm -f ${genbootzip}
zip -r ${genbootzip} work/${SOC}/boot.zip work/${SOC}/freeloader/freeloader.elf work/${SOC}/run_qemu.sh work/${SOC}/disk.img work/${SOC}/freeloader_*.elf work/${SOC}/buildstamp.txt work/${SOC}/fw_payload_xlspike.elf
- echo "Please find generated freeloaders in $SHARELOC/$(git describe --always)"
## Job template for run linux in xlspike
.run_linux_sdk_xlspike_template: &run_linux_sdk_xlspike_job_def
interruptible: true
only:
changes:
- conf/**/*
- .github/**/*
- Makefile*
- .gitlab-ci.yml
- buildroot
- opensbi
- freeloader
- linux
- u-boot
tags:
- env::shell
- net::outside
- user::xl_ci
script:
- |
if [ "x$SOC" != "xdemosoc" ] ; then
echo ">>Will not run xlspike simulation for $SOC"
exit 0
fi
timeout --foreground -s SIGKILL 12m xl_spike work/${SOC}/fw_payload_xlspike.elf > >(tee run_xlspike.log) || {
if cat run_xlspike.log | grep "Run /init" ; then echo "Kernel boot successfully" ; else echo "Kernel boot failed" && exit 1; fi;
if cat run_xlspike.log | grep "Welcome to" ; then echo "Pass simulation" && exit 0; else echo "Failed init process" && exit 1; fi;
}
## Job template for run linux in qemu
.run_linux_sdk_qemu_template: &run_linux_sdk_qemu_job_def
interruptible: true
only:
changes:
- conf/**/*
- .github/**/*
- Makefile*
- .gitlab-ci.yml
- buildroot
- opensbi
- freeloader
- linux
- u-boot
tags:
- env::shell
- net::outside
script:
- echo ">>Run using qemu for $SOC - $CORE - $BOOT_MODE"
- |
cd work/$SOC
# $(cat run_qemu.sh) is workaround for directly run bash run_qemu.sh
# If do kill it will just kill bash process, the qemu process is not killed
# SIGTERM is better for kill qemu
timeout --foreground -s SIGTERM 3m $(cat run_qemu.sh) > >(tee run_qemu.log) || {
if cat run_qemu.log | grep "Run /init" ; then echo "Kernel boot successfully" ; else echo "Kernel boot failed" && exit 1; fi;
if cat run_qemu.log | grep "Welcome to" ; then echo "Pass simulation" && exit 0; else echo "Failed init process" && exit 1; fi;
}
# Manual job template
.build_linux_sdk_manual_template: &build_linux_sdk_manual_job_def
interruptible: true
when: manual
only:
changes:
- conf/**/*
- .github/**/*
- Makefile*
- .gitlab-ci.yml
- buildroot
- opensbi
- freeloader
- linux
- u-boot
artifacts:
name: "bootimages-${SOC}-${CORE}-${BOOT_MODE}-${CI_COMMIT_SHA::8}"
paths:
- work/${SOC}/freeloader/freeloader.elf
- work/${SOC}/boot.zip
expire_in: 2 day
tags:
- env::shell
- net::outside
- user::xl_ci
script:
- export MAKEOPTS="${MAKEOPTS}"
- make preboot
- BUILDBOOTIMAGES=0 bash .github/build_sdk.sh
## Job for build sdk
# Build For ux900 Core, without FPU, flash boot mode
build_ux900_flash:
stage: build
variables:
SOC: "demosoc"
CORE: "ux900"
ARCH_EXT: ""
BOOT_MODE: "flash"
parallel:
matrix:
- SOC: ["demosoc", "evalsoc"]
<<: *build_linux_sdk_job_def
## Job for build sdk
# Build For ux900 Core, without FPU, sd boot mode
build_ux900_sd:
stage: build
variables:
SOC: "demosoc"
CORE: "ux900"
ARCH_EXT: ""
BOOT_MODE: "sd"
parallel:
matrix:
- SOC: ["demosoc", "evalsoc"]
<<: *build_linux_sdk_job_def
# Manual job for ux900 sd
build_ux900_sd_manual:
stage: manual
needs:
- job: build_ux900_sd
variables:
SOC: "evalsoc"
CORE: "ux900"
ARCH_EXT: ""
BOOT_MODE: "sd"
<<: *build_linux_sdk_manual_job_def
# Manual job for ux900 flash
build_ux900_flash_manual:
stage: manual
needs:
- job: build_ux900_flash
variables:
SOC: "evalsoc"
CORE: "ux900"
ARCH_EXT: ""
BOOT_MODE: "flash"
<<: *build_linux_sdk_manual_job_def
release_sources:
interruptible: true
stage: build
only:
changes:
- conf/**/*
- .github/**/*
- Makefile*
- .gitlab-ci.yml
- buildroot
- opensbi
- freeloader
- linux
- u-boot
needs:
- job: build_ux900_flash
tags:
- env::shell
- net::outside
- user::xl_ci
script:
- activate_swdev
- make snapshot
- snapshot_zip=($(ls -t1 GENERATED/snapshot/snapshot_*.zip))
- cp -f ${snapshot_zip} linuxsdk_${CI_COMMIT_REF_NAME//\//\_}_${CI_COMMIT_SHA::8}.zip
artifacts:
name: "nuclei_linuxsdk-job${CI_JOB_ID}_${CI_COMMIT_SHA::8}"
paths:
- buildroot/dl
- linuxsdk_*.zip
expire_in: 2 day
## Job for run sim
# Run For ux900 Core, without FPU, flash boot mode
run_ux900_flash_xlspike:
stage: run
dependencies:
- build_ux900_flash
variables:
SOC: "demosoc"
CORE: "ux900"
BOOT_MODE: "flash"
<<: *run_linux_sdk_xlspike_job_def
## Job for run sim
# Run For ux900 Core, without FPU, sd boot mode
run_ux900_sd_xlspike:
stage: run
dependencies:
- build_ux900_sd
variables:
SOC: "demosoc"
CORE: "ux900"
BOOT_MODE: "sd"
<<: *run_linux_sdk_xlspike_job_def
## Job for run qemu
# Run For ux900 Core, without FPU, flash boot mode
run_ux900_flash_qemu:
stage: run
dependencies:
- build_ux900_flash
variables:
SOC: "demosoc"
CORE: "ux900"
BOOT_MODE: "flash"
<<: *run_linux_sdk_qemu_job_def
## Job for run qemu
# Run For ux900 Core, without FPU, sd boot mode
run_ux900_sd_qemu:
stage: run
dependencies:
- build_ux900_sd
variables:
SOC: "demosoc"
CORE: "ux900"
BOOT_MODE: "sd"
<<: *run_linux_sdk_qemu_job_def
## Job for build sdk
# Build For ux900FD Core, with FPU, flash boot mode
build_ux900fd_flash:
stage: build
dependencies:
variables:
SOC: "demosoc"
CORE: "ux900fd"
ARCH_EXT: ""
BOOT_MODE: "flash"
parallel:
matrix:
- SOC: ["demosoc", "evalsoc"]
<<: *build_linux_sdk_job_def
## Job for build sdk
# Build For ux900FD Core, with FPU, sd boot mode
build_ux900fd_sd:
stage: build
dependencies:
variables:
SOC: "demosoc"
CORE: "ux900fd"
ARCH_EXT: ""
BOOT_MODE: "sd"
parallel:
matrix:
- SOC: ["demosoc", "evalsoc"]
<<: *build_linux_sdk_job_def
# Manual job for ux900fd sd
build_ux900fd_sd_manual:
stage: manual
needs:
- job: build_ux900fd_sd
variables:
SOC: "evalsoc"
CORE: "ux900fd"
ARCH_EXT: ""
BOOT_MODE: "sd"
<<: *build_linux_sdk_manual_job_def
# Manual job for ux900fd flash
build_ux900fd_flash_manual:
stage: manual
needs:
- job: build_ux900fd_flash
variables:
SOC: "evalsoc"
CORE: "ux900fd"
ARCH_EXT: ""
BOOT_MODE: "flash"
<<: *build_linux_sdk_manual_job_def
## Job for run sim
# Run For ux900FD Core, with FPU, flash boot mode
# This ux900fd init process will fail
run_ux900fd_flash_xlspike:
stage: run
allow_failure: true
dependencies:
- build_ux900fd_flash
variables:
SOC: "demosoc"
CORE: "ux900fd"
BOOT_MODE: "flash"
<<: *run_linux_sdk_xlspike_job_def
## Job for run sim
# Run For ux900FD Core, with FPU, sd boot mode
# This ux900fd init process will fail
run_ux900fd_sd_xlspike:
stage: run
allow_failure: true
dependencies:
- build_ux900fd_sd
variables:
SOC: "demosoc"
CORE: "ux900fd"
BOOT_MODE: "sd"
<<: *run_linux_sdk_xlspike_job_def
## Job for run qemu
# Run For ux900FD Core, with FPU, flash boot mode
# This ux900fd init process will fail
run_ux900fd_flash_qemu:
stage: run
allow_failure: true
dependencies:
- build_ux900fd_flash
variables:
SOC: "demosoc"
CORE: "ux900fd"
BOOT_MODE: "flash"
<<: *run_linux_sdk_qemu_job_def
## Job for run qemu
# Run For ux900FD Core, with FPU, sd boot mode
# This ux900fd init process will fail
run_ux900fd_sd_qemu:
stage: run
allow_failure: true
dependencies:
- build_ux900fd_sd
variables:
SOC: "demosoc"
CORE: "ux900fd"
BOOT_MODE: "sd"
<<: *run_linux_sdk_qemu_job_def
C
1
https://gitee.com/Nuclei-Software/nuclei-linux-sdk.git
git@gitee.com:Nuclei-Software/nuclei-linux-sdk.git
Nuclei-Software
nuclei-linux-sdk
nuclei-linux-sdk
dev_nuclei_next

搜索帮助