Skip to content

Commit

Permalink
Merge branch 'SolidRun:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kevax24 authored Feb 25, 2025
2 parents 7cca25a + 5e3d904 commit 95faea3
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 8 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
prepare_container:
runs-on: self-hosted
outputs:
uid: ${{ steps.uid_step.outputs.userid }}
gid: ${{ steps.uid_step.outputs.groupid }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Get user id/group
id: uid_step
run: |
echo "userid=$(id -u)" >> "$GITHUB_OUTPUT"
echo "groupid=$(id -g)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config: /etc/docker/cibuilder.toml

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ciserver.ci:5000
username: ${{ secrets.CI_CACHE_REGISTRY_LOGIN }}
password: ${{ secrets.CI_CACHE_REGISTRY_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: docker
push: true
tags: ciserver.ci:5000/${{ github.repository_id }}:lf-5.15.y-imx8mp
cache-from: type=registry,ref=ciserver.ci:5000/${{ github.repository_id }}:cache
cache-to: type=registry,ref=ciserver.ci:5000/${{ github.repository_id }}:cache,mode=max
build-args: |
USER_ID=${{ steps.uid_step.outputs.userid }}
GROUP_ID=${{ steps.uid_step.outputs.groupid }}
build_images:
needs: prepare_container
runs-on: self-hosted
timeout-minutes: 1080
container:
image: ciserver.ci:5000/${{ github.repository_id }}:lf-5.15.y-imx8mp
credentials:
username: ${{ secrets.CI_CACHE_REGISTRY_LOGIN }}
password: ${{ secrets.CI_CACHE_REGISTRY_PASSWORD }}
options: --user "${{ needs.prepare_container.outputs.uid }}:${{ needs.prepare_container.outputs.gid }}"
outputs:
build_tag: ${{ steps.tag_step.outputs.build_tag }}
steps:
- name: Checkout pull-request version of imx8mp_build
uses: actions/checkout@v4

- name: Get build tag
shell: bash -e {0}
id: tag_step
run: |
build_tag=$(date +%Y-%m-%d)_$(git rev-parse --short HEAD)
echo "build_tag=$build_tag" >> "$GITHUB_OUTPUT"
- name: Build
shell: bash -e {0}
run: |
env SHALLOW=true UBOOT_ENVIRONMENT=mmc:2:1 DISTRO=buildroot ./runme.sh
env SHALLOW=true UBOOT_ENVIRONMENT=mmc:2:2 DISTRO=buildroot ./runme.sh
env SHALLOW=true UBOOT_ENVIRONMENT=mmc:1:0 DISTRO=buildroot ./runme.sh
env SHALLOW=true UBOOT_ENVIRONMENT=mmc:2:1 DISTRO=debian ./runme.sh
env SHALLOW=true UBOOT_ENVIRONMENT=mmc:2:2 DISTRO=debian ./runme.sh
env SHALLOW=true UBOOT_ENVIRONMENT=mmc:1:0 DISTRO=debian ./runme.sh
- name: Select artifacts for publishing
shell: bash -e {0}
run: |
mkdir deploy
cp -L images/linux-*.tar deploy/
cp -L images/linux-headers-*.tar deploy/
cp -L images/*.img deploy/
cp -L images/*.bin deploy/
xz -9 deploy/*
ls -lh deploy
- name: Deploy to the local minio storage
uses: yakubique/[email protected]
with:
endpoint: http://ciserver.ci:9000
insecure: true
access_key: ${{ secrets.CI_CACHE_MINIO_ACCESS }}
secret_key: ${{ secrets.CI_CACHE_MINIO_SECRET }}
bucket: cipublish
source: ./deploy
target: "/${{ github.repository_id }}/${{ steps.tag_step.outputs.build_tag }}"
recursive: true

publish_images:
needs: build_images
runs-on: self-hosted
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
steps:
- name: Download an artifacts from MinIO
uses: yakubique/[email protected]
with:
endpoint: http://ciserver.ci:9000
insecure: true
access_key: ${{ secrets.CI_CACHE_MINIO_ACCESS }}
secret_key: ${{ secrets.CI_CACHE_MINIO_SECRET }}
bucket: cipublish
source: "/${{ github.repository_id }}/${{ needs.build_images.outputs.build_tag }}/"
target: "."
recursive: true

- name: Upload to S3
uses: shallwefootball/[email protected]
with:
aws_key_id: ${{ secrets.IMAGES_S3_ACCESS }}
aws_secret_access_key: ${{ secrets.IMAGES_S3_SECRET }}
aws_bucket: ${{ secrets.IMAGES_S3_BUCKET }}
endpoint: ${{ secrets.IMAGES_S3_HOST }}
source_dir: deploy
destination_dir: IMX8/imx8mp_build/lf-5.15.y/${{ needs.build_images.outputs.build_tag }}
15 changes: 12 additions & 3 deletions configs/kernel.extra
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IPV6_SIT=m
CONFIG_NETFILTER=y
CONFIG_NF_CONNTRACK=m
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
Expand Down Expand Up @@ -310,7 +310,7 @@ CONFIG_IGBVF=y
# CONFIG_RMNET is not set
# CONFIG_SMC91X is not set
# CONFIG_SMSC911X is not set
CONFIG_STMMAC_ETH=m
CONFIG_STMMAC_ETH=m
CONFIG_DWMAC_GENERIC=m
CONFIG_ADIN_PHY=m
# CONFIG_AQUANTIA_PHY is not set
Expand Down Expand Up @@ -1050,7 +1050,7 @@ CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
CONFIG_SCHED_DEBUG=y
CONFIG_SCHED_DEBUG=y
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_FTRACE is not set
CONFIG_CORESIGHT=y
Expand Down Expand Up @@ -1139,3 +1139,12 @@ CONFIG_CDRM_PANEL_DSI_CM=y
CONFIG_DRM_PANEL_RONBO_RB070D30=m
CONFIG_DRM_IMX_DW_MIPI_DSI=m
#CONFIG_DEBUG_DRIVER=y is not set (can be used for debug)
CONFIG_SKB_EXTENSIONS=y
CONFIG_BRIDGE_NETFILTER=m
CONFIG_NETFILTER_FAMILY_BRIDGE=y
CONFIG_NF_CONNTRACK_BRIDGE=m
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_PPP=m
CONFIG_USB_WDM=y
CONFIG_LIBCRC32C=y
CONFIG_USB_NET_CDC_MBIM=m
9 changes: 4 additions & 5 deletions runme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ do_build_buildroot() {
# make menuconfig
make savedefconfig BR2_DEFCONFIG="${ROOTDIR}/build/buildroot/defconfig"
make -j${PARALLEL}
cp $ROOTDIR/build/buildroot/output/images/rootfs.ext2 $ROOTDIR/images/tmp/rootfs.ext4
cp $ROOTDIR/build/buildroot/output/images/rootfs* $ROOTDIR/images/tmp/
cp -L --sparse=always $ROOTDIR/build/buildroot/output/images/rootfs.ext2 "${ROOTFS_IMG}"
cp -L --sparse=always $ROOTDIR/build/buildroot/output/images/rootfs.cpio "$ROOTDIR/images/tmp/"
# Preparing initrd
mkimage -A arm64 -O linux -T ramdisk -d $ROOTDIR/images/tmp/rootfs.cpio $ROOTDIR/images/tmp/initrd.img
}
Expand Down Expand Up @@ -483,7 +483,7 @@ EOF
fi;

# export final rootfs for next steps
cp --sparse=always rootfs.e2.orig "${ROOTDIR}/images/tmp/rootfs.ext4"
cp --sparse=always rootfs.e2.orig "${ROOTFS_IMG}"

# apply overlay (configuration + data files only - can't "chmod +x")
find "${ROOTDIR}/overlay/${DISTRO}" -type f -printf "%P\n" | e2cp -G 0 -O 0 -s "${ROOTDIR}/overlay/${DISTRO}" -d "${ROOTDIR}/images/tmp/rootfs.ext4:" -a
Expand Down Expand Up @@ -568,7 +568,7 @@ IMAGE_BOOTPART_START=$((8*1024*1024)) # partition start aligned to 8MiB
IMAGE_BOOTPART_SIZE=$((150*1024*1024)) # bootpart size = 150MiB
IMAGE_BOOTPART_END=$((IMAGE_BOOTPART_START+IMAGE_BOOTPART_SIZE-1))
IMAGE_ROOTPART_START=$((IMAGE_BOOTPART_END+1))
IMAGE_ROOTPART_SIZE=`stat -c "%s" tmp/rootfs.ext4`
IMAGE_ROOTPART_SIZE=`stat -c "%s" ${ROOTFS_IMG}`
IMAGE_ROOTPART_END=$((IMAGE_ROOTPART_START+IMAGE_ROOTPART_SIZE-1))
IMAGE_SIZE=$((IMAGE_ROOTPART_END+1))
truncate -s ${IMAGE_SIZE} ${IMG}
Expand All @@ -588,5 +588,4 @@ fi
dd if=$ROOTDIR/build/imx-mkimage/iMX8M/flash.bin of=${IMG} bs=1K seek=32 conv=notrunc
dd if=tmp/part1.fat32 of=${IMG} seek=$((IMAGE_BOOTPART_START/512)) conv=notrunc,sparse
dd if=${ROOTFS_IMG} of=${IMG} seek=$((IMAGE_ROOTPART_START/512)) conv=notrunc,sparse
dd if=${ROOTFS_IMG} of=${IMG} seek=$((IMAGE_ROOTPART_START/512)) conv=notrunc,sparse
echo -e "\n\n*** Image is ready - images/${IMG}"

0 comments on commit 95faea3

Please sign in to comment.