From 28e3acd8a7f308f9501734e6854384c22c065032 Mon Sep 17 00:00:00 2001
From: Marc Beninca <git@marc.beninca.link>
Date: Mon, 11 Nov 2024 15:40:04 +0100
Subject: [PATCH] device

---
 bash/ovh-rescue.sh | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/bash/ovh-rescue.sh b/bash/ovh-rescue.sh
index 46f81cf..cabce07 100644
--- a/bash/ovh-rescue.sh
+++ b/bash/ovh-rescue.sh
@@ -140,9 +140,13 @@ source \"/etc/bash/main.sh\" ; ovh_rescue_configure \"${hostname}\""
 	fi
 }
 
-ovh_rescue_wipe_1_2TB() {
-	local device="/dev/sda"
+ovh_rescue_wipe_vle2_0_init() {
+	local device="/dev/sdb"
+	local passphrase
 	local unit="mib"
+	# read passphrase
+	printf "PassPhrase: "
+	read -r -s passphrase
 	#
 	lsblk
 	printf "%s" "WIPE ${device} /?\\ OR CANCEL /!\\"
@@ -152,23 +156,19 @@ ovh_rescue_wipe_1_2TB() {
 	#
 	parted "${device}" unit "${unit}" mkpart "crypt" 65795 1907729
 	#
-	parted "${device}" unit "${unit}" mkpart "boot" 259 65795
+	parted "${device}" unit "${unit}" mkpart "boot" 514 65795
 	#
-	parted "${device}" unit "${unit}" mkpart "esp" 2 259
+	parted "${device}" unit "${unit}" mkpart "esp" 2 514
 	parted "${device}" set 3 esp on
 	#
 	parted "${device}" unit "${unit}" mkpart bios 1 2
 	parted "${device}" set 4 bios_grub on
 	# wipe bios
-	dd if="/dev/zero" of="/dev/sda4"
+	dd if="/dev/zero" of="${device}4"
 	# format esp
-	mkfs.vfat -F 32 -n "esp" "/dev/sda3"
+	mkfs.vfat -F 32 -n "esp" "${device}3"
 	# format boot
-	mkfs.ext4 -F -L "boot" "/dev/sda2"
-	# read passphrase
-	local passphrase
-	printf "PassPhrase: "
-	read -r -s passphrase
+	mkfs.ext4 -F -L "boot" "${device}2"
 	# encrypt
 	echo "${passphrase}" |
 		cryptsetup \
@@ -182,10 +182,10 @@ ovh_rescue_wipe_1_2TB() {
 			--hash "sha512" \
 			--use-random \
 			luksFormat \
-			"/dev/sda1"
+			"${device}1"
 	# open
 	echo "${passphrase}" |
-		cryptsetup luksOpen "/dev/sda1" "crypt"
+		cryptsetup luksOpen "${device}1" "crypt"
 	# pv
 	pvcreate "/dev/mapper/crypt"
 	# vg