@@ -31,7 +31,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
31 | 31 | # Create temporary directory for kernel sources |
|
32 | 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 | 35 | if [ -z "${KERNEL_BRANCH}" ] ; then |
|
36 | 36 | as_nobody -H git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" linux |
|
37 | 37 | else |
@@ -883,4 +883,4 else # BUILD_KERNEL=false | |||
|
883 | 883 | cleanup |
|
884 | 884 | exit 1 |
|
885 | 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 | 20 | cp "${RPI_FIRMWARE_DIR}"/boot/fixup4x.dat "${BOOT_DIR}"/fixup4x.dat |
|
21 | 21 | cp "${RPI_FIRMWARE_DIR}"/boot/start4cd.elf "${BOOT_DIR}"/start4cd.elf |
|
22 | 22 | cp "${RPI_FIRMWARE_DIR}"/boot/start4db.elf "${BOOT_DIR}"/start4db.elf |
|
23 |
cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4 |
|
|
23 | cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4.elf | |
|
24 | 24 | cp "${RPI_FIRMWARE_DIR}"/boot/start4x.elf "${BOOT_DIR}"/start4x.elf |
|
25 | 25 | else |
|
26 | 26 | # Create temporary directory for boot binaries |
@@ -40,7 +40,7 else | |||
|
40 | 40 | as_nobody wget -q -O "${temp_dir}/fixup4x.dat" "${FIRMWARE_URL}/fixup4x.dat" |
|
41 | 41 | as_nobody wget -q -O "${temp_dir}/start4cd.elf" "${FIRMWARE_URL}/start4cd.elf" |
|
42 | 42 | as_nobody wget -q -O "${temp_dir}/start4db.elf" "${FIRMWARE_URL}/start4db.elf" |
|
43 |
as_nobody wget -q -O "${temp_dir}/start4 |
|
|
43 | as_nobody wget -q -O "${temp_dir}/start4.elf" "${FIRMWARE_URL}/start4.elf" | |
|
44 | 44 | as_nobody wget -q -O "${temp_dir}/start4x.elf" "${FIRMWARE_URL}/start4x.elf" |
|
45 | 45 | |
|
46 | 46 | # Move downloaded boot binaries |
@@ -45,7 +45,7 RPI_MODEL=${RPI_MODEL:=3P} | |||
|
45 | 45 | # Debian release |
|
46 | 46 | RELEASE=${RELEASE:=buster} |
|
47 | 47 | if [ $RELEASE = "bullseye" ] ; then |
|
48 | RELEASE=testing | |
|
48 | RELEASE=testing | |
|
49 | 49 | fi |
|
50 | 50 | |
|
51 | 51 | # Kernel Branch |
@@ -270,14 +270,14 fi | |||
|
270 | 270 | |
|
271 | 271 | # Setup architecture specific settings |
|
272 | 272 | if [ -n "$SET_ARCH" ] ; then |
|
273 | # 64-bit configuration | |
|
273 | ## 64-bit configuration | |
|
274 | 274 | if [ "$SET_ARCH" = 64 ] ; then |
|
275 | # General 64-bit depended settings | |
|
275 | ### General 64-bit depended settings | |
|
276 | 276 | QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static} |
|
277 | 277 | KERNEL_ARCH=${KERNEL_ARCH:=arm64} |
|
278 | 278 | KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"} |
|
279 | 279 | |
|
280 | # Raspberry Pi model specific settings | |
|
280 | ### Raspberry Pi model specific settings | |
|
281 | 281 | if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then |
|
282 | 282 | if [ "$RPI_MODEL" != 4 ] ; then |
|
283 | 283 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig} |
@@ -289,20 +289,21 if [ -n "$SET_ARCH" ] ; then | |||
|
289 | 289 | RELEASE_ARCH=${RELEASE_ARCH:=arm64} |
|
290 | 290 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img} |
|
291 | 291 | CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-} |
|
292 | ||
|
292 | 293 | else |
|
293 | 294 | echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit" |
|
294 | 295 | exit 1 |
|
295 | 296 | fi |
|
296 | 297 | fi |
|
297 | 298 | |
|
298 | # 32-bit configuration | |
|
299 | ## 32-bit configuration | |
|
299 | 300 | if [ "$SET_ARCH" = 32 ] ; then |
|
300 | # General 32-bit dependend settings | |
|
301 | ### General 32-bit dependend settings | |
|
301 | 302 | QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static} |
|
302 | 303 | KERNEL_ARCH=${KERNEL_ARCH:=arm} |
|
303 | 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 | 307 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then |
|
307 | 308 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel" |
|
308 | 309 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig} |
@@ -320,7 +321,7 if [ -n "$SET_ARCH" ] ; then | |||
|
320 | 321 | fi |
|
321 | 322 | fi |
|
322 | 323 | fi |
|
323 | # Raspberry Pi model specific settings | |
|
324 | ### Raspberry Pi (2-4) model specific settings | |
|
324 | 325 | if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then |
|
325 | 326 | if [ "$RPI_MODEL" != 4 ] ; then |
|
326 | 327 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig} |
@@ -377,17 +378,18 case "$RPI_MODEL" in | |||
|
377 | 378 | ;; |
|
378 | 379 | esac |
|
379 | 380 | |
|
380 | # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard | |
|
381 | # Raspberry PI 0,3,3P,4 with Bluetooth and Wifi onboard | |
|
381 | 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 | 384 | if [ "$ENABLE_BLUETOOTH" = true ] ; then |
|
384 | 385 | APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" |
|
385 | 386 | fi |
|
386 | 387 | if [ "$ENABLE_WIRELESS" = true ] ; then |
|
387 | 388 | APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant" |
|
388 | 389 | fi |
|
389 |
|
|
|
390 | # Check if the internal wireless interface is not supported by the RPi model | |
|
390 | # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard | |
|
391 | else | |
|
392 | ## Check if the internal wireless interface is not supported by the RPi model | |
|
391 | 393 | if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then |
|
392 | 394 | echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth" |
|
393 | 395 | exit 1 |
@@ -506,7 +508,7 if [ -n "$MISSING_PACKAGES" ] ; then | |||
|
506 | 508 | read -r confirm |
|
507 | 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 | 512 | apt-get update && apt-get -qq -y install `echo "${MISSING_PACKAGES}" | sed "s/ //"` |
|
511 | 513 | fi |
|
512 | 514 | |
@@ -554,8 +556,8 fi | |||
|
554 | 556 | |
|
555 | 557 | # Check if specified CHROOT_SCRIPTS directory exists |
|
556 | 558 | if [ -n "$CHROOT_SCRIPTS" ] && [ ! -d "$CHROOT_SCRIPTS" ] ; then |
|
557 |
|
|
|
558 |
|
|
|
559 | echo "error: ${CHROOT_SCRIPTS} specified directory not found (CHROOT_SCRIPTS)!" | |
|
560 | exit 1 | |
|
559 | 561 | fi |
|
560 | 562 | |
|
561 | 563 | # Check if specified device mapping already exists (will be used by cryptsetup) |
@@ -649,12 +651,12 fi | |||
|
649 | 651 | |
|
650 | 652 | # Replace selected packages with smaller clones |
|
651 | 653 | if [ "$ENABLE_REDUCE" = true ] ; then |
|
652 | # Add levee package instead of vim-tiny | |
|
654 | ## Add levee package instead of vim-tiny | |
|
653 | 655 | if [ "$REDUCE_VIM" = true ] ; then |
|
654 | 656 | APT_INCLUDES="$(echo ${APT_INCLUDES} | sed "s/vim-tiny/levee/")" |
|
655 | 657 | fi |
|
656 | 658 | |
|
657 | # Add dropbear package instead of openssh-server | |
|
659 | ## Add dropbear package instead of openssh-server | |
|
658 | 660 | if [ "$REDUCE_SSHD" = true ] ; then |
|
659 | 661 | APT_INCLUDES="$(echo "${APT_INCLUDES}" | sed "s/openssh-server/dropbear/")" |
|
660 | 662 | fi |
@@ -821,20 +823,21 if [ "$ENABLE_SPLITFS" = true ] ; then | |||
|
821 | 823 | dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count="${TABLE_SECTORS}" |
|
822 | 824 | dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count=0 seek="${ROOT_SECTORS}" |
|
823 | 825 | |
|
824 | # Write firmware/boot partition tables | |
|
826 | ## Write firmware/boot partition tables | |
|
825 | 827 | sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null <<EOM |
|
826 | 828 | ${TABLE_SECTORS},${FRMW_SECTORS},c,* |
|
827 | 829 | EOM |
|
828 | 830 | |
|
829 | # Write root partition table | |
|
831 | ## Write root partition table | |
|
830 | 832 | sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null <<EOM |
|
831 | 833 | ${TABLE_SECTORS},${ROOT_SECTORS},83 |
|
832 | 834 | EOM |
|
833 | 835 | |
|
834 | # Setup temporary loop devices | |
|
836 | ## Setup temporary loop devices | |
|
835 | 837 | FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME"-frmw.img)" |
|
836 | 838 | ROOT_LOOP="$(losetup -o 1M -f --show "$IMAGE_NAME"-root.img)" |
|
837 |
|
|
|
839 | # ENABLE_SPLITFS=false | |
|
840 | else | |
|
838 | 841 |
|
|
839 | 842 | dd if=/dev/zero of="$IMAGE_NAME.img" bs=512 count=0 seek="${IMAGE_SECTORS}" |
|
840 | 843 |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant