reference :
https://openwrt.org/docs/guide-developer/quickstart-build-images
Install dependence package:
sudo apt install subversion g++ zlib1g-dev build-essential git python python3 sudo apt install libncurses5-dev gawk gettext unzip file libssl-dev wget sudo apt install libelf-dev ecj fastjar java-propose-classpath
sudo apt install build-essential libncursesw5-dev python unzip
git clone https://github.com/openwrt/openwrt.git cd openwrt
export FORCE_UNSAFE_CONFIGURE=1
./scripts/feeds update -a ./scripts/feeds install -a make menuconfig