@@ -82,6 +82,36 if [ "$BUILD_KERNEL" = true ] ; then | |||||
82 | -e "s/\(^CONFIG_DRM.*\=\).*/\1n/"\ |
|
82 | -e "s/\(^CONFIG_DRM.*\=\).*/\1n/"\ | |
83 | "${KERNEL_DIR}/.config" |
|
83 | "${KERNEL_DIR}/.config" | |
84 | fi |
|
84 | fi | |
|
85 | ||||
|
86 | # GPL v2.0 | |||
|
87 | #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh | |||
|
88 | if [ "$KERNEL_ZSWAP" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then | |||
|
89 | # enable ZSWAP support for better performance during large builds etc. | |||
|
90 | # requires activation via kernel parameter or sysfs | |||
|
91 | # see e.g. https://askubuntu.com/a/472227 for a summary of ZSWAP (vs ZRAM etc.) | |||
|
92 | # and e.g. https://wiki.archlinux.org/index.php/zswap for parameters etc. | |||
|
93 | ||||
|
94 | set_kernel_config ZPOOL y "${KERNEL_DIR}/.config" | |||
|
95 | set_kernel_config ZSWAP y "${KERNEL_DIR}/.config" | |||
|
96 | set_kernel_config ZBUD y "${KERNEL_DIR}/.config" | |||
|
97 | set_kernel_config Z3FOLD y "${KERNEL_DIR}/.config" | |||
|
98 | set_kernel_config ZSMALLOC y "${KERNEL_DIR}/.config" | |||
|
99 | set_kernel_config PGTABLE_MAPPING y "${KERNEL_DIR}/.config" | |||
|
100 | fi | |||
|
101 | ||||
|
102 | if [ "$KERNEL_VIRT" = true ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then | |||
|
103 | # Submit PRs with edits targeting the _bottom_ of this file | |||
|
104 | # Please set modules where possible, rather than building in, and | |||
|
105 | # provide a short rationale comment for the changes made | |||
|
106 | ||||
|
107 | # enable basic KVM support; see e.g. | |||
|
108 | # https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453 | |||
|
109 | ||||
|
110 | set_kernel_config VIRTUALIZATION y "${KERNEL_DIR}/.config" | |||
|
111 | set_kernel_config KVM y "${KERNEL_DIR}/.config" | |||
|
112 | set_kernel_config VHOST_NET m "${KERNEL_DIR}/.config" | |||
|
113 | set_kernel_config VHOST_CROSS_ENDIAN_LEGACY y "${KERNEL_DIR}/.config" | |||
|
114 | fi | |||
85 |
|
115 | |||
86 | if [ "$KERNELSRC_CONFIG" = true ] ; then |
|
116 | if [ "$KERNELSRC_CONFIG" = true ] ; then | |
87 | # Load default raspberry kernel configuration |
|
117 | # Load default raspberry kernel configuration | |
@@ -242,17 +272,32 if [ "$BUILD_KERNEL" = true ] ; then | |||||
242 | fi |
|
272 | fi | |
243 |
|
273 | |||
244 | else # BUILD_KERNEL=false |
|
274 | else # BUILD_KERNEL=false | |
245 | echo " Install precompiled kernel..." |
|
275 | # echo " Install precompiled kernel..." | |
246 |
|
|
276 | # echo "error: not implemented" | |
|
277 | if [ "$KERNEL_ARCH" = arm64 ] && ( [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ) ; then | |||
|
278 | # Create temporary directory for dl | |||
|
279 | temp_dir=$(as_nobody mktemp -d) | |||
|
280 | ||||
|
281 | # Fetch kernel dl | |||
|
282 | as_nobody wget -c "$RPI3_64_KERNEL_URL" "${temp_dir}"/kernel.tar.xz | |||
|
283 | #extract download | |||
|
284 | tar -xJf kernel.tar.xz -C "${R}" | |||
|
285 | ||||
|
286 | # Remove temporary directory for kernel sources | |||
|
287 | rm -fr "${temp_dir}" | |||
|
288 | ||||
|
289 | # Set permissions of the kernel sources | |||
|
290 | chown -R root:root "${R}/boot" | |||
|
291 | chown -R root:root "${R}/lib" | |||
|
292 | fi | |||
|
293 | ||||
247 | # Check if kernel installation was successful |
|
294 | # Check if kernel installation was successful | |
248 |
|
|
295 | KERNEL="$(ls -1 "${R}"/boot/kernel* | sort | tail -n 1)" | |
249 |
if [ -z "$ |
|
296 | if [ -z "$KERNEL" ] ; then | |
250 |
echo "error: kernel installation failed! (/boot/ |
|
297 | echo "error: kernel installation failed! (/boot/kernel* not found)" | |
251 | cleanup |
|
298 | cleanup | |
252 | exit 1 |
|
299 | exit 1 | |
253 | fi |
|
300 | fi | |
254 | # Copy vmlinuz kernel to the boot directory |
|
|||
255 | install_readonly "${VMLINUZ}" "${BOOT_DIR}/${KERNEL_IMAGE}" |
|
|||
256 |
|
301 | |||
257 | if [ "$SET_ARCH" = 64 ] ; then |
|
302 | if [ "$SET_ARCH" = 64 ] ; then | |
258 | echo "Using precompiled arm64 kernel" |
|
303 | echo "Using precompiled arm64 kernel" |
@@ -79,3 +79,26 chroot_remove_cc() { | |||||
79 | COMPILER_PACKAGES="" |
|
79 | COMPILER_PACKAGES="" | |
80 | fi |
|
80 | fi | |
81 | } |
|
81 | } | |
|
82 | #GPL v2.0 | |||
|
83 | #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh | |||
|
84 | # edited with thir param | |||
|
85 | #start | |||
|
86 | set_kernel_config() { | |||
|
87 | # flag as $1, value to set as $2, config must exist at "./.config" | |||
|
88 | local TGT="CONFIG_${1}" | |||
|
89 | local REP="${2//\//\\/}" | |||
|
90 | if grep -q "^${TGT}[^_]" .config; then | |||
|
91 | sed -i "s/^\(${TGT}=.*\|# ${TGT} is not set\)/${TGT}=${REP}/" "${3}" | |||
|
92 | else | |||
|
93 | echo "${TGT}=${2}" >> "${3}" | |||
|
94 | fi | |||
|
95 | } | |||
|
96 | ||||
|
97 | unset_kernel_config() { | |||
|
98 | # unsets flag with the value of $1, config must exist at "./.config" | |||
|
99 | local TGT="CONFIG_${1}" | |||
|
100 | sed -i "s/^${TGT}=.*/# ${TGT} is not set/" "${2}" | |||
|
101 | } | |||
|
102 | # | |||
|
103 | #end | |||
|
104 | # |
@@ -55,7 +55,12 WLAN_FIRMWARE_URL=${WLAN_FIRMWARE_URL:=https://github.com/RPi-Distro/firmware-no | |||||
55 | COLLABORA_URL=${COLLABORA_URL:=https://repositories.collabora.co.uk/debian} |
|
55 | COLLABORA_URL=${COLLABORA_URL:=https://repositories.collabora.co.uk/debian} | |
56 | FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git} |
|
56 | FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git} | |
57 | UBOOT_URL=${UBOOT_URL:=https://git.denx.de/u-boot.git} |
|
57 | UBOOT_URL=${UBOOT_URL:=https://git.denx.de/u-boot.git} | |
58 | VIDEOCORE_URL=${VIDEOCORE_URL=https://github.com/raspberrypi/userland} |
|
58 | VIDEOCORE_URL=${VIDEOCORE_URL:=https://github.com/raspberrypi/userland} | |
|
59 | #BIS= Kernel has KVM and zswap enabled | |||
|
60 | RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.14.80.20181113/bcmrpi3-kernel-bis-4.14.80.20181113.tar.xz} | |||
|
61 | #default bcmrpi3_defconfig target kernel | |||
|
62 | RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.14.80.20181113/bcmrpi3-kernel-4.14.80.20181113.tar.xz} | |||
|
63 | RPI3_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI3_64_BIS_KERNEL_URL} | |||
59 | #https://aur.archlinux.org/packages/pi-bluetooth/ |
|
64 | #https://aur.archlinux.org/packages/pi-bluetooth/ | |
60 | BLUETOOTH_URL=${BLUETOOTH_URL:=https://aur.archlinux.org/pi-bluetooth.git} |
|
65 | BLUETOOTH_URL=${BLUETOOTH_URL:=https://aur.archlinux.org/pi-bluetooth.git} | |
61 |
|
66 | |||
@@ -166,6 +171,8 KERNEL_MENUCONFIG=${KERNEL_MENUCONFIG:=false} | |||||
166 | KERNEL_REMOVESRC=${KERNEL_REMOVESRC:=true} |
|
171 | KERNEL_REMOVESRC=${KERNEL_REMOVESRC:=true} | |
167 | KERNEL_OLDDEFCONFIG=${KERNEL_OLDDEFCONFIG:=false} |
|
172 | KERNEL_OLDDEFCONFIG=${KERNEL_OLDDEFCONFIG:=false} | |
168 | KERNEL_CCACHE=${KERNEL_CCACHE:=false} |
|
173 | KERNEL_CCACHE=${KERNEL_CCACHE:=false} | |
|
174 | KERNEL_ZSWAP=${KERNEL_ZSWAP:=true} | |||
|
175 | KERNEL_VIRT=${KERNEL_VIRT:=true} | |||
169 |
|
176 | |||
170 | # Kernel compilation from source directory settings |
|
177 | # Kernel compilation from source directory settings | |
171 | KERNELSRC_DIR=${KERNELSRC_DIR:=""} |
|
178 | KERNELSRC_DIR=${KERNELSRC_DIR:=""} |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant