final-fix
This commit is contained in:
parent
b6dd79629d
commit
0b538cc62f
1 changed files with 160 additions and 109 deletions
|
@ -181,13 +181,13 @@ if [ "${dateisystem}" == "btrfs" ]; then
|
||||||
|
|
||||||
elif [ "${dateisystem}" == "ext4" ]; then
|
elif [ "${dateisystem}" == "ext4" ]; then
|
||||||
echo "mit j bestätigen"
|
echo "mit j bestätigen"
|
||||||
if [ "${verschluesselung}" == "y" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
mkfs.ext4 -L p_arch ${deviceluks} #ext4
|
mkfs.ext4 -L p_arch ${deviceluks} #ext4
|
||||||
mount ${deviceluks} ${mountpoint}
|
mount ${deviceluks} ${mountpoint}
|
||||||
else
|
else
|
||||||
mkfs.ext4 -L p_arch ${device}${rootpartitionnummer} #ext4
|
mkfs.ext4 -L p_arch ${device}${rootpartitionnummer} #ext4
|
||||||
mount ${device}${rootpartitionnummer} ${mountpoint}
|
mount ${device}${rootpartitionnummer} ${mountpoint}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -255,12 +255,19 @@ if [ "${dateisystem}" == "btrfs" ]; then
|
||||||
btrfsfstab #btrfs
|
btrfsfstab #btrfs
|
||||||
|
|
||||||
mkdir -p ${mountpoint}/run/btrfs-root
|
mkdir -p ${mountpoint}/run/btrfs-root
|
||||||
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
|
echo "${deviceluks} /run/btrfs-root/ btrfs defaults 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
||||||
|
elif [ "${Partition}" == "mbr" ]; then
|
||||||
|
echo "${deviceluks} /run/btrfs-root/ btrfs defaults 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
||||||
|
fi
|
||||||
|
else
|
||||||
if [ "${Partition}" == "gpt" ]; then
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
echo "PARTUUID=${rootbind} /run/btrfs-root/ btrfs defaults 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
echo "PARTUUID=${rootbind} /run/btrfs-root/ btrfs defaults 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
||||||
elif [ "${Partition}" == "mbr" ]; then
|
elif [ "${Partition}" == "mbr" ]; then
|
||||||
echo "UUID=${rootbind} /run/btrfs-root/ btrfs defaults 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
echo "UUID=${rootbind} /run/btrfs-root/ btrfs defaults 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
#grep -v "/var/lib" < ${mountpoint}/etc/fstab > fstab.neu; mv fstab.neu ${mountpoint}/etc/fstab
|
#grep -v "/var/lib" < ${mountpoint}/etc/fstab > fstab.neu; mv fstab.neu ${mountpoint}/etc/fstab
|
||||||
|
|
||||||
echo "/run/btrfs-root/__current/ROOT/var/lib /var/lib none bind 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
echo "/run/btrfs-root/__current/ROOT/var/lib /var/lib none bind 0 0" >> ${mountpoint}/etc/fstab #btrfs
|
||||||
|
@ -268,11 +275,19 @@ if [ "${dateisystem}" == "btrfs" ]; then
|
||||||
cron
|
cron
|
||||||
|
|
||||||
elif [ "${dateisystem}" == "ext4" ]; then
|
elif [ "${dateisystem}" == "ext4" ]; then
|
||||||
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
|
echo "${deviceluks} / ext4 rw,defaults,noatime,nodiratime,discard 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
elif [ "${Partition}" == "mbr" ]; then
|
||||||
|
echo "${deviceluks} / ext4 rw,defaults,noatime,nodiratime,discard 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
fi
|
||||||
|
else
|
||||||
if [ "${Partition}" == "gpt" ]; then
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
echo "PARTUUID=${rootbind} / ext4 rw,defaults,noatime,nodiratime,discard 0 0" >> ${mountpoint}/etc/fstab
|
echo "PARTUUID=${rootbind} / ext4 rw,defaults,noatime,nodiratime,discard 0 0" >> ${mountpoint}/etc/fstab
|
||||||
elif [ "${Partition}" == "mbr" ]; then
|
elif [ "${Partition}" == "mbr" ]; then
|
||||||
echo "UUID=${rootbind} / ext4 rw,defaults,noatime,nodiratime,discard 0 0" >> ${mountpoint}/etc/fstab
|
echo "UUID=${rootbind} / ext4 rw,defaults,noatime,nodiratime,discard 0 0" >> ${mountpoint}/etc/fstab
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${Partition}" == "gpt" ]; then
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
|
@ -320,6 +335,7 @@ if [ "${verschluesselung}" == "y" ]; then
|
||||||
if [ "${boot}" == "grub" ]; then
|
if [ "${boot}" == "grub" ]; then
|
||||||
tobootdevice=$(blkid -s UUID -o value ${device}${rootpartitionnummer})
|
tobootdevice=$(blkid -s UUID -o value ${device}${rootpartitionnummer})
|
||||||
sed -i 's/GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX="cryptdevice=UUID='$tobootdevice':luks0"/' ${mountpoint}/etc/default/grub
|
sed -i 's/GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX="cryptdevice=UUID='$tobootdevice':luks0"/' ${mountpoint}/etc/default/grub
|
||||||
|
echo "GRUB_ENABLE_CRYPTODISK=y" >> ${mountpoint}/etc/default/grub
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -345,29 +361,29 @@ fi
|
||||||
|
|
||||||
function btrfsformat() {
|
function btrfsformat() {
|
||||||
if [ "$raid" == "raid0" ]; then
|
if [ "$raid" == "raid0" ]; then
|
||||||
if [ "${verschluesselung}" == "y" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
mkfs.btrfs -f -m raid10 -d raid10 ${deviceluks} ${device1}
|
mkfs.btrfs -f -m raid10 -d raid10 ${deviceluks} ${device1}
|
||||||
else
|
else
|
||||||
mkfs.btrfs -f -m raid0 -d raid0 ${device}${rootpartitionnummer} ${device1}
|
mkfs.btrfs -f -m raid0 -d raid0 ${device}${rootpartitionnummer} ${device1}
|
||||||
fi
|
fi
|
||||||
elif [ "$raid" == "raid1" ]; then
|
elif [ "$raid" == "raid1" ]; then
|
||||||
if [ "${verschluesselung}" == "y" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
mkfs.btrfs -f -m raid10 -d raid10 ${deviceluks} ${device1}
|
mkfs.btrfs -f -m raid10 -d raid10 ${deviceluks} ${device1}
|
||||||
else
|
else
|
||||||
mkfs.btrfs -f -m raid1 -d raid1 ${device}${rootpartitionnummer} ${device1}
|
mkfs.btrfs -f -m raid1 -d raid1 ${device}${rootpartitionnummer} ${device1}
|
||||||
fi
|
fi
|
||||||
elif [ "$raid" == "raid10" ]; then
|
elif [ "$raid" == "raid10" ]; then
|
||||||
if [ "${verschluesselung}" == "y" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
mkfs.btrfs -f -m raid10 -d raid10 ${deviceluks} ${device1}
|
mkfs.btrfs -f -m raid10 -d raid10 ${deviceluks} ${device1}
|
||||||
else
|
else
|
||||||
mkfs.btrfs -f -m raid10 -d raid10 ${device}${rootpartitionnummer} ${device1}
|
mkfs.btrfs -f -m raid10 -d raid10 ${device}${rootpartitionnummer} ${device1}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "${verschluesselung}" == "y" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
mkfs.btrfs -f -m single ${deviceluks}
|
mkfs.btrfs -f -m single ${deviceluks}
|
||||||
else
|
else
|
||||||
mkfs.btrfs -f -m single ${device}${rootpartitionnummer}
|
mkfs.btrfs -f -m single ${device}${rootpartitionnummer}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
btrfs filesystem show
|
btrfs filesystem show
|
||||||
|
|
||||||
|
@ -381,7 +397,41 @@ elif [ "${Partition}" == "mbr" ]; then
|
||||||
rootbind=$(blkid -s UUID -o value ${device}${rootpartitionnummer})
|
rootbind=$(blkid -s UUID -o value ${device}${rootpartitionnummer})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${Partition}" == "gpt" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
|
|
||||||
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
|
|
||||||
|
echo -e "${deviceluks} / btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
|
||||||
|
echo -e "${deviceluks} /home btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/home 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
echo -e "${deviceluks} /opt btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/opt 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
echo -e "${deviceluks} /var/cache/pacman/pkg btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/var/cache/pacman/pkg 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
|
||||||
|
# custom-mounts
|
||||||
|
for wort in ${mountsnaps}
|
||||||
|
do
|
||||||
|
echo -e "${deviceluks} ${wort} btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current${wort} 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
elif [ "${Partition}" == "mbr" ]; then
|
||||||
|
|
||||||
|
echo -e "UUID=${rootbind} / btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
|
||||||
|
echo -e "UUID=${rootbind} /home btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/home 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
echo -e "UUID=${rootbind} /opt btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/opt 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
echo -e "UUID=${rootbind} /var/cache/pacman/pkg btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/var/cache/pacman/pkg 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
|
||||||
|
# custom-mounts
|
||||||
|
for wort in ${mountsnaps}
|
||||||
|
do
|
||||||
|
echo -e "UUID=${rootbind} ${wort} btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current${wort} 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
|
|
||||||
echo -e "PARTUUID=${rootbind} / btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT 0 0" >> ${mountpoint}/etc/fstab
|
echo -e "PARTUUID=${rootbind} / btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
|
||||||
|
@ -396,7 +446,7 @@ if [ "${Partition}" == "gpt" ]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
elif [ "${Partition}" == "mbr" ]; then
|
elif [ "${Partition}" == "mbr" ]; then
|
||||||
|
|
||||||
echo -e "UUID=${rootbind} / btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT 0 0" >> ${mountpoint}/etc/fstab
|
echo -e "UUID=${rootbind} / btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT 0 0" >> ${mountpoint}/etc/fstab
|
||||||
|
|
||||||
|
@ -410,24 +460,25 @@ elif [ "${Partition}" == "mbr" ]; then
|
||||||
echo -e "UUID=${rootbind} ${wort} btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current${wort} 0 0" >> ${mountpoint}/etc/fstab
|
echo -e "UUID=${rootbind} ${wort} btrfs rw,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current${wort} 0 0" >> ${mountpoint}/etc/fstab
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function btrfsmount() {
|
function btrfsmount() {
|
||||||
#[[ -z "${device}" ]] && device=${2}
|
#[[ -z "${device}" ]] && device=${2}
|
||||||
|
|
||||||
if [ "${1}" == "1" ] || [ "${1}" == "" ]; then
|
if [ "${1}" == "1" ] || [ "${1}" == "" ]; then
|
||||||
if [ "${verschluesselung}" == "y" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
mkdir -p /mnt/btrfs-root
|
mkdir -p /mnt/btrfs-root
|
||||||
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo ${deviceluks} /mnt/btrfs-root
|
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo ${deviceluks} /mnt/btrfs-root
|
||||||
else
|
else
|
||||||
mkdir -p /mnt/btrfs-root
|
mkdir -p /mnt/btrfs-root
|
||||||
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo ${device}${rootpartitionnummer} /mnt/btrfs-root
|
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo ${device}${rootpartitionnummer} /mnt/btrfs-root
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "${1}" == "2" ] || [ "${1}" == "" ]; then
|
if [ "${1}" == "2" ] || [ "${1}" == "" ]; then
|
||||||
if [ "${verschluesselung}" == "y" ]; then
|
if [ "${verschluesselung}" == "y" ]; then
|
||||||
mkdir -p ${mountpoint}
|
mkdir -p ${mountpoint}
|
||||||
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT ${deviceluks} ${mountpoint}
|
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT ${deviceluks} ${mountpoint}
|
||||||
|
|
||||||
|
@ -447,7 +498,7 @@ if [ "${verschluesselung}" == "y" ]; then
|
||||||
|
|
||||||
mkdir -p ${mountpoint}/var/lib
|
mkdir -p ${mountpoint}/var/lib
|
||||||
mount --bind /mnt/btrfs-root/__current/ROOT/var/lib ${mountpoint}/var/lib
|
mount --bind /mnt/btrfs-root/__current/ROOT/var/lib ${mountpoint}/var/lib
|
||||||
else
|
else
|
||||||
mkdir -p ${mountpoint}
|
mkdir -p ${mountpoint}
|
||||||
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT ${device}${rootpartitionnummer} ${mountpoint}
|
mount -o defaults,noatime,nodiratime,space_cache,discard,ssd,compress=lzo,subvol=__current/ROOT ${device}${rootpartitionnummer} ${mountpoint}
|
||||||
|
|
||||||
|
@ -467,7 +518,7 @@ else
|
||||||
|
|
||||||
mkdir -p ${mountpoint}/var/lib
|
mkdir -p ${mountpoint}/var/lib
|
||||||
mount --bind /mnt/btrfs-root/__current/ROOT/var/lib ${mountpoint}/var/lib
|
mount --bind /mnt/btrfs-root/__current/ROOT/var/lib ${mountpoint}/var/lib
|
||||||
fi
|
fi
|
||||||
# boot mount
|
# boot mount
|
||||||
mkdir -p ${mountpoint}/boot
|
mkdir -p ${mountpoint}/boot
|
||||||
if [ "${Partition}" == "gpt" ]; then
|
if [ "${Partition}" == "gpt" ]; then
|
||||||
|
@ -822,16 +873,16 @@ secureumount
|
||||||
|
|
||||||
if [ "${name}" == "debug" ]
|
if [ "${name}" == "debug" ]
|
||||||
then
|
then
|
||||||
echo "DEBEUG-MODUS"
|
echo "DEBEUG-MODUS"
|
||||||
echo "Wenn kein befehl mehr ausgefuehrt werden muss einfach eingabetaste druecken"
|
echo "Wenn kein befehl mehr ausgefuehrt werden muss einfach eingabetaste druecken"
|
||||||
echo "Welcher befehl soll ausgefuert werden? "
|
echo "Welcher befehl soll ausgefuert werden? "
|
||||||
|
|
||||||
befehl=blablabla
|
befehl=blablabla
|
||||||
while [ "$befehl" != "" ]
|
while [ "$befehl" != "" ]
|
||||||
do
|
do
|
||||||
read -p "" befehl
|
read -p "" befehl
|
||||||
$befehl
|
$befehl
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -910,7 +961,7 @@ if [ "${dateisystem}" == "btrfs" ]; then
|
||||||
btrfs filesystem df ${mountpoint}
|
btrfs filesystem df ${mountpoint}
|
||||||
fi
|
fi
|
||||||
echo "umount!!!"
|
echo "umount!!!"
|
||||||
pause 5
|
sleep 5
|
||||||
secureumount
|
secureumount
|
||||||
echo ""
|
echo ""
|
||||||
echo "Fertig!!!"
|
echo "Fertig!!!"
|
||||||
|
|
Loading…
Reference in a new issue