Skip to content

[WIP] Enable Rockchip arch in kernel #2556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 11 additions & 112 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: |
Space-separated vendor formats to build.
required: true
default: qemu_uefi pxe
default: qemu_uefi
custom_sdk_version:
type: string
required: false
Expand All @@ -21,7 +21,7 @@ on:
description: |
Space-separated vendor formats to build.
required: true
default: qemu_uefi pxe
default: qemu_uefi
custom_sdk_version:
type: string
required: false
Expand All @@ -35,14 +35,11 @@ jobs:
packages:
name: "Build Flatcar packages"
runs-on:
- self-hosted
- debian
- build
- x64
- ubuntu-latest
strategy:
fail-fast: false
fail-fast: true
matrix:
arch: ["amd64", "arm64"]
arch: ["arm64"]
defaults:
run:
working-directory: scripts
Expand All @@ -59,7 +56,7 @@ jobs:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
Expand Down Expand Up @@ -96,7 +93,7 @@ jobs:
arch="${{ matrix.arch }}"
echo "arch=${arch}" >> $GITHUB_ENV

IMAGE_FORMATS="qemu_uefi pxe"
IMAGE_FORMATS="qemu_uefi"
[ -z "${{ inputs.image_formats }}" ] || IMAGE_FORMATS="${{ inputs.image_formats }}"
echo "IMAGE_FORMATS=${IMAGE_FORMATS}" >> $GITHUB_ENV

Expand Down Expand Up @@ -142,31 +139,6 @@ jobs:
-C "${sdk_image}" \
./build_packages --board="${arch}-usr"

# Create binpkgs tarball for archiving as artifact later
./run_sdk_container -n "${container_name}" \
tar -C "/build/${arch}-usr/var/lib/portage/pkgs/" \
-cvf binpkgs.tar .

- name: Extract build logs
if: always() && !cancelled()
shell: bash
run: |
set -euo pipefail
set -x
# Copy logs
./run_sdk_container -n "${container_name}" \
tar -cJf ebuild_logs.tar.xz /build/${arch}-usr/var/log/portage \
/build/${arch}-usr/var/tmp/portage

- name: Upload build logs
if: always() && !cancelled()
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: ${{ matrix.arch }}-build-logs
path: |
scripts/ebuild_logs.tar.xz

- name: Build image
shell: bash
run: |
Expand All @@ -185,7 +157,7 @@ jobs:
./run_sdk_container -n "${container_name}" \
./build_image --board="${arch}-usr" --group="${channel}" \
--output_root="${CI_CONTAINER_ARTIFACT_ROOT}" \
prodtar container sysext
--image_compression_formats=none

- name: Build VM image(s)
shell: bash
Expand Down Expand Up @@ -243,88 +215,15 @@ jobs:
mv * ../../images/
)

- name: Generate reports against last release
run: .github/workflows/image_changes.sh ${{ matrix.arch }} release

- name: Generate reports against last nightly
run: .github/workflows/image_changes.sh ${{ matrix.arch }} nightly

- name: Upload binpkgs
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: ${{ matrix.arch }}-binpkgs
path: |
scripts/binpkgs.tar

- name: Upload update image (used with kola tests later)
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: ${{ matrix.arch }}-test-update
path: |
scripts/artifacts/images/flatcar_test_update.gz

- name: Upload generic image
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: ${{ matrix.arch }}-generic-image
path: |
scripts/artifacts/images/flatcar_production_image.bin
scripts/artifacts/images/flatcar_production_image.grub
scripts/artifacts/images/flatcar_production_image.shim
scripts/artifacts/images/flatcar_production_image.vmlinuz
scripts/artifacts/images/flatcar_production_image*.txt
scripts/artifacts/images/flatcar_production_image*.json
scripts/artifacts/images/flatcar_production_image_pcr_policy.zip
scripts/artifacts/images/flatcar_production_*_efi_*.qcow2
scripts/artifacts/images/flatcar_production_qemu.sh

- name: Upload developer container
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: ${{ matrix.arch }}-devcontainer
path: |
scripts/artifacts/images/flatcar_developer_container*

- name: Upload reports
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: ${{ matrix.arch }}-image-changes-reports
path: |
scripts/image-changes-reports*.txt

# Clean up what we uploaded already so the "vendor images" wildcard
# works when uploading artifacts in the next step.
- name: Remove update, generic and devcontainer images
shell: bash
run: |
set -euo pipefail
set -x
rm -f artifacts/images/flatcar_test_update.gz \
artifacts/images/flatcar_production_image* \
artifacts/images/flatcar_developer_container* \
artifacts/images/flatcar_production_update*

- name: Upload vendor images
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: ${{ matrix.arch }}-vm-images
path: |
scripts/artifacts/images/*.img
scripts/artifacts/images/*.bin
scripts/artifacts/images/flatcar_production_*_efi_*.qcow2
scripts/artifacts/images/*.img
scripts/artifacts/images/*.txt
scripts/artifacts/images/flatcar-*.raw
scripts/artifacts/images/flatcar_production_*.sh
scripts/artifacts/images/flatcar_production_pxe_image.cpio.gz
scripts/artifacts/images/flatcar_production_pxe.vmlinuz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will need to re-add these two lines as well for pxe

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need PXE? For my testing, I use flatcar-install to install the raw image on my SD card.

FYI I'll remove all modifications on the CI once I have a fully working image, I keep it to be able to build on my repo right now but I don't want to mess with the CI after this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, definitely not, wanted to add the note if you need to build the pxe image, you ll need to also add them to the github artifacts.


test:
needs: packages
name: "Run kola tests"
uses: ./.github/workflows/run-kola-tests.yaml
scripts/artifacts/images/flatcar_production_*_efi_*.qcow2
scripts/artifacts/images/flatcar_production_qemu.sh
2 changes: 1 addition & 1 deletion build_library/disk_layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"_comment": "See http://www.chromium.org/chromium-os/building-chromium-os/disk-layout-format",
"metadata":{
"_comment": "Partitions are aligned to 2MB (4096 blocks). For the sake of VHD disks sizes should align to *both* 2MB and a CHS cylender boundry for the common 16H 63S geometry (16*63 = 1008 blocks). The least common multiple of 4096 and 1008 is 258048 blocks.",
"part_alignment": 4096,
"part_alignment": 8192,
"disk_alignment": 258048,
"block_size": 512,
"fs_block_size": 4096
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CONFIG_ARCH_BCM2835=y
CONFIG_ARCH_BCM_IPROC=y
# CONFIG_ARCH_MEDIATEK is not set
# CONFIG_ARCH_QCOM is not set
CONFIG_ARCH_ROCKCHIP=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONFIG_ARCH_MULTI_V7 might be required too

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RK3566 is ARMv8-A (it has only 4 Cortex A-55, which are ARMv8.2-A) and CONFIG_ARCH_MULTI_V7 is for ARMv7 (if I understand correctly). So at first sight, it should not be required but if my real test fails, I'll try to add it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is weird because it says it's for Rockchip Cortex-A9 so I'll try without it and if it doesn't work, I'll try to add it.

If I add it, I'll try to use the SDK container to build locally and make the change if it helps.

CONFIG_ARCH_SEATTLE=y
CONFIG_ARCH_SPRD=y
CONFIG_ARCH_TEGRA=y
Expand All @@ -21,7 +22,7 @@ CONFIG_BCM7XXX_PHY=m
CONFIG_BCMGENET=m
CONFIG_CHR_DEV_SCH=m
CONFIG_COMPAT=y
CONFIG_CONNECTOR=m
CONFIG_CONNECTOR=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
Expand Down Expand Up @@ -96,3 +97,179 @@ CONFIG_USB_ULPI=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_VIRTUALIZATION=y
CONFIG_XGENE_DMA=y

# Configs from Home Assistant OS

CONFIG_CRYPTO_ENGINE=m
CONFIG_CRYPTO_DEV_VIRTIO=m
CONFIG_ARMV8_DEPRECATED=y
CONFIG_SWP_EMULATION=y
CONFIG_CP15_BARRIER_EMULATION=y
CONFIG_SETEND_EMULATION=y

CONFIG_NVME_CORE=y
CONFIG_NVME_HWMON=y

CONFIG_I6300ESB_WDT=y

CONFIG_GPIO_PCA9570=y

CONFIG_USB_ONBOARD_DEV=y
CONFIG_USB_ONBOARD_DEV_USB5744=y

CONFIG_I2C_CADENCE=y

CONFIG_THERMAL_GOV_BANG_BANG=y
CONFIG_SENSORS_GPIO_FAN=y

CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_GPIO_POLLED=y

CONFIG_MMC_SDHCI_OF_DWCMSHC=y

# CONFIG_DW_WATCHDOG is not set


# Configs from multiple sources

CONFIG_ROCKCHIP_ERRATUM_3588001=y
CONFIG_PCIE_ROCKCHIP=y
CONFIG_PCIE_ROCKCHIP_HOST=y
# CONFIG_PCIE_ROCKCHIP_EP is not set
CONFIG_PCIE_ROCKCHIP_DW_HOST=y
CONFIG_MTD_NAND_ROCKCHIP=y
CONFIG_MTD_RAW_NAND=y
CONFIG_HAS_IOMEM=y
# CONFIG_EMAC_ROCKCHIP is not set
CONFIG_ROCKCHIP_PH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HIP_SNPS_PCIE3=y
CONFIG_PHY_ROCKCHIP_TYPEC=y
CONFIG_PHY_ROCKCHIP_USB=y
CONFIG_NVMEM_ROCKCHIP_EFUSE=m
CONFIG_NVMEM_ROCKCHIP_OTP=m
CONFIG_CRYPTO_DEV_ROCKCHIP=m
# CONFIG_CRYPTO_DEV_ROCKCHIP_DEBUG is not set

CONFIG_I2C=y
CONFIG_I2C_RK3X=y

CONFIG_CLK_RK3308=y
CONFIG_CLK_RK3328=y
CONFIG_CLK_RK3368=y
CONFIG_CLK_RK3399=y
CONFIG_CLK_RK3568=y
CONFIG_CLK_RK3576=y
CONFIG_CLK_RK3588=y

CONFIG_EFI_ARMSTUB_DTB_LOADER=y

CONFIG_SCSI=y
CONFIG_SCSI_LOWLEVEL=y
CONFIG_ISCSI_IBFT=y

CONFIG_MFD_RK8XX=y
CONFIG_MFD_RK8XX_I2C=y
CONFIG_MFD_RK8XX_SPI=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_RK805=y
CONFIG_COMMON_CLK=y
CONFIG_COMMON_CLK_RK808=y

CONFIG_OF=y
CONFIG_MFD_RK808=y
CONFIG_REGULATOR_RK808=y

CONFIG_INPUT=y
CONFIG_USB_HID=m
CONFIG_HID_SENSOR_HUB=m

CONFIG_RTC_INTF_DEV_UIE_EMUL=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_RTC_DRV_HYM8563=y
CONFIG_RTC_DRV_NCT3018Y=m
CONFIG_RTC_DRV_RK808=y
CONFIG_RTC_DRV_ISL12026=m
CONFIG_RTC_DRV_X1205=m
CONFIG_RTC_DRV_PCF8523=m
CONFIG_RTC_DRV_PCF85063=m
CONFIG_RTC_DRV_PCF85363=m
CONFIG_RTC_DRV_PCF8563=m
CONFIG_RTC_DRV_PCF8583=m
CONFIG_RTC_DRV_M41T80=m
CONFIG_RTC_DRV_M41T80_WDT=y
CONFIG_RTC_DRV_BQ32K=m
CONFIG_RTC_DRV_S35390A=m
CONFIG_RTC_DRV_FM3130=m
CONFIG_RTC_DRV_RX8010=m
CONFIG_RTC_DRV_RX8581=m
CONFIG_RTC_DRV_RX8025=m
CONFIG_RTC_DRV_EM3027=m
CONFIG_RTC_DRV_RV3028=m
CONFIG_RTC_DRV_RV8803=m
CONFIG_RTC_DRV_SD3078=m
CONFIG_RTC_DRV_M41T93=m
CONFIG_RTC_DRV_M41T94=m
CONFIG_RTC_DRV_DS1302=m
CONFIG_RTC_DRV_DS1305=m
CONFIG_RTC_DRV_DS1343=m
CONFIG_RTC_DRV_DS1347=m
CONFIG_RTC_DRV_DS1390=m
CONFIG_RTC_DRV_MAX6916=m
CONFIG_RTC_DRV_R9701=m
CONFIG_RTC_DRV_RX4581=m
CONFIG_RTC_DRV_RS5C348=m
CONFIG_RTC_DRV_MAX6902=m
CONFIG_RTC_DRV_PCF2123=m
CONFIG_RTC_DRV_MCP795=m
CONFIG_RTC_DRV_DS3232=m
CONFIG_RTC_DRV_PCF2127=m
CONFIG_RTC_DRV_RV3029C2=m
CONFIG_RTC_DRV_RX6110=m
CONFIG_RTC_DRV_EFI=y
CONFIG_RTC_DRV_PL030=m
CONFIG_RTC_DRV_PL031=y
CONFIG_RTC_DRV_CADENCE=m
CONFIG_RTC_DRV_HID_SENSOR_TIME=m
CONFIG_RTC_DRV_GOLDFISH=m
Loading