From 7feea11f6da3a2bf7ad6d4c3542381aea81a5770 Mon Sep 17 00:00:00 2001 From: simono41 Date: Mon, 16 Jul 2018 05:18:57 +0200 Subject: [PATCH 1/4] fix --- arch-install | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arch-install b/arch-install index 3e9f04c..6541f8f 100755 --- a/arch-install +++ b/arch-install @@ -60,7 +60,7 @@ function minimalinstallation() { cp /opt/${repo}/aurinstall.sh ${mountpoint}/usr/bin/aurinstaller chmod +x ${mountpoint}/usr/bin/aurinstaller - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then echo "${name}´s_PC-${version}" > ${mountpoint}/etc/hostname fi @@ -287,14 +287,14 @@ function installation { #boot echo "format" - if [ "y" != "noinstall" ] && [ "${skipbootpartition}" != "y" ]; then + if [ "y" != "${noinstall}" ] && [ "${skipbootpartition}" != "y" ]; then mkfs.vfat -F 32 ${device}${efipartitionnummer} fi #root if [ "${dateisystem}" == "btrfs" ]; then #mkfs.btrfs -f -L p_arch ${device}2 - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then btrfsformat #btrfs fi subvolume #btrfs @@ -302,12 +302,12 @@ function installation { elif [ "${dateisystem}" == "ext4" ]; then echo "confirm with y" if [ "${verschluesselung}" == "y" ]; then - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then mkfs.ext4 -L p_arch ${deviceluks} #ext4 fi mount ${deviceluks} ${mountpoint} else - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then mkfs.ext4 -L p_arch ${device}${rootpartitionnummer} #ext4 fi mount ${device}${rootpartitionnummer} ${mountpoint} @@ -317,14 +317,14 @@ function installation { fi #swap - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then if [ "${swap}" != "n" ]; then mkswap -L p_swap ${device}${swappartitionnummer} fi fi #installation - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then if [ "${offline}" != "n" ] then if [ -f /run/archiso/bootmnt/arch/$(uname -m)/airootfs.sfs ]; then @@ -443,7 +443,7 @@ function installation { fi #makeswapfile+fstab - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then if [ "${swapfile}" == "y" ]; then if [ "${dateisystem}" == "btrfs" ]; then makebtrfsswapfile @@ -453,18 +453,18 @@ function installation { fi fi - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then #hostname echo "${name}´s_PC-${version}" > ${mountpoint}/etc/hostname fi - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then if [ "${usbsecret}" == "y" ]; then usbsecret fi fi - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then if [ "${usbkey}" == "y" ]; then usbkeyinstallation fi @@ -675,7 +675,7 @@ function subvolume() { btrfsmount 1 # Create - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then mkdir -p /mnt/btrfs-root/__snapshot mkdir -p /mnt/btrfs-root/__current btrfs subvolume create /mnt/btrfs-root/__current/ROOT @@ -1116,7 +1116,7 @@ abfrage secureumount -if [ "y" == "debug" ] || [ "y" == "noinstall" ] +if [ "y" == "${debug}" ] || [ "y" == "${noinstall}" ] then echo "DEBEUG-MODUS" echo "If no more commands are required, simply press enter" @@ -1134,7 +1134,7 @@ fi # echo "A purge stops the chance of installing on the system." echo "It may take a while!" -if [ "y" != "noinstall" ]; then +if [ "y" != "${noinstall}" ]; then dd if=/dev/zero of=${device} bs=64M count=10 status=progress fi # @@ -1142,7 +1142,7 @@ if [ "${Partition}" == "uefi" ] then echo "Partitions with UEFI" - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then if [ "${skipbootpartition}" == "y" ] && [ "${swap}" != "n" ]; then partitioniereonepartitionmitswap elif [ "${skipbootpartition}" == "y" ]; then @@ -1180,7 +1180,7 @@ then echo "Finished" elif [ "${Partition}" == "bios" ]; then echo "Partitions with MBR" - if [ "y" != "noinstall" ]; then + if [ "y" != "${noinstall}" ]; then if [ "${skipbootpartition}" == "y" ] && [ "${swap}" != "n" ]; then partitioniereonepartitionmitswap elif [ "${skipbootpartition}" == "y" ]; then @@ -1225,7 +1225,7 @@ fi # benutzerwechsel -if [ "y" != "noinstall" ] && [ -z "${installationsfehler}" ]; then +if [ "y" != "${noinstall}" ] && [ -z "${installationsfehler}" ]; then #arch-chroot ${mountpoint} usermod -l "${name}" user1 #arch-chroot ${mountpoint} usermod -d /home/"${name}" -m "${name}" arch-chroot ${mountpoint} chfn -f "${name}" user1 From 05cd64ac6117d119eefde330f01d686f7ad3faba Mon Sep 17 00:00:00 2001 From: simono41 Date: Mon, 16 Jul 2018 21:47:06 +0200 Subject: [PATCH 2/4] ssh-optimierungen --- arch-graphical-install-auto | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/arch-graphical-install-auto b/arch-graphical-install-auto index f7dea52..edfe95e 100755 --- a/arch-graphical-install-auto +++ b/arch-graphical-install-auto @@ -198,15 +198,19 @@ function userrechte() { chown -cR -v "$username":users /home/"$username" chmod 750 -Rv /home/"$username" #ssh - if [ -d /home/"$username"/.ssh ]; then - chmod 700 /home/"$username"/.ssh + if ! [ -d /home/"$username"/.ssh ]; then + mkdir -p /home/"$username"/.ssh fi + chmod 700 /home/"$username"/.ssh + if [ -f /home/"$username"/.ssh/id_rsa ]; then chmod 600 /home/"$username"/.ssh/id_rsa fi - if [ -f /home/"$username"/.ssh/authorized_keys ]; then - chmod 600 /home/"$username"/.ssh/authorized_keys + + if ! [ -f /home/"$username"/.ssh/authorized_keys ]; then + touch /home/"$username"/.ssh/authorized_keys fi + chmod 600 /home/"$username"/.ssh/authorized_keys } @@ -214,15 +218,19 @@ function rootrechte() { #root chmod 750 -Rv /root #ssh-root - if [ -d /root/.ssh ]; then - chmod 700 /root/.ssh + if ! [ -d /root/.ssh ]; then + mkdir -p /root/.ssh fi + chmod 700 /root/.ssh + if [ -f /root/.ssh/id_rsa ]; then chmod 600 /root/.ssh/id_rsa fi - if [ -f /root/.ssh/authorized_key ]; then - chmod 600 /root/.ssh/authorized_keys + + if ! [ -f /root/.ssh/authorized_key ]; then + touch /root/.ssh/authorized_keys fi + chmod 600 /root/.ssh/authorized_keys } From 3928db4c77fd3885d062d50001d52c4eb35d0aca Mon Sep 17 00:00:00 2001 From: simono41 Date: Tue, 17 Jul 2018 14:36:23 +0200 Subject: [PATCH 3/4] fix --- arch-install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch-install b/arch-install index 6541f8f..5ed73fe 100755 --- a/arch-install +++ b/arch-install @@ -174,13 +174,15 @@ function partionierenohneswap() { } function partitioniereonepartition() { - sgdisk -d 3 ${device} + #sgdisk -d 3 ${device} + parted -s /dev/${device} rm 3 sgdisk -a 2048 -n 3:: -c 3:"Linux filesystem" -t 3:8300 ${device} formatencrypt } function partitioniereonepartitionmitswap() { - sgdisk -d 4 ${device} + #sgdisk -d 4 ${device} + parted -s /dev/${device} rm 4 sgdisk -a 2048 -n 4:: -c 4:"Linux filesystem" -t 4:8300 ${device} formatencrypt } From c40b6621c9590d73c5a4a3583eee648b5b6d538e Mon Sep 17 00:00:00 2001 From: simono41 Date: Tue, 17 Jul 2018 14:42:45 +0200 Subject: [PATCH 4/4] fix --- arch-install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch-install b/arch-install index 5ed73fe..f6a6843 100755 --- a/arch-install +++ b/arch-install @@ -174,15 +174,15 @@ function partionierenohneswap() { } function partitioniereonepartition() { - #sgdisk -d 3 ${device} - parted -s /dev/${device} rm 3 + sgdisk -d 3 ${device} + #parted -s ${device} rm 3 sgdisk -a 2048 -n 3:: -c 3:"Linux filesystem" -t 3:8300 ${device} formatencrypt } function partitioniereonepartitionmitswap() { - #sgdisk -d 4 ${device} - parted -s /dev/${device} rm 4 + sgdisk -d 4 ${device} + #parted -s ${device} rm 4 sgdisk -a 2048 -n 4:: -c 4:"Linux filesystem" -t 4:8300 ${device} formatencrypt } @@ -1136,7 +1136,7 @@ fi # echo "A purge stops the chance of installing on the system." echo "It may take a while!" -if [ "y" != "${noinstall}" ]; then +if [ "y" != "${noinstall}" ] && [ "${skipbootpartition}" != "y" ]; then dd if=/dev/zero of=${device} bs=64M count=10 status=progress fi #