Optimized upodate process

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-21 20:01:32 +02:00
parent 16d16387f2
commit d6bb5a2d18
2 changed files with 7 additions and 8 deletions

View File

@ -91,7 +91,7 @@ To pase the configuration to the program use this syntax:
#echo "n" # ├── If arch: Should a encrypted setup be used? (y/n) #echo "n" # ├── If arch: Should a encrypted setup be used? (y/n)
echo "n" # | Should the image download be forced?(y/n) echo "n" # | Should the image download be forced?(y/n)
echo "n" # | Should the image be transfered to $device_path?(y/n) echo "n" # | Should the image be transfered to $device_path?(y/n)
echo "n" # ├── Overwrite device before copying? (y/n) #echo "n" # ├── Overwrite device before copying? (y/n)
echo "n" # | Should the password be changed?(y/N) echo "n" # | Should the password be changed?(y/N)
#echo "test12345" # ├── The user password_1 #echo "test12345" # ├── The user password_1
#echo "test12345" # ├── The user password_2 #echo "test12345" # ├── The user password_2

View File

@ -342,7 +342,7 @@ if [ "$change_password" == "y" ]
echo '$password_1' echo '$password_1'
echo '$password_1' echo '$password_1'
) | passwd" ) | passwd"
) | chroot "$root_mount_path" /bin/bash || error "Password change failed." ) | chroot "$root_mount_path" /bin/bash || error
else else
error "Passwords didn't match." error "Passwords didn't match."
fi fi
@ -354,20 +354,22 @@ question "Should the hostname be changed?(y/N)" && read -r change_hostname
if [ "$change_hostname" == "y" ] if [ "$change_hostname" == "y" ]
then then
question "Type in the hostname:" && read -r hostname; question "Type in the hostname:" && read -r hostname;
echo "$hostname" > "$root_mount_path""etc/hostname" || error "Changing hostname failed." echo "$hostname" > "$root_mount_path""etc/hostname" || error
else else
info "Skipped hostname change..." info "Skipped hostname change..."
fi fi
question "Should the image system be updated?(y/N)" && read -r update_system question "Should the system be updated?(y/N)" && read -r update_system
if [ "$update_system" == "y" ] if [ "$update_system" == "y" ]
then then
info "Updating system..." &&
( (
echo "yes | pacman-key --init" echo "yes | pacman-key --init"
echo "yes | pacman-key --populate archlinuxarm" echo "yes | pacman-key --populate archlinuxarm"
echo "yes | pacman -Syyu" echo "yes | pacman -Syyu"
) | chroot "$root_mount_path" /bin/bash || error "Password change failed." ) | chroot "$root_mount_path" /bin/bash || error
fi fi
# question "Do you want to copy all Wifi passwords to the device?(y/n)" && read -r copy_wifi # question "Do you want to copy all Wifi passwords to the device?(y/n)" && read -r copy_wifi
# if [ "$copy_wifi" = "y" ] # if [ "$copy_wifi" = "y" ]
# then # then
@ -376,8 +378,5 @@ fi
# rsync -av "$origin_wifi_config_path" "$target_wifi_config_path" # rsync -av "$origin_wifi_config_path" "$target_wifi_config_path"
# fi # fi
info "The first level folder structure on $root_mount_path is:" && tree -laL 1 "$root_mount_path"
info "The first level folder structure on $boot_mount_path is:" && tree -laL 1 "$boot_mount_path"
destructor destructor
success "Setup successfull :)" && exit 0 success "Setup successfull :)" && exit 0