added orangepi_zero_2w

This commit is contained in:
wt
2025-04-01 18:17:21 +07:00
parent 63a7acdfd5
commit bd8616e78c
15 changed files with 16714 additions and 92 deletions
+7 -7
View File
@@ -14,13 +14,13 @@ ko8821au() {
cd $build/$pkgname
git clone $gitsrc
cd ${pkgname}-${pkgver}
make ARCH=$ARCH CROSS_COMPILE=${CROSS_COMPILE}- KSRC=${build}/kernel/linux-${kernel_version} modules ${makeflags}
make ARCH=$ARCH CROSS_COMPILE=${CROSS_COMPILE}- KSRC=${build}/kernel/linux-${KERNEL_VERSION} modules ${makeflags}
check $? "Build ${pkgname}"
mkdir -pv $rootfspath/lib/modules/${kernel_version}/kernel/drivers/net/wireless
cp -v 8821au.ko $rootfspath/lib/modules/${kernel_version}/kernel/drivers/net/wireless/
/sbin/depmod -a ${kernel_version} -b $rootfspath
gzip -9 $rootfspath/lib/modules/${kernel_version}/kernel/drivers/net/wireless/8821au.ko
mkdir -pv $rootfspath/lib/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless
cp -v 8821au.ko $rootfspath/lib/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless/
/sbin/depmod -a ${KERNEL_VERSION} -b $rootfspath
gzip -9 $rootfspath/lib/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless/8821au.ko
check $? "Install Linux Kernel module ${pkgname}"
[ -d $rootfspath/usr/lib/modules/$kernel_version/source ] && rm -rv $rootfspath/usr/lib/modules/$kernel_version/source
[ -d $rootfspath/usr/lib/modules/$kernel_version/build ] && rm -rv $rootfspath/usr/lib/modules/$kernel_version/build
[ -d $rootfspath/usr/lib/modules/$KERNEL_VERSION/source ] && rm -rv $rootfspath/usr/lib/modules/$KERNEL_VERSION/source
[ -d $rootfspath/usr/lib/modules/$KERNEL_VERSION/build ] && rm -rv $rootfspath/usr/lib/modules/$KERNEL_VERSION/build
}
+25 -20
View File
@@ -1,7 +1,7 @@
#!/bin/bash
#------------ config ------------------
export PATH=$PATH:/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/bin
export PATH=$PATH:/opt/toolchains/aarch64-buildroot-linux-uclibc_sdk-buildroot/bin
export version=0.0.1 # script version
export root=$(pwd) # root build directory
# disk="sdz" # disk to write install image
@@ -9,6 +9,7 @@ export distro_name="Simple" # distro name
export distro_desc="Simple linux distro" # distro desctiption
export distro_codename="zero_zero_one" # distro codename
# hyperv_support="false" # hyperv support for kernel image
export BOARD_NAME=orangepi_zero_2w
export out=$root/out # output directory
export build=$root/build # build directory
export sourcesfilename=sources.txt # sources file for downloading
@@ -18,25 +19,29 @@ export rootfsfile=$root/rootfs/rootfs.txt # file to created director
export rootfspath=$build/rootfs # rootfs build directory
export fulllogfile=$root/.log/fulllog.log # file for full build logs
export makeflags=-j$(nproc) # makeflags
export CROSS_COMPILE=arm-buildroot-linux-uclibcgnueabihf
export ARCH=arm
export CROSS_COMPILE=aarch64-buildroot-linux-uclibc
export ARCH=arm64
export sdroot=$out/sdroot
export UCLIBC_CONFIG_FILE=$root/board/${BOARD_NAME}/uclibc-1.0.50.config
export ZLIB_ENABLE="true"
export DROPBEAR_ENABLE="true"
export IMAGE_USABLE_ENABLE="true"
export SFTP_SERVER_ENABLE="true"
export CURL_ENABLE="false"
export BASH_ENABLE="false"
export GIT_ENABLE="false"
export GITEA_ENABLE="false"
export LIBNL_ENABLE="true"
export IW_ENABLE="true"
export WIRELES_TOOLS_ENABLE="true"
export WPA_SUPPLICANT_ENABLE="true"
export HOSTAPD_ENABLE="true"
export OPENSSL_ENABLE="true"
export DNSMASQ_ENABLE="true"
export IPTABLES_ENABLE="true"
export KO8821AU_ENABLE="true"
export KERNEL_VERSION=6.8.6
export KERNEL_CONFIG_FILE=${root}/board/${BOARD_NAME}/linux-${KERNEL_VERSION}.config
export ZLIB_ENABLE=y
export DROPBEAR_ENABLE=y
export IMAGE_USABLE_ENABLE=y
export SFTP_SERVER_ENABLE=y
export CURL_ENABLE=n
export BASH_ENABLE=n
export GIT_ENABLE=n
export GITEA_ENABLE=n
export LIBNL_ENABLE=y
export IW_ENABLE=y
export WIRELES_TOOLS_ENABLE=y
export WPA_SUPPLICANT_ENABLE=y
export HOSTAPD_ENABLE=y
export OPENSSL_ENABLE=y
export DNSMASQ_ENABLE=y
export IPTABLES_ENABLE=y
export KO8821AU_ENABLE=y
#--------------------------------------
+8 -10
View File
@@ -4,8 +4,6 @@
. ./scripts/funcs.sh
. ./scripts/config.sh
kernel_version=6.13.3
#--------------- Building Linux Kernel ---------------------
kernel() {
printf "$UGREEN** Building Linux Kernel\n$RESET"
@@ -13,12 +11,12 @@ kernel() {
mkdir -p $build/kernel # &>> $fulllogfile
cd $build/kernel
printf "$UGREEN** Extracting Linux Kernel\n$RESET"
tar -xvf $root/downloads/linux-$kernel_version.tar.xz # &>> $fulllogfile
tar -xvf $root/downloads/linux-$KERNEL_VERSION.tar.xz # &>> $fulllogfile
check $? "Extract Linux Kernel"
cd linux-$kernel_version
cd linux-$KERNEL_VERSION
printf "$UGREEN** Configuring Linux Kernel\n$RESET"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- mrproper # &>> $fulllogfile
cp -v $root/kernel/config-$kernel_version .config # &>> $fulllogfile
cp -v $root/kernel/config-$KERNEL_VERSION .config # &>> $fulllogfile
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig # &>> $fulllogfile
check $? "Configure Linux Kernel"
printf "$UGREEN** Building Linux Kernel\n$RESET"
@@ -31,7 +29,7 @@ kernel() {
#----------- Build and Install kernel modules --------------
kernel_modules() {
printf "$UGREEN** Building Linux Kernel modules\n$RESET"
cd $build/kernel/linux-$kernel_version
cd $build/kernel/linux-$KERNEL_VERSION
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- modules # &>> fulllogfile
check $? "Build Linux Kernel modules"
printf "$UGREEN** Installing Linux Kernel modules into rootfs path\n$RESET"
@@ -40,7 +38,7 @@ kernel_modules() {
gzip -9 $i;
done
check $? "Install Linux Kernel modules"
rm -v $rootfspath/usr/lib/modules/$kernel_version/{source,build}
rm -v $rootfspath/usr/lib/modules/$KERNEL_VERSION/{source,build}
} # kernel_modules
#-----------------------------------------------------------
@@ -50,7 +48,7 @@ kernel_with_rootfs() {
if [ ! -d $out ]; then
mkdir -pv $out
fi
cd $build/kernel/linux-$kernel_version
cd $build/kernel/linux-$KERNEL_VERSION
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- CONFIG_INITRAMFS_SOURCE=$rootfspath $makeflags # &>> fulllogfile
check $? "Build Linux Kernel with rootfs"
printf "$UGREEN** Installing Linux Kernel into images path\n$RESET"
@@ -65,9 +63,9 @@ kernel_headers() {
printf "$UGREEN** Building Linux Kernel headers\n$RESET"
[ ! -d $build/kernel-headers ] && mkdir $build/kernel-headers
cd $build/kernel-headers
tar -xvf $root/downloads/linux-$kernel_version.tar.xz
tar -xvf $root/downloads/linux-$KERNEL_VERSION.tar.xz
check $? "Extract Linux Kernel"
cd linux-$kernel_version
cd linux-$KERNEL_VERSION
make ARCH=$ARCH headers
check $? "Build kernel headers"
}
+5 -1
View File
@@ -14,7 +14,11 @@ openssl() {
cd $build/${pkgname}
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz
cd ${pkgname}-${pkgver}/
./config linux-armv4 CROSS_COMPILE=${CROSS_COMPILE}-
if [ "$ARCH" = "arm" ]; then
./config linux-armv4 CROSS_COMPILE=${CROSS_COMPILE}-
elif [ "$ARCH" = "arm64" ]; then
./config linux-aarch64 CROSS_COMPILE=${CROSS_COMPILE}-
fi
check $? "Configure ${pkgname}"
make ${makeflags}
check $? "Build ${pkgname}"
+14 -14
View File
@@ -52,20 +52,20 @@ rootfs() {
uclibc
kernel
kernel_modules
[ "$ZLIB_ENABLE" = "true" ] && zlib
[ "$OPENSSL_ENABLE" = "true" ] && openssl
[ "$DNSMASQ_ENABLE" = "true" ] && dnsmasq
[ "$DROPBEAR_ENABLE" = "true" ] && dropbear
[ "$SFTP_SERVER_ENABLE" = "true" ] && sftp_server
[ "$CURL_ENABLE" = "true" ] && curl
[ "$BASH_ENABLE" = "true" ] && bash
[ "$GIT_ENABLE" = "true" ] && git_build
[ "$GITEA_ENABLE" = "true" ] && gitea
[ "$LIBNL_ENABLE" = "true" ] && libnl
[ "$IW_ENABLE" = "true" ] && iw
[ "$HOSTAPD_ENABLE" = "true" ] && hostapd
[ "$IPTABLES_ENABLE" = "true" ] && iptables
[ "$KO8821AU_ENABLE" = "true" ] && ko8821au
[ "$ZLIB_ENABLE" = "y" ] && zlib
[ "$OPENSSL_ENABLE" = "y" ] && openssl
[ "$DNSMASQ_ENABLE" = "y" ] && dnsmasq
[ "$DROPBEAR_ENABLE" = "y" ] && dropbear
[ "$SFTP_SERVER_ENABLE" = "y" ] && sftp_server
[ "$CURL_ENABLE" = "y" ] && curl
[ "$BASH_ENABLE" = "y" ] && bash
[ "$GIT_ENABLE" = "y" ] && git_build
[ "$GITEA_ENABLE" = "y" ] && gitea
[ "$LIBNL_ENABLE" = "y" ] && libnl
[ "$IW_ENABLE" = "y" ] && iw
[ "$HOSTAPD_ENABLE" = "y" ] && hostapd
[ "$IPTABLES_ENABLE" = "y" ] && iptables
[ "$KO8821AU_ENABLE" = "y" ] && ko8821au
chmod 640 $rootfspath/etc/shadow $rootfspath/etc/inittab
chmod 755 $rootfspath/etc/init.d/* $rootfspath/usr/share/udhcpc/default.script $rootfspath/init
+2 -2
View File
@@ -14,8 +14,8 @@ uclibc() {
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.xz # &>> $fulllogfile
check $? "Extract ${pkgname}"
cd ${pkgname}-${pkgver}
cp -rv $root/uclibc/config-${pkgver} .config
sed -i -e "s/KERNEL_HEADERS=/KERNEL_HEADERS=\"..\/..\/kernel-headers\/linux-$kernel_version\/usr\/include\"/g" .config
cp -rv $UCLIBC_CONFIG_FILE .config
sed -i -e "s/KERNEL_HEADERS=/KERNEL_HEADERS=\"..\/..\/kernel-headers\/linux-$KERNEL_VERSION\/usr\/include\"/g" .config
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig
check $? "Configure ${pkgname}"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile