diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh index 8d1f576..148f0b7 100644 --- a/bootstrap.d/13-kernel.sh +++ b/bootstrap.d/13-kernel.sh @@ -31,7 +31,7 @@ if [ "$BUILD_KERNEL" = true ] ; then # Create temporary directory for kernel sources temp_dir=$(as_nobody mktemp -d) - # Fetch current RPi2/3 kernel sources + # Fetch current RPi2/3/4 kernel sources if [ -z "${KERNEL_BRANCH}" ] ; then as_nobody -H git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" linux else @@ -883,4 +883,4 @@ else # BUILD_KERNEL=false cleanup exit 1 fi -fi \ No newline at end of file +fi diff --git a/bootstrap.d/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh index 6278b50..63f556c 100644 --- a/bootstrap.d/15-rpi-config.sh +++ b/bootstrap.d/15-rpi-config.sh @@ -20,7 +20,7 @@ if [ -n "$RPI_FIRMWARE_DIR" ] && [ -d "$RPI_FIRMWARE_DIR" ] ; then cp "${RPI_FIRMWARE_DIR}"/boot/fixup4x.dat "${BOOT_DIR}"/fixup4x.dat cp "${RPI_FIRMWARE_DIR}"/boot/start4cd.elf "${BOOT_DIR}"/start4cd.elf cp "${RPI_FIRMWARE_DIR}"/boot/start4db.elf "${BOOT_DIR}"/start4db.elf - cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4x.elf + cp "${RPI_FIRMWARE_DIR}"/boot/start4.elf "${BOOT_DIR}"/start4.elf cp "${RPI_FIRMWARE_DIR}"/boot/start4x.elf "${BOOT_DIR}"/start4x.elf else # Create temporary directory for boot binaries @@ -40,7 +40,7 @@ else as_nobody wget -q -O "${temp_dir}/fixup4x.dat" "${FIRMWARE_URL}/fixup4x.dat" as_nobody wget -q -O "${temp_dir}/start4cd.elf" "${FIRMWARE_URL}/start4cd.elf" as_nobody wget -q -O "${temp_dir}/start4db.elf" "${FIRMWARE_URL}/start4db.elf" - as_nobody wget -q -O "${temp_dir}/start4x.elf" "${FIRMWARE_URL}/start4x.elf" + as_nobody wget -q -O "${temp_dir}/start4.elf" "${FIRMWARE_URL}/start4.elf" as_nobody wget -q -O "${temp_dir}/start4x.elf" "${FIRMWARE_URL}/start4x.elf" # Move downloaded boot binaries diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 586860f..9d6733b 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -45,7 +45,7 @@ RPI_MODEL=${RPI_MODEL:=3P} # Debian release RELEASE=${RELEASE:=buster} if [ $RELEASE = "bullseye" ] ; then - RELEASE=testing + RELEASE=testing fi # Kernel Branch @@ -270,14 +270,14 @@ fi # Setup architecture specific settings if [ -n "$SET_ARCH" ] ; then - # 64-bit configuration + ## 64-bit configuration if [ "$SET_ARCH" = 64 ] ; then - # General 64-bit depended settings + ### General 64-bit depended settings QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static} KERNEL_ARCH=${KERNEL_ARCH:=arm64} KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"} - # Raspberry Pi model specific settings + ### Raspberry Pi model specific settings if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then if [ "$RPI_MODEL" != 4 ] ; then KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig} @@ -289,20 +289,21 @@ if [ -n "$SET_ARCH" ] ; then RELEASE_ARCH=${RELEASE_ARCH:=arm64} KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img} CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-} + else echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit" exit 1 fi fi - # 32-bit configuration + ## 32-bit configuration if [ "$SET_ARCH" = 32 ] ; then - # General 32-bit dependend settings + ### General 32-bit dependend settings QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static} KERNEL_ARCH=${KERNEL_ARCH:=arm} KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="zImage"} - # Raspberry Pi model specific settings + ### Raspberry Pi (0-1P) model specific settings if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel" KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig} @@ -320,7 +321,7 @@ if [ -n "$SET_ARCH" ] ; then fi fi fi - # Raspberry Pi model specific settings + ### Raspberry Pi (2-4) model specific settings if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then if [ "$RPI_MODEL" != 4 ] ; then KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig} @@ -377,17 +378,18 @@ case "$RPI_MODEL" in ;; esac -# Raspberry PI 0,3,3P with Bluetooth and Wifi onboard +# Raspberry PI 0,3,3P,4 with Bluetooth and Wifi onboard if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then - # Include bluetooth packages on supported boards + ## Include bluetooth packages on supported boards if [ "$ENABLE_BLUETOOTH" = true ] ; then APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" fi if [ "$ENABLE_WIRELESS" = true ] ; then APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant" fi -else # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard - # Check if the internal wireless interface is not supported by the RPi model +# Raspberry PI 1,1P,2 without Wifi and bluetooth onboard +else + ## Check if the internal wireless interface is not supported by the RPi model if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth" exit 1 @@ -506,7 +508,7 @@ if [ -n "$MISSING_PACKAGES" ] ; then read -r confirm [ "$confirm" != "y" ] && exit 1 - # Make sure all missing required packages are installed + ## Make sure all missing required packages are installed apt-get update && apt-get -qq -y install `echo "${MISSING_PACKAGES}" | sed "s/ //"` fi @@ -554,8 +556,8 @@ fi # Check if specified CHROOT_SCRIPTS directory exists if [ -n "$CHROOT_SCRIPTS" ] && [ ! -d "$CHROOT_SCRIPTS" ] ; then - echo "error: ${CHROOT_SCRIPTS} specified directory not found (CHROOT_SCRIPTS)!" - exit 1 + echo "error: ${CHROOT_SCRIPTS} specified directory not found (CHROOT_SCRIPTS)!" + exit 1 fi # Check if specified device mapping already exists (will be used by cryptsetup) @@ -649,12 +651,12 @@ fi # Replace selected packages with smaller clones if [ "$ENABLE_REDUCE" = true ] ; then - # Add levee package instead of vim-tiny + ## Add levee package instead of vim-tiny if [ "$REDUCE_VIM" = true ] ; then APT_INCLUDES="$(echo ${APT_INCLUDES} | sed "s/vim-tiny/levee/")" fi - # Add dropbear package instead of openssh-server + ## Add dropbear package instead of openssh-server if [ "$REDUCE_SSHD" = true ] ; then APT_INCLUDES="$(echo "${APT_INCLUDES}" | sed "s/openssh-server/dropbear/")" fi @@ -821,20 +823,21 @@ if [ "$ENABLE_SPLITFS" = true ] ; then dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count="${TABLE_SECTORS}" dd if=/dev/zero of="$IMAGE_NAME-root.img" bs=512 count=0 seek="${ROOT_SECTORS}" - # Write firmware/boot partition tables + ## Write firmware/boot partition tables sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null < /dev/null <