-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpartitions-script.sh
More file actions
executable file
·28 lines (24 loc) · 955 Bytes
/
partitions-script.sh
File metadata and controls
executable file
·28 lines (24 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -e
parted -s "$DISK" \
mklabel gpt \
mkpart primary 32KiB 16MiB \
name 1 loader \
mkpart primary ext4 16MiB 100% \
name 2 root \
set 2 boot on
bmaptool -q copy "$IMG" "$PART"
TMP=`mktemp`
chmod 644 "$TMP"
debugfs -R "cat /boot/extlinux/extlinux.conf" "$PART" | sed "/menu title/s/U-Boot menu/Flipper build $BUILD_ID/" > "$TMP"
debugfs -w -R "rm /boot/extlinux/extlinux.conf" "$PART"
debugfs -w -R "write $TMP /boot/extlinux/extlinux.conf" "$PART"
debugfs -R "cat /etc/default/u-boot" "$PART" | sed "/U_BOOT_MENU_TITLE/s/U-Boot menu/Flipper build $BUILD_ID/" > "$TMP"
debugfs -w -R "rm /etc/default/u-boot" "$PART"
debugfs -w -R "write $TMP /etc/default/u-boot" "$PART"
debugfs -R "cat /usr/lib/os-release" "$PART"> "$TMP"
echo "BUILD_ID=$BUILD_ID" >> "$TMP"
debugfs -w -R "rm /usr/lib/os-release" "$PART"
debugfs -w -R "write $TMP /usr/lib/os-release" "$PART"
rm -f "$TMP"
sync "$DISK"