##// END OF EJS Templates
Error correction on start4.elf copies...
vidal -
r756:03c30a6b8f78
parent child
Show More
@@ -31,7 +31,7 if [ "$BUILD_KERNEL" = true ] ; then
31 # Create temporary directory for kernel sources
31 # Create temporary directory for kernel sources
32 temp_dir=$(as_nobody mktemp -d)
32 temp_dir=$(as_nobody mktemp -d)
33
33
34 # Fetch current RPi2/3 kernel sources
34 # Fetch current RPi2/3/4 kernel sources
35 if [ -z "${KERNEL_BRANCH}" ] ; then
35 if [ -z "${KERNEL_BRANCH}" ] ; then
36 as_nobody -H git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" linux
36 as_nobody -H git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" linux
37 else
37 else
@@ -52,13 +52,13 if [ "$BUILD_KERNEL" = true ] ; then
52 if [ -n "$KERNEL_THREADS" ] && [ -r /proc/cpuinfo ] ; then
52 if [ -n "$KERNEL_THREADS" ] && [ -r /proc/cpuinfo ] ; then
53 KERNEL_THREADS=$(grep -c processor /proc/cpuinfo)
53 KERNEL_THREADS=$(grep -c processor /proc/cpuinfo)
54 fi
54 fi
55
55
56 # TODO: Check if defined Threadcount is higher than actual cores
56 # TODO: Check if defined Threadcount is higher than actual cores
57 # if [ "$KERNEL_THREADS" > grep -c processor /proc/cpuinfo] ; then
57 # if [ "$KERNEL_THREADS" > grep -c processor /proc/cpuinfo] ; then
58 # echo "Defined more Threads than core assigned to this system"
58 # echo "Defined more Threads than core assigned to this system"
59 # exit 1
59 # exit 1
60 # fi
60 # fi
61
61
62 #Copy 32bit config to 64bit
62 #Copy 32bit config to 64bit
63 if [ "$ENABLE_QEMU" = true ] && [ "$KERNEL_ARCH" = arm64 ]; then
63 if [ "$ENABLE_QEMU" = true ] && [ "$KERNEL_ARCH" = arm64 ]; then
64 cp "${KERNEL_DIR}"/arch/arm/configs/vexpress_defconfig "${KERNEL_DIR}"/arch/arm64/configs/
64 cp "${KERNEL_DIR}"/arch/arm/configs/vexpress_defconfig "${KERNEL_DIR}"/arch/arm64/configs/
@@ -108,7 +108,7 if [ "$BUILD_KERNEL" = true ] ; then
108
108
109 #Switch to KERNELSRC_DIR so we can use set_kernel_config
109 #Switch to KERNELSRC_DIR so we can use set_kernel_config
110 cd "${KERNEL_DIR}" || exit
110 cd "${KERNEL_DIR}" || exit
111
111
112 # Enable RPI POE HAT fan
112 # Enable RPI POE HAT fan
113 if [ "$KERNEL_POEHAT" = true ]; then
113 if [ "$KERNEL_POEHAT" = true ]; then
114 set_kernel_config CONFIG_SENSORS_RPI_POE_FAN m
114 set_kernel_config CONFIG_SENSORS_RPI_POE_FAN m
@@ -119,20 +119,20 if [ "$BUILD_KERNEL" = true ] ; then
119 if [ "$KERNEL_NSPAN" = true ]; then
119 if [ "$KERNEL_NSPAN" = true ]; then
120 set_kernel_config CONFIG_CGROUP_NET_PRIO y
120 set_kernel_config CONFIG_CGROUP_NET_PRIO y
121 fi
121 fi
122
122
123 # Compile in BTRFS
123 # Compile in BTRFS
124 if [ "$KERNEL_BTRFS" = true ]; then
124 if [ "$KERNEL_BTRFS" = true ]; then
125 set_kernel_config CONFIG_BTRFS_FS y
125 set_kernel_config CONFIG_BTRFS_FS y
126 set_kernel_config CONFIG_BTRFS_FS_POSIX_ACL y
126 set_kernel_config CONFIG_BTRFS_FS_POSIX_ACL y
127 set_kernel_config CONFIG_BTRFS_FS_REF_VERIFY y
127 set_kernel_config CONFIG_BTRFS_FS_REF_VERIFY y
128 fi
128 fi
129
129
130 # Diffie-Hellman operations on retained keys
130 # Diffie-Hellman operations on retained keys
131 # (required for >keyutils-1.6)
131 # (required for >keyutils-1.6)
132 if [ "$KERNEL_DHKEY" = true ]; then
132 if [ "$KERNEL_DHKEY" = true ]; then
133 set_kernel_config CONFIG_KEY_DH_OPERATIONS y
133 set_kernel_config CONFIG_KEY_DH_OPERATIONS y
134 fi
134 fi
135
135
136 if [ "$KERNEL_ARCH" = arm64 ] && [ "$ENABLE_QEMU" = false ]; then
136 if [ "$KERNEL_ARCH" = arm64 ] && [ "$ENABLE_QEMU" = false ]; then
137 # Mask this temporarily during switch to rpi-4.19.y
137 # Mask this temporarily during switch to rpi-4.19.y
138 #Fix SD_DRIVER upstream and downstream mess in 64bit RPIdeb_config
138 #Fix SD_DRIVER upstream and downstream mess in 64bit RPIdeb_config
@@ -141,11 +141,11 if [ "$BUILD_KERNEL" = true ] ; then
141 #set_kernel_config CONFIG_MMC_SDHCI_IPROC n
141 #set_kernel_config CONFIG_MMC_SDHCI_IPROC n
142 #set_kernel_config CONFIG_USB_DWC2 n
142 #set_kernel_config CONFIG_USB_DWC2 n
143 #sed -i "s|depends on MMC_BCM2835_MMC && MMC_BCM2835_DMA|depends on MMC_BCM2835_MMC|" "${KERNEL_DIR}"/drivers/mmc/host/Kconfig
143 #sed -i "s|depends on MMC_BCM2835_MMC && MMC_BCM2835_DMA|depends on MMC_BCM2835_MMC|" "${KERNEL_DIR}"/drivers/mmc/host/Kconfig
144
144
145 #VLAN got disabled without reason in arm64bit
145 #VLAN got disabled without reason in arm64bit
146 set_kernel_config CONFIG_IPVLAN m
146 set_kernel_config CONFIG_IPVLAN m
147 fi
147 fi
148
148
149 # enable ZSWAP see https://askubuntu.com/a/472227 or https://wiki.archlinux.org/index.php/zswap
149 # enable ZSWAP see https://askubuntu.com/a/472227 or https://wiki.archlinux.org/index.php/zswap
150 if [ "$KERNEL_ZSWAP" = true ] ; then
150 if [ "$KERNEL_ZSWAP" = true ] ; then
151 set_kernel_config CONFIG_ZPOOL y
151 set_kernel_config CONFIG_ZPOOL y
@@ -156,7 +156,7 if [ "$BUILD_KERNEL" = true ] ; then
156 set_kernel_config CONFIG_PGTABLE_MAPPING y
156 set_kernel_config CONFIG_PGTABLE_MAPPING y
157 set_kernel_config CONFIG_LZO_COMPRESS y
157 set_kernel_config CONFIG_LZO_COMPRESS y
158 fi
158 fi
159
159
160 if [ "$RPI_MODEL" = 4 ] ; then
160 if [ "$RPI_MODEL" = 4 ] ; then
161 # Following are set in current 32-bit LPAE kernel
161 # Following are set in current 32-bit LPAE kernel
162 set_kernel_config CONFIG_CGROUP_PIDS y
162 set_kernel_config CONFIG_CGROUP_PIDS y
@@ -362,7 +362,7 if [ "$BUILD_KERNEL" = true ] ; then
362 set_kernel_config CONFIG_PCIE_BRCMSTB y
362 set_kernel_config CONFIG_PCIE_BRCMSTB y
363 set_kernel_config CONFIG_BCM2835_MMC y
363 set_kernel_config CONFIG_BCM2835_MMC y
364
364
365 # Snap needs squashfs. The ubuntu eoan-preinstalled-server image at
365 # Snap needs squashfs. The ubuntu eoan-preinstalled-server image at
366 # http://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/current/ uses snap
366 # http://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/current/ uses snap
367 # during cloud-init setup at first boot. Without this the login accounts are not
367 # during cloud-init setup at first boot. Without this the login accounts are not
368 # created and the user can not login.
368 # created and the user can not login.
@@ -404,10 +404,10 if [ "$BUILD_KERNEL" = true ] ; then
404 set_kernel_config CONFIG_SLAB_FREELIST_RANDOM=y
404 set_kernel_config CONFIG_SLAB_FREELIST_RANDOM=y
405 set_kernel_config CONFIG_SLAB_FREELIST_HARDENED=y
405 set_kernel_config CONFIG_SLAB_FREELIST_HARDENED=y
406 set_kernel_config CONFIG_MMU_NOTIFIER y
406 set_kernel_config CONFIG_MMU_NOTIFIER y
407
407
408 # erratum
408 # erratum
409 set_kernel_config ARM64_ERRATUM_834220 y
409 set_kernel_config ARM64_ERRATUM_834220 y
410
410
411 # https://sourceforge.net/p/kvm/mailman/message/18440797/
411 # https://sourceforge.net/p/kvm/mailman/message/18440797/
412 set_kernel_config CONFIG_PREEMPT_NOTIFIERS y
412 set_kernel_config CONFIG_PREEMPT_NOTIFIERS y
413 fi
413 fi
@@ -471,7 +471,7 if [ "$BUILD_KERNEL" = true ] ; then
471 set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS m
471 set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS m
472 set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096
472 set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096
473 fi
473 fi
474
474
475 if [ "$ENABLE_CRYPTFS" = true ] ; then
475 if [ "$ENABLE_CRYPTFS" = true ] ; then
476 set_kernel_config CONFIG_EMBEDDED y
476 set_kernel_config CONFIG_EMBEDDED y
477 set_kernel_config CONFIG_EXPERT y
477 set_kernel_config CONFIG_EXPERT y
@@ -625,7 +625,7 if [ "$BUILD_KERNEL" = true ] ; then
625 set_kernel_config CONFIG_NF_TABLES_BRIDGE y
625 set_kernel_config CONFIG_NF_TABLES_BRIDGE y
626 set_kernel_config CONFIG_NF_CT_NETLINK_TIMEOUT m
626 set_kernel_config CONFIG_NF_CT_NETLINK_TIMEOUT m
627 set_kernel_config CONFIG_NFT_OSF m
627 set_kernel_config CONFIG_NFT_OSF m
628
628
629 fi
629 fi
630
630
631 # Enables BPF syscall for systemd-journald see https://github.com/torvalds/linux/blob/master/init/Kconfig#L848 or https://groups.google.com/forum/#!topic/linux.gentoo.user/_2aSc_ztGpA
631 # Enables BPF syscall for systemd-journald see https://github.com/torvalds/linux/blob/master/init/Kconfig#L848 or https://groups.google.com/forum/#!topic/linux.gentoo.user/_2aSc_ztGpA
@@ -637,7 +637,7 if [ "$BUILD_KERNEL" = true ] ; then
637 set_kernel_config CONFIG_XDP_SOCKETS y
637 set_kernel_config CONFIG_XDP_SOCKETS y
638 fi
638 fi
639
639
640 # KERNEL_DEFAULT_GOV was set by user
640 # KERNEL_DEFAULT_GOV was set by user
641 if [ "$KERNEL_DEFAULT_GOV" != ondemand ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then
641 if [ "$KERNEL_DEFAULT_GOV" != ondemand ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then
642 case "$KERNEL_DEFAULT_GOV" in
642 case "$KERNEL_DEFAULT_GOV" in
643 performance)
643 performance)
@@ -811,16 +811,16 else # BUILD_KERNEL=false
811 temp_dir=$(as_nobody mktemp -d)
811 temp_dir=$(as_nobody mktemp -d)
812
812
813 # Fetch kernel dl
813 # Fetch kernel dl
814 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
814 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
815 fi
815 fi
816 if [ "$SET_ARCH" = 64 ] && [ "$RPI_MODEL" = 4 ] ; then
816 if [ "$SET_ARCH" = 64 ] && [ "$RPI_MODEL" = 4 ] ; then
817 # Create temporary directory for dl
817 # Create temporary directory for dl
818 temp_dir=$(as_nobody mktemp -d)
818 temp_dir=$(as_nobody mktemp -d)
819
819
820 # Fetch kernel dl
820 # Fetch kernel dl
821 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI4_64_KERNEL_URL"
821 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI4_64_KERNEL_URL"
822 fi
822 fi
823
823
824 #extract download
824 #extract download
825 tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
825 tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
826
826
@@ -883,4 +883,4 else # BUILD_KERNEL=false
883 cleanup
883 cleanup
884 exit 1
884 exit 1
885 fi
885 fi
886 fi No newline at end of file
886 fi
@@ -20,7 +20,7 if [ -n "$RPI_FIRMWARE_DIR" ] && [ -d "$RPI_FIRMWARE_DIR" ] ; then
20 cp "${RPI_FIRMWARE_DIR}"/boot/fixup4x.dat "${BOOT_DIR}"/fixup4x.dat
20 cp "${RPI_FIRMWARE_DIR}"/boot/fixup4x.dat "${BOOT_DIR}"/fixup4x.dat
21 cp "${RPI_FIRMWARE_DIR}"/boot/start4cd.elf "${BOOT_DIR}"/start4cd.elf
21 cp "${RPI_FIRMWARE_DIR}"/boot/start4cd.elf "${BOOT_DIR}"/start4cd.elf
22 cp "${RPI_FIRMWARE_DIR}"/boot/start4db.elf "${BOOT_DIR}"/start4db.elf
22 cp "${RPI_FIRMWARE_DIR}"/boot/start4db.elf "${BOOT_DIR}"/start4db.elf
23 cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4x.elf
23 cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4.elf
24 cp "${RPI_FIRMWARE_DIR}"/boot/start4x.elf "${BOOT_DIR}"/start4x.elf
24 cp "${RPI_FIRMWARE_DIR}"/boot/start4x.elf "${BOOT_DIR}"/start4x.elf
25 else
25 else
26 # Create temporary directory for boot binaries
26 # Create temporary directory for boot binaries
@@ -40,7 +40,7 else
40 as_nobody wget -q -O "${temp_dir}/fixup4x.dat" "${FIRMWARE_URL}/fixup4x.dat"
40 as_nobody wget -q -O "${temp_dir}/fixup4x.dat" "${FIRMWARE_URL}/fixup4x.dat"
41 as_nobody wget -q -O "${temp_dir}/start4cd.elf" "${FIRMWARE_URL}/start4cd.elf"
41 as_nobody wget -q -O "${temp_dir}/start4cd.elf" "${FIRMWARE_URL}/start4cd.elf"
42 as_nobody wget -q -O "${temp_dir}/start4db.elf" "${FIRMWARE_URL}/start4db.elf"
42 as_nobody wget -q -O "${temp_dir}/start4db.elf" "${FIRMWARE_URL}/start4db.elf"
43 as_nobody wget -q -O "${temp_dir}/start4x.elf" "${FIRMWARE_URL}/start4x.elf"
43 as_nobody wget -q -O "${temp_dir}/start4.elf" "${FIRMWARE_URL}/start4.elf"
44 as_nobody wget -q -O "${temp_dir}/start4x.elf" "${FIRMWARE_URL}/start4x.elf"
44 as_nobody wget -q -O "${temp_dir}/start4x.elf" "${FIRMWARE_URL}/start4x.elf"
45
45
46 # Move downloaded boot binaries
46 # Move downloaded boot binaries
@@ -45,7 +45,7 RPI_MODEL=${RPI_MODEL:=3P}
45 # Debian release
45 # Debian release
46 RELEASE=${RELEASE:=buster}
46 RELEASE=${RELEASE:=buster}
47 if [ $RELEASE = "bullseye" ] ; then
47 if [ $RELEASE = "bullseye" ] ; then
48 RELEASE=testing
48 RELEASE=testing
49 fi
49 fi
50
50
51 # Kernel Branch
51 # Kernel Branch
@@ -65,7 +65,7 SYSTEMDSWAP_URL=${SYSTEMDSWAP_URL:=https://github.com/Nefelim4ag/systemd-swap.gi
65 # Kernel deb packages for 32bit kernel
65 # Kernel deb packages for 32bit kernel
66 RPI_32_KERNEL_URL=${RPI_32_KERNEL_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel_20180422-141901_armhf.deb}
66 RPI_32_KERNEL_URL=${RPI_32_KERNEL_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel_20180422-141901_armhf.deb}
67 RPI_32_KERNELHEADER_URL=${RPI_32_KERNELHEADER_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel-headers_20180422-141901_armhf.deb}
67 RPI_32_KERNELHEADER_URL=${RPI_32_KERNELHEADER_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel-headers_20180422-141901_armhf.deb}
68 # Kernel has KVM and zswap enabled - use if KERNEL_* parameters and precompiled kernel are used
68 # Kernel has KVM and zswap enabled - use if KERNEL_* parameters and precompiled kernel are used
69 RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.19.102.20200211/bcmrpi3-kernel-bis-4.19.102.20200211.tar.xz}
69 RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.19.102.20200211/bcmrpi3-kernel-bis-4.19.102.20200211.tar.xz}
70 # Default precompiled 64bit kernel
70 # Default precompiled 64bit kernel
71 RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.19.102.20200211/bcmrpi3-kernel-4.19.102.20200211.tar.xz}
71 RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.19.102.20200211/bcmrpi3-kernel-4.19.102.20200211.tar.xz}
@@ -73,7 +73,7 RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmr
73 RPI4_64_BIS_KERNEL_URL=${RPI4_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz}
73 RPI4_64_BIS_KERNEL_URL=${RPI4_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz}
74 # Default precompiled 64bit kernel - https://github.com/sakaki-/bcm2711-kernel
74 # Default precompiled 64bit kernel - https://github.com/sakaki-/bcm2711-kernel
75 RPI4_64_DEF_KERNEL_URL=${RPI4_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz}
75 RPI4_64_DEF_KERNEL_URL=${RPI4_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz}
76 # Generic
76 # Generic
77 RPI3_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI3_64_DEF_KERNEL_URL}
77 RPI3_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI3_64_DEF_KERNEL_URL}
78 RPI4_64_KERNEL_URL=${RPI4_64_KERNEL_URL:=$RPI4_64_DEF_KERNEL_URL}
78 RPI4_64_KERNEL_URL=${RPI4_64_KERNEL_URL:=$RPI4_64_DEF_KERNEL_URL}
79 # Kali kernel src - used if ENABLE_NEXMON=true (they patch the wlan kernel modul)
79 # Kali kernel src - used if ENABLE_NEXMON=true (they patch the wlan kernel modul)
@@ -270,73 +270,74 fi
270
270
271 # Setup architecture specific settings
271 # Setup architecture specific settings
272 if [ -n "$SET_ARCH" ] ; then
272 if [ -n "$SET_ARCH" ] ; then
273 # 64-bit configuration
273 ## 64-bit configuration
274 if [ "$SET_ARCH" = 64 ] ; then
274 if [ "$SET_ARCH" = 64 ] ; then
275 # General 64-bit depended settings
275 ### General 64-bit depended settings
276 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static}
276 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static}
277 KERNEL_ARCH=${KERNEL_ARCH:=arm64}
277 KERNEL_ARCH=${KERNEL_ARCH:=arm64}
278 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"}
278 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"}
279
279
280 # Raspberry Pi model specific settings
280 ### Raspberry Pi 64-bit model specific settings
281 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
281 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
282 if [ "$RPI_MODEL" != 4 ] ; then
282 if [ "$RPI_MODEL" != 4 ] ; then
283 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
283 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
284 else
284 else
285 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig}
285 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig}
286 fi
286 fi
287
287
288 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64"
288 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64"
289 RELEASE_ARCH=${RELEASE_ARCH:=arm64}
289 RELEASE_ARCH=${RELEASE_ARCH:=arm64}
290 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
290 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
291 CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-}
291 CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-}
292
292 else
293 else
293 echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit"
294 echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit"
294 exit 1
295 exit 1
295 fi
296 fi
296 fi
297 fi
297
298
298 # 32-bit configuration
299 ## 32-bit configuration
299 if [ "$SET_ARCH" = 32 ] ; then
300 if [ "$SET_ARCH" = 32 ] ; then
300 # General 32-bit dependend settings
301 ### General 32-bit dependend settings
301 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static}
302 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static}
302 KERNEL_ARCH=${KERNEL_ARCH:=arm}
303 KERNEL_ARCH=${KERNEL_ARCH:=arm}
303 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="zImage"}
304 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="zImage"}
304
305
305 # Raspberry Pi model specific settings
306 ### Raspberry Pi (0-1P) model specific settings
306 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then
307 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then
307 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel"
308 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel"
308 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig}
309 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig}
309 RELEASE_ARCH=${RELEASE_ARCH:=armel}
310 RELEASE_ARCH=${RELEASE_ARCH:=armel}
310 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img}
311 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img}
311 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
312 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
312
313 if [ $ENABLE_XORG = true ] ; then
313 if [ $ENABLE_XORG = true ] ; then
314 if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then
314 if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then
315 printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] "
315 printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] "
316 read -r confirm
316 read -r confirm
317 if [ "$confirm" = "y" ] ; then
317 if [ "$confirm" = "y" ] ; then
318 $RELEASE = "stretch"
318 $RELEASE = "stretch"
319 fi
319 fi
320 fi
320 fi
321 fi
321 fi
322 fi
322 fi
323 # Raspberry Pi model specific settings
323 ### Raspberry Pi (2-4) model specific settings
324 if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
324 if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
325 if [ "$RPI_MODEL" != 4 ] ; then
325 if [ "$RPI_MODEL" != 4 ] ; then
326 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
326 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
327 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img}
327 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img}
328 else
328 else
329 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig}
329 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig}
330 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7l.img}
330 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7l.img}
331 fi
331 fi
332
332
333 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf"
333 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf"
334 RELEASE_ARCH=${RELEASE_ARCH:=armhf}
334 RELEASE_ARCH=${RELEASE_ARCH:=armhf}
335
335
336 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-}
336 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-}
337 fi
337 fi
338 fi
338 fi
339 # SET_ARCH not set
339
340 # SET_ARCH not set
340 else
341 else
341 echo "error: Please set '32' or '64' as value for SET_ARCH"
342 echo "error: Please set '32' or '64' as value for SET_ARCH"
342 exit 1
343 exit 1
@@ -344,50 +345,51 fi
344 # Device specific configuration and U-Boot configuration
345 # Device specific configuration and U-Boot configuration
345 case "$RPI_MODEL" in
346 case "$RPI_MODEL" in
346 0)
347 0)
347 DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb}
348 DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb}
348 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
349 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
349 ;;
350 ;;
350 1)
351 1)
351 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b.dtb}
352 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b.dtb}
352 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
353 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
353 ;;
354 ;;
354 1P)
355 1P)
355 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b-plus.dtb}
356 DTB_FILE=${DTB_FILE:=bcm2708-rpi-b-plus.dtb}
356 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
357 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig}
357 ;;
358 ;;
358 2)
359 2)
359 DTB_FILE=${DTB_FILE:=bcm2709-rpi-2-b.dtb}
360 DTB_FILE=${DTB_FILE:=bcm2709-rpi-2-b.dtb}
360 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_2_defconfig}
361 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_2_defconfig}
361 ;;
362 ;;
362 3)
363 3)
363 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
364 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
364 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
365 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
365 ;;
366 ;;
366 3P)
367 3P)
367 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
368 DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb}
368 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
369 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig}
369 ;;
370 ;;
370 4)
371 4)
371 DTB_FILE=${DTB_FILE:=bcm2711-rpi-4-b.dtb}
372 DTB_FILE=${DTB_FILE:=bcm2711-rpi-4-b.dtb}
372 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_4_defconfig}
373 UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_4_defconfig}
373 ;;
374 ;;
374 *)
375 *)
375 echo "error: Raspberry Pi model $RPI_MODEL is not supported!"
376 echo "error: Raspberry Pi model $RPI_MODEL is not supported!"
376 exit 1
377 exit 1
377 ;;
378 ;;
378 esac
379 esac
379
380
380 # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard
381 # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard
381 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
382 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
382 # Include bluetooth packages on supported boards
383 ## Include bluetooth packages on supported boards
383 if [ "$ENABLE_BLUETOOTH" = true ] ; then
384 if [ "$ENABLE_BLUETOOTH" = true ] ; then
384 APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez"
385 APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez"
385 fi
386 fi
386 if [ "$ENABLE_WIRELESS" = true ] ; then
387 if [ "$ENABLE_WIRELESS" = true ] ; then
387 APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant"
388 APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant"
388 fi
389 fi
389 else # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard
390 # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard
390 # Check if the internal wireless interface is not supported by the RPi model
391 else
392 ## Check if the internal wireless interface is not supported by the RPi model
391 if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then
393 if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then
392 echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth"
394 echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth"
393 exit 1
395 exit 1
@@ -440,11 +442,11 if [ "$ENABLE_CRYPTFS" = true ] && [ "$BUILD_KERNEL" = true ] ; then
440 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cryptsetup"
442 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cryptsetup"
441 APT_INCLUDES="${APT_INCLUDES},cryptsetup,busybox,console-setup,cryptsetup-initramfs"
443 APT_INCLUDES="${APT_INCLUDES},cryptsetup,busybox,console-setup,cryptsetup-initramfs"
442
444
443 # If cryptfs,dropbear and initramfs are enabled include dropbear-initramfs package
445 ## If cryptfs,dropbear and initramfs are enabled include dropbear-initramfs package
444 if [ "$CRYPTFS_DROPBEAR" = true ] && [ "$ENABLE_INITRAMFS" = true ]; then
446 if [ "$CRYPTFS_DROPBEAR" = true ] && [ "$ENABLE_INITRAMFS" = true ]; then
445 APT_INCLUDES="${APT_INCLUDES},dropbear-initramfs"
447 APT_INCLUDES="${APT_INCLUDES},dropbear-initramfs"
446 fi
448 fi
447
449
448 if [ -z "$CRYPTFS_PASSWORD" ] ; then
450 if [ -z "$CRYPTFS_PASSWORD" ] ; then
449 echo "error: no password defined (CRYPTFS_PASSWORD)!"
451 echo "error: no password defined (CRYPTFS_PASSWORD)!"
450 exit 1
452 exit 1
@@ -462,11 +464,11 if [ "$ENABLE_UBOOT" = true ] ; then
462 APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bc"
464 APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bc"
463 fi
465 fi
464
466
465 if [ "$ENABLE_USBBOOT" = true ] ; then
467 if [ "$ENABLE_USBBOOT" = true ] ; then
466 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 2 ]; then
468 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 2 ]; then
467 echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P"
469 echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P"
468 exit 1
470 exit 1
469 fi
471 fi
470 fi
472 fi
471
473
472 # Check if root SSH (v2) public key file exists
474 # Check if root SSH (v2) public key file exists
@@ -506,7 +508,7 if [ -n "$MISSING_PACKAGES" ] ; then
506 read -r confirm
508 read -r confirm
507 [ "$confirm" != "y" ] && exit 1
509 [ "$confirm" != "y" ] && exit 1
508
510
509 # Make sure all missing required packages are installed
511 ## Make sure all missing required packages are installed
510 apt-get update && apt-get -qq -y install `echo "${MISSING_PACKAGES}" | sed "s/ //"`
512 apt-get update && apt-get -qq -y install `echo "${MISSING_PACKAGES}" | sed "s/ //"`
511 fi
513 fi
512
514
@@ -554,8 +556,8 fi
554
556
555 # Check if specified CHROOT_SCRIPTS directory exists
557 # Check if specified CHROOT_SCRIPTS directory exists
556 if [ -n "$CHROOT_SCRIPTS" ] && [ ! -d "$CHROOT_SCRIPTS" ] ; then
558 if [ -n "$CHROOT_SCRIPTS" ] && [ ! -d "$CHROOT_SCRIPTS" ] ; then
557 echo "error: ${CHROOT_SCRIPTS} specified directory not found (CHROOT_SCRIPTS)!"
559 echo "error: ${CHROOT_SCRIPTS} specified directory not found (CHROOT_SCRIPTS)!"
558 exit 1
560 exit 1
559 fi
561 fi
560
562
561 # Check if specified device mapping already exists (will be used by cryptsetup)
563 # Check if specified device mapping already exists (will be used by cryptsetup)
@@ -649,12 +651,12 fi
649
651
650 # Replace selected packages with smaller clones
652 # Replace selected packages with smaller clones
651 if [ "$ENABLE_REDUCE" = true ] ; then
653 if [ "$ENABLE_REDUCE" = true ] ; then
652 # Add levee package instead of vim-tiny
654 ## Add levee package instead of vim-tiny
653 if [ "$REDUCE_VIM" = true ] ; then
655 if [ "$REDUCE_VIM" = true ] ; then
654 APT_INCLUDES="$(echo ${APT_INCLUDES} | sed "s/vim-tiny/levee/")"
656 APT_INCLUDES="$(echo ${APT_INCLUDES} | sed "s/vim-tiny/levee/")"
655 fi
657 fi
656
658
657 # Add dropbear package instead of openssh-server
659 ## Add dropbear package instead of openssh-server
658 if [ "$REDUCE_SSHD" = true ] ; then
660 if [ "$REDUCE_SSHD" = true ] ; then
659 APT_INCLUDES="$(echo "${APT_INCLUDES}" | sed "s/openssh-server/dropbear/")"
661 APT_INCLUDES="$(echo "${APT_INCLUDES}" | sed "s/openssh-server/dropbear/")"
660 fi
662 fi
@@ -702,12 +704,12 fi
702 if [ -n "$CHROOT_SCRIPTS" ] && [ -d "$CHROOT_SCRIPTS" ] ; then
704 if [ -n "$CHROOT_SCRIPTS" ] && [ -d "$CHROOT_SCRIPTS" ] ; then
703 cp -r "${CHROOT_SCRIPTS}" "${R}/chroot_scripts"
705 cp -r "${CHROOT_SCRIPTS}" "${R}/chroot_scripts"
704 chroot_exec /bin/bash -x <<'EOF'
706 chroot_exec /bin/bash -x <<'EOF'
705 for SCRIPT in /chroot_scripts/* ; do
707 for SCRIPT in /chroot_scripts/* ; do
706 if [ -f $SCRIPT -a -x $SCRIPT ] ; then
708 if [ -f $SCRIPT -a -x $SCRIPT ] ; then
707 $SCRIPT
709 $SCRIPT
708 fi
710 fi
709 done
711 done
710 EOF
712 EOF
711 rm -rf "${R}/chroot_scripts"
713 rm -rf "${R}/chroot_scripts"
712 fi
714 fi
713
715
@@ -823,13 +825,13 if [ "$ENABLE_SPLITFS" = true ] ; then
823
825
824 # Write firmware/boot partition tables
826 # Write firmware/boot partition tables
825 sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null <<EOM
827 sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null <<EOM
826 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
828 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
827 EOM
829 EOM
828
830
829 # Write root partition table
831 # Write root partition table
830 sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null <<EOM
832 sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null <<EOM
831 ${TABLE_SECTORS},${ROOT_SECTORS},83
833 ${TABLE_SECTORS},${ROOT_SECTORS},83
832 EOM
834 EOM
833
835
834 # Setup temporary loop devices
836 # Setup temporary loop devices
835 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME"-frmw.img)"
837 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME"-frmw.img)"
@@ -840,9 +842,9 else # ENABLE_SPLITFS=false
840
842
841 # Write partition table
843 # Write partition table
842 sfdisk -q -L -uS -f "$IMAGE_NAME.img" 2> /dev/null <<EOM
844 sfdisk -q -L -uS -f "$IMAGE_NAME.img" 2> /dev/null <<EOM
843 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
845 ${TABLE_SECTORS},${FRMW_SECTORS},c,*
844 ${ROOT_OFFSET},${ROOT_SECTORS},83
846 ${ROOT_OFFSET},${ROOT_SECTORS},83
845 EOM
847 EOM
846
848
847 # Setup temporary loop devices
849 # Setup temporary loop devices
848 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME".img)"
850 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME".img)"
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant