Deactivated code for manjaro

This commit is contained in:
Kevin Veen-Birkenbach 2021-12-14 17:15:46 +01:00
parent 8a4f9012e1
commit f711d7894f

View File

@ -233,8 +233,10 @@ if [ "$transfer_image" = "y" ]
info "Skipping image transfer..."
fi
info "Start regular mounting procedure..."
if mount | grep -q "$boot_partition_path"
if [ "$os" != "manjaro" ]
then
info "Start regular mounting procedure..."
if mount | grep -q "$boot_partition_path"
then
info "$boot_partition_path is allready mounted..."
else
@ -245,23 +247,23 @@ if mount | grep -q "$boot_partition_path"
decrypt_root
mount_partitions
fi
fi
fi
fstab_path="$root_mount_path""etc/fstab" &&
fstab_search_string=$(echo "/dev/mmcblk0p1"| sed -e 's/[\/&]/\\&/g') &&
fstab_replace_string=$(echo "UUID=$boot_partition_uuid"| sed -e 's/[\/&]/\\&/g') &&
info "Seeding UUID to $fstab_path to avoid path conflicts..." &&
sed -i "s/$fstab_search_string/$fstab_replace_string/g" "$fstab_path" &&
info "Content of $fstab_path:$(cat "$fstab_path")" || error
fstab_path="$root_mount_path""etc/fstab" &&
fstab_search_string=$(echo "/dev/mmcblk0p1"| sed -e 's/[\/&]/\\&/g') &&
fstab_replace_string=$(echo "UUID=$boot_partition_uuid"| sed -e 's/[\/&]/\\&/g') &&
info "Seeding UUID to $fstab_path to avoid path conflicts..." &&
sed -i "s/$fstab_search_string/$fstab_replace_string/g" "$fstab_path" &&
info "Content of $fstab_path:$(cat "$fstab_path")" || error
info "Define target paths..." &&
target_home_path="$root_mount_path""home/" &&
target_username=$(ls "$target_home_path") &&
target_user_home_folder_path="$target_home_path$target_username/" &&
target_user_ssh_folder_path="$target_user_home_folder_path"".ssh/" &&
target_authorized_keys="$target_user_ssh_folder_path""authorized_keys" &&
question "Should the ssh-key be copied to the image?(y/N)" && read -r copy_ssh_key || error
if [ "$copy_ssh_key" == "y" ]
info "Define target paths..." &&
target_home_path="$root_mount_path""home/" &&
target_username=$(ls "$target_home_path") &&
target_user_home_folder_path="$target_home_path$target_username/" &&
target_user_ssh_folder_path="$target_user_home_folder_path"".ssh/" &&
target_authorized_keys="$target_user_ssh_folder_path""authorized_keys" &&
question "Should the ssh-key be copied to the image?(y/N)" && read -r copy_ssh_key || error
if [ "$copy_ssh_key" == "y" ]
then
info "Copy ssh key to target..." &&
origin_user_rsa_pub="$origin_user_home"".ssh/id_rsa.pub" || error
@ -279,18 +281,18 @@ if [ "$copy_ssh_key" == "y" ]
fi
else
info "Skipped SSH-key copying.."
fi
fi
info "Start chroot procedures..."
info "Start chroot procedures..."
mount_chroot_binds
mount_chroot_binds
copy_qemu
copy_qemu
copy_resolve_conf
copy_resolve_conf
question "Should the password of the standart user \"$target_username\" be changed?(y/N)" && read -r change_password
if [ "$change_password" == "y" ]
question "Should the password of the standart user \"$target_username\" be changed?(y/N)" && read -r change_password
if [ "$change_password" == "y" ]
then
info "Changing passwords on target system..."
question "Type in new password: " && read -r password_1
@ -312,21 +314,21 @@ if [ "$change_password" == "y" ]
fi
else
info "Skipped password change..."
fi
fi
hostname_path="$root_mount_path""etc/hostname"
question "Should the hostname be changed?(y/N)" && read -r change_hostname
if [ "$change_hostname" == "y" ]
hostname_path="$root_mount_path""etc/hostname"
question "Should the hostname be changed?(y/N)" && read -r change_hostname
if [ "$change_hostname" == "y" ]
then
question "Type in the hostname:" && read -r target_hostname;
echo "$target_hostname" > "$hostname_path" || error
else
target_hostname=$(cat "$hostname_path")
info "Skipped hostname change..."
fi
info "Used hostname is: $target_hostname"
fi
info "Used hostname is: $target_hostname"
case "$os" in
case "$os" in
"arch"|"manjaro")
info "Populating keys..." &&
(
@ -334,10 +336,10 @@ case "$os" in
echo "yes | pacman-key --populate archlinuxarm"
) | chroot "$root_mount_path" /bin/bash || error
;;
esac
esac
question "Should the system be updated?(y/N)" && read -r update_system
if [ "$update_system" == "y" ]
question "Should the system be updated?(y/N)" && read -r update_system
if [ "$update_system" == "y" ]
then
info "Updating system..."
case "$os" in
@ -354,17 +356,17 @@ if [ "$update_system" == "y" ]
warning "System update for operation system \"$os\" is not supported yet. Skipped."
;;
esac
fi
fi
info "Installing software for filesystem $root_filesystem..."
if [ "$root_filesystem" == "btrfs" ]
info "Installing software for filesystem $root_filesystem..."
if [ "$root_filesystem" == "btrfs" ]
then
install "btrfs-progs"
else
info "Skipped."
fi
fi
if [ "$encrypt_system" == "y" ]
if [ "$encrypt_system" == "y" ]
then
# Adapted this instruction for setting up encrypted systems @see https://gist.github.com/gea0/4fc2be0cb7a74d0e7cc4322aed710d38
info "Setup encryption..." &&
@ -435,10 +437,10 @@ if [ "$encrypt_system" == "y" ]
sed -i "s/$cmdline_search_string/$cmdline_replace_string/g" "$cmdline_txt_path" &&
info "Content of $cmdline_txt_path:$(cat "$cmdline_txt_path")" || error
fi
fi
fi
question "Do you want to setup Wifi on the device?(y/N)" && read -r setup_wifi
if [ "$setup_wifi" = "y" ]
question "Do you want to setup Wifi on the device?(y/N)" && read -r setup_wifi
if [ "$setup_wifi" = "y" ]
then
question "Please type in the ssid:" && read -r ssid
question "Please type in the psk:" && read -r psk
@ -452,10 +454,10 @@ if [ "$setup_wifi" = "y" ]
warning "Wifi setting for operation system \"$os\" is not supported yet. Skipped."
;;
esac
fi
fi
info "Running system specific procedures..."
if [ "$os" = "retropie" ]
info "Running system specific procedures..."
if [ "$os" = "retropie" ]
then
question "Should the roms be copied to the system?(y/N)" && read -r copy_roms
if [ "$copy_roms" == "y" ]
@ -474,7 +476,7 @@ if [ "$os" = "retropie" ]
echo 'wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/install_gpi.sh" | bash'
) | chroot "$root_mount_path" /bin/bash || error
fi
fi
fi
destructor
success "Setup successfull :)" && exit 0