This commit is contained in:
j3d1 2020-02-06 11:47:08 +01:00
parent c81e420526
commit 713c8a8041

View file

@ -26,6 +26,8 @@ function first_stage(){
break
done
export DEVICE
apt install -y debootstrap cryptsetup btrfs-progs lvm2
if [ -d /dev/vg0 ]; then
@ -67,6 +69,7 @@ function first_stage(){
echo $LUKS_PASSWORD
)| cryptsetup luksFormat ${DEVICE}2
echo $LUKS_PASSWORD | cryptsetup luksOpen ${DEVICE}2 cryptlvm
unset LUKS_PASSWORD
pvcreate /dev/mapper/cryptlvm
vgcreate vg0 /dev/mapper/cryptlvm
@ -100,14 +103,16 @@ function first_stage(){
function second_stage(){
set -e
echo $TARGET
echo $LVM_SIZE
export DEBIAN_FRONTEND=noninteractive
(
echo $ROOT_PASSWORD
echo $ROOT_PASSWORD
) | passwd
unset ROOT_PASSWORD
echo -n > /etc/motd
apt install -y linux-image-amd64 grub2 cryptsetup btrfs-progs lvm2 locales tzdata keyboard-configuration console-common zsh
update_sources
apt install -y linux-image-amd64 grub2 cryptsetup btrfs-progs lvm2 firmware-iwlwifi locales tzdata keyboard-configuration console-common zsh
brub-install
mkdir /snap
btrfs subvolume snapshot / /snap/$(date +%Y-%m-%d_basesystem)
apt install -y task-mate-desktop mate-desktop-environment-extra
@ -120,6 +125,7 @@ function second_stage(){
echo
echo
) | adduser jedi
unset USER_PASSWORD
HOME=/home/jedi
btrfs subvolume snapshot / /snap/$(date +%Y-%m-%d_user_gui)
@ -139,3 +145,11 @@ function post_install_stage(){
umount -l $LINE;
done
}
function update_sources(){
if [ ! grep -Fxq "contrib" /etc/apt/sources.list ]
then
sed -i 's/main/main contrib non-free/g' /etc/apt/sources.list
apt update
fi
}