Parcourir la source

Successfully target Arch on the rpi 4B

Donald Carr il y a 4 ans
Parent
commit
5adcbb9647
1 fichiers modifiés avec 23 ajouts et 5 suppressions
  1. 23 5
      PKGBUILD

+ 23 - 5
PKGBUILD

@@ -6,7 +6,7 @@ options=('!strip')
 # The firmware the kernel produces blows: don't falsify this lightly
 # "linux-firmware=20170309.695f2d6-1"
 pkgrel=1
-pkgver=5.9.13.g19ec2e445aab
+pkgver=5.10.rc2.494.g417dfb389c1e
 pkgdesc="Kernel build from head"
 arch=("x86_64" "aarch64" "armv7h")
 license=("GPL2.1")
@@ -42,7 +42,17 @@ pkgver() {
 
 build() {
   cd $_kernel_src_dir && git clean -xdf
-  cp ${_config_file} ${_kernel_src_dir}/.config
+
+  if [[ -n ${_config_preset} ]]; then
+    echo ${_make_cmd} ${_config_preset}
+    ${_make_cmd} ${_config_preset}
+  elif [[ -n ${_config_file} ]]; then
+    cp ${_config_file} ${_kernel_src_dir}/.config
+  else
+    echo "Kernel not configured; bailing"
+    exit 1
+  fi
+
   ${_make_cmd} all 2>&1 | tee ${log_path}
 
   if [ -n "${LOCAL_PI_VER}" ]; then
@@ -65,8 +75,9 @@ package() {
   fi
 
   mkdir -p ${boot_dir}
-  if [ "${LOCAL_PI_VER}" = "3" ]; then
-    cp arch/arm64/boot/Image ${boot_dir}/Image${postfix}
+  if [ "${LOCAL_PI_VER}" = "3" ] || [ "${LOCAL_PI_VER}" = "4" ]; then
+    cp arch/arm64/boot/Image ${boot_dir}/Image
+    cp arch/arm64/boot/Image.gz ${boot_dir}/Image.gz
   elif [ "${LOCAL_PI_VER}" = "2" ]; then
     cp arch/arm/boot/zImage ${boot_dir}/vmlinuz-${postfix}
   else
@@ -97,8 +108,15 @@ if [ -n "${LOCAL_PI_VER}" ]; then
         _config_file="${startdir}/rpi3"
         _xcompile_args="ARCH=arm64 CROSS_COMPILE=/opt/x-tools/aarch64-rpi3-linux-gnu/bin/aarch64-rpi3-linux-gnu-"
     ;;
+   4)
+        #symbols omitted by default wtf!
+        #DTC_FLAGS=\"-@ -H epapr\"
+        echo "Compiling for the RPi 4 aarch64"
+        _config_preset="bcm2711_defconfig"
+        _xcompile_args="ARCH=arm64 CROSS_COMPILE=${HOME}/x-tools/aarch64-spudd-linux-gnu/bin/aarch64-spudd-linux-gnu-"
+    ;;
     *)
-        echo "Only supports the rpi3 at this point in time"
+        echo "Only supports the rpi 4 at this point in time"
         exit 1
     ;;
     esac