diff --git a/README.md b/README.md index dc77c47..ef194c3 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,8 @@ Use debootstrap script variant `minbase` which only includes essential packages Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information. ##### `ENABLE_UBOOT`=false -Replace the default RPi 0/1/2/3/4 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol. +Replace the default RPi 0/1/2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol. +RPI4 needs tbd ##### `UBOOTSRC_DIR`="" Path to a directory (`u-boot`) of [U-Boot bootloader sources](https://git.denx.de/?p=u-boot.git;a=summary) that will be copied, configured, build and installed inside the chroot. @@ -322,7 +323,7 @@ Precompiled 64bit kernel for RPI3/4 by [https://github.com/sakaki-/](sakaki) ##### `CROSS_COMPILE`="arm-linux-gnueabihf-" This sets the cross-compile environment for the compiler. - + ##### `KERNEL_ARCH`="arm" This sets the kernel architecture for the compiler. diff --git a/bootstrap.d/14-fstab.sh b/bootstrap.d/14-fstab.sh index c8461a4..88f18f5 100644 --- a/bootstrap.d/14-fstab.sh +++ b/bootstrap.d/14-fstab.sh @@ -1,4 +1,4 @@ -#!/bin/sh +# # Setup fstab and initramfs # @@ -8,17 +8,6 @@ # Install and setup fstab install_readonly files/mount/fstab "${ETC_DIR}/fstab" -#USB BOOT /boot on sda1 / on sda2 -if [ "$ENABLE_USBBOOT" = true ] && [ "$ENABLE_CRYPTFS" = false ]; then - sed -i "s/mmcblk0p1/sda1/" "${ETC_DIR}/fstab" - sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab" -fi - -# Add usb/sda disk root partition to fstab -if [ "$ENABLE_SPLITFS" = true ] && [ "$ENABLE_CRYPTFS" = false ]; then - sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/fstab" -fi - # Generate initramfs file if [ "$ENABLE_INITRAMFS" = true ] ; then if [ "$ENABLE_CRYPTFS" = true ] ; then @@ -49,7 +38,7 @@ if [ "$ENABLE_INITRAMFS" = true ] ; then sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/crypttab" fi - if [ "$CRYPTFS_DROPBEAR" = true ]; then + if [ "$CRYPTFS_DROPBEAR" = true ] ; then if [ "$ENABLE_DHCP" = false ] ; then # Get cdir from NET_ADDRESS e.g. 24 cdir=$(printf "%s" "${NET_ADDRESS}" | cut -d '/' -f2) @@ -58,7 +47,10 @@ if [ "$ENABLE_INITRAMFS" = true ] ; then NET_MASK=$(cdr2mask "$cdir") # Write static ip settings to "${ETC_DIR}"/initramfs-tools/initramfs.conf + # ip=:::::: sed -i "\$a\nIP=${NET_ADDRESS}::${NET_GATEWAY}:${NET_MASK}:${HOSTNAME}:" "${ETC_DIR}"/initramfs-tools/initramfs.conf + else + sed -i "\$a\nIP=::::${HOSTNAME}::dhcp" "${ETC_DIR}"/initramfs-tools/initramfs.conf fi if [ -n "$CRYPTFS_DROPBEAR_PUBKEY" ] && [ -f "$CRYPTFS_DROPBEAR_PUBKEY" ] ; then @@ -112,6 +104,16 @@ if [ "$ENABLE_INITRAMFS" = true ] ; then chroot_exec cryptsetup close "${CRYPTFS_MAPPING}" # CRYPTFS=false else + #USB BOOT /boot on sda1 / on sda2 + if [ "$ENABLE_USBBOOT" = true ] ; then + sed -i "s/mmcblk0p1/sda1/" "${ETC_DIR}/fstab" + sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab" + fi + + # Add usb/sda disk root partition to fstab + if [ "$ENABLE_SPLITFS" = true ] ; then + sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/fstab" + fi # Generate initramfs without encrypted root partition support chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}" fi