Photonicat 编译 OpenWRT, Debian: Difference between revisions

From Photonicat Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 59: Line 59:
sudo apt update
sudo apt update
sudo apt upgrade -y
sudo apt upgrade -y
sudo apt install -y build-essential flex bison genext2fs \
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
    ccache ecj fastjar file g++ gawk gettext git \
  bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
    java-propose-classpath libelf-dev libncurses5-dev \
  git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \
    libncursesw5-dev libssl-dev python2.7-dev python3 \
  libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
    unzip wget python3-distutils python3-setuptools python3-dev \
  mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \
    rsync subversion swig time xsltproc zlib1g-dev \
  libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \
    device-tree-compiler gcc-aarch64-linux-gnu bc lz4 python
  vim wget xmlto xxd zlib1g-dev
</pre>
</pre>


Line 71: Line 71:
Get repo files from Github (non-root user):  
Get repo files from Github (non-root user):  
<pre>
<pre>
git clone https://github.com/photonicat/rockchip_rk3568_linux_sdk -b openwrt --single-branch rk3568-linux-sdk
git clone https://github.com/photonicat/rockchip_rk3568_openwrt.git
cd rk3568-linux-sdk
cd rockchip_rk3568_openwrt
git submodule update --init
</pre>
</pre>


Line 79: Line 78:
Run the command below:
Run the command below:
<pre>
<pre>
./rk3568-config-photonicat-openwrt.sh
./scripts/feeds update -a               
./scripts/feeds install -a                                                                       
cp ./configs/base_defconfig .config
</pre>
</pre>


Line 85: Line 86:
Run the command below:
Run the command below:
<pre>
<pre>
export CROSS_COMPILE=aarch64-linux-gnu-
make
./build.sh
</pre>
</pre>
The output path is <code>rockdev</code>, system image path is <code>rockdev/pack</code>
The output path is <code>bin/targets/rockchip/armv8/</code>, system image will be named like <code>photonicatwrt-23.04-rxxxx+xx-xxxxxxxxx-rockchip-armv8-ariaboard_photonicat-squashfs-sysupgrade.img.gz</code>


===Edit your menuconfig===
===Edit your menuconfig===
<pre>
<pre>
cd openwrt
make menuconfig
make menuconfig ARCH=aarch64
</pre>
</pre>


save and re-run build process again.
save and re-run build process again.


IPKs will be under: <pre>./openwrt/staging_dir/packages/armvirt/</pre>
IPKs will be under: <pre>bin/targets/rockchip/armv8/packages/</pre>


==Flash system images to the onboard eMMC==
==Flash system images to the onboard eMMC==

Revision as of 15:36, 8 June 2023

Debian

Host System Requirements

Debian 11 (bullseye) or Ubuntu 20.04.

Compiling Requirements

On Debian/Ubuntu systems, install the packages:

sudo apt-get install build-essential flex bison genext2fs

Get Repo files by tarball(with .git)

wget https://dl.photonicat.com/repos/rk3568-debian-source-20220927.tar.xz

Install live build packages

Install live build packages if not installed yet:

sudo dpkg -i debian/ubuntu-build-service/packages/*.deb
sudo apt-get install -f

Config build target

Run the command below:

./rk3568-config-photonicat-debian.sh

Build system image

Run the command below:

./build.sh

The output path is rockdev, system image path is rockdev/pack


OpenWRT

Photonicat image contains following packages:

  1. OpenWRT (within rk3568-linux-sdk which builds bootloader, uboot, kernel and OpenWRT)
  2. pcat-manager (within rk3568-linux-sdk)
  3. pcat-manager-web (python closed source. install manually: e.g: https://dl.photonicat.com/repos/openwrt/volatile/pcat-manager-web_1.0.9-0_aarch64_cortex-a53.ipk, we need to change luci listen port to 8080.)
  4. quectel-cm (within rk3568-linux-sdk)

rk3568-linux-sdk will fetch uboot, kernel, openwrt, and copmile them in one build script.

In addition to default packages we have 3 more package for power and modem manager.

  • modem/power_manager (written in c)
  • web interface for displaying mobile modem and battery info. (written in python)
  • c program modem watchdog

Host System Requirements

Debian 11 (bullseye) or Ubuntu 20.04, other distributions may work but not tested.

Compiling Requirements

Please a NORMAL USER, not root

On Debian/Ubuntu systems, install the packages:

sudo apt update
sudo apt upgrade -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
   bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
   git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \
   libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
   mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \
   libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \
   vim wget xmlto xxd zlib1g-dev

Get repo files

Get repo files from Github (non-root user):

git clone https://github.com/photonicat/rockchip_rk3568_openwrt.git
cd rockchip_rk3568_openwrt

Config build target

Run the command below:

./scripts/feeds update -a                 
./scripts/feeds install -a                                                                        
cp ./configs/base_defconfig .config

Build system image

Run the command below:

make

The output path is bin/targets/rockchip/armv8/, system image will be named like photonicatwrt-23.04-rxxxx+xx-xxxxxxxxx-rockchip-armv8-ariaboard_photonicat-squashfs-sysupgrade.img.gz

Edit your menuconfig

make menuconfig

save and re-run build process again.

IPKs will be under:

bin/targets/rockchip/armv8/packages/

Flash system images to the onboard eMMC

Refer: Photonicat_快速上手#4G/5G版本按键功能定义 to enter the firmware update mode, use A-to-A cable to connect USB OTG port to PC, and use the command below:

sudo tools/linux/Linux_Upgrade_Tool/Linux_Upgrade_Tool/upgrade_tool uf rockdev/pack/BOARDCONFIG-RK3568-PHOTONICAT-OPENWRT-DDR4-GPT-IMAGE_DATE-IMAGE_TIME.img #Replace IMAGE_DATE and IMAGE_TIME with the one you get.

Build your own package, modules

use

make menuconfig

to select

<M> package_name

for your desired package(s).