Skip to content

Commit

Permalink
RK3326: gzip unified u-boot image
Browse files Browse the repository at this point in the history
  • Loading branch information
spycat88 committed Aug 28, 2024
1 parent a779039 commit db3a836
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions projects/Rockchip/bootloader/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ for BOOT_IMAGE in ${SUBDEVICE}_u-boot.itb u-boot.itb u-boot.img; do
fi
done

if [ -f $SYSTEM_ROOT/usr/share/bootloader/rk3326-uboot.bin ]; then
echo "Updating rk3326-uboot.bin on $BOOT_DISK..."
dd if=$SYSTEM_ROOT/usr/share/bootloader/rk3326-uboot.bin of=$BOOT_DISK bs=512 seek=64 conv=fsync &>/dev/null
if [ -f $SYSTEM_ROOT/usr/share/bootloader/rk3326-uboot.bin.gz ]; then
echo "Updating rk3326-uboot.bin.gz on $BOOT_DISK..."
gunzip -c $SYSTEM_ROOT/usr/share/bootloader/rk3326-uboot.bin.gz | dd of=$BOOT_DISK bs=512 seek=64 conv=fsync &>/dev/null
fi

if [ -f $SYSTEM_ROOT/usr/share/bootloader/rk3399-uboot.bin ]; then
Expand Down
6 changes: 3 additions & 3 deletions projects/Rockchip/devices/RK3326/bootloader/mkimage
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Copyright (C) 2024-present ROCKNIX (https://github.com/ROCKNIX)

mkimage_uboot() {
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/rk3326-uboot.bin" ]; then
echo "image: writing rk3326-uboot.bin to $(basename ${DISK})..."
dd if="${RELEASE_DIR}/3rdparty/bootloader/rk3326-uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/rk3326-uboot.bin.gz" ]; then
echo "image: writing rk3326-uboot.bin.gz to $(basename ${DISK})..."
gunzip -c "${RELEASE_DIR}/3rdparty/bootloader/rk3326-uboot.bin.gz" | dd of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
fi
}

Expand Down
3 changes: 2 additions & 1 deletion projects/Rockchip/devices/RK3326/packages/u-boot/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ EOF
dd if=${PKG_BUILD}/idbloader.img of=${PKG_BUILD}/rk3326-uboot.bin bs=512 seek=0 conv=fsync,notrunc
dd if=${PKG_BUILD}/u-boot.img of=${PKG_BUILD}/rk3326-uboot.bin bs=512 seek=16320 conv=fsync,notrunc
dd if=${PKG_BUILD}/trust.img of=${PKG_BUILD}/rk3326-uboot.bin bs=512 seek=24512 conv=fsync,notrunc
gzip ${PKG_BUILD}/rk3326-uboot.bin
}

makeinstall_target() {
Expand All @@ -72,7 +73,7 @@ makeinstall_target() {
-i "${INSTALL}/usr/share/bootloader/boot.ini"
fi

PKG_UBOOTIMG=${PKG_BUILD}/rk3326-uboot.bin
PKG_UBOOTIMG=${PKG_BUILD}/rk3326-uboot.bin.gz

if [ ${PKG_UBOOTIMG} ]; then
cp -av ${PKG_UBOOTIMG} $INSTALL/usr/share/bootloader
Expand Down

0 comments on commit db3a836

Please sign in to comment.