diff --git a/build-all.sh b/build-all.sh index dd5e15268655..b77f785b9758 100644 --- a/build-all.sh +++ b/build-all.sh @@ -108,7 +108,7 @@ for line in "${buildlist[@]}"; do unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \ CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \ write_uboot_platform family_tweaks BOOTSCRIPT UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER UBOOT_TARGET \ - MODULES MODULES_NEXT INITRD_ARCH + MODULES MODULES_NEXT INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line n=$[$n+1] diff --git a/configuration.sh b/configuration.sh index ceef3e65ca14..0c4dc72a1f40 100644 --- a/configuration.sh +++ b/configuration.sh @@ -20,7 +20,6 @@ EXIT_PATCHING_ERROR="" # exit patching if failed HOST="$BOARD" # set hostname to the board CACHEDIR=$DEST/cache - [[ -z $ROOTFS_TYPE ]] && ROOTFS_TYPE=ext4 # default rootfs type is ext4 [[ "ext4 f2fs btrfs nfs fel" != *$ROOTFS_TYPE* ]] && exit_with_error "Unknown rootfs type" "$ROOTFS_TYPE" @@ -54,7 +53,9 @@ OFFSET=1 # Bootloader space in MB (1 x 2048 = default) ARCH=armhf KERNEL_IMAGE_TYPE=zImage SERIALCON=ttyS0 -BOOTSIZE=0 # Mb size of boot partition + +# WARNING: This option is deprecated +BOOTSIZE=0 if [[ -f $SRC/lib/config/sources/$LINUXFAMILY.conf ]]; then source $SRC/lib/config/sources/$LINUXFAMILY.conf diff --git a/debootstrap-ng.sh b/debootstrap-ng.sh index 86b76a8a38d8..04f0b1bdd434 100644 --- a/debootstrap-ng.sh +++ b/debootstrap-ng.sh @@ -402,21 +402,12 @@ prepare_partitions() fi echo "tmpfs /tmp tmpfs defaults,nosuid 0 0" >> $CACHEDIR/sdcard/etc/fstab - # stage: create boot script - if [[ $ROOTFS_TYPE == nfs ]]; then - # copy script provided by user if exists - if [[ -f $SRC/userpatches/nfs-boot.cmd ]]; then - display_alert "Using custom NFS boot script" "userpatches/nfs-boot.cmd" "info" - cp $SRC/userpatches/nfs-boot.cmd $CACHEDIR/sdcard/boot/boot.cmd - else - cp $SRC/lib/scripts/nfs-boot.cmd.template $CACHEDIR/sdcard/boot/boot.cmd - fi - elif [[ $BOOTSIZE != 0 && -f $CACHEDIR/sdcard/boot/boot.cmd ]]; then + if [[ $ROOTFS_TYPE != nfs && $BOOTSIZE != 0 && -f $CACHEDIR/sdcard/boot/boot.cmd ]]; then sed -i 's/mmcblk0p1/mmcblk0p2/' $CACHEDIR/sdcard/boot/boot.cmd sed -i "s/rootfstype=ext4/rootfstype=$ROOTFS_TYPE/" $CACHEDIR/sdcard/boot/boot.cmd fi - # recompile .cmd to .scr if needed + # recompile .cmd to .scr if boot.cmd exists [[ -f $CACHEDIR/sdcard/boot/boot.cmd ]] && \ mkimage -C none -A arm -T script -d $CACHEDIR/sdcard/boot/boot.cmd $CACHEDIR/sdcard/boot/boot.scr > /dev/null 2>&1 diff --git a/distributions.sh b/distributions.sh index ad90b912b8b9..ff3516e34f90 100644 --- a/distributions.sh +++ b/distributions.sh @@ -71,6 +71,20 @@ install_common() local bootscript_dst=${BOOTSCRIPT##*:} cp $SRC/lib/config/bootscripts/$bootscript_src $CACHEDIR/sdcard/boot/$bootscript_dst + [[ -n $BOOTENV_FILE && -f $SRC/lib/config/bootenv/$BOOTENV_FILE ]] && \ + cp $SRC/lib/config/bootenv/$BOOTENV_FILE $CACHEDIR/sdcard/boot/armbianEnv.txt + + # TODO: modify $bootscript_dst or armbianEnv.txt to make NFS boot universal + # instead of copying sunxi-specific template + if [[ $ROOTFS_TYPE == nfs ]]; then + display_alert "Copying NFS boot script template" + if [[ -f $SRC/userpatches/nfs-boot.cmd ]]; then + cp $SRC/userpatches/nfs-boot.cmd $CACHEDIR/sdcard/boot/boot.cmd + else + cp $SRC/lib/scripts/nfs-boot.cmd.template $CACHEDIR/sdcard/boot/boot.cmd + fi + fi + # initial date for fake-hwclock date -u '+%Y-%m-%d %H:%M:%S' > $CACHEDIR/sdcard/etc/fake-hwclock.data