mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
rocknix: add support for auto-updating rocknix-abl
This commit is contained in:
@@ -48,6 +48,10 @@ if [ -f "$SYSTEM_ROOT/usr/share/bootloader/boot/grub/grubenv" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$BOOT_ROOT/rocknix-abl" ]; then
|
||||
. $SYSTEM_ROOT/usr/bin/updateabl
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT ro
|
||||
sync
|
||||
mount -o remount,ro $BOOT_ROOT
|
||||
|
||||
@@ -48,6 +48,10 @@ if [ -f "$SYSTEM_ROOT/usr/share/bootloader/boot/grub/grubenv" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$BOOT_ROOT/rocknix-abl" ]; then
|
||||
. $SYSTEM_ROOT/usr/bin/updateabl
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT ro
|
||||
sync
|
||||
mount -o remount,ro $BOOT_ROOT
|
||||
|
||||
@@ -48,6 +48,10 @@ if [ -f "$SYSTEM_ROOT/usr/share/bootloader/boot/grub/grubenv" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$BOOT_ROOT/rocknix-abl" ]; then
|
||||
. $SYSTEM_ROOT/usr/bin/updateabl
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT ro
|
||||
sync
|
||||
mount -o remount,ro $BOOT_ROOT
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)
|
||||
#
|
||||
# This script will update the ABL on the internal UFS.
|
||||
# This script will update the ABL on the internal eMMC/UFS.
|
||||
|
||||
set -euo pipefail
|
||||
. $SYSTEM_ROOT/etc/os-release
|
||||
|
||||
case "$HW_DEVICE" in
|
||||
SM6115|SM8250|SM8550|SM8650)
|
||||
@@ -15,24 +15,22 @@ case "$HW_DEVICE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
ELF="/usr/share/bootloader/rocknix_abl/abl_signed.elf"
|
||||
|
||||
ABL_A="/dev/disk/by-partlabel/abl_a"
|
||||
ABL_B="/dev/disk/by-partlabel/abl_b"
|
||||
|
||||
# ---- Sanity checks ----
|
||||
ELF="$SYSTEM_ROOT/usr/share/bootloader/rocknix_abl/abl_signed.elf"
|
||||
if [ ! -f "${ELF}" ]; then
|
||||
echo "Error: ABL update not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ABL_A="$($SYSTEM_ROOT/usr/sbin/blkid -t PARTLABEL=abl_a -o device)"
|
||||
ABL_B="$($SYSTEM_ROOT/usr/sbin/blkid -t PARTLABEL=abl_b -o device)"
|
||||
if [ ! -b "${ABL_A}" ] || [ ! -b "${ABL_B}" ]; then
|
||||
echo "Error: ABL partitions not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ---- Get sector size ----
|
||||
SS="$(blockdev --getss "${ABL_A}")"
|
||||
SS="$($SYSTEM_ROOT/usr/sbin/blockdev --getss "${ABL_A}")"
|
||||
if [ -z "${SS}" ]; then
|
||||
echo "Error: failed to get sector size"
|
||||
exit 1
|
||||
@@ -45,4 +43,4 @@ dd if="${ELF}" of="${ABL_B}" bs="${SS}" conv=fsync,notrunc status=none
|
||||
|
||||
sync
|
||||
|
||||
echo "ABL update completed successfully."
|
||||
echo "ABL update completed successfully..."
|
||||
|
||||
@@ -605,8 +605,8 @@ CONFIG_DEFAULT_DEPMOD_FILE=""
|
||||
# CONFIG_ACPID is not set
|
||||
# CONFIG_FEATURE_ACPID_COMPAT is not set
|
||||
# CONFIG_BLKDISCARD is not set
|
||||
CONFIG_BLKID=y
|
||||
CONFIG_FEATURE_BLKID_TYPE=y
|
||||
# CONFIG_BLKID is not set
|
||||
# CONFIG_FEATURE_BLKID_TYPE is not set
|
||||
CONFIG_BLOCKDEV=y
|
||||
# CONFIG_CAL is not set
|
||||
# CONFIG_CHRT is not set
|
||||
|
||||
@@ -207,6 +207,9 @@ makeinstall_init() {
|
||||
ln -sf busybox ${INSTALL}/usr/bin/bc
|
||||
chmod 4755 ${INSTALL}/usr/bin/busybox
|
||||
|
||||
mkdir -p ${INSTALL}/usr/sbin
|
||||
ln -sf /usr/bin/busybox ${INSTALL}/usr/sbin/blockdev
|
||||
|
||||
mkdir -p ${INSTALL}/etc
|
||||
touch ${INSTALL}/etc/fstab
|
||||
ln -sf /proc/self/mounts ${INSTALL}/etc/mtab
|
||||
|
||||
@@ -78,7 +78,8 @@ PKG_CONFIGURE_OPTS_HOST="--enable-shared \
|
||||
PKG_CONFIGURE_OPTS_INIT="${UTILLINUX_CONFIG_DEFAULT} \
|
||||
--enable-libblkid \
|
||||
--enable-libmount \
|
||||
--enable-fsck"
|
||||
--enable-fsck \
|
||||
--enable-blkid"
|
||||
|
||||
if [ "${INITRAMFS_PARTED_SUPPORT}" = "yes" ]; then
|
||||
PKG_CONFIGURE_OPTS_INIT+=" --enable-mkfs --enable-libuuid --enable-btrfs"
|
||||
|
||||
Reference in New Issue
Block a user