This commit is contained in:
simono41 2017-11-11 01:43:12 +01:00
parent 2acfbbac0b
commit 0dcc286422

View file

@ -17,6 +17,38 @@ function minimalinstallation() {
pacstrap -c -d -G -M ${mountpoint} $line pacstrap -c -d -G -M ${mountpoint} $line
done < /etc/packages_all.txt done < /etc/packages_all.txt
}
function secureumount() {
if [ "${dateisystem}" == "btrfs" ]; then
if cat /proc/mounts | grep ${mountpoint} > /dev/null; then
if [ "${Partition}" == "gpt" ]; then
umount ${mountpoint}/boot
fi
btrfs fi df ${mountpoint}
echo "umount!!!"
umount ${mountpoint}/home
umount ${mountpoint}/opt
umount ${mountpoint}/var/cache/pacman/pkg
umount ${mountpoint}/var/lib
# custom-mounts
for wort in ${mountsnaps}
do
umount ${mountpoint}${wort}
done
umount /mnt/btrfs-root
#umount -R /mnt
fi
elif [ "${dateisystem}" == "ext4" ]; then
if cat /proc/mounts | grep ${mountpoint} > /dev/null; then
if [ "${Partition}" == "gpt" ]; then
umount ${mountpoint}/boot
fi
umount ${mountpoint}
fi
fi
} }
function partionierenmitswap() { function partionierenmitswap() {
@ -605,52 +637,46 @@ function abfrage() {
if [ "${dateisystem}" == "btrfs" ]; then if [ "${dateisystem}" == "btrfs" ]; then
if [ "${Partition}" == "gpt" ]; then if [ "${Partition}" == "gpt" ]; then
bootpartitionnummer=1 bootpartitionnummer=1
echo "Boot-Partition = ${device}${bootpartitionnummer}"
efipartitionnummer=2 efipartitionnummer=2
echo "EFI-Partition = ${device}${efipartitionnummer}"
rootpartitionnummer=3 rootpartitionnummer=3
echo "ROOT-Partition = ${device}${rootpartitionnummer}"
if [ "${swap}" != "n" ]; then if [ "${swap}" != "n" ]; then
swappartitionnummer=4 swappartitionnummer=3
echo "Swap-Partition = ${device}${swappartitionnummer}" rootpartitionnummer=4
fi fi
elif [ "${Partition}" == "mbr" ]; then elif [ "${Partition}" == "mbr" ]; then
bootpartitionnummer=1 bootpartitionnummer=1
echo "Boot-Partition = ${device}${bootpartitionnummer}"
efipartitionnummer=2 efipartitionnummer=2
echo "EFI-Partition = ${device}${efipartitionnummer}"
rootpartitionnummer=3 rootpartitionnummer=3
echo "ROOT-Partition = ${device}${rootpartitionnummer}"
if [ "${swap}" != "n" ]; then if [ "${swap}" != "n" ]; then
swappartitionnummer=4 swappartitionnummer=3
echo "Swap-Partition = ${device}${swappartitionnummer}" rootpartitionnummer=4
fi fi
fi fi
elif [ "${dateisystem}" == "ext4" ]; then elif [ "${dateisystem}" == "ext4" ]; then
if [ "${Partition}" == "gpt" ]; then if [ "${Partition}" == "gpt" ]; then
bootpartitionnummer=1 bootpartitionnummer=1
echo "Boot-Partition = ${device}${bootpartitionnummer}"
efipartitionnummer=2 efipartitionnummer=2
echo "EFI-Partition = ${device}${efipartitionnummer}"
rootpartitionnummer=3 rootpartitionnummer=3
echo "ROOT-Partition = ${device}${rootpartitionnummer}"
if [ "${swap}" != "n" ]; then if [ "${swap}" != "n" ]; then
swappartitionnummer=4 swappartitionnummer=3
echo "Swap-Partition = ${device}${swappartitionnummer}" rootpartitionnummer=4
fi fi
elif [ "${Partition}" == "mbr" ]; then elif [ "${Partition}" == "mbr" ]; then
bootpartitionnummer=1 bootpartitionnummer=1
echo "Boot-Partition = ${device}${bootpartitionnummer}"
efipartitionnummer=2 efipartitionnummer=2
echo "EFI-Partition = ${device}${efipartitionnummer}"
rootpartitionnummer=3 rootpartitionnummer=3
echo "ROOT-Partition = ${device}${rootpartitionnummer}"
if [ "${swap}" != "n" ]; then if [ "${swap}" != "n" ]; then
swappartitionnummer=4 swappartitionnummer=3
rootpartitionnummer=4
fi
fi
fi
echo "Boot-Partition = ${device}${bootpartitionnummer}"
echo "EFI-Partition = ${device}${efipartitionnummer}"
echo "Swap-Partition = ${device}${swappartitionnummer}" echo "Swap-Partition = ${device}${swappartitionnummer}"
fi echo "ROOT-Partition = ${device}${rootpartitionnummer}"
fi
fi
# #
read -p "Sind alle Angaben Richtig?: [y/N] " sicherheitsabfrage read -p "Sind alle Angaben Richtig?: [y/N] " sicherheitsabfrage
@ -693,39 +719,12 @@ then
exit 0 exit 0
fi fi
fi fi
fi
# debug = Installation überspringen zu arch-graphical-install und DEBEUG-MODUS # debug = Installation überspringen zu arch-graphical-install und DEBEUG-MODUS
abfrage abfrage
if [ "${name}" != "debug" ]
then secureumount
#
if cat /proc/mounts | grep ${device}1 > /dev/null; then
echo "gemountet"
umount ${device}1
else
echo "nicht gemountet"
fi
#
if cat /proc/mounts | grep ${device}2 > /dev/null; then
echo "gemountet"
umount ${device}2
else
echo "nicht gemountet"
fi
#
if cat /proc/mounts | grep ${device}3 > /dev/null; then
echo "gemountet"
umount ${device}2
else
echo "nicht gemountet"
fi
#
if cat /proc/mounts | grep /mnt > /dev/null; then
echo "gemountet"
umount -R /mnt
else
echo "nicht gemountet"
fi fi
# #
@ -814,27 +813,10 @@ fi
echo "df!!!" echo "df!!!"
df -h ${mountpoint} df -h ${mountpoint}
if [ "${dateisystem}" == "btrfs" ]; then if [ "${dateisystem}" == "btrfs" ]; then
btrfs fi df ${mountpoint} btrfs filesystem df ${mountpoint}
fi
echo "umount!!!" echo "umount!!!"
umount ${mountpoint}/home secureumount
umount ${mountpoint}/opt
umount ${mountpoint}/var/cache/pacman/pkg
umount ${mountpoint}/var/lib
# custom-mounts
for wort in ${mountsnaps}
do
umount ${mountpoint}${wort}
done
if [ "${Partition}" == "gpt" ]; then
umount ${mountpoint}/boot
fi
umount /mnt/btrfs-root
#umount -R /mnt
else
umount ${mountpoint}
fi
echo "" echo ""
echo "Fertig!!!" echo "Fertig!!!"
read -p "Installation erfolgreich Abgeschlossen. Wollen sie den PC NEUSTARTEN?: [Y/n] " sicherheitsabfrage read -p "Installation erfolgreich Abgeschlossen. Wollen sie den PC NEUSTARTEN?: [Y/n] " sicherheitsabfrage