Skip to content

Commit

Permalink
support bpi-m6-cn build with gitee
Browse files Browse the repository at this point in the history
  • Loading branch information
BPI-SINOVOIP committed Oct 21, 2024
1 parent d318f0b commit fa847e5
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
45 changes: 45 additions & 0 deletions config/boards/bananapim6-cn.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Synaptics VS680 SoC quad core A73(2.1Ghz) 4GB SoC eMMC USB3
BOARD_NAME="Banana Pi M6"
BOARDFAMILY="vs680"
VENDOR="Armbian-bpi-senarytech"
BOOTCONFIG="vs680_oemboot_c05_defconfig"
KERNEL_TARGET="legacy"
FULL_DESKTOP="yes"
BOOT_LOGO="desktop"
WIREGUARD="no"
#
OFFSET="100"
BOOT_FS_LABEL="BPI-BOOT"
ROOT_FS_LABEL="BPI-ROOT"
BOOTSIZE="256"
SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes
BOOTFS_TYPE="fat"

function post_family_tweaks__bananapim6_naming_audios() {
display_alert "$BOARD" "Renaming bananapim6 audios" "info"

mkdir -p $SDCARD/etc/udev/rules.d/
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"' > $SDCARD/etc/udev/rules.d/90-naming-audios.rules
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi1-sound", ENV{SOUND_DESCRIPTION}="HDMI1 Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmiin-sound", ENV{SOUND_DESCRIPTION}="HDMI-In Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-dp0-sound", ENV{SOUND_DESCRIPTION}="DP0 Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-es8316-sound", ENV{SOUND_DESCRIPTION}="ES8316 Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules

return 0
}

# Override family config for this board; let's avoid conditionals in family config.
function post_family_config__bananapim6_use_vendor_uboot() {
#BOOTSOURCE='https://github.com/BPI-SINOVOIP/pi-u-boot.git'
BOOTSOURCE='https://gitee.com/bananapi/pi-u-boot.git'
BOOTBRANCH='branch:v2019.10-vs680-hdmi-rx'
BOOTPATCHDIR="legacy"
}

function post_family_config__bananapim6_use_vendor_kernel() {
declare -g KERNEL_MAJOR_MINOR="5.4" # Major and minor versions of this kernel.
#KERNELSOURCE='https://github.com/BPI-SINOVOIP/pi-linux.git'
KERNELSOURCE='https://gitee.com/bananapi/pi-linux.git'
KERNELBRANCH='branch:pi-5.4-vs680-hdmi-rx'
KERNELPATCHDIR="legacy"
}
9 changes: 8 additions & 1 deletion config/sources/families/vs680.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
# https://github.com/armbian/build/
#
declare -g ARCH="arm64"
SERIALCON='ttyPS0'
SERIALCON='ttyS0'
LINUXFAMILY=vs680

# Skip all wifi drivers
#declare -g KERNEL_DRIVERS_SKIP+=(driver_generic_bring_back_ipx driver_mt7921u_add_pids driver_rtl8152_rtl8153 driver_rtl8189ES
# driver_rtl8189FS driver_rtl8192EU driver_rtl8811_rtl8812_rtl8814_rtl8821 driver_xradio_xr819 driver_rtl8811CU_rtl8821C
# driver_rtl8188EU_rtl8188ETV driver_rtl88x2bu driver_rtw88 driver_rtl88x2cs driver_rtl8822cs_bt driver_rtl8723DS driver_rtl8723DU
# driver_rtl8822BS driver_uwe5622 driver_rtl8723cs driver_rtl8852bs)

declare -g KERNEL_DRIVERS_SKIP+=(driver_rtl8822BS driver_uwe5622 driver_rtl8723cs driver_rtl8852bs)
KERNELSOURCE='https://github.com/BPI-SINOVOIP/pi-linux.git'
declare -g KERNEL_MAJOR_MINOR="5.4" # Major and minor versions of this kernel
#KERNELBRANCH='branch:pi-5.4-vs680'
Expand Down
32 changes: 32 additions & 0 deletions lib/functions/general/git-ref2info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,30 @@ function memoized_git_ref_to_info() {
exit_with_error "Failed to fetch SHA1 of '${MEMO_DICT[GIT_SOURCE]}' '${ref_type}' '${ref_name}' - make sure it's correct"
fi

if [[ "${ARMBIAN_COMMAND}" == "artifact-config-dump-json" ]] && [[ ${ref_type} == "branch" ]]; then
{
flock -x 5
flock -x 6

[[ -s "${SRC}"/output/info/git_sources.json ]] || echo '[]' >&5
jq --arg source "${MEMO_DICT[GIT_SOURCE]}" \
--arg branch "${ref_name}" \
--arg sha1 "${sha1}" \
"if (map(select(.source == \$source and .branch == \$branch))| length) !=0 then \
(.[]|select(.source == \$source and .branch == \$branch)).sha1 |= \$sha1 \
else \
. + [{\"source\": \$source, \"branch\": \$branch, \"sha1\": \$sha1}] \
end" /dev/fd/5 >&6
cat /dev/fd/6 > "${SRC}"/output/info/git_sources.json
} 5<> "${SRC}"/output/info/git_sources.json 6<> "${SRC}"/output/info/git_sources.json.new
fi

if [[ -f "${SRC}"/config/sources/git_sources.json && ${ref_type} == "branch" ]]; then
cached_revision=$(jq --raw-output '.[] | select(.source == "'${MEMO_DICT[GIT_SOURCE]}'" and .branch == "'$ref_name'") |.sha1' "${SRC}"/config/sources/git_sources.json)
display_alert "Found cached git version" "${cached_revision}" "info"
[[ -z "${cached_revision}" ]] || sha1=${cached_revision}
fi

MEMO_DICT+=(["SHA1"]="${sha1}")

if [[ "${2}" == "include_makefile_body" ]]; then
Expand All @@ -99,6 +123,14 @@ function memoized_git_ref_to_info() {
url="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/Makefile?h=${sha1}"
;;

"https://gitee.com/"*)
# parse org/repo from https://gitee.com/org/repo
declare org_and_repo=""
org_and_repo="$(echo "${git_source}" | cut -d/ -f4-5)"
org_and_repo="${org_and_repo%.git}" # remove .git if present
url="https://gitee.com/${org_and_repo}/raw/${sha1}/Makefile"
;;

"https://github.com/"*)
# parse org/repo from https://github.com/org/repo
declare org_and_repo=""
Expand Down

0 comments on commit fa847e5

Please sign in to comment.