Skip to content

Commit

Permalink
Merge branch 'main' into optimize_rk3588-kernel-configs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexl83 authored Jun 9, 2024
2 parents bf69f23 + 0e7e76d commit b5f83a7
Show file tree
Hide file tree
Showing 17 changed files with 457 additions and 916 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/labeler.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/pr-auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Automatic Pull Request Labeling"
#
# Set labels for pull requests automatically based on size (modified via job 'label-size') and file categories (modified via .github/labeler)
#

on:
- pull_request_target

jobs:

label-category:
permissions:
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

label-size:
permissions:
contents: read # for pascalgn/size-label-action to determine modified files
pull-requests: write # for pascalgn/size-label-action to add labels to PRs
runs-on: ubuntu-latest
steps:
- name: size-label
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
sizes: >
{
"0": "small",
"50": "medium",
"250": "large"
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
name: Generate artifacts on PR
name: Generate artifacts on PR if 'Build' label exists
#
# If PR is labeled with "Build" and you are a member of "Release manager" team it will start (additional security feature)
# If PR is labeled with "Build" and you are a member of "Release manager" team it will start a build train (additional security feature)
#

on:
pull_request:
types: [opened, reopened, synchronize, review_requested, labeled]

concurrency:
group: pipeline-pr-${{github.event.pull_request.number}}
cancel-in-progress: true
types: [opened, reopened, synchronize, labeled]

jobs:

Check:
permissions:
pull-requests: read

name: "verify if compilation can be executed"
name: "Check if 'Build' label is active and user is authorized"
if: contains(github.event.pull_request.labels.*.name, 'Build')
runs-on: Linux
outputs:
Expand All @@ -36,6 +32,9 @@ jobs:

needs: Check
name: "Update artifacts"
concurrency:
group: pipeline-pr-${{github.event.pull_request.number}}
cancel-in-progress: true
if: ${{ github.repository_owner == 'Armbian' && needs.Check.outputs.member == 'true' }}
uses: armbian/os/.github/workflows/complete-artifact-matrix-all.yml@main
secrets:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Lint On Scripts
name: Lint on Scripts
#
# Run ShellCheck on all scripts and generates report as build artefact
# Run ShellCheck on all scripts and generate report as build artifact
#

on:
workflow_dispatch:
pull_request:
types: [opened, reopened, edited, synchronize]
types: [opened, reopened, synchronize]

permissions:
contents: read
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: List all changed files
run: |
# use framework internal mechanism for checking `lib` and `extensions` code only one file is passed,
# Use framework internal mechanism for checking `lib` and `extensions` code only one file is passed,
# and source's are followed, thus the whole project is "understood" by shellcheck.
# For example, when checking individual files, one variable might be thought "unused" because it
# is only used in another file, which does not happen when done properly.
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/pr-size-labeler.yml

This file was deleted.

83 changes: 74 additions & 9 deletions config/boards/odroidhc4.csc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BOARD_NAME="Odroid HC4"
BOARDFAMILY="meson-sm1"
BOARD_MAINTAINER=""
BOOTCONFIG="odroid-c4_defconfig" # But also 'odroid-hc4_defconfig', see below at UBOOT_TARGET_MAP
BOOTCONFIG="odroid-c4_defconfig" # for the SD card; but also 'odroid-hc4_defconfig', see below at pre_config_uboot_target
KERNEL_TARGET="current,edge"
MODULES_BLACKLIST="simpledrm" # SimpleDRM conflicts with Panfrost
FULL_DESKTOP="no"
Expand All @@ -11,19 +11,84 @@ BOOT_FDT_FILE="amlogic/meson-sm1-odroid-hc4.dtb"
PACKAGE_LIST_BOARD="lm-sensors fancontrol" # SPI, sensors, manual fan control via 'pwmconfig'

# Newer u-boot for the HC4. There's patches in `board_odroidhc4` for the defconfigs used in the UBOOT_TARGET_MAP below.
BOOTBRANCH_BOARD="tag:v2023.01"
BOOTPATCHDIR="v2023.01"
BOOTBRANCH_BOARD="tag:v2024.04"
BOOTPATCHDIR="v2024.04"

# We build u-boot twice: odroid-hc4_sd_defconfig config for SD cards, and HC4 (with SATA/PCI/SPI) config for SPI.
# Go look at the related patches for speculations on why.
# We build u-boot twice: C4 config for SD cards, and HC4 (with SATA/PCI/SPI) config for SPI.
UBOOT_TARGET_MAP="
odroid-hc4_sd_defconfig u-boot-dtb.img;;u-boot.bin.sd.bin:u-boot.bin u-boot-dtb.img
odroid-hc4_defconfig u-boot-dtb.img;;u-boot.bin:u-boot-spi.bin
armbian_target=sd u-boot-dtb.img;;u-boot.bin.sd.bin:u-boot.bin u-boot-dtb.img
armbian_target=spi u-boot-dtb.img;;u-boot.bin:u-boot-spi.bin
"

# The SPI version (u-boot-spi.bin, built from odroid-hc4_defconfig above) is then used by nand-sata-install
# The SPI version (u-boot-spi.bin, built from odroid-hc4_defconfig above) is then used by nand-sata-install / armbian-install
function write_uboot_platform_mtd() {
dd if=$1/u-boot-spi.bin of=/dev/mtdblock0
declare -a extra_opts_flashcp=("--verbose")
if flashcp -h | grep -q -e '--partition'; then
echo "Confirmed flashcp supports --partition -- read and write only changed blocks." >&2
extra_opts_flashcp+=("--partition")
else
echo "flashcp does not support --partition, will write full SPI flash blocks." >&2
fi
flashcp "${extra_opts_flashcp[@]}" "${1}/u-boot-spi.bin" /dev/mtd0
}

# FIP blobs; the C4 & HC4 fip blobs are actually the same, still LE carries both.
function post_uboot_custom_postprocess__odroid_hc4_uboot() {
display_alert "Signing u-boot FIP" "${BOARD}" "info"
uboot_g12_postprocess "${SRC}"/cache/sources/amlogic-boot-fip/odroid-hc4 g12a
}

# switch defconfig according to target, so we can still use the same post_config_uboot_target for both.
function pre_config_uboot_target__odroidhc4_defconfig_per_target() {
case "${target_make}" in
"armbian_target=spi "*)
BOOTCONFIG="odroid-hc4_defconfig"
;;
"armbian_target=sd "*)
BOOTCONFIG="odroid-c4_defconfig"
;;
*)
exit_with_error "Unknown target_make: '${target_make}', unknown BOOTCONFIG."
;;
esac
display_alert "setting BOOTCONFIG for target" "${target_make}: '${BOOTCONFIG}'" "info"
}

# Enable extra u-boot .config options, this way we avoid patching defconfig
function post_config_uboot_target__extra_configs_for_odroid_hc4() {
display_alert "u-boot for ${BOARD}" "u-boot: enable preboot & pci+usb start in preboot" "info"
run_host_command_logged scripts/config --enable CONFIG_USE_PREBOOT
run_host_command_logged scripts/config --set-str CONFIG_PREBOOT "'run boot_pci_enum; usb start'" # double quotes required due to run_host_command_logged's quirks

display_alert "u-boot for ${BOARD}" "u-boot: enable EFI debugging command" "info"
run_host_command_logged scripts/config --enable CMD_EFIDEBUG
run_host_command_logged scripts/config --enable CMD_NVEDIT_EFI

## WAIT ## display_alert "u-boot for ${BOARD}" "u-boot: disable EFI Video Framebuffer" "info"
## WAIT ## run_host_command_logged scripts/config --disable CONFIG_VIDEO_DT_SIMPLEFB # "Enables the code to pass the framebuffer to the kernel as a simple framebuffer in the device tree."
## WAIT ## # CONFIG_VIDEO_EFI is unrelated: its about _using_ an EFI framebuffer when booted by an EFI-capable bootloader earlier in the chain. Not about _providing_ an EFI framebuffer. That's simplefb.
## WAIT ## # CONFIG_FDT_SIMPLEFB seems to be rpi-specific and 100% unrelated here

display_alert "u-boot for ${BOARD}" "u-boot: enable I2C support" "info"
run_host_command_logged scripts/config --enable CONFIG_DM_I2C
run_host_command_logged scripts/config --enable CONFIG_SYS_I2C_MESON
run_host_command_logged scripts/config --enable CONFIG_CMD_I2C

display_alert "u-boot for ${BOARD}" "u-boot: enable more compression support" "info"
run_host_command_logged scripts/config --enable CONFIG_LZO
run_host_command_logged scripts/config --enable CONFIG_BZIP2
run_host_command_logged scripts/config --enable CONFIG_ZSTD

display_alert "u-boot for ${BOARD}" "u-boot: enable gpio LED support" "info"
run_host_command_logged scripts/config --enable CONFIG_LED
run_host_command_logged scripts/config --enable CONFIG_LED_GPIO

display_alert "u-boot for ${BOARD}" "u-boot: enable networking cmds" "info"
run_host_command_logged scripts/config --enable CONFIG_CMD_NFS
run_host_command_logged scripts/config --enable CONFIG_CMD_WGET
run_host_command_logged scripts/config --enable CONFIG_CMD_DNS
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP_SACK
}

# @TODO: this is no longer needed in `edge` branch -- Neil has sent a patch with a trip for the cooling map in the DT - also doesn't hurt.
Expand Down
3 changes: 2 additions & 1 deletion config/sources/families/meson-sm1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ uboot_custom_postprocess() {
if [[ $BOARD == odroidc4 ]]; then
uboot_g12_postprocess $SRC/cache/sources/amlogic-boot-fip/odroid-c4 g12a
elif [[ $BOARD == odroidhc4 ]]; then
uboot_g12_postprocess $SRC/cache/sources/amlogic-boot-fip/odroid-hc4 g12a
# do nothing. odroid HC4 has its own post_uboot_custom_postprocess hook, directly in the board file.
:
elif [[ $BOARD == khadas-vim3l ]]; then
# do nothing. VIM3L has its own post_uboot_custom_postprocess hook, directly in the board file.
:
Expand Down
2 changes: 1 addition & 1 deletion lib/functions/main/rootfs-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function build_rootfs_and_image() {
LOG_SECTION="apt_lists_copy_from_host_to_image_and_update" do_with_logging apt_lists_copy_from_host_to_image_and_update

# creating xapian index that synaptic runs faster
if [[ "${BUILD_DESKTOP}" == yes && -f "${SDCARD}/usr/sbin/update-apt-xapian-index" ]]; then
if [[ "${BUILD_DESKTOP}" == yes && "${BETA}" != "yes" && -f "${SDCARD}/usr/sbin/update-apt-xapian-index" ]]; then
display_alert "Recreating Synaptic search index" "Please wait - updating Xapian index for image" "info"
chroot_sdcard "/usr/sbin/update-apt-xapian-index -u"
fi
Expand Down
Loading

0 comments on commit b5f83a7

Please sign in to comment.