OpenWrt port to LingYun IGKboards
935060b7f0a60d14f78d8d305dbd4e4b91ac7450..624a06e4e79fbd1f38e1a2343a94565b7e5c0727
2026-05-20 guowenxue
Update openwrt build script
624a06 diff | tree
2026-05-20 guowenxue
Add IGKBoard-RK3576 patch file
e0aa18 diff | tree
2026-05-20 guowenxue
Add generate patch shell script
d2b7f7 diff | tree
2026-05-20 guowenxue
Add openwrt build shell script
fa63a7 diff | tree
1 files modified
3 files added
9789 ■■■■■ changed files
.gitignore 2 ●●● patch | view | raw | blame | history
build.sh 184 ●●●●● patch | view | raw | blame | history
patch/gen_patch.sh 75 ●●●●● patch | view | raw | blame | history
patch/openwrt-25.12-igkboard-rk3576.patch 9528 ●●●●● patch | view | raw | blame | history
.gitignore
@@ -1 +1 @@
openwrt-*
openwrt-*/
build.sh
New file
@@ -0,0 +1,184 @@
#!/bin/bash
# board
BOARD=igkboard-rk3576
# openwrt branch
BRANCH=openwrt-25.12
#openwrt url
GITURL=https://github.com/openwrt/openwrt.git
# this project absolute path
PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
# binaries build prefix install path
PRFX_PATH=$PRJ_PATH/install
# binaries finally install path if needed
#INST_PATH=/tftp
# config file path
CONF_FILE=$PRJ_PATH/config.json
# shell script will exit once get command error
set -e
#+-------------------------+
#| Shell script functions  |
#+-------------------------+
function pr_error() {
    echo -e "\033[40;31m $1 \033[0m"
}
function pr_warn() {
    echo -e "\033[40;33m $1 \033[0m"
}
function pr_info() {
    echo -e "\033[40;32m $1 \033[0m"
}
# decompress a packet to destination path
function do_unpack()
{
    tarball=$1
    dstpath=`pwd`
    if [[ $# == 2 ]] ; then
        dstpath=$2
    fi
    pr_info "decompress $tarball => $dstpath"
    mkdir -p $dstpath
    case $tarball in
        *.tar.gz)
            tar -xzf $tarball -C $dstpath
            ;;
        *.tar.bz2)
            tar -xjf $tarball -C $dstpath
            ;;
        *.tar.xz)
            tar -xJf $tarball -C $dstpath
            ;;
        *.tar.zst)
            tar -I zstd -xf $tarball -C $dstpath
            ;;
        *.tar)
            tar -xf $tarball -C $dstpath
            ;;
        *.zip)
            unzip -qo $tarball -d $dstpath
            ;;
        *)
            pr_error "decompress Unsupport packet: $tarball"
            return 1;
            ;;
    esac
}
# parser configure file and export environment variable
function do_export()
{
    export SDK=$BRANCH
}
function do_fetch()
{
    cd $PRJ_PATH
    if [ -f $SDK/Makefile ] ; then
        pr_info "$SDK source code fetched already"
        return 0;
    fi
    pr_info "start fetch source code"
    git clone $GITURL -b $BRANCH $SDK --depth=1
    cd $SDK && pwd
    sed -i 's#https://git.openwrt.org/feed/#https://github.com/openwrt/#g' feeds.conf.default
    sed -i 's#https://git.openwrt.org/project/#https://github.com/openwrt/#g' feeds.conf.default
    sed -i 's#https://git.openwrt.org/#https://github.com/openwrt/#g' feeds.conf.default
    pr_info "start feeds update and install "
    ./scripts/feeds update -a
    ./scripts/feeds install -a
}
function do_patch()
{
    PATCH_FILE=$PRJ_PATH/patch/${BRANCH}-${BOARD}.patch
    cd $PRJ_PATH/$SDK
    if [ ! -f patched.tag ] ; then
        pr_info "do patch $(basename $PATCH_FILE)"
        patch -p1 < $PATCH_FILE
    fi
}
function do_config()
{
    DEF_CONFIG=.${BOARD}.defconfig
    cd $PRJ_PATH/$SDK
    pr_info "make defconfig: $DEF_CONFIG"
    cp $DEF_CONFIG .config
    make defconfig
}
function do_build()
{
    IMAGE_PATH=bin/targets/*/*/
    echo ""
    pr_warn "startu build..."
    make V=s -j$(nproc)
    #make -j1
    echo ""
    pr_warn "output images path: $IMAGE_PATH"
    ls $IMAGE_PATH
    echo ""
}
function do_clean()
{
    cd $WKSP/SDK && pwd
    pr_warn "start clean"
    make clean
}
#+-------------------------+
#| Shell script body entry |
#+-------------------------+
do_export
if [[ $# == 1 && $1 == -c ]] ;then
    do_clean
    exit;
fi
pr_warn "start build $SDK SDK for ${BOARD}"
do_fetch
do_patch
do_config
do_build
patch/gen_patch.sh
New file
@@ -0,0 +1,75 @@
#!/bin/bash
# Description: This shell script used to generate patch file
#      Author: guowenxue <guowenxue@gmail.com>
#     Version: 1.0.0
# this project absolute path
#PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
PRJ_PATH=$(pwd)
# shell script will exit once get command error
#set -e
#+-------------------------+
#| Shell script functions  |
#+-------------------------+
function pr_error() {
    echo -e "\033[40;31m $1 \033[0m"
}
function pr_warn() {
    echo -e "\033[40;33m $1 \033[0m"
}
function pr_info() {
    echo -e "\033[40;32m $1 \033[0m"
}
# parser configure file and export environment variable
function do_export()
{
    export SDKVER=$(basename $1)
    export BOARD=$(basename $2)
}
function gen_patch()
{
    SRC_PATH=$1
    PATCH_NAME=${SDKVER}-${BOARD}.patch
    if [ ! -d $SRC_FPATH ] ;  then
        pr_error "\nERROR: source code $SRC_FPATH not exist, exit now\n\n"
        exit;
    fi
    pr_info "generate patch file for $SRC_PATH"
    cd $SRC_PATH
    pwd
    if [ ! -f patched.tag ] ; then
        touch patched.tag
    fi
    git add * 2> /dev/null
    git add .igkboard-*.defconfig 2> /dev/null
    git add -f files 2> /dev/null
    git diff --cached > $PRJ_PATH/$PATCH_NAME
}
function do_patch()
{
    gen_patch buildroot
}
if [ $# != 2 ] ; then
    pr_info "$0 usage example:"
    pr_info "$0 openwrt-25.12 igkboard-rk3576"
    exit
fi
do_export $1 $2
gen_patch $1
patch/openwrt-25.12-igkboard-rk3576.patch
New file
Diff too large