This commit is contained in:
Marc Beninca 2024-11-12 20:03:47 +01:00
parent 5cf0d4021e
commit dfe3be4f1c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 21 additions and 12 deletions

19
bash/fs.sh Normal file
View file

@ -0,0 +1,19 @@
fs_make_fat() {
local device="${1}"
local name="${2}"
local volid="${3}"
if [ -b "${device}" ]; then
set -- \
-F 32 \
-S 4096
if [ -n "${name}" ]; then
set -- "${@}" \
-n "${name}"
fi
if [ -n "${volid}" ]; then
set -- "${@}" \
-i "${volid}"
fi
mkfs.fat "${@}" "${device}"
fi
}

View file

@ -49,12 +49,7 @@ rescue_wipe_0_init_hetzner_8_8() {
# format esp # format esp
dd \ dd \
if="/dev/zero" of="${device}3" bs="1M" if="/dev/zero" of="${device}3" bs="1M"
mkfs.vfat \ fs_make_fat "${device}3" "esp-${number}" "0000000${number}"
-F 32 \
-S 4096 \
-i "0000000${number}" \
-n "esp-${number}" \
"${device}3"
# mount esp # mount esp
mkdir --parents "/media/esp/${number}" mkdir --parents "/media/esp/${number}"
mount "${device}3" "/media/esp/${number}" mount "${device}3" "/media/esp/${number}"

View file

@ -22,12 +22,7 @@ rescue_wipe_0_init_ovh_vle2() {
# esp / wipe # esp / wipe
dd if="/dev/zero" of="${device}3" bs="1M" dd if="/dev/zero" of="${device}3" bs="1M"
# esp / format # esp / format
mkfs.vfat \ fs_make_fat "${device}3" "esp" "00000001"
-F 32 \
-S 4096 \
-i "00000001" \
-n "esp" \
"${device}3"
# esp / mount # esp / mount
mkdir --parents "/media/esp" mkdir --parents "/media/esp"
mount "${device}3" "/media/esp" mount "${device}3" "/media/esp"