Commit a155e49e authored by Marco Marinello's avatar Marco Marinello

Merge branch 'master' of gitlab.fuss.bz.it:fuss/fucc into buster

parents eec97107 bb58575e
Pipeline #57 passed with stages
in 29 minutes and 12 seconds
......@@ -14,6 +14,8 @@ stages:
rebuild-squashfs:
image: debian:buster
stage: clonezilla
only:
- tags
script:
- apt-get update -qy
- apt-get install -y build-essential debhelper libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev unzip wget squashfs-tools openssh-client
......@@ -33,6 +35,8 @@ rebuild-squashfs:
build-buster:
image: debian:buster
stage: packaging
only:
- tags
script:
- rm ../fuss-fucc* || true
- apt-get update -qy
......
CLONEZILLA_SOURCE="https://vorboss.dl.sourceforge.net/project/clonezilla/clonezilla_live_stable/2.6.2-15/clonezilla-live-2.6.2-15-i686.zip"
CLONEZILLA_SOURCE="https://downloads.sourceforge.net/project/clonezilla/clonezilla_live_stable/2.6.2-15/clonezilla-live-2.6.2-15-i686.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fclonezilla%2Ffiles%2Fclonezilla_live_stable%2F2.6.2-15%2Fclonezilla-live-2.6.2-15-i686.zip%2Fdownload%3Fuse_mirror%3Dnetix&ts=1568208151"
CLONEZILLA_SAVE_TO="../clonezilla-orig.zip"
......
......@@ -8,7 +8,7 @@
# Last modified 07 May 2019 --> added various stuff for experimental autojoin to a domain
# Last modified 21 June 2019 --> added various stuff for experimental join to a cluster
# Last modified 01 July 2019 --> added ssh to script and changed disk detection method
#
#
# PRT 1 ---------------------------
service ssh start
......@@ -41,7 +41,7 @@ getDisk(){
else
diskVar="$(echo $myDevice | tr -d [:blank:])"
fi
# SSD of HP g450 laptops
if [ $diskVar == "nvme0n1" ];then
rootPartition="p$rootPartition"
......@@ -56,6 +56,19 @@ mountPoint="/mnt"
computerList="/home/partimag/computerList.txt"
macAddress=$(getNetStuff 2)
if [ "$1" = "check" ]; then
myLine=$(grep $macAddress $computerList | tail -1)
hostname=$(echo $myLine | awk '{print $1}')
img=$(echo $myLine | awk '{print $3}')
join=$(echo $myLine | awk '{print $4}')
cluster=$(echo $myLine | awk '{print $5}')
if ! dialog --title "FUSS FUCC" --yesno "Hostname: $hostname \nMAC: $macAddress \nImage: $img \nJoin: $join \nCluster: $cluster \nContinue?" 13 70; then
grep -v $macAddress $computerList > ${computerList}.new
cp ${computerList}.new ${computerList}
rm ${computerList}.new
fi
fi
if ! grep $macAddress $computerList; then
dialog --title "FUSS FUCC" --msgbox "Hi,\nunfortunatley, there is no valid configuration to setup this computer. Please go through the next few steps to configure how to install this PC.\nPlease make sure that the file /home/clonezilla/computerList.txt is owned and writable by clonezilla, otherwise we'll not be able to save the informations you're going to enter." 13 70
hostname=$(dialog --title "FUSS FUCC" --inputbox "Please, pick an HOSTNAME for this PC" --output-fd 1 10 70)
......@@ -89,16 +102,16 @@ mount $rootDisk$rootPartition $mountPoint
currentName="$(cat $mountPoint/etc/hostname)"
newName="$(grep "$macAddress" $computerList | awk '{print $1}')"
echo "SETTING HOSTNAME"
echo "SETTING HOSTNAME"
for i in hostname hosts mailname
do
if [ -e $mountPoint/etc/$i ]; then
sed -ie "s/$currentName/$newName/g" $mountPoint/etc/$i
else
echo "The file $i is not present on this system"
fi
fi
done
......@@ -106,7 +119,7 @@ done
# ### Here I insert the part for the joining preparation of the machine
# Verify whether the machine has to be joined to the domain or not.
# If so the .ssh keys are needed and also a script .....
# If so the .ssh keys are needed and also a script .....
joinVar="$(cat $computerList | grep "$macAddress" | awk '{print $4}')"
......@@ -136,5 +149,3 @@ fi
reboot
# BEGIN ANSIBLE MANAGED (default)
DEFAULT menu.c32
MENU MASTER PASSWD myPassword
# END ANSIBLE MANAGED (default)
#timeout 15
label Clonezilla-unattended
MENU LABEL Clonezilla Automatico (Ramdisk)
MENU PASSWD myPassword
# Please remove the ssh key from .ssh/authorized_keys of the clonezilla
# user instead of using this line!
# MENU PASSWD myPassword
KERNEL clonezilla/live/vmlinuz
APPEND initrd=clonezilla/live/initrd.img boot=live username=clonezilla union=overlay config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts=NONE ocs_live_batch=no net.ifnames=0 nosplash noprompt keyboard-layouts=it locales=it_IT.UTF-8 ocs_prerun1="sshfs clonezilla@proxy:/srv/clonezilla /home/partimag -o IdentityFile=/home/clonezilla/.ssh/id_rsa -o StrictHostKeyChecking=no" ocs_prerun2="screen -S XY '/home/partimag/script' " fetch=tftp://proxy/clonezilla/live/filesystem.squashfs
label Clonezilla-confirm
MENU LABEL Clonezilla Automatico con conferma (Ramdisk)
# Please remove the ssh key from .ssh/authorized_keys of the clonezilla
# user instead of using this line!
# MENU PASSWD myPassword
KERNEL clonezilla/live/vmlinuz
APPEND initrd=clonezilla/live/initrd.img boot=live username=clonezilla union=overlay config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts=NONE ocs_live_batch=no net.ifnames=0 nosplash noprompt keyboard-layouts=it locales=it_IT.UTF-8 ocs_prerun1="sshfs clonezilla@proxy:/srv/clonezilla /home/partimag -o IdentityFile=/home/clonezilla/.ssh/id_rsa -o StrictHostKeyChecking=no" ocs_prerun2="screen -S XY '/home/partimag/script check' " fetch=tftp://proxy/clonezilla/live/filesystem.squashfs
label Clonezilla-Manuale
MENU LABEL Clonezilla Manuale (Ramdisk)
MENU PASSWD myPassword
# Please remove the ssh key from .ssh/authorized_keys of the clonezilla
# user instead of using this line!
# MENU PASSWD myPassword
KERNEL clonezilla/live/vmlinuz
APPEND initrd=clonezilla/live/initrd.img boot=live username=clonezilla union=overlay config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts=NONE ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch=no net.ifnames=0 nosplash noprompt keyboard-layouts=it locales=it_IT.UTF-8 ocs_repository="ssh://clonezilla@proxy/srv/clonezilla" fetch=tftp://proxy/clonezilla/live/filesystem.squashfs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment