summaryrefslogtreecommitdiff
path: root/nfs/scripts/image_deploy_I5456.sh
blob: d0c8916198aa21e816016e0a1650ec0e40e8abc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/busybox sh
# Should only started from image_capture.sh, it defines some helper functions and variables)
# echo_color() <text-color> <background-color> [prefix text] <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

echo_color white blue ">>> Restoring /dev/sda boot sectors"
pigz -dc "$indir/sda-dd.gz" | dd of=/dev/sda count=2048

echo_color white blue ">>> Detecting new partitions"
echo -e "w\nq\n" | fdisk /dev/sda

echo_color white blue ">>> Restoring /dev/sda1 NTFS BOOT"
pigz -dc "$indir/sda1-partclone.gz" | partclone.restore -o /dev/sda1

echo_color white blue ">>> Restoring /dev/sda2 NTFS WINDOWS"
pigz -dc "$indir/sda2-partclone.gz" | partclone.restore -o /dev/sda2

echo_color white blue ">>> Restoring /dev/sda3 EXT4 LINUX"
pigz -dc "$indir/sda3-partclone.gz" | partclone.restore -o /dev/sda3