diff --git a/.gitignore b/.gitignore index ca3445224e68..8747dceeaedf 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.bak *.swp *.tar.gz +*.patch b.sh .tmp diff --git a/external/cache/debs/h618/linux-u-boot-current-orangepizero2w_1.0.0_arm64.deb b/external/cache/debs/h618/linux-u-boot-current-orangepizero2w_1.0.0_arm64.deb new file mode 100644 index 000000000000..305c4d16e59d Binary files /dev/null and b/external/cache/debs/h618/linux-u-boot-current-orangepizero2w_1.0.0_arm64.deb differ diff --git a/external/cache/debs/h618/linux-u-boot-current-orangepizero3_1.0.0_arm64.deb b/external/cache/debs/h618/linux-u-boot-current-orangepizero3_1.0.0_arm64.deb new file mode 100644 index 000000000000..8e731998ac8d Binary files /dev/null and b/external/cache/debs/h618/linux-u-boot-current-orangepizero3_1.0.0_arm64.deb differ diff --git a/external/config/boards/orangepizero2.conf b/external/config/boards/orangepizero2.conf index 65fa321002e6..651eed74b0c8 100644 --- a/external/config/boards/orangepizero2.conf +++ b/external/config/boards/orangepizero2.conf @@ -2,7 +2,7 @@ BOARD_NAME="OPI Zero2" BOARDFAMILY="sun50iw9" BOOTCONFIG="orangepi_zero2_defconfig" -KERNEL_TARGET="current,next" +KERNEL_TARGET="next" MODULES_LEGACY="uwe5622_bsp_sdio sprdwl_ng sprdbt_tty" MODULES_CURRENT="uwe5622_bsp_sdio sprdwl_ng sprdbt_tty" MODULES_NEXT="uwe5622_bsp_sdio sprdwl_ng sprdbt_tty" diff --git a/external/config/sources/families/sun50iw9.conf b/external/config/sources/families/sun50iw9.conf index 4fd55c52301d..c39d2fb49d9e 100644 --- a/external/config/sources/families/sun50iw9.conf +++ b/external/config/sources/families/sun50iw9.conf @@ -60,8 +60,10 @@ case $BRANCH in ATF_TARGET_MAP='PLAT=sun50i_h616 DEBUG=1 bl31;;build/sun50i_h616/debug/bl31.bin' UBOOT_TARGET_MAP=';;u-boot-sunxi-with-spl.bin' [[ $BOARD =~ orangepizero2 ]] && BOOTBRANCH='branch:v2021.10-sunxi' - [[ $BOARD =~ orangepizero3|orangepir1b|orangepizero2w ]] && BOOTBRANCH='v2021.07-sunxi' BOOTSCRIPT='boot-sun50iw9-next.cmd:boot.cmd' + if [[ $BOARD =~ orangepizero3|orangepir1b|orangepizero2w ]]; then + BOOTBRANCH='branch:v2021.07-sunxi' + fi ## For Linux5.16.y #KERNELBRANCH="branch:orange-pi-5.16-sunxi64" @@ -112,7 +114,7 @@ family_tweaks_bsp() uboot_custom_postprocess() { - if [[ ${BRANCH} =~ legacy|current ]]; then + if [[ ${BRANCH} =~ legacy|current && $(dpkg --print-architecture) == amd64 ]]; then rm dts/*.dts sys_config ${BOARD}-u-boot-${BRANCH}.dtb -r >/dev/null 2>&1 export PATH=${EXTER}/packages/pack-uboot/${BOARDFAMILY}/tools/:$PATH diff --git a/scripts/compilation.sh b/scripts/compilation.sh index a4bbe5b50b3c..fd3001cc7d5e 100755 --- a/scripts/compilation.sh +++ b/scripts/compilation.sh @@ -112,6 +112,14 @@ compile_atf() compile_uboot() { + + if [[ ${BOARDFAMILY} == "sun50iw9" && ${BRANCH} =~ legacy|current && $(dpkg --print-architecture) == arm64 ]]; then + + local uboot_name=${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb + display_alert "Compile u-boot is not supported, only copy precompiled deb package" "$uboot_name" "info" + cp "${EXTER}/cache/debs/h618/$uboot_name" "${DEB_STORAGE}/u-boot/" + else + # not optimal, but extra cleaning before overlayfs_wrapper should keep sources directory clean if [[ $CLEAN_LEVEL == *make* ]]; then display_alert "Cleaning" "$BOOTSOURCEDIR" "info" @@ -215,6 +223,15 @@ compile_uboot() fi + if [[ ${BOARDFAMILY} == "sun50iw9" && ${BRANCH} == "next" ]]; then + if [[ ${MEM_TYPE} == "1500MB" ]]; then + + sed -i 's/^.*CONFIG_DRAM_SUN50I_H616_TRIM_SIZE*/CONFIG_DRAM_SUN50I_H616_TRIM_SIZE=y/g' .config + else + sed -i 's/^.*CONFIG_DRAM_SUN50I_H616_TRIM_SIZE*/# CONFIG_DRAM_SUN50I_H616_TRIM_SIZE is not set/g' .config + fi + fi + [[ -f tools/logos/udoo.bmp ]] && cp "${EXTER}"/packages/blobs/splash/udoo.bmp tools/logos/udoo.bmp touch .scmversion @@ -315,6 +332,8 @@ compile_uboot() rsync --remove-source-files -rq "$uboottempdir/${uboot_name}.deb" "${DEB_STORAGE}/u-boot/" rm -rf "$uboottempdir" + + fi } create_linux-source_package () diff --git a/scripts/debootstrap.sh b/scripts/debootstrap.sh index 4da51a7b3bee..d160c384d386 100755 --- a/scripts/debootstrap.sh +++ b/scripts/debootstrap.sh @@ -748,7 +748,11 @@ create_image() IMAGE_TYPE=desktop fi - local version="${BOARD^}_${REVISION}_${DISTRIBUTION,}_${RELEASE}_${IMAGE_TYPE}"${DESKTOP_ENVIRONMENT:+_$DESKTOP_ENVIRONMENT}"_linux$(grab_version "$LINUXSOURCEDIR")" + if [[ ${MEM_TYPE} == "1500MB" ]]; then + local version="${BOARD^}_${REVISION}_${DISTRIBUTION,}_${RELEASE}_${IMAGE_TYPE}"${DESKTOP_ENVIRONMENT:+_$DESKTOP_ENVIRONMENT}"_linux$(grab_version "$LINUXSOURCEDIR")_1.5gb" + else + local version="${BOARD^}_${REVISION}_${DISTRIBUTION,}_${RELEASE}_${IMAGE_TYPE}"${DESKTOP_ENVIRONMENT:+_$DESKTOP_ENVIRONMENT}"_linux$(grab_version "$LINUXSOURCEDIR")" + fi [[ $ROOTFS_TYPE == nfs ]] && version=${version}_nfsboot destimg=$DEST/images/${version} diff --git a/scripts/main.sh b/scripts/main.sh index 3b578c5fe930..d64564a2300c 100755 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -280,7 +280,20 @@ if [[ -z $BRANCH ]]; then fi +if [[ -z ${MEM_TYPE} && ${BOARD} =~ orangepizero3|orangepir1b|orangepizero2w && ${BUILD_OPT} =~ u-boot|image && ${BRANCH} == next ]]; then + options+=("1500MB" "1.5 GB Memory") + options+=("Others" "1/2/4 GB Memory") + + menustr="Please choose memory size for ${BOARD}." + MEM_TYPE=$(whiptail --title "${titlestr}" --backtitle "${backtitle}" \ + --menu "${menustr}" "${TTY_Y}" "${TTY_X}" $((TTY_Y - 8)) \ + --cancel-button Exit --ok-button Select "${options[@]}" \ + 3>&1 1>&2 2>&3) + + unset options + [[ -z $MEM_TYPE ]] && exit_with_error "No option selected" +fi if [[ $BUILD_OPT =~ rootfs|image && -z $RELEASE ]]; then