GPT init
This commit is contained in:
parent
0afed12025
commit
76152cd72d
28
clone/clone
28
clone/clone
|
@ -37,12 +37,13 @@ echo "\n>>> [3] Formatting disk";
|
|||
|
||||
# (1) Confirmation #
|
||||
read -p" (!) Erase the whole disk ? it is irreversible! (y/n) [n]" confirm_format;
|
||||
( test -z "$confirm_format" || test $confirm_format != "y" ) \
|
||||
&& (echo "<<< aborting" && exit);
|
||||
test -z "$confirm_format" && echo "<<< aborting" && exit;
|
||||
test $confirm_format != "y" && echo "<<< aborting" && exit;
|
||||
|
||||
# (2) Init gpt entry #
|
||||
echo " ))) replace by real code (((";
|
||||
# echo -e "g\nw" | fdisk $1";
|
||||
# echo " ))) replace by real code (((";
|
||||
|
||||
echo -e "g\nw" | sudo fdisk $1;
|
||||
|
||||
|
||||
|
||||
|
@ -52,8 +53,8 @@ echo "\n>>> [4] Burning image into disk";
|
|||
|
||||
# (1) Confirmation #
|
||||
read -p" (!) Burn the whole disk ? it is irreversible! (y/n) [n]" confirm_burn;
|
||||
( test -z "$confirm_burn" || test $confirm_burn != "y" ) \
|
||||
&& (echo "<<< aborting" && exit);
|
||||
test -z "$confirm_burn" && echo "<<< aborting" && exit;
|
||||
test $confirm_burn != "y" && echo "<<< aborting" && exit;
|
||||
|
||||
# (2) Burning image into disk #
|
||||
sudo dd if=./original.img of=$1 bs=4M \
|
||||
|
@ -68,7 +69,7 @@ exit;
|
|||
# [5] Mount partition
|
||||
#========================================================#
|
||||
|
||||
echo ">>> [5] Mounting partition ${1}2";
|
||||
echo "\n>>> [5] Mounting partition ${1}2";
|
||||
|
||||
# [1] Mount device partition
|
||||
sudo mount ${1}2 /mnt -o uid=$UID,gid=$GID,umask=022;
|
||||
|
@ -76,6 +77,19 @@ sudo mount ${1}2 /mnt -o uid=$UID,gid=$GID,umask=022;
|
|||
echo "<<< done";
|
||||
|
||||
|
||||
# [6] Updating users & groups
|
||||
#========================================================#
|
||||
|
||||
echo "\n>>> [6] Updating users & groups";
|
||||
|
||||
echo " (.) Adding user satsuser";
|
||||
sudo echo "satsuser:{somedigestedpass}:17185:0:999999:7::" >> /mnt/etc/shadow;
|
||||
sudo echo "satsuser:{somedigestedpass}:17185:0:999999:7::" >> /mnt/etc/shadow-;
|
||||
|
||||
echo " (.) Adding group ssh-key";
|
||||
|
||||
|
||||
|
||||
# [4] Manage SSH keys #
|
||||
########################################
|
||||
|
||||
|
|
Loading…
Reference in New Issue