Index: radix-setup/scripts/setup
===================================================================
--- radix-setup/scripts/setup (revision 224)
+++ radix-setup/scripts/setup (revision 225)
@@ -279,6 +279,7 @@
uefi_bytes=
if [ "${hardware}" = "baikal-m1" -o \
+ "${hardware}" = "orange-pi5" -o \
"${hardware}" = "visionfive2" -o \
"${hardware}" = "intel-pc64" ] ; then
partition_table_type=g
@@ -549,7 +550,7 @@
exit
fi
- let 'root_bytes = ( root_end_sector - root_start_sector + 1 ) * log_sector_size'
+ root_bytes=`echo "(${root_end_sector} - ${root_start_sector} + 1) * ${log_sector_size}" | bc`
if [ "${root_part_number}" -eq "1" ] ; then
if [ "${partition_table_type}" = "g" ] ; then
@@ -1150,9 +1151,9 @@
for dev in `lsblk -ldn -o name` ; do
#
- # Skip 'mtd.*', 'mmcblk[0-9]*boot.*':
+ # Skip 'ram.*', 'zram.*', 'mtd.*', 'mmcblk[0-9]*boot.*':
#
- if `echo ${dev} | grep -q 'mtd.*\|mmcblk[0-9]*boot.*'` ; then
+ if `echo ${dev} | grep -q 'ram.*\|zram.*\|mtd.*\|mmcblk[0-9]*boot.*'` ; then
continue
fi
#
@@ -2217,7 +2218,8 @@
EOF
- if [ "${hardware}" = "baikal-m1" -o \
+ if [ "${hardware}" = "baikal-m1" -o \
+ "${hardware}" = "orange-pi5" -o \
"${hardware}" = "visionfive2" ] ; then
cat >> ${grub_cfg} << EOF
font '/boot/grub/fonts/dejavusansmono.pf2'
@@ -2262,6 +2264,13 @@
EOF
fi
+ if [ "${hardware}" = "orange-pi5" ] ; then
+ cat >> ${grub_cfg} << EOF
+ devicetree (\$root)/boot/rockchip/rk3588s-orangepi-5.dtb
+ linux (\$root)/boot/Image root=PARTUUID=\$part_uuid ro rootwait console=ttyS2,1500000n8 console=tty1
+EOF
+ fi
+
if [ "${hardware}" = "visionfive2" ] ; then
cat >> ${grub_cfg} << EOF
devicetree (\$root)/boot/starfive/jh7110-visionfive-v2.dtb
@@ -2333,6 +2342,7 @@
cat ${fstab} > ${ROOT_MPOINT}/etc/fstab
if [ "${hardware}" = "baikal-m1" -o \
+ "${hardware}" = "orange-pi5" -o \
"${hardware}" = "visionfive2" -o \
"${hardware}" = "ebox-3350dx2" -o \
"${hardware}" = "intel-pc32" -o \
@@ -2457,6 +2467,62 @@
${grub_modules} 2>/dev/null 1>/dev/null
}
+install_orange_pi5_grub()
+{
+ UEFI=`get_uefi_devname`
+ UEFI_MPOINT=$MNT/UEFI
+
+ if [ "x${UEFI}" = "x" ] ; then
+ fatal_error_dialog "Cannot mount EFI partition. Exit ${program}."
+ push_log "ERROR: Cannot mount EFI partition"
+ push_log "Aborted due to an error"
+ push_err "ERROR: Cannot mount EFI partition"
+ EXITSTATUS=22
+ exit
+ fi
+
+ if `mount | grep -q ${UEFI}` ; then
+ umount ${UEFI}
+ fi
+ mkdir -p ${UEFI_MPOINT}
+ if [ "x`mount | grep ${UEFI_MPOINT}`" != "x" ] ; then
+ umount ${UEFI_MPOINT}
+ fi
+ mount ${UEFI} ${UEFI_MPOINT}
+
+ local grub_modules="all_video archelp bfs bitmap bitmap_scale blocklist boot btrfs"
+ grub_modules="${grub_modules} cat chain configfile cpio date datehook datetime disk diskfilter"
+ grub_modules="${grub_modules} echo efi_gop efifwsetup efinet elf eval exfat ext2 extcmd f2fs fat"
+ grub_modules="${grub_modules} fdt file font fshelp gettext gfxmenu gfxterm gfxterm_background"
+ grub_modules="${grub_modules} gfxterm_menu gptsync gzio halt hashsum help hexdump iso9660 jpeg"
+ grub_modules="${grub_modules} json keystatus linux loadenv loopback ls lsefi lzopio mdraid1x"
+ grub_modules="${grub_modules} memdisk minicmd msdospart net newc normal part_gpt part_msdos"
+ grub_modules="${grub_modules} png probe procfs read reboot regexp reiserfs search search_fs_file"
+ grub_modules="${grub_modules} search_fs_uuid search_label serial squash4 tar terminal terminfo"
+ grub_modules="${grub_modules} test tftp time tr trig true udf ufs1 ufs2 video video_colors"
+ grub_modules="${grub_modules} video_fb videoinfo xzio zstd"
+
+ /usr/sbin/grub-install --skip-fs-probe \
+ --fonts=dejavusansmono \
+ --boot-directory=${ROOT_MPOINT}/boot \
+ --directory=/usr/lib/grub/arm64-efi \
+ --target=arm64-efi --no-efi \
+ --no-bootsector --no-nvram 2>/dev/null 1>/dev/null
+
+ mkdir -p ${ROOT_MPOINT}/boot/efi
+ mkdir -p ${ROOT_MPOINT}/boot/grub/arm64-efi
+ cat ${grub_load_cfg} > ${ROOT_MPOINT}/boot/grub/arm64-efi/load.cfg
+
+ mkdir -p ${UEFI_MPOINT}/efi/boot
+ /usr/bin/grub-mkimage --format=arm64-efi \
+ --directory=/usr/lib/grub/arm64-efi \
+ --compression=xz \
+ --prefix=/efi/boot \
+ --config="${grub_load_cfg}" \
+ --output=${UEFI_MPOINT}/efi/boot/bootaa64.efi \
+ ${grub_modules} 2>/dev/null 1>/dev/null
+}
+
install_starfive_vf2_grub()
{
UEFI=`get_uefi_devname`
@@ -2738,6 +2804,7 @@
# ----------
#
if [ "${hardware}" = "baikal-m1" -o \
+ "${hardware}" = "orange-pi5" -o \
"${hardware}" = "visionfive2" -o \
"${hardware}" = "intel-pc64" ] ; then
prepare_partuuid_etc_fstab
@@ -2751,6 +2818,7 @@
# -------------------
#
if [ "${hardware}" = "baikal-m1" -o \
+ "${hardware}" = "orange-pi5" -o \
"${hardware}" = "visionfive2" -o \
"${hardware}" = "ebox-3350dx2" -o \
"${hardware}" = "intel-pc32" -o \
@@ -2772,6 +2840,9 @@
if [ "${hardware}" = "baikal-m1" ] ; then
install_baikal_m1_grub
fi
+if [ "${hardware}" = "orange-pi5" ] ; then
+ install_orange_pi5_grub
+fi
if [ "${hardware}" = "visionfive2" ] ; then
install_starfive_vf2_grub
fi
@@ -2786,8 +2857,8 @@
fi
#
-# Install GRUB:
-# ------------
+# Install U-Boot:
+# --------------
#
if [ "${hardware}" = "leez-p710" ] ; then
install_leez_p710_uboot "${device}"