]> git.parisson.com Git - clone-me.git/commitdiff
re-order dirs, rename master
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 28 May 2025 09:45:39 +0000 (11:45 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 28 May 2025 09:46:01 +0000 (11:46 +0200)
51 files changed:
chroot-off.sh [deleted file]
chroot-on.sh [deleted file]
fix_fstab.sh [deleted file]
rsync_remote_nuc.sh [deleted file]
scripts/chroot-off.sh [new file with mode: 0755]
scripts/chroot-on.sh [new file with mode: 0755]
scripts/clone_no_kernel.sh [new file with mode: 0644]
scripts/fix_fstab.sh [new file with mode: 0755]
scripts/rsync_remote_nuc.sh [new file with mode: 0755]
scripts/tc_backup.sh [new file with mode: 0755]
scripts/tc_backup_local.sh [new file with mode: 0755]
scripts/tc_clone.sh [new file with mode: 0755]
scripts/tc_clone_nuc.sh [new file with mode: 0755]
scripts/tc_clone_nuc_local.sh [new file with mode: 0755]
scripts/tc_clone_nuc_no_fat.sh [new file with mode: 0755]
scripts/tc_clone_nuc_no_fs.sh [new file with mode: 0755]
scripts/tc_clone_nuc_nvme.sh [new file with mode: 0755]
scripts/tc_clone_nuc_nvme_efi.sh [new file with mode: 0755]
scripts/tc_clone_nuc_nvme_efi_back.sh [new file with mode: 0755]
scripts/tc_clone_nuc_sda.sh [new file with mode: 0755]
scripts/tc_clone_nuc_sda_efi.sh [new file with mode: 0755]
scripts/tc_clone_nuc_sda_efi_dos.sh [new file with mode: 0755]
scripts/tc_clone_pxe.sh [new file with mode: 0755]
scripts/tc_clone_pxe_local.sh [new file with mode: 0755]
scripts/tc_clone_pxe_s10.sh [new file with mode: 0755]
scripts/tc_clone_update_pxe.sh [new file with mode: 0755]
scripts/tc_clone_update_pxe_s10.sh [new file with mode: 0755]
scripts/tc_clone_xps.sh [new file with mode: 0755]
scripts/tc_mount_master.sh [new file with mode: 0755]
scripts/tc_umount_master.sh [new file with mode: 0755]
tc_backup.sh [deleted file]
tc_backup_local.sh [deleted file]
tc_clone.sh [deleted file]
tc_clone_nuc.sh [deleted file]
tc_clone_nuc_local.sh [deleted file]
tc_clone_nuc_no_fat.sh [deleted file]
tc_clone_nuc_no_fs.sh [deleted file]
tc_clone_nuc_nv.sh [deleted file]
tc_clone_nuc_nv_efi.sh [deleted file]
tc_clone_nuc_nv_efi_back.sh [deleted file]
tc_clone_nuc_sda.sh [deleted file]
tc_clone_nuc_sda_efi.sh [deleted file]
tc_clone_nuc_sda_efi_dos.sh [deleted file]
tc_clone_pxe.sh [deleted file]
tc_clone_pxe_local.sh [deleted file]
tc_clone_pxe_s10.sh [deleted file]
tc_clone_update_pxe.sh [deleted file]
tc_clone_update_pxe_s10.sh [deleted file]
tc_clone_xps.sh [deleted file]
tc_mount_master.sh [deleted file]
tc_umount_master.sh [deleted file]

diff --git a/chroot-off.sh b/chroot-off.sh
deleted file mode 100755 (executable)
index 4733ad8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-dir=/mnt/custom
-
-umount $dir/sys
-umount $dir/proc
-umount $dir/dev/pts
-umount $dir/dev
-umount $dir/var
-umount $dir/home
-umount $dir
-
diff --git a/chroot-on.sh b/chroot-on.sh
deleted file mode 100755 (executable)
index 060e808..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-dir=/mnt/custom
-
-ROOT=/dev/sdg2
-VAR=/dev/sdg3
-HOME=/dev/sdg6
-
-mount $ROOT $dir
-mount --bind /sys $dir/sys
-mount --bind /proc $dir/proc
-mount --bind /dev $dir/dev
-mount --bind /dev/pts $dir/dev/pts
-#mount --bind /run $dir/run
-mount $VAR $dir/var
-mount $HOME $dir/home
-
-chroot $dir
diff --git a/fix_fstab.sh b/fix_fstab.sh
deleted file mode 100755 (executable)
index ea337d6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MASTER=192.168.0.64
-MASTERPATH=/mnt/custom
-NAME=$1
-CLONE=/mnt/$NAME
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-echo "Please enter the type of all system partitions (i.e. xfs, ext4 or other):"
-FS_TYPE="ext4"
-
-echo "Please enter the ROOT partition name (i.e. sda1 or other):"
-ROOT_PART="sda1"
-
-echo "Please enter the HOME partition name (i.e. sda2 or other):"
-HOME_PART="sda2"
-
-echo "Please enter the VAR partition name (i.e. sda5 or other, or the same as the ROOT one if included):"
-VAR_PART="sda5"
-
-echo "Please enter the SWAP partition name (i.e. sda6 or other):"
-SWAP_PART="sda7"
-
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" >> $CLONE/etc/fstab
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
- echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-
-echo "Hello world, I'm an NEW TC clone ! :)"
-
diff --git a/rsync_remote_nuc.sh b/rsync_remote_nuc.sh
deleted file mode 100755 (executable)
index e1055f5..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-mount /dev/sdg2 /mnt/custom
-mount /dev/sdg3 /mnt/custom/var
-mount /dev/sdg6 /mnt/custom/home
-
-sudo rsync -a --one-file-system -e 'ssh -p 22022' root@localhost:/ /mnt/custom/ 
-sudo rsync -a --one-file-system -e 'ssh -p 22022' root@localhost:/var/ /mnt/custom/var/
-sudo rsync -a --one-file-system --exclude=archives --exclude=trash  -e 'ssh -p 22022' root@localhost:/home/ /mnt/custom/home/
-
diff --git a/scripts/chroot-off.sh b/scripts/chroot-off.sh
new file mode 100755 (executable)
index 0000000..4733ad8
--- /dev/null
@@ -0,0 +1,11 @@
+
+dir=/mnt/custom
+
+umount $dir/sys
+umount $dir/proc
+umount $dir/dev/pts
+umount $dir/dev
+umount $dir/var
+umount $dir/home
+umount $dir
+
diff --git a/scripts/chroot-on.sh b/scripts/chroot-on.sh
new file mode 100755 (executable)
index 0000000..060e808
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+dir=/mnt/custom
+
+ROOT=/dev/sdg2
+VAR=/dev/sdg3
+HOME=/dev/sdg6
+
+mount $ROOT $dir
+mount --bind /sys $dir/sys
+mount --bind /proc $dir/proc
+mount --bind /dev $dir/dev
+mount --bind /dev/pts $dir/dev/pts
+#mount --bind /run $dir/run
+mount $VAR $dir/var
+mount $HOME $dir/home
+
+chroot $dir
diff --git a/scripts/clone_no_kernel.sh b/scripts/clone_no_kernel.sh
new file mode 100644 (file)
index 0000000..2db2a23
--- /dev/null
@@ -0,0 +1,2 @@
+
+rsync -a --one-file-system --exclude=/boot --exclude=/et/fstab --exclude=/etc/cryptsetup-initramfs/ --exclude=/etc/crypttab --exclude=/etc/initramfs-tools $1/ $2/
diff --git a/scripts/fix_fstab.sh b/scripts/fix_fstab.sh
new file mode 100755 (executable)
index 0000000..ea337d6
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.64
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+echo "Please enter the type of all system partitions (i.e. xfs, ext4 or other):"
+FS_TYPE="ext4"
+
+echo "Please enter the ROOT partition name (i.e. sda1 or other):"
+ROOT_PART="sda1"
+
+echo "Please enter the HOME partition name (i.e. sda2 or other):"
+HOME_PART="sda2"
+
+echo "Please enter the VAR partition name (i.e. sda5 or other, or the same as the ROOT one if included):"
+VAR_PART="sda5"
+
+echo "Please enter the SWAP partition name (i.e. sda6 or other):"
+SWAP_PART="sda7"
+
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" >> $CLONE/etc/fstab
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+ echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+
+echo "Hello world, I'm an NEW TC clone ! :)"
+
diff --git a/scripts/rsync_remote_nuc.sh b/scripts/rsync_remote_nuc.sh
new file mode 100755 (executable)
index 0000000..e1055f5
--- /dev/null
@@ -0,0 +1,9 @@
+
+mount /dev/sdg2 /mnt/custom
+mount /dev/sdg3 /mnt/custom/var
+mount /dev/sdg6 /mnt/custom/home
+
+sudo rsync -a --one-file-system -e 'ssh -p 22022' root@localhost:/ /mnt/custom/ 
+sudo rsync -a --one-file-system -e 'ssh -p 22022' root@localhost:/var/ /mnt/custom/var/
+sudo rsync -a --one-file-system --exclude=archives --exclude=trash  -e 'ssh -p 22022' root@localhost:/home/ /mnt/custom/home/
+
diff --git a/scripts/tc_backup.sh b/scripts/tc_backup.sh
new file mode 100755 (executable)
index 0000000..9188f96
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -e
+
+echo "Please enter the MASTER_HOST address:"
+read MASTER_HOST
+
+echo "Please enter the MASTER_PATH:"
+read MASTER_PATH
+
+echo "Please enter the BACKUP_PATH:"
+read BACKUP_PATH
+
+CLONE=$BACKUP_PATH
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+echo "rsyncing root..."
+rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
+
+echo "$MASTER_HOST has been backup to $BACKUP_PATH ! :)"
diff --git a/scripts/tc_backup_local.sh b/scripts/tc_backup_local.sh
new file mode 100755 (executable)
index 0000000..89d53f5
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -e
+
+echo "Please enter the MASTER_PATH:"
+read MASTER_PATH
+
+echo "Please enter the BACKUP_PATH:"
+read BACKUP_PATH
+
+CLONE=$BACKUP_PATH
+
+if [ ! -d $CLONE ]; then
+ sudo mkdir $CLONE
+fi
+
+# CLONING
+echo "rsyncing root..."
+sudo rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_PATH/ $CLONE/
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ sudo mkdir $DEST
+fi
+sudo rsync -a --one-file-system --delete $MASTER_PATH/var/ $CLONE/var/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ sudo mkdir $DEST
+fi
+sudo rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_PATH/home/ $CLONE/home/
+
+echo "$MASTER_PATH has been backup to $BACKUP_PATH ! :)"
diff --git a/scripts/tc_clone.sh b/scripts/tc_clone.sh
new file mode 100755 (executable)
index 0000000..9b99a2a
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.64
+MASTERPATH=/mnt/custom
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+echo "Please enter the target system name:"
+read NAME
+
+echo "Please enter the type of all system partitions (i.e. xfs, ext4 or other):"
+read FS_TYPE
+
+echo "Please enter the ROOT partition name (i.e. sda1 or other):"
+read ROOT_PART
+
+echo "Please enter the HOME partition name (i.e. sda2 or other):"
+read HOME_PART
+
+echo "Please enter the VAR partition name (i.e. sda5 or other):"
+read VAR_PART
+
+echo "Please enter the SWAP partition name (i.e. sda6 or other):"
+read SWAP_PART
+
+CLONE=/mnt/$NAME
+
+# CLONING
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+mount /dev/$HOME_PART $DEST
+rsync -a --exclude=$MASTER:/home/telecaster/archives/ --exclude=$MASTER:/home/telecaster/trash/ \
+     --exclude=$MASTER:/home/telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ mount /dev/$VAR_PART $CLONE/var
+fi
+rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
+
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+ echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $NAME > $CLONE/etc/hostname
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+# GRUB
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE
+
+echo "Hello world, I'm an NEW TC clone ! :)"
+
+
diff --git a/scripts/tc_clone_nuc.sh b/scripts/tc_clone_nuc.sh
new file mode 100755 (executable)
index 0000000..aa2ff30
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+set -e
+
+echo "Please enter the MASTER_HOST address:"
+read MASTER_HOST
+
+echo "Please enter the MASTER_HOST path:"
+read MASTER_PATH
+
+echo "Please enter the target system ID:"
+read ID
+
+FS_TYPE="ext4"
+
+UEFI_PART="sda1"
+ROOT_PART="sda2"
+VAR_PART="sda3"
+SWAP_PART="sda5"
+HOME_PART="sda6"
+
+mkfs.vfat /dev/$UEFI_PART
+mkfs.$FS_TYPE /dev/$ROOT_PART
+mkfs.$FS_TYPE /dev/$VAR_PART
+mkfs.$FS_TYPE /dev/$HOME_PART
+mkswap /dev/$SWAP_PART
+
+CLONE=/mnt/$ID
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ mount /dev/$VAR_PART $CLONE/var
+fi
+rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+mount /dev/$HOME_PART $DEST
+rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
+umount $CLONE/home
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+ echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+# GRUB
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/scripts/tc_clone_nuc_local.sh b/scripts/tc_clone_nuc_local.sh
new file mode 100755 (executable)
index 0000000..9f77d16
--- /dev/null
@@ -0,0 +1,103 @@
+#!/bin/bash
+
+set -e
+
+#echo "Please enter the MASTER_HOST address:"
+#read MASTER_HOST
+
+#echo "Please enter the MASTER_HOST path:"
+#read MASTER_PATH
+
+echo "Please enter the target system ID:"
+read ID
+
+FS_TYPE="ext4"
+
+#UEFI_PART="sda1"
+ROOT_PART="sdb1"
+VAR_PART="sdb2"
+SWAP_PART="sdb3"
+HOME_PART="sdb4"
+
+#mkfs.vfat /dev/$UEFI_PART
+mkfs.$FS_TYPE /dev/$ROOT_PART
+mkfs.$FS_TYPE /dev/$VAR_PART
+mkfs.$FS_TYPE /dev/$HOME_PART
+mkswap /dev/$SWAP_PART
+
+CLONE=/mnt/$ID
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system / $CLONE/
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ mount /dev/$VAR_PART $CLONE/var
+fi
+rsync -a --one-file-system --delete /var/ $CLONE/var/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+mount /dev/$HOME_PART $DEST
+rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" /home/ $CLONE/home/
+umount $CLONE/home
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+ echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /dev/pts $CLONE/dev/pts
+mount -o bind /sys $CLONE/sys
+
+# GRUB
+#chroot $CLONE mount -a
+chroot $CLONE update-grub
+chroot $CLONE grub-install /dev/sdb
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/sys
+umount $CLONE/dev/pts
+umount $CLONE/dev
+umount $CLONE/proc
+umount $CLONE/var
+umount $CLONE
+
+update-grub
+
+echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/scripts/tc_clone_nuc_no_fat.sh b/scripts/tc_clone_nuc_no_fat.sh
new file mode 100755 (executable)
index 0000000..1f3c783
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+set -e
+
+echo "Please enter the MASTER_HOST address:"
+read MASTER_HOST
+
+echo "Please enter the MASTER_HOST path:"
+read MASTER_PATH
+
+echo "Please enter the target system ID:"
+read ID
+
+FS_TYPE="ext4"
+
+ROOT_PART="sda1"
+VAR_PART="sda2"
+SWAP_PART="sda3"
+HOME_PART="sda4"
+
+mkfs.$FS_TYPE /dev/$ROOT_PART
+mkfs.$FS_TYPE /dev/$VAR_PART
+mkfs.$FS_TYPE /dev/$HOME_PART
+mkswap /dev/$SWAP_PART
+
+CLONE=/mnt/$ID
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ mount /dev/$VAR_PART $CLONE/var
+fi
+rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+mount /dev/$HOME_PART $DEST
+rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
+umount $CLONE/home
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+ echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+# GRUB
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/scripts/tc_clone_nuc_no_fs.sh b/scripts/tc_clone_nuc_no_fs.sh
new file mode 100755 (executable)
index 0000000..5205473
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+set -e
+
+echo "Please enter the MASTER_HOST address:"
+read MASTER_HOST
+
+echo "Please enter the MASTER_HOST path:"
+read MASTER_PATH
+
+echo "Please enter the target system ID:"
+read ID
+
+FS_TYPE="ext4"
+
+UEFI_PART="sda1"
+ROOT_PART="sda2"
+VAR_PART="sda3"
+SWAP_PART="sda5"
+HOME_PART="sda6"
+
+#mkfs.vfat /dev/$UEFI_PART
+#mkfs.$FS_TYPE /dev/$ROOT_PART
+#mkfs.$FS_TYPE /dev/$VAR_PART
+#mkfs.$FS_TYPE /dev/$HOME_PART
+#mkswap /dev/$SWAP_PART
+
+CLONE=/mnt/$ID
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ mount /dev/$VAR_PART $CLONE/var
+fi
+rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+mount /dev/$HOME_PART $DEST
+rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
+umount $CLONE/home
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+ echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+# GRUB
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/scripts/tc_clone_nuc_nvme.sh b/scripts/tc_clone_nuc_nvme.sh
new file mode 100755 (executable)
index 0000000..2bcc6fb
--- /dev/null
@@ -0,0 +1,121 @@
+#!/bin/bash
+
+set -e
+
+OPTIND=1         # Reset in case getopts has been used previously in the shell.
+
+ROOT="/"
+FS_TYPE="ext4"
+
+DISK=nvme0n1
+ROOT_PART="nvme0n1p1"
+VAR_PART="nvme0n1p5"
+SWAP_PART="nvme0n1p6"
+HOME_PART="nvme0n1p7"
+
+while getopts m:i:p:r:s:d:f flag
+do
+    case "${flag}" in
+        m) MASTER=${OPTARG};;
+        i) ID=${OPTARG};;
+        f) FORMAT=true;;
+        r) ROOT=${OPTARG};;
+        s) SYNC=true;;
+        p) PARTITIONS=${OPTARG};;
+    esac
+done
+
+CLONE=/mnt/$ID
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+#umount /dev/$HOME_PART $$CLONE/home
+#umount /dev/$VAR_PART $CLONE/var
+#umount /dev/$ROOT_PART $CLONE
+
+if [ $PARTITIONS ]; then
+    sfdisk /dev/$DISK < $PARTITIONS
+fi
+
+if [ $FORMAT ]; then
+    mkfs.$FS_TYPE -q /dev/$ROOT_PART
+    mkfs.$FS_TYPE -q /dev/$VAR_PART
+    mkfs.$FS_TYPE -q  /dev/$HOME_PART
+    mkswap /dev/$SWAP_PART
+fi
+
+
+mount /dev/$ROOT_PART $CLONE
+
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+  mkdir $DEST
+fi
+mount /dev/$VAR_PART $CLONE/var
+
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+   mkdir $DEST
+fi
+mount /dev/$HOME_PART $CLONE/home
+
+if [ $SYNC ]; then
+    # CLONING
+    echo "rsyncing root..."
+    rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER:$ROOT/ $CLONE/
+
+    echo "rsyncing var..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
+
+    echo "rsyncing home..."
+    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
+fi
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo "RESUME=UUID=$uuid" >> $CLONE/etc/initramfs-tools/conf.d/resume
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount --bind /sys $CLONE/sys
+mount --bind /proc $CLONE/proc
+mount --bind /dev $CLONE/dev
+mount --bind /dev/pts $CLONE/dev/pts
+
+# GRUB
+chroot $CLONE grub-install /dev/nvme0n1
+chroot $CLONE update-initramfs -u
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/dev/pts
+umount $CLONE/dev
+umount $CLONE/proc
+umount $CLONE/sys
+umount $CLONE/var
+umount $CLONE/home
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/scripts/tc_clone_nuc_nvme_efi.sh b/scripts/tc_clone_nuc_nvme_efi.sh
new file mode 100755 (executable)
index 0000000..1a8a31b
--- /dev/null
@@ -0,0 +1,158 @@
+#!/bin/bash
+
+set -e
+
+OPTIND=1         # Reset in case getopts has been used previously in the shell.
+
+ROOT="/"
+FS_TYPE="ext4"
+
+DISK=nvme0n1
+EFI_PART="nvme0n1p1"
+ROOT_PART="nvme0n1p2"
+VAR_PART="nvme0n1p3"
+SWAP_PART="nvme0n1p4"
+HOME_PART="nvme0n1p5"
+
+while getopts m:i:p:r:s:d:f:b flag
+do
+    case "${flag}" in
+        m) MASTER=${OPTARG};;
+        i) ID=${OPTARG};;
+        f) FORMAT=true;;
+        r) ROOT=${OPTARG};;
+        s) SYNC=true;;
+        p) PARTITIONS=${OPTARG};;
+        b) BACKUP=false;;
+    esac
+done
+
+CLONE=/mnt/$ID
+
+# UMOUNT
+DIR=$CLONE/home
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/var
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/boot/efi
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+
+if [ $PARTITIONS ]; then
+    sfdisk /dev/$DISK < $PARTITIONS
+fi
+
+if [ $FORMAT ]; then
+    mkfs.vfat /dev/$EFI_PART
+    mkfs.$FS_TYPE -q /dev/$ROOT_PART
+    mkswap -q /dev/$SWAP_PART
+    mkfs.$FS_TYPE -q /dev/$VAR_PART
+    mkfs.$FS_TYPE -q  /dev/$HOME_PART
+fi
+
+
+mount /dev/$ROOT_PART $CLONE
+mkdir -p $CLONE/boot/efi
+mount  /dev/$EFI_PART $CLONE/boot/efi
+
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+  mkdir $DEST
+fi
+mount /dev/$VAR_PART $CLONE/var
+
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+   mkdir $DEST
+fi
+mount /dev/$HOME_PART $CLONE/home
+
+
+if [ $SYNC ]; then
+    # CLONING
+    echo "rsyncing root..."
+
+    if [ $BACKUP ]; then
+        rsync -a --delete --one-file-system $MASTER:$ROOT/root/ $CLONE/
+    else
+        rsync -a --delete --one-file-system $MASTER:$ROOT/ $CLONE/
+    fi
+
+    echo "rsyncing efi..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
+
+    echo "rsyncing var..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
+
+    echo "rsyncing home..."
+    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "monitor/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
+fi
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $EFI_PART`
+echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+swap_uuid=`get_uuid $SWAP_PART`
+echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
+
+echo $ID > $CLONE/etc/hostname
+echo $ID | cut -d "-" -f 2 > $CLONE/etc/tc-id
+
+# CHROOT
+mount --bind /sys $CLONE/sys
+mount --bind /proc $CLONE/proc
+mount --bind /dev $CLONE/dev
+mount --bind /dev/pts $CLONE/dev/pts
+mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
+
+# GRUB EFI
+chroot $CLONE apt update
+chroot $CLONE apt install grub-efi
+chroot $CLONE grub-install /dev/$DISK
+chroot $CLONE update-initramfs -u
+chroot $CLONE update-grub
+chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
+chroot $CLONE efibootmgr --verbose | grep debian
+
+# UMOUNT
+umount $CLONE/sys/firmware/efi/efivars
+umount $CLONE/dev/pts
+umount $CLONE/dev
+umount $CLONE/proc
+umount $CLONE/sys
+umount $CLONE/boot/efi
+umount $CLONE/var
+umount $CLONE/home
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/scripts/tc_clone_nuc_nvme_efi_back.sh b/scripts/tc_clone_nuc_nvme_efi_back.sh
new file mode 100755 (executable)
index 0000000..ef71845
--- /dev/null
@@ -0,0 +1,150 @@
+#!/bin/bash
+
+set -e
+
+OPTIND=1         # Reset in case getopts has been used previously in the shell.
+
+ROOT="/"
+FS_TYPE="ext4"
+
+DISK=nvme0n1
+EFI_PART="nvme0n1p1"
+ROOT_PART="nvme0n1p2"
+VAR_PART="nvme0n1p3"
+SWAP_PART="nvme0n1p4"
+HOME_PART="nvme0n1p5"
+
+while getopts m:i:p:r:s:d:f flag
+do
+    case "${flag}" in
+        m) MASTER=${OPTARG};;
+        i) ID=${OPTARG};;
+        f) FORMAT=true;;
+        r) ROOT=${OPTARG};;
+        s) SYNC=true;;
+        p) PARTITIONS=${OPTARG};;
+    esac
+done
+
+CLONE=/mnt/$ID
+
+# UMOUNT
+DIR=$CLONE/home
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/var
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/boot/efi
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+
+if [ $PARTITIONS ]; then
+    sfdisk /dev/$DISK < $PARTITIONS
+fi
+
+if [ $FORMAT ]; then
+    mkfs.vfat /dev/$EFI_PART
+    mkfs.$FS_TYPE -q /dev/$ROOT_PART
+    mkswap /dev/$SWAP_PART
+    mkfs.$FS_TYPE -q /dev/$VAR_PART
+    mkfs.$FS_TYPE -q  /dev/$HOME_PART
+fi
+
+
+mount /dev/$ROOT_PART $CLONE
+mkdir -p $CLONE/boot/efi
+mount  /dev/$EFI_PART $CLONE/boot/efi
+
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+  mkdir $DEST
+fi
+mount /dev/$VAR_PART $CLONE/var
+
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+   mkdir $DEST
+fi
+mount /dev/$HOME_PART $CLONE/home
+
+
+if [ $SYNC ]; then
+    # CLONING
+    echo "rsyncing root..."
+    rsync -a --delete --one-file-system $MASTER:$ROOT/root/ $CLONE/
+
+    echo "rsyncing efi..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
+
+    echo "rsyncing var..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
+
+    echo "rsyncing home..."
+    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "monitor/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
+fi
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $EFI_PART`
+echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+swap_uuid=`get_uuid $SWAP_PART`
+echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount --bind /sys $CLONE/sys
+mount --bind /proc $CLONE/proc
+mount --bind /dev $CLONE/dev
+mount --bind /dev/pts $CLONE/dev/pts
+mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
+
+# GRUB EFI
+chroot $CLONE apt install grub-efi
+chroot $CLONE grub-install /dev/$DISK
+chroot $CLONE update-initramfs -u
+chroot $CLONE update-grub
+chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
+chroot $CLONE efibootmgr --verbose | grep debian
+
+# UMOUNT
+umount $CLONE/sys/firmware/efi/efivars
+umount $CLONE/dev/pts
+umount $CLONE/dev
+umount $CLONE/proc
+umount $CLONE/sys
+umount $CLONE/boot/efi
+umount $CLONE/var
+umount $CLONE/home
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/scripts/tc_clone_nuc_sda.sh b/scripts/tc_clone_nuc_sda.sh
new file mode 100755 (executable)
index 0000000..60de7f2
--- /dev/null
@@ -0,0 +1,121 @@
+#!/bin/bash
+
+set -e
+
+OPTIND=1         # Reset in case getopts has been used previously in the shell.
+
+ROOT="/"
+FS_TYPE="ext4"
+
+DISK=sda
+ROOT_PART="sda1"
+VAR_PART="sda2"
+SWAP_PART="sda3"
+HOME_PART="sda4"
+
+while getopts m:i:p:r:s:d:f flag
+do
+    case "${flag}" in
+        m) MASTER=${OPTARG};;
+        i) ID=${OPTARG};;
+        f) FORMAT=true;;
+        r) ROOT=${OPTARG};;
+        s) SYNC=true;;
+        p) PARTITIONS=${OPTARG};;
+    esac
+done
+
+CLONE=/mnt/$ID
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+#umount /dev/$HOME_PART $$CLONE/home
+#umount /dev/$VAR_PART $CLONE/var
+#umount /dev/$ROOT_PART $CLONE
+
+if [ $PARTITIONS ]; then
+    sfdisk /dev/$DISK < $PARTITIONS
+fi
+
+if [ $FORMAT ]; then
+    mkfs.$FS_TYPE -q /dev/$ROOT_PART
+    mkfs.$FS_TYPE -q /dev/$VAR_PART
+    mkfs.$FS_TYPE -q  /dev/$HOME_PART
+    mkswap /dev/$SWAP_PART
+fi
+
+
+mount /dev/$ROOT_PART $CLONE
+
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+  mkdir $DEST
+fi
+mount /dev/$VAR_PART $CLONE/var
+
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+   mkdir $DEST
+fi
+mount /dev/$HOME_PART $CLONE/home
+
+if [ $SYNC ]; then
+    # CLONING
+    echo "rsyncing root..."
+    rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER:$ROOT/ $CLONE/
+
+    echo "rsyncing var..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
+
+    echo "rsyncing home..."
+    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
+fi
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo "RESUME=UUID=$uuid" >> $CLONE/etc/initramfs-tools/conf.d/resume
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount --bind /sys $CLONE/sys
+mount --bind /proc $CLONE/proc
+mount --bind /dev $CLONE/dev
+mount --bind /dev/pts $CLONE/dev/pts
+
+# GRUB
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-initramfs -u
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/dev/pts
+umount $CLONE/dev
+umount $CLONE/proc
+umount $CLONE/sys
+umount $CLONE/var
+umount $CLONE/home
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/scripts/tc_clone_nuc_sda_efi.sh b/scripts/tc_clone_nuc_sda_efi.sh
new file mode 100755 (executable)
index 0000000..f666f83
--- /dev/null
@@ -0,0 +1,151 @@
+#!/bin/bash
+
+set -e
+
+OPTIND=1         # Reset in case getopts has been used previously in the shell.
+
+ROOT="/"
+FS_TYPE="ext4"
+
+DISK=sda
+EFI_PART="sda1"
+ROOT_PART="sda2"
+VAR_PART="sda3"
+SWAP_PART="sda4"
+HOME_PART="sda5"
+
+while getopts m:i:p:r:s:d:f flag
+do
+    case "${flag}" in
+        m) MASTER=${OPTARG};;
+        i) ID=${OPTARG};;
+        f) FORMAT=true;;
+        r) ROOT=${OPTARG};;
+        s) SYNC=true;;
+        p) PARTITIONS=${OPTARG};;
+    esac
+done
+
+CLONE=/mnt/$ID
+
+# UMOUNT
+DIR=$CLONE/home
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/var
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/boot/efi
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+
+if [ $PARTITIONS ]; then
+    sfdisk /dev/$DISK < $PARTITIONS
+fi
+
+if [ $FORMAT ]; then
+    mkfs.vfat /dev/$EFI_PART
+    mkfs.$FS_TYPE -q /dev/$ROOT_PART
+    mkswap -q /dev/$SWAP_PART
+    mkfs.$FS_TYPE -q /dev/$VAR_PART
+    mkfs.$FS_TYPE -q  /dev/$HOME_PART
+fi
+
+
+mount /dev/$ROOT_PART $CLONE
+mkdir -p $CLONE/boot/efi
+mount  /dev/$EFI_PART $CLONE/boot/efi
+
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+  mkdir $DEST
+fi
+mount /dev/$VAR_PART $CLONE/var
+
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+   mkdir $DEST
+fi
+mount /dev/$HOME_PART $CLONE/home
+
+
+if [ $SYNC ]; then
+    # CLONING
+    echo "rsyncing root..."
+    rsync -a --delete --one-file-system $MASTER:$ROOT/ $CLONE/
+
+    echo "rsyncing efi..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
+
+    echo "rsyncing var..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
+
+    echo "rsyncing home..."
+    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" --exclude "monitor/*" $MASTER:$ROOT/home/ $CLONE/home/
+fi
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $EFI_PART`
+echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+swap_uuid=`get_uuid $SWAP_PART`
+echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
+
+echo $ID > $CLONE/etc/hostname
+echo $ID | cut -d "-" -f 2 > $CLONE/etc/tc-id
+
+# CHROOT
+mount --bind /sys $CLONE/sys
+mount --bind /proc $CLONE/proc
+mount --bind /dev $CLONE/dev
+mount --bind /dev/pts $CLONE/dev/pts
+
+# GRUB EFI
+mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
+chroot $CLONE apt install grub-efi
+chroot $CLONE grub-install /dev/$DISK
+chroot $CLONE update-initramfs -u
+chroot $CLONE update-grub
+chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
+chroot $CLONE efibootmgr --verbose | grep debian
+
+# UMOUNT
+umount $CLONE/sys/firmware/efi/efivars
+umount $CLONE/dev/pts
+umount $CLONE/dev
+umount $CLONE/proc
+umount $CLONE/sys
+umount $CLONE/boot/efi
+umount $CLONE/var
+umount $CLONE/home
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/scripts/tc_clone_nuc_sda_efi_dos.sh b/scripts/tc_clone_nuc_sda_efi_dos.sh
new file mode 100755 (executable)
index 0000000..174199f
--- /dev/null
@@ -0,0 +1,150 @@
+#!/bin/bash
+
+set -e
+
+OPTIND=1         # Reset in case getopts has been used previously in the shell.
+
+ROOT="/"
+FS_TYPE="ext4"
+
+DISK=sda
+EFI_PART="sda1"
+ROOT_PART="sda2"
+VAR_PART="sda5"
+SWAP_PART="sda3"
+HOME_PART="sda6"
+
+while getopts m:i:p:r:s:d:f flag
+do
+    case "${flag}" in
+        m) MASTER=${OPTARG};;
+        i) ID=${OPTARG};;
+        f) FORMAT=true;;
+        r) ROOT=${OPTARG};;
+        s) SYNC=true;;
+        p) PARTITIONS=${OPTARG};;
+    esac
+done
+
+CLONE=/mnt/$ID
+
+# UMOUNT
+DIR=$CLONE/home
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/var
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+DIR=$CLONE/boot/efi
+if [ -d $DIR ]; then
+    umount $DIR
+fi
+
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+
+if [ $PARTITIONS ]; then
+    sfdisk /dev/$DISK < $PARTITIONS
+fi
+
+if [ $FORMAT ]; then
+    mkfs.vfat /dev/$EFI_PART
+    mkfs.$FS_TYPE -q /dev/$ROOT_PART
+    mkswap /dev/$SWAP_PART
+    mkfs.$FS_TYPE -q /dev/$VAR_PART
+    mkfs.$FS_TYPE -q  /dev/$HOME_PART
+fi
+
+
+mount /dev/$ROOT_PART $CLONE
+mkdir -p $CLONE/boot/efi
+mount  /dev/$EFI_PART $CLONE/boot/efi
+
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+  mkdir $DEST
+fi
+mount /dev/$VAR_PART $CLONE/var
+
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+   mkdir $DEST
+fi
+mount /dev/$HOME_PART $CLONE/home
+
+
+if [ $SYNC ]; then
+    # CLONING
+    echo "rsyncing root..."
+    rsync -a --delete --one-file-system $MASTER:$ROOT/ $CLONE/
+
+    echo "rsyncing efi..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
+
+    echo "rsyncing var..."
+    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
+
+    echo "rsyncing home..."
+    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
+fi
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $EFI_PART`
+echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+swap_uuid=`get_uuid $SWAP_PART`
+echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount --bind /sys $CLONE/sys
+mount --bind /proc $CLONE/proc
+mount --bind /dev $CLONE/dev
+mount --bind /dev/pts $CLONE/dev/pts
+
+# GRUB EFI
+mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
+chroot $CLONE apt install grub-efi
+chroot $CLONE grub-install /dev/$DISK
+chroot $CLONE update-initramfs -u
+chroot $CLONE update-grub
+chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
+chroot $CLONE efibootmgr --verbose | grep debian
+
+# UMOUNT
+umount $CLONE/sys/firmware/efi/efivars
+umount $CLONE/dev/pts
+umount $CLONE/dev
+umount $CLONE/proc
+umount $CLONE/sys
+umount $CLONE/boot/efi
+umount $CLONE/var
+umount $CLONE/home
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/scripts/tc_clone_pxe.sh b/scripts/tc_clone_pxe.sh
new file mode 100755 (executable)
index 0000000..7b5e341
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.62
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+FS_TYPE="ext4"
+
+ROOT_PART="sda1"
+HOME_PART="sda2"
+VAR_PART="sda5"
+SWAP_PART="sda6"
+
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+mount /dev/$HOME_PART $CLONE/home
+rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+mount /dev/$VAR_PART $CLONE/var
+rsync -a --delete --one-file-system $MASTER:$MASTERPATH/var/ $CLONE/var/
+
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $NAME > $CLONE/etc/hostname
+
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE/
+
+echo "Hello world, I'm a NEW TC-202 clone ! B-)"
+
+
diff --git a/scripts/tc_clone_pxe_local.sh b/scripts/tc_clone_pxe_local.sh
new file mode 100755 (executable)
index 0000000..0b72b87
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+set -e
+
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+FS_TYPE="ext4"
+
+ROOT_PART="sdb1"
+HOME_PART="sdb2"
+VAR_PART="sdb5"
+SWAP_PART="sdb6"
+
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --one-file-system $MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+mount /dev/$HOME_PART $CLONE/home
+rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+mount /dev/$VAR_PART $CLONE/var
+rsync -a --delete --one-file-system $MASTERPATH/var/ $CLONE/var/
+
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $NAME > $CLONE/etc/hostname
+
+chroot $CLONE grub-install /dev/sdb
+chroot $CLONE update-grub
+
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE/
+
+echo "Hello world, I'm a NEW TC-202 clone ! B-)"
+
+
diff --git a/scripts/tc_clone_pxe_s10.sh b/scripts/tc_clone_pxe_s10.sh
new file mode 100755 (executable)
index 0000000..7b5e341
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.62
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+FS_TYPE="ext4"
+
+ROOT_PART="sda1"
+HOME_PART="sda2"
+VAR_PART="sda5"
+SWAP_PART="sda6"
+
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+mount /dev/$HOME_PART $CLONE/home
+rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+mount /dev/$VAR_PART $CLONE/var
+rsync -a --delete --one-file-system $MASTER:$MASTERPATH/var/ $CLONE/var/
+
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $VAR_PART`
+echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $NAME > $CLONE/etc/hostname
+
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE/
+
+echo "Hello world, I'm a NEW TC-202 clone ! B-)"
+
+
diff --git a/scripts/tc_clone_update_pxe.sh b/scripts/tc_clone_update_pxe.sh
new file mode 100755 (executable)
index 0000000..036339b
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.64
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+mount /dev/sda1 $CLONE
+echo "rsyncing root..."
+rsync -a --delete --one-file-system --exclude=/etc/fstab --exclude=/etc/hostname --exclude=/etc/hosts $MASTER:$MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+mount /dev/sda2 $CLONE/home
+rsync -a --delete --exclude=telecaster/archives --exclude=telecaster/trash --exclude=telecaster/bin --exclude=home/telecaster/test --exclude=networkmanagement $MASTER:$MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+mount /dev/sda5 $CLONE/var
+rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE
+
+echo "OK, I'm an updated TC clone!"
+
diff --git a/scripts/tc_clone_update_pxe_s10.sh b/scripts/tc_clone_update_pxe_s10.sh
new file mode 100755 (executable)
index 0000000..8a96158
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.62
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+mount /dev/sda1 $CLONE
+echo "rsyncing root..."
+rsync -a --delete --one-file-system --exclude=/etc/fstab --exclude=/etc/hostname --exclude=/etc/hosts $MASTER:$MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+mount /dev/sda3 $CLONE/home
+rsync -a --exclude=telecaster/archives --exclude=telecaster/trash --exclude=telecaster/bin --exclude=telecaster/test $MASTER:$MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+#umount $CLONE/var
+umount $CLONE
+
+echo "OK, I'm an updated TC (s10) clone!"
+
+
diff --git a/scripts/tc_clone_xps.sh b/scripts/tc_clone_xps.sh
new file mode 100755 (executable)
index 0000000..33252f7
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+set -e
+
+echo "Please enter the MASTER_HOST address:"
+read MASTER_HOST
+
+echo "Please enter the MASTER_HOST path:"
+read MASTER_PATH
+
+echo "Please enter the target system ID:"
+read ID
+
+FS_TYPE="ext4"
+
+ROOT_PART="sda1"
+VAR_PART="sda5"
+SWAP_PART="sda3"
+HOME_PART="sda6"
+
+mkfs.$FS_TYPE /dev/$ROOT_PART
+mkfs.$FS_TYPE /dev/$VAR_PART
+mkfs.$FS_TYPE /dev/$HOME_PART
+mkswap /dev/$SWAP_PART
+
+CLONE=/mnt/$ID
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+mount /dev/$ROOT_PART $CLONE
+echo "rsyncing root..."
+rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
+
+echo "rsyncing var..."
+DEST=$CLONE/var
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ mount /dev/$VAR_PART $CLONE/var
+fi
+rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
+
+echo "rsyncing home..."
+DEST=$CLONE/home
+if [ ! -d $DEST ]; then
+ mkdir $DEST
+fi
+mount /dev/$HOME_PART $DEST
+rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
+umount $CLONE/home
+
+# FSTAB
+get_uuid () {
+disks=/dev/disk/by-uuid
+for id in `ls $disks`; do
+ part=`readlink -f $disks/$id`
+ if [ $part == /dev/$1 ]; then
+  echo $id
+ fi
+done
+}
+
+uuid=`get_uuid $ROOT_PART`
+echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
+if [ ! $VAR_PART == $ROOT_PART ]; then
+ uuid=`get_uuid $VAR_PART`
+ echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+fi
+uuid=`get_uuid $HOME_PART`
+echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
+uuid=`get_uuid $SWAP_PART`
+echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
+
+echo $ID > $CLONE/etc/hostname
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+# GRUB
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+# UMOUNT
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE
+
+echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/scripts/tc_mount_master.sh b/scripts/tc_mount_master.sh
new file mode 100755 (executable)
index 0000000..c3eb0f1
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+
+CLONE=/mnt/custom
+
+mount /dev/sda1 $CLONE
+mount /dev/sda2 $CLONE/var
+mount /dev/sda4 $CLONE/home
+
+df
+
+echo "OK, I'm the Master of the TC clones!"
diff --git a/scripts/tc_umount_master.sh b/scripts/tc_umount_master.sh
new file mode 100755 (executable)
index 0000000..a102386
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+
+CLONE=/mnt/custom
+
+umount $CLONE/var
+umount $CLONE/home
+umount $CLONE
+
+df
+
+
diff --git a/tc_backup.sh b/tc_backup.sh
deleted file mode 100755 (executable)
index 9188f96..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Please enter the MASTER_HOST address:"
-read MASTER_HOST
-
-echo "Please enter the MASTER_PATH:"
-read MASTER_PATH
-
-echo "Please enter the BACKUP_PATH:"
-read BACKUP_PATH
-
-CLONE=$BACKUP_PATH
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-# CLONING
-echo "rsyncing root..."
-rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
-
-echo "$MASTER_HOST has been backup to $BACKUP_PATH ! :)"
diff --git a/tc_backup_local.sh b/tc_backup_local.sh
deleted file mode 100755 (executable)
index 89d53f5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Please enter the MASTER_PATH:"
-read MASTER_PATH
-
-echo "Please enter the BACKUP_PATH:"
-read BACKUP_PATH
-
-CLONE=$BACKUP_PATH
-
-if [ ! -d $CLONE ]; then
- sudo mkdir $CLONE
-fi
-
-# CLONING
-echo "rsyncing root..."
-sudo rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_PATH/ $CLONE/
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- sudo mkdir $DEST
-fi
-sudo rsync -a --one-file-system --delete $MASTER_PATH/var/ $CLONE/var/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- sudo mkdir $DEST
-fi
-sudo rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_PATH/home/ $CLONE/home/
-
-echo "$MASTER_PATH has been backup to $BACKUP_PATH ! :)"
diff --git a/tc_clone.sh b/tc_clone.sh
deleted file mode 100755 (executable)
index 9b99a2a..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MASTER=192.168.0.64
-MASTERPATH=/mnt/custom
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-echo "Please enter the target system name:"
-read NAME
-
-echo "Please enter the type of all system partitions (i.e. xfs, ext4 or other):"
-read FS_TYPE
-
-echo "Please enter the ROOT partition name (i.e. sda1 or other):"
-read ROOT_PART
-
-echo "Please enter the HOME partition name (i.e. sda2 or other):"
-read HOME_PART
-
-echo "Please enter the VAR partition name (i.e. sda5 or other):"
-read VAR_PART
-
-echo "Please enter the SWAP partition name (i.e. sda6 or other):"
-read SWAP_PART
-
-CLONE=/mnt/$NAME
-
-# CLONING
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-mount /dev/$HOME_PART $DEST
-rsync -a --exclude=$MASTER:/home/telecaster/archives/ --exclude=$MASTER:/home/telecaster/trash/ \
-     --exclude=$MASTER:/home/telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
-umount $CLONE/home
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-if [ ! $VAR_PART == $ROOT_PART ]; then
- mount /dev/$VAR_PART $CLONE/var
-fi
-rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
-
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
- echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $NAME > $CLONE/etc/hostname
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-# GRUB
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE
-
-echo "Hello world, I'm an NEW TC clone ! :)"
-
-
diff --git a/tc_clone_nuc.sh b/tc_clone_nuc.sh
deleted file mode 100755 (executable)
index aa2ff30..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Please enter the MASTER_HOST address:"
-read MASTER_HOST
-
-echo "Please enter the MASTER_HOST path:"
-read MASTER_PATH
-
-echo "Please enter the target system ID:"
-read ID
-
-FS_TYPE="ext4"
-
-UEFI_PART="sda1"
-ROOT_PART="sda2"
-VAR_PART="sda3"
-SWAP_PART="sda5"
-HOME_PART="sda6"
-
-mkfs.vfat /dev/$UEFI_PART
-mkfs.$FS_TYPE /dev/$ROOT_PART
-mkfs.$FS_TYPE /dev/$VAR_PART
-mkfs.$FS_TYPE /dev/$HOME_PART
-mkswap /dev/$SWAP_PART
-
-CLONE=/mnt/$ID
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-# CLONING
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-if [ ! $VAR_PART == $ROOT_PART ]; then
- mount /dev/$VAR_PART $CLONE/var
-fi
-rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-mount /dev/$HOME_PART $DEST
-rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
-umount $CLONE/home
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
- echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-# GRUB
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/tc_clone_nuc_local.sh b/tc_clone_nuc_local.sh
deleted file mode 100755 (executable)
index 9f77d16..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-
-set -e
-
-#echo "Please enter the MASTER_HOST address:"
-#read MASTER_HOST
-
-#echo "Please enter the MASTER_HOST path:"
-#read MASTER_PATH
-
-echo "Please enter the target system ID:"
-read ID
-
-FS_TYPE="ext4"
-
-#UEFI_PART="sda1"
-ROOT_PART="sdb1"
-VAR_PART="sdb2"
-SWAP_PART="sdb3"
-HOME_PART="sdb4"
-
-#mkfs.vfat /dev/$UEFI_PART
-mkfs.$FS_TYPE /dev/$ROOT_PART
-mkfs.$FS_TYPE /dev/$VAR_PART
-mkfs.$FS_TYPE /dev/$HOME_PART
-mkswap /dev/$SWAP_PART
-
-CLONE=/mnt/$ID
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-# CLONING
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system / $CLONE/
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-if [ ! $VAR_PART == $ROOT_PART ]; then
- mount /dev/$VAR_PART $CLONE/var
-fi
-rsync -a --one-file-system --delete /var/ $CLONE/var/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-mount /dev/$HOME_PART $DEST
-rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" /home/ $CLONE/home/
-umount $CLONE/home
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
- echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /dev/pts $CLONE/dev/pts
-mount -o bind /sys $CLONE/sys
-
-# GRUB
-#chroot $CLONE mount -a
-chroot $CLONE update-grub
-chroot $CLONE grub-install /dev/sdb
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/sys
-umount $CLONE/dev/pts
-umount $CLONE/dev
-umount $CLONE/proc
-umount $CLONE/var
-umount $CLONE
-
-update-grub
-
-echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/tc_clone_nuc_no_fat.sh b/tc_clone_nuc_no_fat.sh
deleted file mode 100755 (executable)
index 1f3c783..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Please enter the MASTER_HOST address:"
-read MASTER_HOST
-
-echo "Please enter the MASTER_HOST path:"
-read MASTER_PATH
-
-echo "Please enter the target system ID:"
-read ID
-
-FS_TYPE="ext4"
-
-ROOT_PART="sda1"
-VAR_PART="sda2"
-SWAP_PART="sda3"
-HOME_PART="sda4"
-
-mkfs.$FS_TYPE /dev/$ROOT_PART
-mkfs.$FS_TYPE /dev/$VAR_PART
-mkfs.$FS_TYPE /dev/$HOME_PART
-mkswap /dev/$SWAP_PART
-
-CLONE=/mnt/$ID
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-# CLONING
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-if [ ! $VAR_PART == $ROOT_PART ]; then
- mount /dev/$VAR_PART $CLONE/var
-fi
-rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-mount /dev/$HOME_PART $DEST
-rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
-umount $CLONE/home
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
- echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-# GRUB
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/tc_clone_nuc_no_fs.sh b/tc_clone_nuc_no_fs.sh
deleted file mode 100755 (executable)
index 5205473..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Please enter the MASTER_HOST address:"
-read MASTER_HOST
-
-echo "Please enter the MASTER_HOST path:"
-read MASTER_PATH
-
-echo "Please enter the target system ID:"
-read ID
-
-FS_TYPE="ext4"
-
-UEFI_PART="sda1"
-ROOT_PART="sda2"
-VAR_PART="sda3"
-SWAP_PART="sda5"
-HOME_PART="sda6"
-
-#mkfs.vfat /dev/$UEFI_PART
-#mkfs.$FS_TYPE /dev/$ROOT_PART
-#mkfs.$FS_TYPE /dev/$VAR_PART
-#mkfs.$FS_TYPE /dev/$HOME_PART
-#mkswap /dev/$SWAP_PART
-
-CLONE=/mnt/$ID
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-# CLONING
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-if [ ! $VAR_PART == $ROOT_PART ]; then
- mount /dev/$VAR_PART $CLONE/var
-fi
-rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-mount /dev/$HOME_PART $DEST
-rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
-umount $CLONE/home
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
- echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-# GRUB
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/tc_clone_nuc_nv.sh b/tc_clone_nuc_nv.sh
deleted file mode 100755 (executable)
index 2bcc6fb..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/bash
-
-set -e
-
-OPTIND=1         # Reset in case getopts has been used previously in the shell.
-
-ROOT="/"
-FS_TYPE="ext4"
-
-DISK=nvme0n1
-ROOT_PART="nvme0n1p1"
-VAR_PART="nvme0n1p5"
-SWAP_PART="nvme0n1p6"
-HOME_PART="nvme0n1p7"
-
-while getopts m:i:p:r:s:d:f flag
-do
-    case "${flag}" in
-        m) MASTER=${OPTARG};;
-        i) ID=${OPTARG};;
-        f) FORMAT=true;;
-        r) ROOT=${OPTARG};;
-        s) SYNC=true;;
-        p) PARTITIONS=${OPTARG};;
-    esac
-done
-
-CLONE=/mnt/$ID
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-#umount /dev/$HOME_PART $$CLONE/home
-#umount /dev/$VAR_PART $CLONE/var
-#umount /dev/$ROOT_PART $CLONE
-
-if [ $PARTITIONS ]; then
-    sfdisk /dev/$DISK < $PARTITIONS
-fi
-
-if [ $FORMAT ]; then
-    mkfs.$FS_TYPE -q /dev/$ROOT_PART
-    mkfs.$FS_TYPE -q /dev/$VAR_PART
-    mkfs.$FS_TYPE -q  /dev/$HOME_PART
-    mkswap /dev/$SWAP_PART
-fi
-
-
-mount /dev/$ROOT_PART $CLONE
-
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
-  mkdir $DEST
-fi
-mount /dev/$VAR_PART $CLONE/var
-
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
-   mkdir $DEST
-fi
-mount /dev/$HOME_PART $CLONE/home
-
-if [ $SYNC ]; then
-    # CLONING
-    echo "rsyncing root..."
-    rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER:$ROOT/ $CLONE/
-
-    echo "rsyncing var..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
-
-    echo "rsyncing home..."
-    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
-fi
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo "RESUME=UUID=$uuid" >> $CLONE/etc/initramfs-tools/conf.d/resume
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount --bind /sys $CLONE/sys
-mount --bind /proc $CLONE/proc
-mount --bind /dev $CLONE/dev
-mount --bind /dev/pts $CLONE/dev/pts
-
-# GRUB
-chroot $CLONE grub-install /dev/nvme0n1
-chroot $CLONE update-initramfs -u
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/dev/pts
-umount $CLONE/dev
-umount $CLONE/proc
-umount $CLONE/sys
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/tc_clone_nuc_nv_efi.sh b/tc_clone_nuc_nv_efi.sh
deleted file mode 100755 (executable)
index 1a8a31b..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/bin/bash
-
-set -e
-
-OPTIND=1         # Reset in case getopts has been used previously in the shell.
-
-ROOT="/"
-FS_TYPE="ext4"
-
-DISK=nvme0n1
-EFI_PART="nvme0n1p1"
-ROOT_PART="nvme0n1p2"
-VAR_PART="nvme0n1p3"
-SWAP_PART="nvme0n1p4"
-HOME_PART="nvme0n1p5"
-
-while getopts m:i:p:r:s:d:f:b flag
-do
-    case "${flag}" in
-        m) MASTER=${OPTARG};;
-        i) ID=${OPTARG};;
-        f) FORMAT=true;;
-        r) ROOT=${OPTARG};;
-        s) SYNC=true;;
-        p) PARTITIONS=${OPTARG};;
-        b) BACKUP=false;;
-    esac
-done
-
-CLONE=/mnt/$ID
-
-# UMOUNT
-DIR=$CLONE/home
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/var
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/boot/efi
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-
-if [ $PARTITIONS ]; then
-    sfdisk /dev/$DISK < $PARTITIONS
-fi
-
-if [ $FORMAT ]; then
-    mkfs.vfat /dev/$EFI_PART
-    mkfs.$FS_TYPE -q /dev/$ROOT_PART
-    mkswap -q /dev/$SWAP_PART
-    mkfs.$FS_TYPE -q /dev/$VAR_PART
-    mkfs.$FS_TYPE -q  /dev/$HOME_PART
-fi
-
-
-mount /dev/$ROOT_PART $CLONE
-mkdir -p $CLONE/boot/efi
-mount  /dev/$EFI_PART $CLONE/boot/efi
-
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
-  mkdir $DEST
-fi
-mount /dev/$VAR_PART $CLONE/var
-
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
-   mkdir $DEST
-fi
-mount /dev/$HOME_PART $CLONE/home
-
-
-if [ $SYNC ]; then
-    # CLONING
-    echo "rsyncing root..."
-
-    if [ $BACKUP ]; then
-        rsync -a --delete --one-file-system $MASTER:$ROOT/root/ $CLONE/
-    else
-        rsync -a --delete --one-file-system $MASTER:$ROOT/ $CLONE/
-    fi
-
-    echo "rsyncing efi..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
-
-    echo "rsyncing var..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
-
-    echo "rsyncing home..."
-    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "monitor/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
-fi
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $EFI_PART`
-echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-swap_uuid=`get_uuid $SWAP_PART`
-echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
-
-echo $ID > $CLONE/etc/hostname
-echo $ID | cut -d "-" -f 2 > $CLONE/etc/tc-id
-
-# CHROOT
-mount --bind /sys $CLONE/sys
-mount --bind /proc $CLONE/proc
-mount --bind /dev $CLONE/dev
-mount --bind /dev/pts $CLONE/dev/pts
-mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
-
-# GRUB EFI
-chroot $CLONE apt update
-chroot $CLONE apt install grub-efi
-chroot $CLONE grub-install /dev/$DISK
-chroot $CLONE update-initramfs -u
-chroot $CLONE update-grub
-chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
-chroot $CLONE efibootmgr --verbose | grep debian
-
-# UMOUNT
-umount $CLONE/sys/firmware/efi/efivars
-umount $CLONE/dev/pts
-umount $CLONE/dev
-umount $CLONE/proc
-umount $CLONE/sys
-umount $CLONE/boot/efi
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/tc_clone_nuc_nv_efi_back.sh b/tc_clone_nuc_nv_efi_back.sh
deleted file mode 100644 (file)
index ef71845..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/bash
-
-set -e
-
-OPTIND=1         # Reset in case getopts has been used previously in the shell.
-
-ROOT="/"
-FS_TYPE="ext4"
-
-DISK=nvme0n1
-EFI_PART="nvme0n1p1"
-ROOT_PART="nvme0n1p2"
-VAR_PART="nvme0n1p3"
-SWAP_PART="nvme0n1p4"
-HOME_PART="nvme0n1p5"
-
-while getopts m:i:p:r:s:d:f flag
-do
-    case "${flag}" in
-        m) MASTER=${OPTARG};;
-        i) ID=${OPTARG};;
-        f) FORMAT=true;;
-        r) ROOT=${OPTARG};;
-        s) SYNC=true;;
-        p) PARTITIONS=${OPTARG};;
-    esac
-done
-
-CLONE=/mnt/$ID
-
-# UMOUNT
-DIR=$CLONE/home
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/var
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/boot/efi
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-
-if [ $PARTITIONS ]; then
-    sfdisk /dev/$DISK < $PARTITIONS
-fi
-
-if [ $FORMAT ]; then
-    mkfs.vfat /dev/$EFI_PART
-    mkfs.$FS_TYPE -q /dev/$ROOT_PART
-    mkswap /dev/$SWAP_PART
-    mkfs.$FS_TYPE -q /dev/$VAR_PART
-    mkfs.$FS_TYPE -q  /dev/$HOME_PART
-fi
-
-
-mount /dev/$ROOT_PART $CLONE
-mkdir -p $CLONE/boot/efi
-mount  /dev/$EFI_PART $CLONE/boot/efi
-
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
-  mkdir $DEST
-fi
-mount /dev/$VAR_PART $CLONE/var
-
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
-   mkdir $DEST
-fi
-mount /dev/$HOME_PART $CLONE/home
-
-
-if [ $SYNC ]; then
-    # CLONING
-    echo "rsyncing root..."
-    rsync -a --delete --one-file-system $MASTER:$ROOT/root/ $CLONE/
-
-    echo "rsyncing efi..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
-
-    echo "rsyncing var..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
-
-    echo "rsyncing home..."
-    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "monitor/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
-fi
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $EFI_PART`
-echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-swap_uuid=`get_uuid $SWAP_PART`
-echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount --bind /sys $CLONE/sys
-mount --bind /proc $CLONE/proc
-mount --bind /dev $CLONE/dev
-mount --bind /dev/pts $CLONE/dev/pts
-mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
-
-# GRUB EFI
-chroot $CLONE apt install grub-efi
-chroot $CLONE grub-install /dev/$DISK
-chroot $CLONE update-initramfs -u
-chroot $CLONE update-grub
-chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
-chroot $CLONE efibootmgr --verbose | grep debian
-
-# UMOUNT
-umount $CLONE/sys/firmware/efi/efivars
-umount $CLONE/dev/pts
-umount $CLONE/dev
-umount $CLONE/proc
-umount $CLONE/sys
-umount $CLONE/boot/efi
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/tc_clone_nuc_sda.sh b/tc_clone_nuc_sda.sh
deleted file mode 100755 (executable)
index 60de7f2..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/bash
-
-set -e
-
-OPTIND=1         # Reset in case getopts has been used previously in the shell.
-
-ROOT="/"
-FS_TYPE="ext4"
-
-DISK=sda
-ROOT_PART="sda1"
-VAR_PART="sda2"
-SWAP_PART="sda3"
-HOME_PART="sda4"
-
-while getopts m:i:p:r:s:d:f flag
-do
-    case "${flag}" in
-        m) MASTER=${OPTARG};;
-        i) ID=${OPTARG};;
-        f) FORMAT=true;;
-        r) ROOT=${OPTARG};;
-        s) SYNC=true;;
-        p) PARTITIONS=${OPTARG};;
-    esac
-done
-
-CLONE=/mnt/$ID
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-#umount /dev/$HOME_PART $$CLONE/home
-#umount /dev/$VAR_PART $CLONE/var
-#umount /dev/$ROOT_PART $CLONE
-
-if [ $PARTITIONS ]; then
-    sfdisk /dev/$DISK < $PARTITIONS
-fi
-
-if [ $FORMAT ]; then
-    mkfs.$FS_TYPE -q /dev/$ROOT_PART
-    mkfs.$FS_TYPE -q /dev/$VAR_PART
-    mkfs.$FS_TYPE -q  /dev/$HOME_PART
-    mkswap /dev/$SWAP_PART
-fi
-
-
-mount /dev/$ROOT_PART $CLONE
-
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
-  mkdir $DEST
-fi
-mount /dev/$VAR_PART $CLONE/var
-
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
-   mkdir $DEST
-fi
-mount /dev/$HOME_PART $CLONE/home
-
-if [ $SYNC ]; then
-    # CLONING
-    echo "rsyncing root..."
-    rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER:$ROOT/ $CLONE/
-
-    echo "rsyncing var..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
-
-    echo "rsyncing home..."
-    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
-fi
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo "RESUME=UUID=$uuid" >> $CLONE/etc/initramfs-tools/conf.d/resume
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount --bind /sys $CLONE/sys
-mount --bind /proc $CLONE/proc
-mount --bind /dev $CLONE/dev
-mount --bind /dev/pts $CLONE/dev/pts
-
-# GRUB
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-initramfs -u
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/dev/pts
-umount $CLONE/dev
-umount $CLONE/proc
-umount $CLONE/sys
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/tc_clone_nuc_sda_efi.sh b/tc_clone_nuc_sda_efi.sh
deleted file mode 100755 (executable)
index f666f83..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/bash
-
-set -e
-
-OPTIND=1         # Reset in case getopts has been used previously in the shell.
-
-ROOT="/"
-FS_TYPE="ext4"
-
-DISK=sda
-EFI_PART="sda1"
-ROOT_PART="sda2"
-VAR_PART="sda3"
-SWAP_PART="sda4"
-HOME_PART="sda5"
-
-while getopts m:i:p:r:s:d:f flag
-do
-    case "${flag}" in
-        m) MASTER=${OPTARG};;
-        i) ID=${OPTARG};;
-        f) FORMAT=true;;
-        r) ROOT=${OPTARG};;
-        s) SYNC=true;;
-        p) PARTITIONS=${OPTARG};;
-    esac
-done
-
-CLONE=/mnt/$ID
-
-# UMOUNT
-DIR=$CLONE/home
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/var
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/boot/efi
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-
-if [ $PARTITIONS ]; then
-    sfdisk /dev/$DISK < $PARTITIONS
-fi
-
-if [ $FORMAT ]; then
-    mkfs.vfat /dev/$EFI_PART
-    mkfs.$FS_TYPE -q /dev/$ROOT_PART
-    mkswap -q /dev/$SWAP_PART
-    mkfs.$FS_TYPE -q /dev/$VAR_PART
-    mkfs.$FS_TYPE -q  /dev/$HOME_PART
-fi
-
-
-mount /dev/$ROOT_PART $CLONE
-mkdir -p $CLONE/boot/efi
-mount  /dev/$EFI_PART $CLONE/boot/efi
-
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
-  mkdir $DEST
-fi
-mount /dev/$VAR_PART $CLONE/var
-
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
-   mkdir $DEST
-fi
-mount /dev/$HOME_PART $CLONE/home
-
-
-if [ $SYNC ]; then
-    # CLONING
-    echo "rsyncing root..."
-    rsync -a --delete --one-file-system $MASTER:$ROOT/ $CLONE/
-
-    echo "rsyncing efi..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
-
-    echo "rsyncing var..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
-
-    echo "rsyncing home..."
-    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" --exclude "monitor/*" $MASTER:$ROOT/home/ $CLONE/home/
-fi
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $EFI_PART`
-echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-swap_uuid=`get_uuid $SWAP_PART`
-echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
-
-echo $ID > $CLONE/etc/hostname
-echo $ID | cut -d "-" -f 2 > $CLONE/etc/tc-id
-
-# CHROOT
-mount --bind /sys $CLONE/sys
-mount --bind /proc $CLONE/proc
-mount --bind /dev $CLONE/dev
-mount --bind /dev/pts $CLONE/dev/pts
-
-# GRUB EFI
-mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
-chroot $CLONE apt install grub-efi
-chroot $CLONE grub-install /dev/$DISK
-chroot $CLONE update-initramfs -u
-chroot $CLONE update-grub
-chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
-chroot $CLONE efibootmgr --verbose | grep debian
-
-# UMOUNT
-umount $CLONE/sys/firmware/efi/efivars
-umount $CLONE/dev/pts
-umount $CLONE/dev
-umount $CLONE/proc
-umount $CLONE/sys
-umount $CLONE/boot/efi
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/tc_clone_nuc_sda_efi_dos.sh b/tc_clone_nuc_sda_efi_dos.sh
deleted file mode 100644 (file)
index 174199f..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/bash
-
-set -e
-
-OPTIND=1         # Reset in case getopts has been used previously in the shell.
-
-ROOT="/"
-FS_TYPE="ext4"
-
-DISK=sda
-EFI_PART="sda1"
-ROOT_PART="sda2"
-VAR_PART="sda5"
-SWAP_PART="sda3"
-HOME_PART="sda6"
-
-while getopts m:i:p:r:s:d:f flag
-do
-    case "${flag}" in
-        m) MASTER=${OPTARG};;
-        i) ID=${OPTARG};;
-        f) FORMAT=true;;
-        r) ROOT=${OPTARG};;
-        s) SYNC=true;;
-        p) PARTITIONS=${OPTARG};;
-    esac
-done
-
-CLONE=/mnt/$ID
-
-# UMOUNT
-DIR=$CLONE/home
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/var
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-DIR=$CLONE/boot/efi
-if [ -d $DIR ]; then
-    umount $DIR
-fi
-
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-
-if [ $PARTITIONS ]; then
-    sfdisk /dev/$DISK < $PARTITIONS
-fi
-
-if [ $FORMAT ]; then
-    mkfs.vfat /dev/$EFI_PART
-    mkfs.$FS_TYPE -q /dev/$ROOT_PART
-    mkswap /dev/$SWAP_PART
-    mkfs.$FS_TYPE -q /dev/$VAR_PART
-    mkfs.$FS_TYPE -q  /dev/$HOME_PART
-fi
-
-
-mount /dev/$ROOT_PART $CLONE
-mkdir -p $CLONE/boot/efi
-mount  /dev/$EFI_PART $CLONE/boot/efi
-
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
-  mkdir $DEST
-fi
-mount /dev/$VAR_PART $CLONE/var
-
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
-   mkdir $DEST
-fi
-mount /dev/$HOME_PART $CLONE/home
-
-
-if [ $SYNC ]; then
-    # CLONING
-    echo "rsyncing root..."
-    rsync -a --delete --one-file-system $MASTER:$ROOT/ $CLONE/
-
-    echo "rsyncing efi..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/boot/efi/ $CLONE/boot/efi/
-
-    echo "rsyncing var..."
-    rsync -a --one-file-system --delete $MASTER:$ROOT/var/ $CLONE/var/
-
-    echo "rsyncing home..."
-    rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" --exclude "edit/*" $MASTER:$ROOT/home/ $CLONE/home/
-fi
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $EFI_PART`
-echo "UUID=$uuid    /boot/efi    vfat    umask=0077    0       1" >> $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-swap_uuid=`get_uuid $SWAP_PART`
-echo "UUID=$swap_uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo "RESUME=UUID=$swap_uuid" > $CLONE/etc/initramfs-tools/conf.d/resume
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount --bind /sys $CLONE/sys
-mount --bind /proc $CLONE/proc
-mount --bind /dev $CLONE/dev
-mount --bind /dev/pts $CLONE/dev/pts
-
-# GRUB EFI
-mount -t efivarfs none $CLONE/sys/firmware/efi/efivars
-chroot $CLONE apt install grub-efi
-chroot $CLONE grub-install /dev/$DISK
-chroot $CLONE update-initramfs -u
-chroot $CLONE update-grub
-chroot $CLONE file /boot/efi/EFI/debian/grubx64.efi
-chroot $CLONE efibootmgr --verbose | grep debian
-
-# UMOUNT
-umount $CLONE/sys/firmware/efi/efivars
-umount $CLONE/dev/pts
-umount $CLONE/dev
-umount $CLONE/proc
-umount $CLONE/sys
-umount $CLONE/boot/efi
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER ! :)"
diff --git a/tc_clone_pxe.sh b/tc_clone_pxe.sh
deleted file mode 100755 (executable)
index 7b5e341..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MASTER=192.168.0.62
-MASTERPATH=/mnt/custom
-NAME=$1
-CLONE=/mnt/$NAME
-
-FS_TYPE="ext4"
-
-ROOT_PART="sda1"
-HOME_PART="sda2"
-VAR_PART="sda5"
-SWAP_PART="sda6"
-
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
-
-echo "rsyncing home..."
-mount /dev/$HOME_PART $CLONE/home
-rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
-umount $CLONE/home
-
-echo "rsyncing var..."
-mount /dev/$VAR_PART $CLONE/var
-rsync -a --delete --one-file-system $MASTER:$MASTERPATH/var/ $CLONE/var/
-
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $NAME > $CLONE/etc/hostname
-
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE/
-
-echo "Hello world, I'm a NEW TC-202 clone ! B-)"
-
-
diff --git a/tc_clone_pxe_local.sh b/tc_clone_pxe_local.sh
deleted file mode 100755 (executable)
index 0b72b87..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MASTERPATH=/mnt/custom
-NAME=$1
-CLONE=/mnt/$NAME
-
-FS_TYPE="ext4"
-
-ROOT_PART="sdb1"
-HOME_PART="sdb2"
-VAR_PART="sdb5"
-SWAP_PART="sdb6"
-
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --one-file-system $MASTERPATH/ $CLONE/
-
-echo "rsyncing home..."
-mount /dev/$HOME_PART $CLONE/home
-rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTERPATH/home/ $CLONE/home/
-umount $CLONE/home
-
-echo "rsyncing var..."
-mount /dev/$VAR_PART $CLONE/var
-rsync -a --delete --one-file-system $MASTERPATH/var/ $CLONE/var/
-
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $NAME > $CLONE/etc/hostname
-
-chroot $CLONE grub-install /dev/sdb
-chroot $CLONE update-grub
-
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE/
-
-echo "Hello world, I'm a NEW TC-202 clone ! B-)"
-
-
diff --git a/tc_clone_pxe_s10.sh b/tc_clone_pxe_s10.sh
deleted file mode 100755 (executable)
index 7b5e341..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MASTER=192.168.0.62
-MASTERPATH=/mnt/custom
-NAME=$1
-CLONE=/mnt/$NAME
-
-FS_TYPE="ext4"
-
-ROOT_PART="sda1"
-HOME_PART="sda2"
-VAR_PART="sda5"
-SWAP_PART="sda6"
-
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
-
-echo "rsyncing home..."
-mount /dev/$HOME_PART $CLONE/home
-rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
-umount $CLONE/home
-
-echo "rsyncing var..."
-mount /dev/$VAR_PART $CLONE/var
-rsync -a --delete --one-file-system $MASTER:$MASTERPATH/var/ $CLONE/var/
-
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $VAR_PART`
-echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $NAME > $CLONE/etc/hostname
-
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE/
-
-echo "Hello world, I'm a NEW TC-202 clone ! B-)"
-
-
diff --git a/tc_clone_update_pxe.sh b/tc_clone_update_pxe.sh
deleted file mode 100755 (executable)
index 036339b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MASTER=192.168.0.64
-MASTERPATH=/mnt/custom
-NAME=$1
-CLONE=/mnt/$NAME
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-# CLONING
-mount /dev/sda1 $CLONE
-echo "rsyncing root..."
-rsync -a --delete --one-file-system --exclude=/etc/fstab --exclude=/etc/hostname --exclude=/etc/hosts $MASTER:$MASTERPATH/ $CLONE/
-
-echo "rsyncing home..."
-mount /dev/sda2 $CLONE/home
-rsync -a --delete --exclude=telecaster/archives --exclude=telecaster/trash --exclude=telecaster/bin --exclude=home/telecaster/test --exclude=networkmanagement $MASTER:$MASTERPATH/home/ $CLONE/home/
-umount $CLONE/home
-
-echo "rsyncing var..."
-mount /dev/sda5 $CLONE/var
-rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE
-
-echo "OK, I'm an updated TC clone!"
-
diff --git a/tc_clone_update_pxe_s10.sh b/tc_clone_update_pxe_s10.sh
deleted file mode 100755 (executable)
index 8a96158..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MASTER=192.168.0.62
-MASTERPATH=/mnt/custom
-NAME=$1
-CLONE=/mnt/$NAME
-
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-mount /dev/sda1 $CLONE
-echo "rsyncing root..."
-rsync -a --delete --one-file-system --exclude=/etc/fstab --exclude=/etc/hostname --exclude=/etc/hosts $MASTER:$MASTERPATH/ $CLONE/
-
-echo "rsyncing home..."
-mount /dev/sda3 $CLONE/home
-rsync -a --exclude=telecaster/archives --exclude=telecaster/trash --exclude=telecaster/bin --exclude=telecaster/test $MASTER:$MASTERPATH/home/ $CLONE/home/
-umount $CLONE/home
-
-echo "rsyncing var..."
-rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-#umount $CLONE/var
-umount $CLONE
-
-echo "OK, I'm an updated TC (s10) clone!"
-
-
diff --git a/tc_clone_xps.sh b/tc_clone_xps.sh
deleted file mode 100755 (executable)
index 33252f7..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Please enter the MASTER_HOST address:"
-read MASTER_HOST
-
-echo "Please enter the MASTER_HOST path:"
-read MASTER_PATH
-
-echo "Please enter the target system ID:"
-read ID
-
-FS_TYPE="ext4"
-
-ROOT_PART="sda1"
-VAR_PART="sda5"
-SWAP_PART="sda3"
-HOME_PART="sda6"
-
-mkfs.$FS_TYPE /dev/$ROOT_PART
-mkfs.$FS_TYPE /dev/$VAR_PART
-mkfs.$FS_TYPE /dev/$HOME_PART
-mkswap /dev/$SWAP_PART
-
-CLONE=/mnt/$ID
-if [ ! -d $CLONE ]; then
- mkdir $CLONE
-fi
-
-# CLONING
-mount /dev/$ROOT_PART $CLONE
-echo "rsyncing root..."
-rsync -a --delete --exclude "/var/*" --exclude "/home/*" --one-file-system $MASTER_HOST:$MASTER_PATH/ $CLONE/
-
-echo "rsyncing var..."
-DEST=$CLONE/var
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-if [ ! $VAR_PART == $ROOT_PART ]; then
- mount /dev/$VAR_PART $CLONE/var
-fi
-rsync -a --one-file-system --delete $MASTER_HOST:$MASTER_PATH/var/ $CLONE/var/
-
-echo "rsyncing home..."
-DEST=$CLONE/home
-if [ ! -d $DEST ]; then
- mkdir $DEST
-fi
-mount /dev/$HOME_PART $DEST
-rsync -a --one-file-system --exclude "archives/*" --exclude "trash/*" --exclude "test/*" $MASTER_HOST:$MASTER_PATH/home/ $CLONE/home/
-umount $CLONE/home
-
-# FSTAB
-get_uuid () {
-disks=/dev/disk/by-uuid
-for id in `ls $disks`; do
- part=`readlink -f $disks/$id`
- if [ $part == /dev/$1 ]; then
-  echo $id
- fi
-done
-}
-
-uuid=`get_uuid $ROOT_PART`
-echo "UUID=$uuid    /    $FS_TYPE    defaults,errors=remount-ro    0       1" > $CLONE/etc/fstab
-if [ ! $VAR_PART == $ROOT_PART ]; then
- uuid=`get_uuid $VAR_PART`
- echo "UUID=$uuid    /var    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-fi
-uuid=`get_uuid $HOME_PART`
-echo "UUID=$uuid    /home    $FS_TYPE    defaults,errors=remount-ro    0       2" >> $CLONE/etc/fstab
-uuid=`get_uuid $SWAP_PART`
-echo "UUID=$uuid    none    swap    sw    0       0" >> $CLONE/etc/fstab
-
-echo $ID > $CLONE/etc/hostname
-
-# CHROOT
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-# GRUB
-chroot $CLONE grub-install /dev/sda
-chroot $CLONE update-grub
-
-# UMOUNT
-umount $CLONE/sys
-umount $CLONE/dev
-umount $CLONE/proc
-
-umount $CLONE/var
-umount $CLONE
-
-echo "Hello world, I'm $ID cloned from $MASTER_HOST ! :)"
diff --git a/tc_mount_master.sh b/tc_mount_master.sh
deleted file mode 100755 (executable)
index c3eb0f1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-set -e
-
-CLONE=/mnt/custom
-
-mount /dev/sda1 $CLONE
-mount /dev/sda2 $CLONE/var
-mount /dev/sda4 $CLONE/home
-
-df
-
-echo "OK, I'm the Master of the TC clones!"
diff --git a/tc_umount_master.sh b/tc_umount_master.sh
deleted file mode 100755 (executable)
index a102386..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-set -e
-
-CLONE=/mnt/custom
-
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-df
-
-