wip
This commit is contained in:
parent
6469d453d4
commit
388d1d2e87
1 changed files with 38 additions and 37 deletions
75
entry.sh
75
entry.sh
|
@ -5,20 +5,20 @@ function first_stage(){
|
||||||
set -e
|
set -e
|
||||||
echo foo first_stage
|
echo foo first_stage
|
||||||
|
|
||||||
echo -n "luks password: "
|
#echo -n "luks password: "
|
||||||
read -s luks_password_in
|
#read -s luks_password_in
|
||||||
export LUKS_PASSWORD=$luks_password_in
|
#export LUKS_PASSWORD=$luks_password_in
|
||||||
echo
|
#echo
|
||||||
|
|
||||||
echo -n "root password: "
|
echo -n "root password: "
|
||||||
read -s root_password_in
|
read -s root_password_in
|
||||||
export ROOT_PASSWORD=$root_password_in
|
export ROOT_PASSWORD=$root_password_in
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo -n "user password: "
|
#echo -n "user password: "
|
||||||
read -s user_password_in
|
#read -s user_password_in
|
||||||
export USER_PASSWORD=$user_password_in
|
#export USER_PASSWORD=$user_password_in
|
||||||
echo
|
#echo
|
||||||
|
|
||||||
lsblk -ftpo NAME,FSTYPE,LABEL,UUID,FSAVAIL,MOUNTPOINT
|
lsblk -ftpo NAME,FSTYPE,LABEL,UUID,FSAVAIL,MOUNTPOINT
|
||||||
select DEVICE in $(lsblk -frpno NAME); do
|
select DEVICE in $(lsblk -frpno NAME); do
|
||||||
|
@ -52,7 +52,7 @@ function first_stage(){
|
||||||
echo p
|
echo p
|
||||||
echo 1
|
echo 1
|
||||||
echo
|
echo
|
||||||
echo +2G
|
echo +1G
|
||||||
echo n
|
echo n
|
||||||
echo p
|
echo p
|
||||||
echo 2
|
echo 2
|
||||||
|
@ -64,14 +64,14 @@ function first_stage(){
|
||||||
echo mkfs.ext4 ${DEVICE}1
|
echo mkfs.ext4 ${DEVICE}1
|
||||||
yes | mkfs.ext4 ${DEVICE}1
|
yes | mkfs.ext4 ${DEVICE}1
|
||||||
|
|
||||||
(
|
#(
|
||||||
echo $LUKS_PASSWORD
|
#echo $LUKS_PASSWORD
|
||||||
echo $LUKS_PASSWORD
|
#echo $LUKS_PASSWORD
|
||||||
)| cryptsetup luksFormat ${DEVICE}2
|
#)| cryptsetup luksFormat ${DEVICE}2
|
||||||
echo $LUKS_PASSWORD | cryptsetup luksOpen ${DEVICE}2 cryptlvm
|
#echo $LUKS_PASSWORD | cryptsetup luksOpen ${DEVICE}2 cryptlvm
|
||||||
unset LUKS_PASSWORD
|
#unset LUKS_PASSWORD
|
||||||
pvcreate /dev/mapper/cryptlvm
|
pvcreate ${DEVICE}2
|
||||||
vgcreate vg0 /dev/mapper/cryptlvm
|
vgcreate vg0 ${DEVICE}2
|
||||||
|
|
||||||
export LVM_SIZE=$(dev_size /dev/mapper/cryptlvm)
|
export LVM_SIZE=$(dev_size /dev/mapper/cryptlvm)
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ function first_stage(){
|
||||||
|
|
||||||
genfstab -U $TARGET | tee $TARGET/etc/fstab
|
genfstab -U $TARGET | tee $TARGET/etc/fstab
|
||||||
UUID=$(lsblk -lpo NAME,UUID | grep ${DEVICE}2 | awk '{print $2}')
|
UUID=$(lsblk -lpo NAME,UUID | grep ${DEVICE}2 | awk '{print $2}')
|
||||||
echo cryptlvm UUID=${UUID} none luks > $TARGET/etc/crypttab
|
#echo cryptlvm UUID=${UUID} none luks > $TARGET/etc/crypttab
|
||||||
}
|
}
|
||||||
|
|
||||||
function second_stage(){
|
function second_stage(){
|
||||||
|
@ -112,29 +112,30 @@ function second_stage(){
|
||||||
echo -n > /etc/motd
|
echo -n > /etc/motd
|
||||||
sed -i 's/main/main contrib non-free/g' /etc/apt/sources.list
|
sed -i 's/main/main contrib non-free/g' /etc/apt/sources.list
|
||||||
apt update
|
apt update
|
||||||
apt install -y linux-image-amd64 grub2 cryptsetup btrfs-progs lvm2 firmware-iwlwifi locales tzdata keyboard-configuration console-common zsh intel-microcode
|
#apt install -y linux-image-amd64 grub2 cryptsetup btrfs-progs lvm2 firmware-iwlwifi locales tzdata keyboard-configuration console-common zsh intel-microcode
|
||||||
|
apt install -y linux-image-amd64 grub2 btrfs-progs lvm2 locales tzdata keyboard-configuration console-common intel-microcode
|
||||||
grub-install ${DEVICE}
|
grub-install ${DEVICE}
|
||||||
mkdir /snap
|
mkdir /snap
|
||||||
btrfs subvolume snapshot / /snap/$(date +%Y-%m-%d_basesystem)
|
btrfs subvolume snapshot / /snap/$(date +%Y-%m-%d_basesystem)
|
||||||
apt install -y task-mate-desktop mate-desktop-environment-extra
|
#apt install -y task-mate-desktop mate-desktop-environment-extra
|
||||||
(
|
#(
|
||||||
echo $USER_PASSWORD
|
#echo $USER_PASSWORD
|
||||||
echo $USER_PASSWORD
|
#echo $USER_PASSWORD
|
||||||
echo
|
#echo
|
||||||
echo
|
#echo
|
||||||
echo
|
#echo
|
||||||
echo
|
#echo
|
||||||
echo
|
#echo
|
||||||
) | adduser jedi
|
#) | adduser jedi
|
||||||
unset USER_PASSWORD
|
#unset USER_PASSWORD
|
||||||
|
|
||||||
HOME=/home/jedi
|
#HOME=/home/jedi
|
||||||
btrfs subvolume snapshot / /snap/$(date +%Y-%m-%d_user_gui)
|
#btrfs subvolume snapshot / /snap/$(date +%Y-%m-%d_user_gui)
|
||||||
apt install -y git virt-manager telegram-desktop firefox thunderbird geany vlc pidgin inkscape meld kicad blender
|
#apt install -y git virt-manager telegram-desktop firefox thunderbird geany vlc pidgin inkscape meld kicad blender
|
||||||
git clone git://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
|
#git clone git://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
|
||||||
chmod 0755 $HOME/.oh-my-zsh
|
#chmod 0755 $HOME/.oh-my-zsh
|
||||||
chown -R jedi:jedi $HOME
|
#chown -R jedi:jedi $HOME
|
||||||
chsh --shell /bin/zsh jedi
|
#chsh --shell /bin/zsh jedi
|
||||||
|
|
||||||
echo second_stage done
|
echo second_stage done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue