add extlinux.conf (#2722)
* add extlinux.conf * - make sure armbianEnv is not added - we don't need variables for NAME_KERNEL and NAME_INITRD. This is not going to change - also MAIN_CMDLINE could at least be renamed so its clear to belong to EXT configuration. Elsewhere this doesn't apply since we have boot scripts Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
This commit is contained in:
parent
2c987b7a09
commit
71dc41f0ba
@ -1,3 +1,4 @@
|
||||
MAIN_CMDLINE="rootflags=data=writeback rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 bootsplash.bootfile=bootsplash.armbian"
|
||||
INITRD_ARCH=arm64
|
||||
QEMU_BINARY="qemu-aarch64-static"
|
||||
ARCHITECTURE=arm64
|
||||
|
||||
@ -613,13 +613,19 @@ prepare_partitions()
|
||||
sed -i "s/console=.*/console=$DEFAULT_CONSOLE/" $SDCARD/boot/armbianEnv.txt
|
||||
else
|
||||
echo "console=$DEFAULT_CONSOLE" >> $SDCARD/boot/armbianEnv.txt
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# recompile .cmd to .scr if boot.cmd exists
|
||||
[[ -f $SDCARD/boot/boot.cmd ]] && \
|
||||
mkimage -C none -A arm -T script -d $SDCARD/boot/boot.cmd $SDCARD/boot/boot.scr > /dev/null 2>&1
|
||||
|
||||
# create extlinux config
|
||||
if [[ -f $SDCARD/boot/extlinux/extlinux.conf ]]; then
|
||||
echo " APPEND root=$rootfs $SRC_CMDLINE $MAIN_CMDLINE" >> $SDCARD/boot/extlinux/extlinux.conf
|
||||
[[ -f $SDCARD/boot/armbianEnv.txt ]] && rm $SDCARD/boot/armbianEnv.txt
|
||||
fi
|
||||
|
||||
} #############################################################################
|
||||
|
||||
# update_initramfs
|
||||
|
||||
@ -164,36 +164,52 @@ install_common()
|
||||
# NOTE: this needs to be executed before family_tweaks
|
||||
local bootscript_src=${BOOTSCRIPT%%:*}
|
||||
local bootscript_dst=${BOOTSCRIPT##*:}
|
||||
cp "${SRC}/config/bootscripts/${bootscript_src}" "${SDCARD}/boot/${bootscript_dst}"
|
||||
|
||||
if [[ -n $BOOTENV_FILE ]]; then
|
||||
if [[ -f $USERPATCHES_PATH/bootenv/$BOOTENV_FILE ]]; then
|
||||
cp "$USERPATCHES_PATH/bootenv/${BOOTENV_FILE}" "${SDCARD}"/boot/armbianEnv.txt
|
||||
elif [[ -f $SRC/config/bootenv/$BOOTENV_FILE ]]; then
|
||||
cp "${SRC}/config/bootenv/${BOOTENV_FILE}" "${SDCARD}"/boot/armbianEnv.txt
|
||||
# create extlinux config file
|
||||
if [[ $SRC_EXTLINUX == yes ]]; then
|
||||
|
||||
mkdir -p $SDCARD/boot/extlinux
|
||||
cat <<-EOF > "$SDCARD/boot/extlinux/extlinux.conf"
|
||||
LABEL Armbian
|
||||
LINUX /boot/Image
|
||||
INITRD /boot/uInitrd
|
||||
FDT /boot/dtb/$BOOT_FDT_FILE
|
||||
EOF
|
||||
|
||||
else
|
||||
|
||||
cp "${SRC}/config/bootscripts/${bootscript_src}" "${SDCARD}/boot/${bootscript_dst}"
|
||||
|
||||
if [[ -n $BOOTENV_FILE ]]; then
|
||||
if [[ -f $USERPATCHES_PATH/bootenv/$BOOTENV_FILE ]]; then
|
||||
cp "$USERPATCHES_PATH/bootenv/${BOOTENV_FILE}" "${SDCARD}"/boot/armbianEnv.txt
|
||||
elif [[ -f $SRC/config/bootenv/$BOOTENV_FILE ]]; then
|
||||
cp "${SRC}/config/bootenv/${BOOTENV_FILE}" "${SDCARD}"/boot/armbianEnv.txt
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# 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 $USERPATCHES_PATH/nfs-boot.cmd ]]; then
|
||||
cp "$USERPATCHES_PATH"/nfs-boot.cmd "${SDCARD}"/boot/boot.cmd
|
||||
else
|
||||
cp "${SRC}"/config/templates/nfs-boot.cmd.template "${SDCARD}"/boot/boot.cmd
|
||||
# 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 $USERPATCHES_PATH/nfs-boot.cmd ]]; then
|
||||
cp "$USERPATCHES_PATH"/nfs-boot.cmd "${SDCARD}"/boot/boot.cmd
|
||||
else
|
||||
cp "${SRC}"/config/templates/nfs-boot.cmd.template "${SDCARD}"/boot/boot.cmd
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -n $OVERLAY_PREFIX && -f "${SDCARD}"/boot/armbianEnv.txt ]] && \
|
||||
echo "overlay_prefix=$OVERLAY_PREFIX" >> "${SDCARD}"/boot/armbianEnv.txt
|
||||
|
||||
[[ -n $DEFAULT_OVERLAYS && -f "${SDCARD}"/boot/armbianEnv.txt ]] && \
|
||||
echo "overlays=${DEFAULT_OVERLAYS//,/ }" >> "${SDCARD}"/boot/armbianEnv.txt
|
||||
|
||||
[[ -n $BOOT_FDT_FILE && -f "${SDCARD}"/boot/armbianEnv.txt ]] && \
|
||||
echo "fdtfile=${BOOT_FDT_FILE}" >> "${SDCARD}/boot/armbianEnv.txt"
|
||||
|
||||
fi
|
||||
|
||||
[[ -n $OVERLAY_PREFIX && -f "${SDCARD}"/boot/armbianEnv.txt ]] && \
|
||||
echo "overlay_prefix=$OVERLAY_PREFIX" >> "${SDCARD}"/boot/armbianEnv.txt
|
||||
|
||||
[[ -n $DEFAULT_OVERLAYS && -f "${SDCARD}"/boot/armbianEnv.txt ]] && \
|
||||
echo "overlays=${DEFAULT_OVERLAYS//,/ }" >> "${SDCARD}"/boot/armbianEnv.txt
|
||||
|
||||
[[ -n $BOOT_FDT_FILE && -f "${SDCARD}"/boot/armbianEnv.txt ]] && \
|
||||
echo "fdtfile=${BOOT_FDT_FILE}" >> "${SDCARD}/boot/armbianEnv.txt"
|
||||
|
||||
# initial date for fake-hwclock
|
||||
date -u '+%Y-%m-%d %H:%M:%S' > "${SDCARD}"/etc/fake-hwclock.data
|
||||
|
||||
|
||||
@ -211,8 +211,8 @@ create_board_package()
|
||||
rootdev=\$(sed -e 's/^.*root=//' -e 's/ .*\$//' < /proc/cmdline)
|
||||
rootfstype=\$(sed -e 's/^.*rootfstype=//' -e 's/ .*$//' < /proc/cmdline)
|
||||
|
||||
# recreate armbianEnv.txt only not exists
|
||||
if [ ! -f /boot/armbianEnv.txt ]; then
|
||||
# recreate armbianEnv.txt if it and extlinux does not exists
|
||||
if [ ! -f /boot/armbianEnv.txt ] && [ ! -f /boot/extlinux/extlinux.conf ]; then
|
||||
cp /usr/share/armbian/armbianEnv.txt /boot >/dev/null 2>&1
|
||||
echo "rootdev="\$rootdev >> /boot/armbianEnv.txt
|
||||
echo "rootfstype="\$rootfstype >> /boot/armbianEnv.txt
|
||||
|
||||
Loading…
Reference in New Issue
Block a user