summaryrefslogtreecommitdiff
path: root/nfs/scripts/image_deploy_I5734.sh
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2020-07-04 23:38:38 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2020-07-04 23:38:38 +0200
commitcf81fed0c9277550e6b98927f7ff2f8eb5de7b40 (patch)
treed193ebdaed1853d2868c26c43d2fc0c00ebb42ac /nfs/scripts/image_deploy_I5734.sh
parent8d273fe8d76ef394cfab04a195c90f4b7aeb8495 (diff)
downloadeficast-cf81fed0c9277550e6b98927f7ff2f8eb5de7b40.tar.gz
eficast-cf81fed0c9277550e6b98927f7ff2f8eb5de7b40.tar.bz2
eficast-cf81fed0c9277550e6b98927f7ff2f8eb5de7b40.zip
Add blkdiscard on image. Add nfs scripts newer examples.
Diffstat (limited to 'nfs/scripts/image_deploy_I5734.sh')
-rw-r--r--nfs/scripts/image_deploy_I5734.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/nfs/scripts/image_deploy_I5734.sh b/nfs/scripts/image_deploy_I5734.sh
new file mode 100644
index 0000000..74ba9ca
--- /dev/null
+++ b/nfs/scripts/image_deploy_I5734.sh
@@ -0,0 +1,39 @@
+#!/bin/busybox sh
+# Should only started from image_capture.sh, it defines some helper functions and variables)
+# echo_color() <text-color> <background-color> <message>
+# $outdir is the also the current working dir, garanted to be empty and writable
+# Many cloning/partitioning tools are available for use, see make-boot-image.sh
+
+last=$(cat "$imagedir/I5734/last")
+last=${last:-XXXXXXXX}
+indir="$imagedir/I5734/$last/"
+
+echo_color white blue ">>> Discarding whole ${firstdisk}"
+blkdiscard -v ${firstdisk}
+
+echo_color white blue ">>> Restoring ${firstdisk} boot sectors"
+pigz -dc "$indir/sda-dd.gz" | dd of=${firstdisk} count=2048
+
+echo_color white blue ">>> Detecting new partitions"
+echo -e "r\ne\ny\nw\ny" | gdisk ${firstdisk}
+
+echo_color white blue ">>> Restoring ${firstdiskp}1 NTFS WinRecovery"
+pigz -dc "$indir/sda1-partclone.gz" | partclone.restore -o ${firstdiskp}1
+
+echo_color white blue ">>> Restoring ${firstdiskp}2 FAT32 EFI"
+pigz -dc "$indir/sda2-partclone.gz" | partclone.restore -o ${firstdiskp}2
+
+echo_color white blue ">>> Restoring ${firstdiskp}3 RAW M$ Reserved"
+pigz -dc "$indir/sda3-dd.gz" | dd of=${firstdiskp}3
+
+echo_color white blue ">>> Restoring ${firstdiskp}4 NTFS Win10"
+pigz -dc "$indir/sda4-partclone.gz" | partclone.restore -o ${firstdiskp}4
+
+echo_color white blue ">>> Customizing WINDOWS"
+mkdir -p /mnt/win
+mount.ntfs ${firstdiskp}4 /mnt/win
+hostname > /mnt/win/EMAC/newhostname.txt
+echo "yes" > /mnt/win/EMAC/freshlycloned.txt
+echo $last_win > /mnt/win/EMAC/masterver.txt
+umount /mnt/win
+