diff --git a/board/phytium/dd_and_checkMD5.sh b/board/phytium/dd_and_checkMD5.sh index 060e40124e6171a629a69bf3d2670bacd0f8cd5e..0b88a830a2445e3ffaee4fb35d80b756b8650c5e 100755 --- a/board/phytium/dd_and_checkMD5.sh +++ b/board/phytium/dd_and_checkMD5.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Phytium phytiumpi burning script +# +# Copyright (c) 2023-2024 Phytium Technology Co., Ltd. + # dd_and_checkMD5.sh - To dd sdcard.img into the disk and verify the MD5 valuses that # ensure sdcard.img is correctly written into the disk. # dd_and_checkMD5.sh is suitable for the phytiumpi file system compiled from Phytium-Pi-OS. diff --git a/package/phytium-tools/src/resize.sh b/package/phytium-tools/src/resize.sh index b9a69305d4ad0fa2a565040cfcb5f9e405f2e342..6bda25043db2b3f975f09bbd646a8b7a1efc1e41 100755 --- a/package/phytium-tools/src/resize.sh +++ b/package/phytium-tools/src/resize.sh @@ -1,18 +1,22 @@ #!/bin/sh +# Phytium phytiumpi resize script +# +# Copyright (c) 2023-2024 Phytium Technology Co., Ltd. + ROOT_PART="$(findmnt / -o source -n)" ROOT_DEV="/dev/$(lsblk -no pkname "$ROOT_PART")" PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")" - LAST_PART_NUM=$(parted "$ROOT_DEV" -ms unit s p | tail -n 1 | cut -f 1 -d:) + LAST_PART_NUM=$(fdisk -l "$ROOT_DEV" | tail -n 1 | cut -f 1 -d' ' | cut -d 'p' -f 2) if [ "$LAST_PART_NUM" -ne "$PART_NUM" ]; then whiptail --msgbox "$ROOT_PART is not the last partition. Don't know how to expand" 20 60 2 return 0 fi # Get the starting offset of the root partition - PART_START=$(parted "$ROOT_DEV" -ms unit s p | grep "^${PART_NUM}" | cut -f 2 -d: | sed 's/[^0-9]//g') + PART_START=$(fdisk -l "$ROOT_DEV" | tail -n 1 | cut -f 7 -d' ') [ "$PART_START" ] || return 1 # Return value will likely be error for fdisk as it fails to reload the # partition table because the root fs is mounted diff --git a/package/phytium-tools/src/runtime_replace_bootloader.sh b/package/phytium-tools/src/runtime_replace_bootloader.sh index 56002711cfa728beb20c19dc90ee2022bbb2b1df..029fce666cf82640701c914a9181161a75487741 100755 --- a/package/phytium-tools/src/runtime_replace_bootloader.sh +++ b/package/phytium-tools/src/runtime_replace_bootloader.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Phytium phytiumpi replace bootloader at runtime script +# +# Copyright (c) 2023-2024 Phytium Technology Co., Ltd. + # runtime_replace_bootloader.sh - Providing the method for performing runtime replacement of the bootloader for phytiumpi. usage()