Skip to content

Commit

Permalink
Merge pull request #55 from 0x754C/main
Browse files Browse the repository at this point in the history
clean code, rewrite build script, add github ci
  • Loading branch information
Zepan authored Jun 5, 2024
2 parents 3392ba1 + 6fb35dc commit a6543d1
Show file tree
Hide file tree
Showing 30 changed files with 5,648 additions and 552 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: mkimg-lpi3h-ci

on:
workflow_dispatch:

env:
ARCH: arm64

jobs:
prepare:
runs-on: ubuntu-22.04
env:
CREATE_TARBALL: LonganPi-3H-SDK/build/rootfs.tar
steps:
- name: Install Software
run: |
sudo apt update && \
sudo apt install -y qemu-user-static gcc-aarch64-linux-gnu \
mmdebstrap git binfmt-support make build-essential bison \
flex make gcc libncurses-dev debian-archive-keyring swig \
libssl-dev bc python3-setuptools python3-dev libconfuse-dev \
debhelper fuse2fs rsync kmod cpio debian-keyring fuse ccache
- name: ccache
uses: hendrikmuhs/[email protected]

- name: Checkout genimage
uses: actions/checkout@v4
with:
repository: pengutronix/genimage
path: genimage
ref: v17

- name: build genimage
run: |
pushd genimage
./autogen.sh
./configure
make -j$(nproc)
sudo make install
popd
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: 'LonganPi-3H-SDK' # TODO: make this name a global variable

- name: Build
run: |
pushd LonganPi-3H-SDK
git config --global user.email "[email protected]"
git config --global user.name "nop"
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
sh mkatf.sh
sh mkuboot.sh
sh mklinux.sh
sh mkoverlay.sh
sudo sh mkrootfs.sh
sudo sh mkimage.sh
popd
- name: Make Checksum file & Compress files & Clean
run: |
pushd LonganPi-3H-SDK
sudo xz -z -v -9 -T $(nproc) build/images/sdcard.img
sudo mv build/images/* ../
popd
sudo sha512sum sdcard.img.xz > sdcard.img.xz.sha512
sudo rm -rf LonganPi-3H-SDK
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
retention-days: 30
name: lpi3h-${{ env.BOARD }}-${{ env.BUILD_ID }}
path: |
*.xz
*.sha512
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
build/*
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# LonganPi-3H-SDK

# Prebuild Download

latest build: https://github.com/sipeed/LonganPi-3H-SDK/actions

Scripts and blobs for LonganPi 3H image build.
> Tested on Ubuntu 22.04.2 LTS and WSL2 Ubuntu-22.04
0. Install some dependencies
```shell
sudo apt update
sudo apt install qemu-user-static gcc-aarch64-linux-gnu mmdebstrap git binfmt-support make build-essential bison flex make gcc libncurses-dev debian-archive-keyring swig libssl-dev bc python3-setuptools
sudo apt install qemu-user-static gcc-aarch64-linux-gnu mmdebstrap git binfmt-support make build-essential bison flex make gcc libncurses-dev debian-archive-keyring swig libssl-dev bc python3-setuptools python3-dev genimage debhelper fuse2fs rsync kmod cpio debian-keyring fuse
```

1. Build arm-trusted-firmware
Expand All @@ -23,16 +28,20 @@ sudo apt install qemu-user-static gcc-aarch64-linux-gnu mmdebstrap git binfmt-su
./mklinux.sh
```

4. Build rootfs
4. add extra files for longanpi3h

```shell
# for Debian desktop
sudo ./mkrootfs-debian-gui.sh
./mkoverlay.sh
```

# for Debian without gui
# sudo ./mkrootfs-debian-cli.sh
5. Build debian rootfs

# for Ubuntu without gui
# sudo ./mkrootfs-ubuntu-cli.sh
```shell
./mkrootfs.sh
```

6. Build sdcard image

```shell
./mkimage.sh
```
26 changes: 0 additions & 26 deletions find-ubuntu-mirrors.sh

This file was deleted.

18 changes: 18 additions & 0 deletions genimage.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Minimal SD card image for the Allwinner H618

image sdcard.img {
hdimage {
}

partition u-boot {
in-partition-table = false
image = "u-boot-sunxi-with-spl.bin"
offset = 8K
}

partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
offset = 8M
}
}
118 changes: 118 additions & 0 deletions linux/0037-longanpi_3h_defconfig-enable-some-feature-use-for-lp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
From dab8be613bc2bcc55399b563eeb073419a8a5344 Mon Sep 17 00:00:00 2001
From: Lu Hui <[email protected]>
Date: Thu, 28 Mar 2024 18:22:30 +0800
Subject: [PATCH 37/37] longanpi_3h_defconfig: enable some feature use for
lpi3h cluster

---
arch/arm64/configs/longanpi_3h_defconfig | 47 ++++++++++++++++++------
1 file changed, 35 insertions(+), 12 deletions(-)

diff --git a/arch/arm64/configs/longanpi_3h_defconfig b/arch/arm64/configs/longanpi_3h_defconfig
index 614fe0ed5650..164795864a11 100644
--- a/arch/arm64/configs/longanpi_3h_defconfig
+++ b/arch/arm64/configs/longanpi_3h_defconfig
@@ -866,13 +866,13 @@ CONFIG_TCP_CONG_HTCP=m
# CONFIG_TCP_CONG_ILLINOIS is not set
# CONFIG_TCP_CONG_DCTCP is not set
# CONFIG_TCP_CONG_CDG is not set
-# CONFIG_TCP_CONG_BBR is not set
+CONFIG_TCP_CONG_BBR=m
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_AO is not set
# CONFIG_TCP_MD5SIG is not set
-# CONFIG_IPV6 is not set
+CONFIG_IPV6=m
# CONFIG_MPTCP is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
@@ -1058,7 +1058,7 @@ CONFIG_IP_NF_IPTABLES=y
# CONFIG_IP_NF_FILTER is not set
# CONFIG_IP_NF_TARGET_SYNPROXY is not set
CONFIG_IP_NF_NAT=m
-# CONFIG_IP_NF_TARGET_MASQUERADE is not set
+CONFIG_IP_NF_TARGET_MASQUERADE=m
# CONFIG_IP_NF_TARGET_NETMAP is not set
# CONFIG_IP_NF_TARGET_REDIRECT is not set
# CONFIG_IP_NF_MANGLE is not set
@@ -1324,13 +1324,13 @@ CONFIG_OF_RESERVED_MEM=y
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_NULL_BLK is not set
-# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_DRBD=m
# CONFIG_DRBD_FAULT_INJECTION is not set
-# CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_RAM=m
# CONFIG_CDROM_PKTCDVD is not set
-# CONFIG_ATA_OVER_ETH is not set
+CONFIG_ATA_OVER_ETH=m
CONFIG_BLK_DEV_RBD=m
# CONFIG_BLK_DEV_UBLK is not set

@@ -1432,13 +1432,13 @@ CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
-# CONFIG_DUMMY is not set
-# CONFIG_WIREGUARD is not set
+CONFIG_DUMMY=m
+CONFIG_WIREGUARD=m
# CONFIG_EQUALIZER is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_IPVLAN is not set
-# CONFIG_VXLAN is not set
+CONFIG_VXLAN=m
# CONFIG_GENEVE is not set
# CONFIG_BAREUDP is not set
# CONFIG_GTP is not set
@@ -1446,7 +1446,7 @@ CONFIG_NET_CORE=y
# CONFIG_NETCONSOLE is not set
CONFIG_TUN=m
# CONFIG_TUN_VNET_CROSS_LE is not set
-# CONFIG_VETH is not set
+CONFIG_VETH=m
# CONFIG_NLMON is not set
# CONFIG_NETKIT is not set
CONFIG_ETHERNET=y
@@ -3623,7 +3623,30 @@ CONFIG_CONFIGFS_FS=y
# end of Pseudo filesystems

# CONFIG_MISC_FILESYSTEMS is not set
-# CONFIG_NETWORK_FILESYSTEMS is not set
+CONFIG_NETWORK_FILESYSTEMS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V2=m
+CONFIG_NFS_V3=m
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=m
+CONFIG_NFS_V4_1=y
+CONFIG_NFS_V4_2=y
+# CONFIG_NFS_DISABLE_UDP_SUPPORT is not set
+CONFIG_NFS_V4_2_READ_PLUS=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2=y
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_BLOCKLAYOUT=y
+CONFIG_NFSD_SCSILAYOUT=y
+CONFIG_NFSD_FLEXFILELAYOUT=y
+CONFIG_NFSD_V4_2_INTER_SSC=y
+CONFIG_CIFS=m
+CONFIG_SMB_SERVER=m
+CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN=y
+CONFIG_CODA_FS=m
+CONFIG_AFS_FS=m
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
--
2.40.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 95c270ddd994ccc366fb8000480d72e4dc16745f Mon Sep 17 00:00:00 2001
From: Lu Hui <[email protected]>
Date: Tue, 2 Apr 2024 15:42:52 +0800
Subject: [PATCH 38/38] longanpi_3h_defconfig: enable more format for initramfs
compression

---
arch/arm64/configs/longanpi_3h_defconfig | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/configs/longanpi_3h_defconfig b/arch/arm64/configs/longanpi_3h_defconfig
index 164795864a11..25884df72920 100644
--- a/arch/arm64/configs/longanpi_3h_defconfig
+++ b/arch/arm64/configs/longanpi_3h_defconfig
@@ -188,12 +188,12 @@ CONFIG_NET_NS=y
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
-# CONFIG_RD_GZIP is not set
-# CONFIG_RD_BZIP2 is not set
-# CONFIG_RD_LZMA is not set
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
# CONFIG_RD_XZ is not set
-# CONFIG_RD_LZO is not set
-# CONFIG_RD_LZ4 is not set
+CONFIG_RD_LZO=y
+CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
# CONFIG_BOOT_CONFIG is not set
# CONFIG_INITRAMFS_PRESERVE_MTIME is not set
--
2.40.1

Loading

0 comments on commit a6543d1

Please sign in to comment.