Remove USB support

This commit is contained in:
2026-04-27 15:26:47 -05:00
parent 4af9cb4a30
commit 4e3f5a158e
+12 -28
View File
@@ -7,6 +7,7 @@ YELLOW='\e[33m'
RESET='\e[0m'
MOUNT_POINTS=("/dev" "/dev/pts" "/proc" "/sys" "/sys/firmware/efi/efivars" "/run")
IMG_FILE="PBX.img3.lz4"
NO_WRITE=false
NO_RETABLE=false
NO_USB=false
@@ -93,38 +94,21 @@ update-grub
echo -e "${GREEN}Restore and resize complete!${RESET}"
}
write_image() {
if [[ $NO_USB == true ]]; then
echo "Writing image to $(get_partition $disk_name "3")..."
lz4 -dc ./Image/PBX.img3.lz4 | dd of=$(get_partition $disk_name "3") status=progress
partprobe || true
write_img() {
img_file_dir="null"
if [[ -f "./${IMG_FILE}" ]]; then
img_file_dir="./${IMG_FILE}"
elif [[ ! -f "./Image/${IMG_FILE}" ]]; then
img_file_dir="./Image/${IMG_FILE}"
else
read -rp "Enter the name of the usb partition in /dev/mapper (e.g., sda1): " disk_suffix
usb_name="/dev/mapper/${disk_suffix}"
user_response="n"
read -rp "$(echo -e "${RED}You are about to WRITE and ERASE disk ${disk_name} | Are you sure? y/N: ${RESET}")" user_response
if [[ $user_response != y ]]; then
echo "Exiting script"
exit
fi
echo "Mounting Ventoy..."
mkdir -p /mnt/ventoy
mount $usb_name /mnt/ventoy
cd /mnt/ventoy/Images
echo "Writing image to $(get_partition $disk_name "3")..."
lz4 -dc PBX.img.lz4 | dd of=$(get_partition $disk_name "3") status=progress
partprobe || true
img_file_dir="null"
fi
echo "Writing image to $(get_partition $disk_name "3")..."
lz4 -dc ${img_file_dir} | dd of=$(get_partition $disk_name "3") status=progress
partprobe || true
}
rewrite_gpt_table() {