Merge pull request #41 from spycat88/rk-fixies

mkimage: fix reading /flash on Windows on RK devices
This commit is contained in:
spycat88 2024-04-03 11:52:28 +01:00 committed by GitHub
commit d264dab8ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 24 deletions

View file

@ -11,6 +11,8 @@ PKG_DEPENDS_TARGET="toolchain Python3 swig:host rkbin glibc pyelftools:host"
PKG_LONGDESC="Rockchip U-Boot is a bootloader for embedded systems."
PKG_PATCH_DIRS+="${DEVICE}"
PKG_NEED_UNPACK="$PROJECT_DIR/$PROJECT/bootloader"
case ${DEVICE} in
RK3588*)
PKG_VERSION="ad0cfba1ac51e8dd8b039f6c56b9c9f9a679df91"

View file

@ -68,41 +68,22 @@ sync
# create partitions
echo "image: creating partitions..."
if [ "${PARTITION_TABLE}" = "gpt" ] && [ "${BOOTLOADER}" = "u-boot" ]
then
echo "image: creating SPL partition(s)."
parted -s "${DISK}" unit s mkpart ${UBOOT_LABEL} 16384 24575 >/dev/null 2>&1
parted -s "${DISK}" unit s mkpart ${TRUST_LABEL} 24576 32767 >/dev/null 2>&1
fi
SYSTEM_PART_END=$(( ${SYSTEM_PART_START} + (${SYSTEM_SIZE} * 1024 * 1024 / 512) - 1 ))
STORAGE_PART_START=$(( ${SYSTEM_PART_END} + 1 ))
STORAGE_PART_END=$(( ${STORAGE_PART_START} + (${STORAGE_SIZE} * 1024 * 1024 / 512) - 1 ))
if [ "${PARTITION_TABLE}" = "gpt" ]; then
echo "image: Create GPT boot partition."
parted -s "${DISK}" -a min unit s mkpart boot fat32 ${SYSTEM_PART_START} ${SYSTEM_PART_END}
parted -s "${DISK}" -a min unit s mkpart system fat32 ${SYSTEM_PART_START} ${SYSTEM_PART_END}
parted -s "${DISK}" -a min unit s mkpart storage ext4 ${STORAGE_PART_START} ${STORAGE_PART_END}
parted -s "${DISK}" set 1 legacy_boot on
else
echo "image: Create MBR boot partition."
parted -s "${DISK}" -a min unit s mkpart primary fat32 ${SYSTEM_PART_START} ${SYSTEM_PART_END}
parted -s "${DISK}" -a min unit s mkpart primary fat32 ${SYSTEM_PART_START} ${SYSTEM_PART_END}
parted -s "${DISK}" -a min unit s mkpart primary ext4 ${STORAGE_PART_START} ${STORAGE_PART_END}
parted -s "${DISK}" set 1 boot on
fi
if [ "${PARTITION_TABLE}" = "gpt" ]; then
echo "image: Create GPT storage partition."
parted -s "${DISK}" -a min unit s mkpart storage ext4 ${STORAGE_PART_START} ${STORAGE_PART_END}
else
echo "image: Create MBR Storage partition."
parted -s "${DISK}" -a min unit s mkpart primary ext4 ${STORAGE_PART_START} ${STORAGE_PART_END}
fi
sync
if [ "${PARTITION_TABLE}" = "gpt" ] && [ "${BOOTLOADER}" = "u-boot" ]; then
echo "image: Set OS partition as boot"
parted -s "${DISK}" set 3 boot on
fi
sync
echo "image: creating sparse file for part2..."
STORAGE_PART_COUNT=$(( ${STORAGE_PART_END} - ${STORAGE_PART_START} + 1 ))
sync