Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions raspberry/arch_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,17 @@ partitioning()
print_color "Create MS-DOS MBR..." "blue"
sudo parted -s ${DEVICE} mklabel msdos > /dev/null 2>&1
print_color "Partitioning..." "blue"
sudo parted -s ${DEVICE} mkpart primary fat32 1MiB 513MiB > /dev/null 2>&1
Copy link
Author

@I-Iege I-Iege Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you use tabs?


sudo parted -s ${DEVICE} mkpart primary fat32 1MiB 513MiB > /dev/null 2>&1
sudo parted -s ${DEVICE} mkpart primary ext4 513MiB 100% > /dev/null 2>&1
}

format_partitions()
{
p=$(( ${#DEVICE} -gt 3 ? "p" : "" ))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is bash syntax the shell syntax would be:
p=$([ ${#DEVICE} -gt 3 ] && "p" || "")

print_color "Formatting Partitions..." "blue"
sudo mkfs.vfat -F32 ${DEVICE}1 > /dev/null 2>&1
sudo mkfs.ext4 -F ${DEVICE}2 > /dev/null 2>&1
sudo mkfs.vfat -F32 ${DEVICE}${p}1 > /dev/null 2>&1
sudo mkfs.ext4 -F ${DEVICE}${p}2 > /dev/null 2>&1
}

mount_partitions()
Expand All @@ -155,8 +157,9 @@ mount_partitions()
sudo mkdir -p "$path"
done
print_color "Mounting Partitions..." "blue"
sudo mount -t vfat ${DEVICE}1 $boot
sudo mount ${DEVICE}2 $root
p=$(( ${#DEVICE} -gt 3 ? "p" : "" ))
sudo mount -t vfat ${DEVICE}${p}1 $boot
sudo mount ${DEVICE}${p}2 $root
}

prep_device()
Expand Down