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
+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"
}