mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
projects: cleanup bootloader files
This commit is contained in:
@@ -211,3 +211,111 @@ EOF
|
||||
fi
|
||||
add_system_doc ${SYSTEM_NAME}
|
||||
}
|
||||
|
||||
# dtb.xml parsing
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
|
||||
SUBDEVICES=$(xmlstarlet sel -t -m "//dtb/${DEVICE}/*[@mkimage_options]" -v "name()" -n "${DTBXML}" 2>/dev/null | tr '\n' ' ')
|
||||
|
||||
get_kernel_make_extracmd() {
|
||||
local DTB_PREFIX
|
||||
DTB_PREFIX=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/@dtb_prefix" "${DTBXML}" 2>/dev/null)
|
||||
DTB_PREFIX="${DTB_PREFIX}/"
|
||||
xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "${DTB_PREFIX}" -v "." -o ".dtb " "${DTBXML}" 2>/dev/null
|
||||
}
|
||||
|
||||
get_fdt() {
|
||||
local FDT_FILENAME=""
|
||||
|
||||
if [[ -n "${SUBDEVICE}" ]]; then
|
||||
FDT_FILENAME=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@fdt" "${DTBXML}" 2>/dev/null || true)
|
||||
fi
|
||||
|
||||
if [[ -z "${FDT_FILENAME}" ]]; then
|
||||
FDT_FILENAME=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/@fdt" "${DTBXML}" 2>/dev/null || true)
|
||||
fi
|
||||
|
||||
[ -n "${FDT_FILENAME}" ] && echo "${FDT_FILENAME}" || true
|
||||
}
|
||||
|
||||
generate_grub_cfg_body() {
|
||||
cat << EOF
|
||||
insmod part_gpt
|
||||
insmod part_msdos
|
||||
load_env
|
||||
|
||||
if [ "\${saved_entry}" ]; then
|
||||
set timeout=2
|
||||
set default="\${saved_entry}"
|
||||
else
|
||||
set timeout=-1
|
||||
fi
|
||||
|
||||
if [ x"\${feature_menuentry_id}" = xy ]; then
|
||||
menuentry_id_option="--id"
|
||||
else
|
||||
menuentry_id_option=""
|
||||
fi
|
||||
export menuentry_id_option
|
||||
|
||||
function savedefault {
|
||||
saved_entry="\${chosen}"
|
||||
save_env saved_entry
|
||||
}
|
||||
|
||||
set timeout_style=menu
|
||||
set lang=en_US
|
||||
loadfont /EFI/BOOT/dejavu-mono.pf2
|
||||
set rotation=270
|
||||
set gfxmode=auto
|
||||
insmod efi_gop
|
||||
insmod gfxterm
|
||||
terminal_output gfxterm
|
||||
set menu_color_normal=cyan/blue
|
||||
set menu_color_highlight=white/blue
|
||||
|
||||
EOF
|
||||
|
||||
xmlstarlet sel -t -m "//dtb/${DEVICE}/file" \
|
||||
-v "concat(@short, '|', @full, '|', .)" -n "${DTBXML}" 2>/dev/null | while IFS='|' read -r SHORT FULL DTB; do
|
||||
|
||||
cat << EOF
|
||||
menuentry '${FULL}' \$menuentry_id_option '${SHORT}' {
|
||||
savedefault
|
||||
search --set -f /KERNEL
|
||||
linux /KERNEL boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} grub_portable ${EXTRA_CMDLINE}
|
||||
devicetree /${DTB}.dtb
|
||||
}
|
||||
EOF
|
||||
done
|
||||
|
||||
xmlstarlet sel -t -m "//dtb/${DEVICE}/file" \
|
||||
-v "concat(@short, '|', @full, '|', .)" -n "${DTBXML}" 2>/dev/null | while IFS='|' read -r SHORT FULL DTB; do
|
||||
|
||||
cat << EOF
|
||||
menuentry '${FULL} RECOVERY' \$menuentry_id_option '${SHORT}-recovery' {
|
||||
search --set -f /KERNEL
|
||||
linux /KERNEL boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} grub_portable ${EXTRA_CMDLINE} recovery
|
||||
devicetree /${DTB}.dtb
|
||||
}
|
||||
EOF
|
||||
done
|
||||
}
|
||||
|
||||
mkimage_all() {
|
||||
local OPTIONS_LIST=""
|
||||
|
||||
if [[ -n "${SUBDEVICE}" ]]; then
|
||||
OPTIONS_LIST=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@mkimage_options" "${DTBXML}" 2>/dev/null)
|
||||
fi
|
||||
|
||||
if [[ -z "${OPTIONS_LIST}" ]]; then
|
||||
OPTIONS_LIST=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/@mkimage_options" "${DTBXML}" 2>/dev/null)
|
||||
fi
|
||||
|
||||
for step in $(echo "${OPTIONS_LIST}" | tr ',' ' '); do
|
||||
local func_name="mkimage_${step}"
|
||||
|
||||
"${func_name}"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<dtb>
|
||||
<H700 bootmethod="extlinux">
|
||||
<H700 mkimage_options="dtb,extlinux,uboot" fdt="dtb.img" dtb_prefix="allwinner">
|
||||
<file>sun50i-h700-anbernic-rg35xx-plus</file>
|
||||
<file>sun50i-h700-anbernic-rg35xx-plus-rev6-panel</file>
|
||||
<file>sun50i-h700-anbernic-rg35xx-pro</file>
|
||||
@@ -16,8 +16,8 @@
|
||||
<file>sun50i-h700-anbernic-rg34xx</file>
|
||||
<file>sun50i-h700-anbernic-rg34xx-sp</file>
|
||||
</H700>
|
||||
<RK3326>
|
||||
<a bootmethod="bootini">
|
||||
<RK3326 dtb_prefix="rockchip">
|
||||
<a mkimage_options="dtb,bootini,uboot">
|
||||
<file>rk3326-anbernic-rg351m</file>
|
||||
<file>rk3326-anbernic-rg351v</file>
|
||||
<file>rk3326-gameconsole-r33s</file>
|
||||
@@ -29,18 +29,18 @@
|
||||
<file>rk3326-powkiddy-rgb10</file>
|
||||
<file>rk3326-powkiddy-rgb20s</file>
|
||||
</a>
|
||||
<b bootmethod="bootini">
|
||||
<b mkimage_options="dtb,bootini,uboot">
|
||||
<file>rk3326-powkiddy-rgb10x</file>
|
||||
<file>rk3326-magicx-xu10</file>
|
||||
<file>rk3326-magicx-xu-mini-m</file>
|
||||
<file>rk3326-gameconsole-r36max</file>
|
||||
</b>
|
||||
</RK3326>
|
||||
<RK3399 bootmethod="extlinux">
|
||||
<RK3399 mkimage_options="dtb,extlinux,uboot" fdt="device_trees/rk3399-anbernic-rg552.dtb" dtb_prefix="rockchip">
|
||||
<file>rk3399-anbernic-rg552</file>
|
||||
</RK3399>
|
||||
<RK3566>
|
||||
<Generic bootmethod="extlinux_fdtdir">
|
||||
<RK3566 dtb_prefix="rockchip">
|
||||
<Generic mkimage_options="dtb,extlinux_fdtdir,uboot" fdt="device_trees">
|
||||
<file>rk3566-anbernic-rg-arc-d</file>
|
||||
<file>rk3566-anbernic-rg-arc-s</file>
|
||||
<file>rk3566-anbernic-rg353p</file>
|
||||
@@ -54,36 +54,30 @@
|
||||
<file>rk3566-powkiddy-rgb30</file>
|
||||
<file>rk3566-powkiddy-rk2023</file>
|
||||
</Generic>
|
||||
<Powkiddy_x55 bootmethod="extlinux">
|
||||
<Powkiddy_x55 mkimage_options="dtb,extlinux,uboot" fdt="device_trees/rk3566-powkiddy-x55.dtb">
|
||||
<file>rk3566-powkiddy-x55</file>
|
||||
<file>rk3566-powkiddy-x35s</file>
|
||||
</Powkiddy_x55>
|
||||
</RK3566>
|
||||
<RK3588 bootmethod="extlinux">
|
||||
<RK3588 mkimage_options="dtb,extlinux,uboot" fdt="device_trees/rk3588s-gameforce-ace.dtb" dtb_prefix="rockchip">
|
||||
<file>rk3588s-gameforce-ace</file>
|
||||
<file>rk3588-orangepi-5-plus</file>
|
||||
<file>rk3588-orangepi-5-max</file>
|
||||
<file>rk3588-rock-5b</file>
|
||||
<file>rk3588-rock-5b-plus</file>
|
||||
<file>rk3588s-orangepi-5</file>
|
||||
<file>rk3588s-orangepi-5-pro</file>
|
||||
<file>rk3588s-retro-lite-cm5</file>
|
||||
<file>rk3588s-retroled-cm5</file>
|
||||
<file>rk3588s-rock-5a</file>
|
||||
<file>rk3588s-nanopi-r6c</file>
|
||||
<file>rk3588s-nanopi-r6s</file>
|
||||
</RK3588>
|
||||
<S922X bootmethod="extlinux_fdtdir">
|
||||
<S922X mkimage_options="dtb,extlinux_fdtdir,gou_extras,uboot" dtb_prefix="amlogic">
|
||||
<file>meson-g12b-odroid-go-ultra</file>
|
||||
<file>meson-g12b-powkiddy-rgb10-max-3-pro</file>
|
||||
</S922X>
|
||||
<SM8250 bootmethod="grub">
|
||||
<SDM845 mkimage_options="dtb,efi" dtb_prefix="qcom">
|
||||
<file short="odin" full="AYN Odin" rotation="3">sdm845-ayn-odin</file>
|
||||
</SDM845>
|
||||
<SM8250 mkimage_options="dtb,efi" dtb_prefix="qcom">
|
||||
<file short="rp5" full="Retroid Pocket 5" rotation="3">sm8250-retroidpocket-rp5</file>
|
||||
<file short="rpflip2" full="Retroid Pocket Flip2" rotation="3">sm8250-retroidpocket-flip2</file>
|
||||
<file short="rpmini" full="Retroid Pocket Mini" rotation="1">sm8250-retroidpocket-rpmini</file>
|
||||
<file short="rpminiv2" full="Retroid Pocket Mini V2" rotation="1">sm8250-retroidpocket-rpminiv2</file>
|
||||
</SM8250>
|
||||
<SM8550 bootmethod="grub">
|
||||
<SM8550 mkimage_options="dtb,efi,linuxloader,uboot" dtb_prefix="qcom">
|
||||
<file short="odin2" full="AYN Odin2">qcs8550-ayn-odin2</file>
|
||||
<file short="odin2portal" full="AYN Odin2 Portal">qcs8550-ayn-odin2portal</file>
|
||||
<file short="odin2mini" full="AYN Odin2 Mini">qcs8550-ayn-odin2mini</file>
|
||||
@@ -92,7 +86,4 @@
|
||||
<file short="pocketds" full="AYANEO Pocket DS">qcs8550-ayaneo-pocketds</file>
|
||||
<file short="pocketevo" full="AYANEO Pocket EVO">qcs8550-ayaneo-pocketevo</file>
|
||||
</SM8550>
|
||||
<SDM845 bootmethod="grub">
|
||||
<file short="odin" full="AYN Odin" rotation="3">sdm845-ayn-odin</file>
|
||||
</SDM845>
|
||||
</dtb>
|
||||
|
||||
@@ -1,33 +1,38 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
. config/functions
|
||||
|
||||
mkimage_uboot() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" ]; then
|
||||
# RK3566-Generic and RK3566-Powkiddy_x55
|
||||
echo "image: writing ${SUBDEVICE}_uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" ]; then
|
||||
echo "image: writing uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_bootini() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ]; then
|
||||
echo "image: copying ${SUBDEVICE}_boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ::/boot.ini
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ]; then
|
||||
echo "image: copying boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ::
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/u-boot.bin" ]; then
|
||||
# S922X
|
||||
echo "image: writing u-boot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/u-boot.bin" of="${DISK}" bs=512 seek=1 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/u-boot-sunxi-with-spl.bin" ]; then
|
||||
# H700
|
||||
echo "image: writing u-boot-sunxi-with-spl.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/u-boot-sunxi-with-spl.bin" of="${DISK}" bs=1K seek=8 conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
else
|
||||
# SM8550
|
||||
echo "image: copying u-boot files..."
|
||||
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/boot" ::
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_extlinux(){
|
||||
echo "image: set exlinux.conf to FDT /device_trees/${DTB[0]}.dtb..."
|
||||
echo "image: set exlinux.conf to FDT /$(get_fdt)..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDT /device_trees/${DTB[0]}.dtb
|
||||
FDT /$(get_fdt)
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
@@ -40,21 +45,31 @@ mkimage_extlinux_fdtdir(){
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDTDIR /device_trees
|
||||
FDTDIR /$(get_fdt)
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_bootini() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ]; then
|
||||
echo "image: copying ${SUBDEVICE}_boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ::/boot.ini
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ]; then
|
||||
echo "image: copying boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ::
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_dtb() {
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/device_trees ]; then
|
||||
echo "image: copying device trees..."
|
||||
if [ "${DEVICE}" = "RK3326" ]; then
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/device_trees/*.dtb ::
|
||||
else
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/device_trees ::
|
||||
fi
|
||||
echo "image: copying device trees..."
|
||||
if [ "${DEVICE}" = "RK3326" ]; then
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/device_trees/*.dtb ::
|
||||
elif [ "${DEVICE}" = "S922X" -o "${DEVICE}" = "SDM845" -o "${DEVICE}" = "SM8250" -o "${DEVICE}" = "SM8550" ]; then
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/*.dtb ::
|
||||
else
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/device_trees ::
|
||||
fi
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/overlays ]; then
|
||||
echo "image: copying device tree overlays..."
|
||||
@@ -62,10 +77,19 @@ mkimage_dtb() {
|
||||
fi
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
BOOTMETHOD=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@bootmethod" ${DTBXML})
|
||||
mkimage_gou_extras() {
|
||||
echo "image: copying res..."
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/res ::
|
||||
}
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_${BOOTMETHOD}
|
||||
mkimage_uboot
|
||||
mkimage_efi() {
|
||||
echo "image: copying EFI files..."
|
||||
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/EFI" ::
|
||||
}
|
||||
|
||||
mkimage_linuxloader() {
|
||||
echo "image: copying LinuxLoader.cfg..."
|
||||
mcopy "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/bootloader/LinuxLoader.cfg" ::
|
||||
}
|
||||
|
||||
mkimage_all
|
||||
@@ -1,41 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
mkimage_uboot() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/u-boot-sunxi-with-spl.bin" ]; then
|
||||
echo "image: writing u-boot-sunxi-with-spl.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/u-boot-sunxi-with-spl.bin" of="${DISK}" bs=1K seek=8 conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_extlinux(){
|
||||
echo "image: set exlinux.conf to FDT /dtb.img..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDT /dtb.img
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_dtb() {
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/device_trees ]; then
|
||||
echo "image: copying device trees..."
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/device_trees ::
|
||||
fi
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/overlays ]; then
|
||||
echo "image: copying device tree overlays..."
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/overlays ::
|
||||
fi
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
BOOTMETHOD=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@bootmethod" ${DTBXML})
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_${BOOTMETHOD}
|
||||
mkimage_uboot
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Kernel extra targets to build
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "allwinner/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet console=ttyS0,115200 console=tty0 systemd.debug_shell=ttyS0"
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
mkimage_uboot() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" ]; then
|
||||
echo "image: writing ${SUBDEVICE}_uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" ]; then
|
||||
echo "image: writing uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_bootini() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ]; then
|
||||
echo "image: copying ${SUBDEVICE}_boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ::/boot.ini
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ]; then
|
||||
echo "image: copying boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ::
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_extlinux(){
|
||||
echo "image: set exlinux.conf to FDT /device_trees/${DTB[0]}.dtb..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDT /device_trees/${DTB[0]}.dtb
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_extlinux_fdtdir(){
|
||||
echo "image: set extlinux.conf to FDTDIR /device_trees..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDTDIR /device_trees
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_dtb() {
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/device_trees ]; then
|
||||
echo "image: copying device trees..."
|
||||
if [ "${DEVICE}" = "RK3326" ]; then
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/device_trees/*.dtb ::
|
||||
else
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/device_trees ::
|
||||
fi
|
||||
fi
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/overlays ]; then
|
||||
echo "image: copying device tree overlays..."
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/overlays ::
|
||||
fi
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
BOOTMETHOD=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@bootmethod" ${DTBXML})
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_${BOOTMETHOD}
|
||||
mkimage_uboot
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Kernel extra targets to build
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "rockchip/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet console=ttyS2,115200 console=tty0 systemd.debug_shell=ttyS2"
|
||||
@@ -71,6 +71,3 @@
|
||||
|
||||
# Debug tty path
|
||||
DEBUG_TTY="/dev/ttyS2"
|
||||
|
||||
# ROCKNIX Subdevices
|
||||
SUBDEVICES=$(xmlstarlet sel -t -m "//dtb/${DEVICE}/*[@bootmethod]" -v "name()" -n "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
mkimage_uboot() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" ]; then
|
||||
echo "image: writing ${SUBDEVICE}_uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" ]; then
|
||||
echo "image: writing uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_bootini() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ]; then
|
||||
echo "image: copying ${SUBDEVICE}_boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ::/boot.ini
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ]; then
|
||||
echo "image: copying boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ::
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_extlinux(){
|
||||
echo "image: set exlinux.conf to FDT /device_trees/${DTB[0]}.dtb..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDT /device_trees/${DTB[0]}.dtb
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_extlinux_fdtdir(){
|
||||
echo "image: set extlinux.conf to FDTDIR /device_trees..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDTDIR /device_trees
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_dtb() {
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/device_trees ]; then
|
||||
echo "image: copying device trees..."
|
||||
if [ "${DEVICE}" = "RK3326" ]; then
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/device_trees/*.dtb ::
|
||||
else
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/device_trees ::
|
||||
fi
|
||||
fi
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/overlays ]; then
|
||||
echo "image: copying device tree overlays..."
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/overlays ::
|
||||
fi
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
BOOTMETHOD=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@bootmethod" ${DTBXML})
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_${BOOTMETHOD}
|
||||
mkimage_uboot
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Kernel extra targets to build
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "rockchip/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet console=ttyS2,115200 console=tty0 systemd.debug_shell=ttyS2"
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
mkimage_uboot() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" ]; then
|
||||
echo "image: writing ${SUBDEVICE}_uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" ]; then
|
||||
echo "image: writing uboot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_bootini() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ]; then
|
||||
echo "image: copying ${SUBDEVICE}_boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/${SUBDEVICE}_boot.ini" ::/boot.ini
|
||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ]; then
|
||||
echo "image: copying boot.ini..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" ::
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_extlinux(){
|
||||
echo "image: set exlinux.conf to FDT /device_trees/${DTB[0]}.dtb..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDT /device_trees/${DTB[0]}.dtb
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_extlinux_fdtdir(){
|
||||
echo "image: set extlinux.conf to FDTDIR /device_trees..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDTDIR /device_trees
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_dtb() {
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/device_trees ]; then
|
||||
echo "image: copying device trees..."
|
||||
if [ "${DEVICE}" = "RK3326" ]; then
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/device_trees/*.dtb ::
|
||||
else
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/device_trees ::
|
||||
fi
|
||||
fi
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/overlays ]; then
|
||||
echo "image: copying device tree overlays..."
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/overlays ::
|
||||
fi
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
BOOTMETHOD=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@bootmethod" ${DTBXML})
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_${BOOTMETHOD}
|
||||
mkimage_uboot
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Kernel extra targets to build
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "rockchip/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet console=ttyS2,115200 console=tty0 systemd.debug_shell=ttyS2"
|
||||
@@ -75,8 +75,5 @@
|
||||
# Debug tty path
|
||||
DEBUG_TTY="/dev/ttyS2"
|
||||
|
||||
# ROCKNIX Subdevices
|
||||
SUBDEVICES=$(xmlstarlet sel -t -m "//dtb/${DEVICE}/*[@bootmethod]" -v "name()" -n "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")
|
||||
|
||||
# Build and install rocknix out-of-tree device trees and overlays (yes / no)
|
||||
ROCKNIX_DEVICE_TREE_OVERLAYS="yes"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Kernel extra targets to build
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "rockchip/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet console=ttyFIQ0 console=tty0 systemd.debug_shell=ttyFIQ0 coherent_pool=2M fbcon=rotate:1"
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2022-24 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
mkimage_uboot() {
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/u-boot.bin" ]; then
|
||||
echo "image: writing u-boot.bin to $(basename ${DISK})..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/u-boot.bin" of="${DISK}" bs=512 seek=1 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_extlinux_fdtdir(){
|
||||
echo "image: set extlinux.conf to FDTDIR /..."
|
||||
mkdir -p "${IMG_TMP}/extlinux"
|
||||
cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf"
|
||||
LABEL ${DISTRO}
|
||||
LINUX /${KERNEL_NAME}
|
||||
FDTDIR /
|
||||
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
|
||||
EOF
|
||||
echo "image: copying exlinux.conf..."
|
||||
mcopy -s -o "${IMG_TMP}/extlinux" ::
|
||||
}
|
||||
|
||||
mkimage_dtb() {
|
||||
echo "image: copying device trees..."
|
||||
for dtb in ${DTB[@]}; do
|
||||
echo "image: copying ${dtb}.dtb..."
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/${dtb}.dtb ::
|
||||
done
|
||||
if [ -d ${RELEASE_DIR}/3rdparty/bootloader/overlays ]; then
|
||||
echo "image: copying device tree overlays..."
|
||||
mcopy -s ${RELEASE_DIR}/3rdparty/bootloader/overlays ::
|
||||
fi
|
||||
}
|
||||
|
||||
mkimage_gou_extras() {
|
||||
echo "image: copying res..."
|
||||
mcopy ${RELEASE_DIR}/3rdparty/bootloader/res ::
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
BOOTMETHOD=$(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/@bootmethod" ${DTBXML})
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_${BOOTMETHOD}
|
||||
mkimage_gou_extras
|
||||
mkimage_uboot
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Kernel extra targets to build
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "amlogic/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet console=ttyAML0,115200n8 console=tty0 systemd.debug_shell=ttyAML0"
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
mkimage_dtb() {
|
||||
echo "image: copying device trees..."
|
||||
for dtb in ${DTB[@]}; do
|
||||
echo "image: copying ${dtb}.dtb..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/${dtb}.dtb" ::
|
||||
done
|
||||
}
|
||||
|
||||
mkimage_efi() {
|
||||
echo "image: copying EFI files..."
|
||||
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/EFI" ::
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_efi
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "qcom/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet rootwait console=tty0 clk_ignore_unused pd_ignore_unused"
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
|
||||
mkdir -p "${INSTALL}/usr/share/bootloader/EFI/BOOT"
|
||||
cat << EOF > "${INSTALL}/usr/share/bootloader/EFI/BOOT/grub.cfg"
|
||||
insmod part_gpt
|
||||
insmod part_msdos
|
||||
load_env
|
||||
|
||||
if [ "\${saved_entry}" ]; then
|
||||
set timeout=2
|
||||
set default="\${saved_entry}"
|
||||
else
|
||||
set timeout=-1
|
||||
fi
|
||||
|
||||
if [ x"\${feature_menuentry_id}" = xy ]; then
|
||||
menuentry_id_option="--id"
|
||||
else
|
||||
menuentry_id_option=""
|
||||
fi
|
||||
export menuentry_id_option
|
||||
|
||||
function savedefault {
|
||||
saved_entry="\${chosen}"
|
||||
save_env saved_entry
|
||||
}
|
||||
|
||||
set timeout_style=menu
|
||||
set lang=en_US
|
||||
loadfont /EFI/BOOT/dejavu-mono.pf2
|
||||
set rotation=270
|
||||
set gfxmode=auto
|
||||
insmod efi_gop
|
||||
insmod gfxterm
|
||||
terminal_output gfxterm
|
||||
set menu_color_normal=cyan/blue
|
||||
set menu_color_highlight=white/blue
|
||||
|
||||
EOF
|
||||
|
||||
xmlstarlet sel -t -m "//${DEVICE}/file" \
|
||||
-v "concat(@short, '|', @full, '|', @rotation, '|', .)" -n "${DTBXML}" | while IFS='|' read -r SHORT FULL ROTATION DTB; do
|
||||
|
||||
cat << EOF >> "${INSTALL}/usr/share/bootloader/EFI/BOOT/grub.cfg"
|
||||
menuentry '${FULL}' \$menuentry_id_option '${SHORT}' {
|
||||
savedefault
|
||||
search --set -f /KERNEL
|
||||
linux /KERNEL boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} grub_portable ${EXTRA_CMDLINE} fbcon=rotate:${ROTATION}
|
||||
devicetree /${DTB}.dtb
|
||||
}
|
||||
EOF
|
||||
done
|
||||
|
||||
xmlstarlet sel -t -m "//${DEVICE}/file" \
|
||||
-v "concat(@short, '|', @full, '|', @rotation, '|', .)" -n "${DTBXML}" | while IFS='|' read -r SHORT FULL ROTATION DTB; do
|
||||
|
||||
cat << EOF >> "${INSTALL}/usr/share/bootloader/EFI/BOOT/grub.cfg"
|
||||
menuentry '${FULL} RECOVERY' \$menuentry_id_option '${SHORT}-recovery' {
|
||||
search --set -f /KERNEL
|
||||
linux /KERNEL boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} grub_portable ${EXTRA_CMDLINE} fbcon=rotate:${ROTATION} recovery
|
||||
devicetree /${DTB}.dtb
|
||||
}
|
||||
EOF
|
||||
done
|
||||
@@ -1,21 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
mkimage_dtb() {
|
||||
echo "image: copying device trees..."
|
||||
for dtb in ${DTB[@]}; do
|
||||
echo "image: copying ${dtb}.dtb..."
|
||||
mcopy "${RELEASE_DIR}/3rdparty/bootloader/${dtb}.dtb" ::
|
||||
done
|
||||
}
|
||||
|
||||
mkimage_efi() {
|
||||
echo "image: copying EFI files..."
|
||||
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/EFI" ::
|
||||
}
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
readarray -t DTB < <(xmlstarlet sel -t -v "//dtb/${DEVICE}/${SUBDEVICE}/file" ${DTBXML})
|
||||
|
||||
mkimage_dtb
|
||||
mkimage_efi
|
||||
@@ -30,7 +30,7 @@
|
||||
KERNEL_TARGET="Image"
|
||||
|
||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||
KERNEL_MAKE_EXTRACMD=" $(xmlstarlet sel -t -m "//dtb/${DEVICE}//file" -o "qcom/" -v "." -o ".dtb " "${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml")"
|
||||
KERNEL_MAKE_EXTRACMD=" $(get_kernel_make_extracmd)"
|
||||
|
||||
# Kernel cmdline
|
||||
EXTRA_CMDLINE="quiet rootwait console=tty0 clk_ignore_unused pd_ignore_unused"
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
DTBXML="${PROJECT_DIR}/${PROJECT}/bootloader/dtb.xml"
|
||||
|
||||
mkdir -p "${INSTALL}/usr/share/bootloader/EFI/BOOT"
|
||||
cat << EOF > "${INSTALL}/usr/share/bootloader/EFI/BOOT/grub.cfg"
|
||||
insmod part_gpt
|
||||
insmod part_msdos
|
||||
load_env
|
||||
|
||||
if [ "\${saved_entry}" ]; then
|
||||
set timeout=2
|
||||
set default="\${saved_entry}"
|
||||
else
|
||||
set timeout=-1
|
||||
fi
|
||||
|
||||
if [ x"\${feature_menuentry_id}" = xy ]; then
|
||||
menuentry_id_option="--id"
|
||||
else
|
||||
menuentry_id_option=""
|
||||
fi
|
||||
export menuentry_id_option
|
||||
|
||||
function savedefault {
|
||||
saved_entry="\${chosen}"
|
||||
save_env saved_entry
|
||||
}
|
||||
|
||||
set timeout_style=menu
|
||||
set lang=en_US
|
||||
loadfont /EFI/BOOT/dejavu-mono.pf2
|
||||
set rotation=270
|
||||
set gfxmode=auto
|
||||
insmod efi_gop
|
||||
insmod gfxterm
|
||||
terminal_output gfxterm
|
||||
set menu_color_normal=cyan/blue
|
||||
set menu_color_highlight=white/blue
|
||||
|
||||
EOF
|
||||
|
||||
xmlstarlet sel -t -m "//${DEVICE}/file" \
|
||||
-v "concat(@short, '|', @full, '|', .)" -n "${DTBXML}" | while IFS='|' read -r SHORT FULL DTB; do
|
||||
|
||||
cat << EOF >> "${INSTALL}/usr/share/bootloader/EFI/BOOT/grub.cfg"
|
||||
menuentry '${FULL}' \$menuentry_id_option '${SHORT}' {
|
||||
savedefault
|
||||
search --set -f /KERNEL
|
||||
linux /KERNEL boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} grub_portable ${EXTRA_CMDLINE}
|
||||
devicetree /${DTB}.dtb
|
||||
}
|
||||
EOF
|
||||
done
|
||||
|
||||
xmlstarlet sel -t -m "//${DEVICE}/file" \
|
||||
-v "concat(@short, '|', @full, '|', .)" -n "${DTBXML}" | while IFS='|' read -r SHORT FULL DTB; do
|
||||
|
||||
cat << EOF >> "${INSTALL}/usr/share/bootloader/EFI/BOOT/grub.cfg"
|
||||
menuentry '${FULL} RECOVERY' \$menuentry_id_option '${SHORT}-recovery' {
|
||||
search --set -f /KERNEL
|
||||
linux /KERNEL boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} grub_portable ${EXTRA_CMDLINE} recovery
|
||||
devicetree /${DTB}.dtb
|
||||
}
|
||||
EOF
|
||||
done
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user