From 756b646443616cb1520d4cd7fbf615a8f36dabda Mon Sep 17 00:00:00 2001 From: lindongping Date: Tue, 18 Jun 2024 17:33:13 +0800 Subject: [PATCH 1/2] shell scripts: add copyright Signed-off-by: lindongping --- board/phytium/dd_and_checkMD5.sh | 5 +++++ package/phytium-tools/src/resize.sh | 4 ++++ package/phytium-tools/src/runtime_replace_bootloader.sh | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/board/phytium/dd_and_checkMD5.sh b/board/phytium/dd_and_checkMD5.sh index 060e4012..0b88a830 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 b9a69305..2fdd9617 100755 --- a/package/phytium-tools/src/resize.sh +++ b/package/phytium-tools/src/resize.sh @@ -1,5 +1,9 @@ #!/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")" diff --git a/package/phytium-tools/src/runtime_replace_bootloader.sh b/package/phytium-tools/src/runtime_replace_bootloader.sh index 56002711..029fce66 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() -- Gitee From 54abf876b31bee90722fc2a5a0fc1bd1475827d0 Mon Sep 17 00:00:00 2001 From: lindongping Date: Tue, 18 Jun 2024 17:35:03 +0800 Subject: [PATCH 2/2] resize.sh:support 16GB SD card Signed-off-by: lindongping --- package/phytium-tools/src/resize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/phytium-tools/src/resize.sh b/package/phytium-tools/src/resize.sh index 2fdd9617..6bda2504 100755 --- a/package/phytium-tools/src/resize.sh +++ b/package/phytium-tools/src/resize.sh @@ -9,14 +9,14 @@ ROOT_PART="$(findmnt / -o source -n)" 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 -- Gitee