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