diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index f18e9e54..d4d30fee 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -783,7 +783,7 @@ function build_rv_ubuntu_kernel() fi local KERNELRELEASE=$(make ARCH=riscv LOCALVERSION="" kernelrelease) - make -j$(nproc) ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE LOCALVERSION="" bindeb-pkg + make -j$(nproc) ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE LOCALVERSION="" bindeb-pkg dtbs ret=$? if [ $ret -ne 0 ]; then popd @@ -798,6 +798,9 @@ function build_rv_ubuntu_kernel() mv ../linux-image-${KERNELRELEASE}_*.deb $RV_DEB_INSTALL_DIR/linux-image-${KERNELRELEASE}.deb mv ../linux-headers-${KERNELRELEASE}_*.deb $RV_DEB_INSTALL_DIR/linux-headers-${KERNELRELEASE}.deb mv ../linux-libc-dev_${KERNELRELEASE}-*.deb $RV_DEB_INSTALL_DIR/linux-libc-dev_${KERNELRELEASE}.deb + + cp $RV_KERNEL_BUILD_DIR/arch/riscv/boot/dts/sophgo/${CHIP}-*.dtb $RV_FIRMWARE_INSTALL_DIR + popd } @@ -806,6 +809,7 @@ function clean_rv_ubuntu_kernel() RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/ubuntu rm -rf $RV_KERNEL_BUILD_DIR rm -f $RV_DEB_INSTALL_DIR/linux-*.deb + rm -f $RV_FIRMWARE_INSTALL_DIR/*.dtb } function build_rv_fedora_kernel() @@ -916,7 +920,7 @@ EOT RPMBUILD_DIR=$RV_KERNEL_SRC_DIR/rpmbuild fi - make -j$(nproc) ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE LOCALVERSION="" rpm-pkg + make -j$(nproc) ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE LOCALVERSION="" rpm-pkg dtbs ret=$? rm ~/.rpmmacros if [ -e ~/.rpmmacros.orig ]; then @@ -938,6 +942,7 @@ EOT fi cp $RPMBUILD_DIR/RPMS/riscv64/*.rpm $RV_RPM_INSTALL_DIR/ + cp $RV_KERNEL_SRC_DIR/arch/riscv/boot/dts/sophgo/${CHIP}-*.dtb $RV_FIRMWARE_INSTALL_DIR make ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE distclean rm *.tar.gz rm -rf $RPMBUILD_DIR @@ -1446,12 +1451,14 @@ function build_rv_firmware() if [ "$CHIP" = "bm1690" ];then build_rv_kernel ap build_rv_kernel tp - else + build_rv_uroot + elif [ "$CHIP" = "mango" ];then build_rv_kernel + build_rv_uroot + build_rv_edk2 + elif [ "$CHIP" = "sg2044" ];then build_rv_edk2 fi - - build_rv_uroot } function clean_rv_firmware() @@ -1471,7 +1478,7 @@ function build_rv_firmware_bin() if [ ! -e "$RELEASED_NOTE_MD" ] || [ ! -s "$RELEASED_NOTE_MD" ];then version="1.0.0" - else + else version=$(awk 'END {split($1, a, "_"); print a[1]}' $RELEASED_NOTE_MD) fi @@ -1488,7 +1495,7 @@ function build_rv_firmware_bin() cp firmware-$version.bin image-bmc $RV_SCRIPTS_DIR/gen-tar-for-bmc.sh image-bmc -o obmc-bios.tar.gz -m ast2600-sophgo -v $version -s fi - rm -f image-bmc *.xml + rm -f image-bmc *.xml popd } diff --git a/scripts/gen_sg2044_img.sh b/scripts/gen_sg2044_img.sh index 8a49779c..b6fb7239 100644 --- a/scripts/gen_sg2044_img.sh +++ b/scripts/gen_sg2044_img.sh @@ -96,19 +96,17 @@ function build_rv_image() sudo cp -v $RV_FIRMWARE_INSTALL_DIR/u-boot.bin $EFI_PARTITION_DIR/riscv64 fi - sudo cp -v $RV_FIRMWARE_INSTALL_DIR/initrd.img $EFI_PARTITION_DIR/riscv64 sudo cp -v $RV_FIRMWARE_INSTALL_DIR/zsbl.bin $EFI_PARTITION_DIR/riscv64 sudo cp -v $RV_FIRMWARE_INSTALL_DIR/fw_dynamic.bin $EFI_PARTITION_DIR/riscv64 if [ "$CHIP" = "bm1690" ]; then + sudo cp -v $RV_FIRMWARE_INSTALL_DIR/initrd.img $EFI_PARTITION_DIR/riscv64 sudo cp -v $RV_FIRMWARE_INSTALL_DIR/rp_Image $EFI_PARTITION_DIR/riscv64 sudo cp -v $RV_TOP_DIR/bootloader-riscv/scripts/bm1690-config.ini $RV_FIRMWARE_INSTALL_DIR/conf.ini sudo cp -v $RV_FIRMWARE_INSTALL_DIR/conf.ini $EFI_PARTITION_DIR/riscv64 - else - sudo cp -v $RV_FIRMWARE_INSTALL_DIR/riscv64_Image $EFI_PARTITION_DIR/riscv64 fi - sudo cp -v $RV_FIRMWARE_INSTALL_DIR/*.dtb $EFI_PARTITION_DIR/riscv64 + sudo cp -v $RV_FIRMWARE_INSTALL_DIR/${CHIP}-*.dtb $EFI_PARTITION_DIR/riscv64 echo 'mount system files' sudo mount --bind /proc $RV_OUTPUT_DIR/root/proc