RR: Fix the new bs issues
This commit is contained in:
parent
fc546fbc23
commit
87ae8a7c37
@ -4,10 +4,10 @@ export LANG=en_US.UTF8
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
DISK="$(cat "/tmp/pika-installer-gtk4-target-auto.txt")"
|
S_DISK="$(cat "/tmp/pika-installer-gtk4-target-auto.txt")"
|
||||||
LOCALE="$(cat "/tmp/pika-installer-gtk4-lang.txt")"
|
S_LOCALE="$(cat "/tmp/pika-installer-gtk4-lang.txt")"
|
||||||
KEYBOARD="$(cat "/tmp/pika-installer-gtk4-keyboard.txt")"
|
S_KEYBOARD="$(cat "/tmp/pika-installer-gtk4-keyboard.txt")"
|
||||||
TIMEZONE="$(cat "/tmp/pika-installer-gtk4-timezone.txt")"
|
S_TIMEZONE="$(cat "/tmp/pika-installer-gtk4-timezone.txt")"
|
||||||
|
|
||||||
p3_size=$(echo "scale=2 ; $(cat /tmp/pika-installer-p3-size.txt) / 1024 / 1024" | bc | cut -f1 -d".")
|
p3_size=$(echo "scale=2 ; $(cat /tmp/pika-installer-p3-size.txt) / 1024 / 1024" | bc | cut -f1 -d".")
|
||||||
|
|
||||||
@ -15,83 +15,83 @@ touch "/tmp/pika-installer-gtk4-status-parting.txt"
|
|||||||
|
|
||||||
if [[ ! -f "/tmp/pika-installer-gtk4-target-automatic-luks.txt" ]]
|
if [[ ! -f "/tmp/pika-installer-gtk4-target-automatic-luks.txt" ]]
|
||||||
then
|
then
|
||||||
for part in $(sudo /usr/lib/pika/pika-installer-gtk4/scripts/partition-utility.sh get_partitions | grep ${DISK}); do
|
for part in $(sudo /usr/lib/pika/pika-installer-gtk4/scripts/partition-utility.sh get_partitions | grep ${S_DISK}); do
|
||||||
PARTITION="/dev/$part"
|
PARTITION="/dev/$part"
|
||||||
sudo swapoff $PARTITION || true
|
sudo swapoff $PARTITION || true
|
||||||
done
|
done
|
||||||
wipefs -af /dev/${DISK}
|
wipefs -af /dev/${S_DISK}
|
||||||
# Partition the drives
|
# Partition the drives
|
||||||
parted -s -a optimal /dev/${DISK} mklabel gpt \
|
parted -s -a optimal /dev/${S_DISK} mklabel gpt \
|
||||||
mkpart "linux-efi" 1MiB 513Mib \
|
mkpart "linux-efi" 1MiB 513Mib \
|
||||||
mkpart "linux-boot" 513Mib 1537Mib \
|
mkpart "linux-boot" 513Mib 1537Mib \
|
||||||
mkpart "linux-root" 1537Mib "$p3_size"Mib \
|
mkpart "linux-root" 1537Mib "$p3_size"Mib \
|
||||||
mkpart "linux-home" "$p3_size"Mib 100% \
|
mkpart "linux-home" "$p3_size"Mib 100% \
|
||||||
print
|
print
|
||||||
# add p to partition if it's nvme
|
# add p to partition if it's nvme
|
||||||
if echo ${DISK} | grep -i "nvme"
|
if echo ${S_DISK} | grep -i "nvme"
|
||||||
then
|
then
|
||||||
#
|
#
|
||||||
sleep 10
|
sleep 10
|
||||||
# Add filesystems
|
# Add filesystems
|
||||||
yes | mkfs -t vfat -F 32 /dev/${DISK}p1
|
yes | mkfs -t vfat -F 32 /dev/${S_DISK}p1
|
||||||
yes | mkfs -t ext4 /dev/${DISK}p2
|
yes | mkfs -t ext4 /dev/${S_DISK}p2
|
||||||
yes | mkfs.btrfs -f /dev/${DISK}p3
|
yes | mkfs.btrfs -f /dev/${S_DISK}p3
|
||||||
yes | mkfs.btrfs -f /dev/${DISK}p4
|
yes | mkfs.btrfs -f /dev/${S_DISK}p4
|
||||||
sleep 2
|
sleep 2
|
||||||
# Begin Mounting
|
# Begin Mounting
|
||||||
mkdir -p /media/pika-install-mount
|
mkdir -p /media/pika-install-mount
|
||||||
mount /dev/${DISK}p3 /media/pika-install-mount/
|
mount /dev/${S_DISK}p3 /media/pika-install-mount/
|
||||||
mkdir -p /media/pika-install-mount/home
|
mkdir -p /media/pika-install-mount/home
|
||||||
mount /dev/${DISK}p4 /media/pika-install-mount/home
|
mount /dev/${S_DISK}p4 /media/pika-install-mount/home
|
||||||
mkdir -p /media/pika-install-mount/boot
|
mkdir -p /media/pika-install-mount/boot
|
||||||
mount /dev/${DISK}p2 /media/pika-install-mount/boot
|
mount /dev/${S_DISK}p2 /media/pika-install-mount/boot
|
||||||
mkdir -p /media/pika-install-mount/boot/efi
|
mkdir -p /media/pika-install-mount/boot/efi
|
||||||
mount /dev/${DISK}p1 /media/pika-install-mount/boot/efi
|
mount /dev/${S_DISK}p1 /media/pika-install-mount/boot/efi
|
||||||
pikainstall -r /media/pika-install-mount/ -l ${LOCALE} -k ${KEYBOARD} -t ${TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
pikainstall -r /media/pika-install-mount/ -l ${S_LOCALE} -k ${S_KEYBOARD} -t ${S_TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
||||||
else
|
else
|
||||||
sleep 10
|
sleep 10
|
||||||
# Add filesystems
|
# Add filesystems
|
||||||
yes | mkfs -t vfat -F 32 /dev/${DISK}1
|
yes | mkfs -t vfat -F 32 /dev/${S_DISK}1
|
||||||
yes | mkfs -t ext4 /dev/${DISK}2
|
yes | mkfs -t ext4 /dev/${S_DISK}2
|
||||||
yes | mkfs.btrfs -f /dev/${DISK}3
|
yes | mkfs.btrfs -f /dev/${S_DISK}3
|
||||||
yes | mkfs.btrfs -f /dev/${DISK}4
|
yes | mkfs.btrfs -f /dev/${S_DISK}4
|
||||||
sleep 2
|
sleep 2
|
||||||
# Begin Mounting
|
# Begin Mounting
|
||||||
mkdir -p /media/pika-install-mount
|
mkdir -p /media/pika-install-mount
|
||||||
mount /dev/${DISK}3 /media/pika-install-mount/
|
mount /dev/${S_DISK}3 /media/pika-install-mount/
|
||||||
mkdir -p /media/pika-install-mount/home
|
mkdir -p /media/pika-install-mount/home
|
||||||
mount /dev/${DISK}4 /media/pika-install-mount/home
|
mount /dev/${S_DISK}4 /media/pika-install-mount/home
|
||||||
mkdir -p /media/pika-install-mount/boot
|
mkdir -p /media/pika-install-mount/boot
|
||||||
mount /dev/${DISK}2 /media/pika-install-mount/boot
|
mount /dev/${S_DISK}2 /media/pika-install-mount/boot
|
||||||
mkdir -p /media/pika-install-mount/boot/efi
|
mkdir -p /media/pika-install-mount/boot/efi
|
||||||
mount /dev/${DISK}1 /media/pika-install-mount/boot/efi
|
mount /dev/${S_DISK}1 /media/pika-install-mount/boot/efi
|
||||||
pikainstall -r /media/pika-install-mount/ -l ${LOCALE} -k ${KEYBOARD} -t ${TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
pikainstall -r /media/pika-install-mount/ -l ${S_LOCALE} -k ${S_KEYBOARD} -t ${S_TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LUKS_KEY="$(cat "/tmp/pika-installer-gtk4-target-automatic-luks.txt")"
|
S_LUKS_KEY="$(cat "/tmp/pika-installer-gtk4-target-automatic-luks.txt")"
|
||||||
for part in $(sudo /usr/lib/pika/pika-installer-gtk4/scripts/partition-utility.sh get_partitions | grep ${DISK}); do
|
for part in $(sudo /usr/lib/pika/pika-installer-gtk4/scripts/partition-utility.sh get_partitions | grep ${S_DISK}); do
|
||||||
PARTITION="/dev/$part"
|
PARTITION="/dev/$part"
|
||||||
sudo swapoff $PARTITION || true
|
sudo swapoff $PARTITION || true
|
||||||
done
|
done
|
||||||
wipefs -af /dev/${DISK}
|
wipefs -af /dev/${S_DISK}
|
||||||
# Partition the drives
|
# Partition the drives
|
||||||
parted -s -a optimal /dev/${DISK} mklabel gpt \
|
parted -s -a optimal /dev/${S_DISK} mklabel gpt \
|
||||||
mkpart "linux-efi" 1MiB 513Mib \
|
mkpart "linux-efi" 1MiB 513Mib \
|
||||||
mkpart "linux-boot" 513Mib 1537Mib \
|
mkpart "linux-boot" 513Mib 1537Mib \
|
||||||
mkpart "linux-root" 1537Mib "$p3_size"Mib \
|
mkpart "linux-root" 1537Mib "$p3_size"Mib \
|
||||||
mkpart "linux-home" "$p3_size"Mib 100% \
|
mkpart "linux-home" "$p3_size"Mib 100% \
|
||||||
print
|
print
|
||||||
# add p to partition if it's nvme
|
# add p to partition if it's nvme
|
||||||
if echo ${DISK} | grep -i "nvme"
|
if echo ${S_DISK} | grep -i "nvme"
|
||||||
then
|
then
|
||||||
sleep 10
|
sleep 10
|
||||||
# Add filesystems
|
# Add filesystems
|
||||||
yes | mkfs -t vfat -F 32 /dev/${DISK}p1
|
yes | mkfs -t vfat -F 32 /dev/${S_DISK}p1
|
||||||
yes | mkfs -t ext4 /dev/${DISK}p2
|
yes | mkfs -t ext4 /dev/${S_DISK}p2
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${DISK}p3
|
printf ${S_LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${S_DISK}p3
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${DISK}p4
|
printf ${S_LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${S_DISK}p4
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${DISK}p3 crypt_root
|
printf ${S_LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${S_DISK}p3 crypt_root
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${DISK}p4 crypt_home
|
printf ${S_LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${S_DISK}p4 crypt_home
|
||||||
yes | mkfs.btrfs -f /dev/mapper/crypt_root
|
yes | mkfs.btrfs -f /dev/mapper/crypt_root
|
||||||
yes | mkfs.btrfs -f /dev/mapper/crypt_home
|
yes | mkfs.btrfs -f /dev/mapper/crypt_home
|
||||||
sleep 2
|
sleep 2
|
||||||
@ -101,19 +101,19 @@ else
|
|||||||
mkdir -p /media/pika-install-mount/home
|
mkdir -p /media/pika-install-mount/home
|
||||||
mount /dev/mapper/crypt_home /media/pika-install-mount/home
|
mount /dev/mapper/crypt_home /media/pika-install-mount/home
|
||||||
mkdir -p /media/pika-install-mount/boot
|
mkdir -p /media/pika-install-mount/boot
|
||||||
mount /dev/${DISK}p2 /media/pika-install-mount/boot
|
mount /dev/${S_DISK}p2 /media/pika-install-mount/boot
|
||||||
mkdir -p /media/pika-install-mount/boot/efi
|
mkdir -p /media/pika-install-mount/boot/efi
|
||||||
mount /dev/${DISK}p1 /media/pika-install-mount/boot/efi
|
mount /dev/${S_DISK}p1 /media/pika-install-mount/boot/efi
|
||||||
pikainstall -r /media/pika-install-mount/ -c ${LUKS_KEY} -l ${LOCALE} -k ${KEYBOARD} -t ${TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
pikainstall -r /media/pika-install-mount/ -c ${S_LUKS_KEY} -l ${S_LOCALE} -k ${S_KEYBOARD} -t ${S_TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
||||||
else
|
else
|
||||||
sleep 10
|
sleep 10
|
||||||
# Add filesystems
|
# Add filesystems
|
||||||
yes | mkfs -t vfat -F 32 /dev/${DISK}1
|
yes | mkfs -t vfat -F 32 /dev/${S_DISK}1
|
||||||
yes | mkfs -t ext4 /dev/${DISK}2
|
yes | mkfs -t ext4 /dev/${S_DISK}2
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${DISK}3
|
printf ${S_LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${S_DISK}3
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${DISK}4
|
printf ${S_LUKS_KEY} | cryptsetup -q -v --type luks2 luksFormat /dev/${S_DISK}4
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${DISK}3 crypt_root
|
printf ${S_LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${S_DISK}3 crypt_root
|
||||||
printf ${LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${DISK}4 crypt_home
|
printf ${S_LUKS_KEY} | cryptsetup -q -v luksOpen /dev/${S_DISK}4 crypt_home
|
||||||
yes | mkfs.btrfs -f /dev/mapper/crypt_root
|
yes | mkfs.btrfs -f /dev/mapper/crypt_root
|
||||||
yes | mkfs.btrfs -f /dev/mapper/crypt_home
|
yes | mkfs.btrfs -f /dev/mapper/crypt_home
|
||||||
sleep 2
|
sleep 2
|
||||||
@ -123,9 +123,9 @@ else
|
|||||||
mkdir -p /media/pika-install-mount/home
|
mkdir -p /media/pika-install-mount/home
|
||||||
mount /dev/mapper/crypt_home /media/pika-install-mount/home
|
mount /dev/mapper/crypt_home /media/pika-install-mount/home
|
||||||
mkdir -p /media/pika-install-mount/boot
|
mkdir -p /media/pika-install-mount/boot
|
||||||
mount /dev/${DISK}2 /media/pika-install-mount/boot
|
mount /dev/${S_DISK}2 /media/pika-install-mount/boot
|
||||||
mkdir -p /media/pika-install-mount/boot/efi
|
mkdir -p /media/pika-install-mount/boot/efi
|
||||||
mount /dev/${DISK}1 /media/pika-install-mount/boot/efi
|
mount /dev/${S_DISK}1 /media/pika-install-mount/boot/efi
|
||||||
pikainstall -r /media/pika-install-mount/ -c ${LUKS_KEY} -l ${LOCALE} -k ${KEYBOARD} -t ${TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
pikainstall -r /media/pika-install-mount/ -c ${S_LUKS_KEY} -l ${S_LOCALE} -k ${S_KEYBOARD} -t ${S_TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
@ -6,12 +6,12 @@ exec &> >(tee /tmp/pika-installer-gtk4-log)
|
|||||||
|
|
||||||
if [[ -f /tmp/pika-installer-gtk4-target-manual.txt ]]
|
if [[ -f /tmp/pika-installer-gtk4-target-manual.txt ]]
|
||||||
then
|
then
|
||||||
sudo /usr/lib/pika/pika-installer-gtk4/scripts/manual-partition-install.sh
|
sudo /usr/lib/pika/pika-installer-gtk4/scripts/manual-partition-install.sh || touch /tmp/pika-installer-gtk4-fail.txt
|
||||||
else
|
else
|
||||||
if [[ -f /tmp/pika-installer-gtk4-target-auto.txt ]]
|
if [[ -f /tmp/pika-installer-gtk4-target-auto.txt ]]
|
||||||
then
|
then
|
||||||
sudo /usr/lib/pika/pika-installer-gtk4/scripts/automatic-partition-install.sh
|
sudo /usr/lib/pika/pika-installer-gtk4/scripts/automatic-partition-install.sh || touch /tmp/pika-installer-gtk4-fail.txt
|
||||||
else
|
else
|
||||||
echo "critical installer error" && exit 1 && touch /tmp/pika-installer-gtk4-fail.txt
|
echo "critical installer error" && touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -4,9 +4,9 @@ export LANG=en_US.UTF8
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
LOCALE="$(cat "/tmp/pika-installer-gtk4-lang.txt")"
|
S_LOCALE="$(cat "/tmp/pika-installer-gtk4-lang.txt")"
|
||||||
KEYBOARD="$(cat "/tmp/pika-installer-gtk4-keyboard.txt")"
|
S_KEYBOARD="$(cat "/tmp/pika-installer-gtk4-keyboard.txt")"
|
||||||
TIMEZONE="$(cat "/tmp/pika-installer-gtk4-timezone.txt")"
|
S_TIMEZONE="$(cat "/tmp/pika-installer-gtk4-timezone.txt")"
|
||||||
|
|
||||||
touch "/tmp/pika-installer-gtk4-status-parting.txt"
|
touch "/tmp/pika-installer-gtk4-status-parting.txt"
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ done
|
|||||||
|
|
||||||
if [[ ! -f "/tmp/pika-installer-gtk4-crypttab" ]]
|
if [[ ! -f "/tmp/pika-installer-gtk4-crypttab" ]]
|
||||||
then
|
then
|
||||||
pikainstall -r /media/pika-install-mount/ --manual 1 -l ${LOCALE} -k ${KEYBOARD} -t ${TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
pikainstall -r /media/pika-install-mount/ --manual 1 -l ${S_LOCALE} -k ${S_KEYBOARD} -t ${S_TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
||||||
else
|
else
|
||||||
pikainstall -r /media/pika-install-mount/ --manual 2 -l ${LOCALE} -k ${KEYBOARD} -t ${TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
pikainstall -r /media/pika-install-mount/ --manual 2 -l ${S_LOCALE} -k ${S_KEYBOARD} -t ${S_TIMEZONE} && touch /tmp/pika-installer-gtk4-successful.txt || touch /tmp/pika-installer-gtk4-fail.txt && exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -321,3 +321,10 @@ msgstr "Done"
|
|||||||
|
|
||||||
msgid "partitioning"
|
msgid "partitioning"
|
||||||
msgstr "Partitioning"
|
msgstr "Partitioning"
|
||||||
|
|
||||||
|
msgid "luks2_password_confirm"
|
||||||
|
msgstr "Confirm LUKS Password"
|
||||||
|
|
||||||
|
msgid "luks_not_match"
|
||||||
|
msgstr "The LUKS Passwords do not match!"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
@ -127,6 +127,15 @@ pub fn automatic_partitioning(
|
|||||||
.build();
|
.build();
|
||||||
partition_method_automatic_luks_error_label.add_css_class("small_error_text");
|
partition_method_automatic_luks_error_label.add_css_class("small_error_text");
|
||||||
|
|
||||||
|
let partition_method_automatic_luks_error2_label = gtk::Label::builder()
|
||||||
|
.label(gettext("luks_not_match"))
|
||||||
|
.halign(Align::Start)
|
||||||
|
.valign(Align::End)
|
||||||
|
.vexpand(true)
|
||||||
|
.visible(false)
|
||||||
|
.build();
|
||||||
|
partition_method_automatic_luks_error2_label.add_css_class("small_error_text");
|
||||||
|
|
||||||
let partition_method_automatic_luks_box = gtk::Box::builder()
|
let partition_method_automatic_luks_box = gtk::Box::builder()
|
||||||
.orientation(Orientation::Horizontal)
|
.orientation(Orientation::Horizontal)
|
||||||
.build();
|
.build();
|
||||||
@ -153,6 +162,21 @@ pub fn automatic_partitioning(
|
|||||||
.sensitive(false)
|
.sensitive(false)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
let partition_method_automatic_luks_password_confirm_entry = adw::PasswordEntryRow::builder()
|
||||||
|
.title(gettext("luks2_password_confirm"))
|
||||||
|
.hexpand(true)
|
||||||
|
.sensitive(true)
|
||||||
|
.visible(false)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
let _partition_method_automatic_luks_password = partition_method_automatic_luks_password_entry
|
||||||
|
.bind_property(
|
||||||
|
"sensitive",
|
||||||
|
&partition_method_automatic_luks_password_confirm_entry,
|
||||||
|
"visible",
|
||||||
|
)
|
||||||
|
.sync_create()
|
||||||
|
.build();
|
||||||
let partition_method_automatic_target_buffer = gtk::TextBuffer::builder().build();
|
let partition_method_automatic_target_buffer = gtk::TextBuffer::builder().build();
|
||||||
|
|
||||||
let partition_method_automatic_luks_buffer = gtk::TextBuffer::builder().build();
|
let partition_method_automatic_luks_buffer = gtk::TextBuffer::builder().build();
|
||||||
@ -207,59 +231,102 @@ pub fn automatic_partitioning(
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
partition_method_automatic_luks_checkbutton.connect_toggled(clone!(@weak partition_method_automatic_luks_checkbutton, @weak partition_method_automatic_luks_password_entry, @weak partition_method_automatic_disk_error_label, @weak partition_method_automatic_luks_error_label, @weak bottom_next_button, @weak partition_method_automatic_target_buffer, @weak partition_method_automatic_luks_buffer => move |_| {
|
partition_method_automatic_luks_checkbutton.connect_toggled(clone!(@weak partition_method_automatic_luks_error2_label,@weak partition_method_automatic_luks_checkbutton, @weak partition_method_automatic_luks_password_confirm_entry, @weak partition_method_automatic_luks_password_entry, @weak partition_method_automatic_disk_error_label, @weak partition_method_automatic_luks_error_label, @weak bottom_next_button, @weak partition_method_automatic_target_buffer, @weak partition_method_automatic_luks_buffer => move |_| {
|
||||||
if partition_method_automatic_luks_checkbutton.is_active() == true {
|
if partition_method_automatic_luks_checkbutton.is_active() == true {
|
||||||
partition_method_automatic_luks_password_entry.set_sensitive(true);
|
partition_method_automatic_luks_password_entry.set_sensitive(true);
|
||||||
|
if partition_method_automatic_luks_password_entry.text() != partition_method_automatic_luks_password_confirm_entry.text() {
|
||||||
|
partition_method_automatic_luks_error2_label.set_visible(true)
|
||||||
|
} else {
|
||||||
|
partition_method_automatic_luks_error2_label.set_visible(false)
|
||||||
|
}
|
||||||
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
|
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
|
||||||
partition_method_automatic_luks_error_label.set_visible(true);
|
partition_method_automatic_luks_error_label.set_visible(true);
|
||||||
bottom_next_button.set_sensitive(false);
|
bottom_next_button.set_sensitive(false);
|
||||||
} else {
|
} else {
|
||||||
partition_method_automatic_luks_error_label.set_visible(false);
|
partition_method_automatic_luks_error_label.set_visible(false);
|
||||||
if partition_method_automatic_disk_error_label.get_visible() {
|
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
|
||||||
//
|
bottom_next_button.set_sensitive(true);
|
||||||
} else {
|
} else {
|
||||||
bottom_next_button.set_sensitive(true);
|
bottom_next_button.set_sensitive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
partition_method_automatic_luks_password_entry.set_sensitive(false);
|
partition_method_automatic_luks_password_entry.set_sensitive(false);
|
||||||
partition_method_automatic_luks_error_label.set_visible(false);
|
partition_method_automatic_luks_error_label.set_visible(false);
|
||||||
if partition_method_automatic_disk_error_label.get_visible() {
|
partition_method_automatic_luks_error2_label.set_visible(false);
|
||||||
//
|
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
|
||||||
} else {
|
|
||||||
bottom_next_button.set_sensitive(true);
|
bottom_next_button.set_sensitive(true);
|
||||||
|
} else {
|
||||||
|
bottom_next_button.set_sensitive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
partition_method_automatic_luks_password_entry.connect_changed(clone!(@weak partition_method_automatic_luks_checkbutton, @weak partition_method_automatic_luks_password_entry, @weak partition_method_automatic_disk_error_label, @weak partition_method_automatic_luks_error_label, @weak bottom_next_button, @weak partition_method_automatic_luks_buffer => move |_| {
|
partition_method_automatic_luks_password_entry.connect_changed(clone!(@weak partition_method_automatic_luks_error2_label,@weak partition_method_automatic_luks_checkbutton, @weak partition_method_automatic_luks_password_confirm_entry, @weak partition_method_automatic_luks_password_entry, @weak partition_method_automatic_disk_error_label, @weak partition_method_automatic_luks_error_label, @weak bottom_next_button, @weak partition_method_automatic_target_buffer, @weak partition_method_automatic_luks_buffer => move |_| {
|
||||||
if partition_method_automatic_luks_checkbutton.is_active() == true {
|
if partition_method_automatic_luks_checkbutton.is_active() == true {
|
||||||
partition_method_automatic_luks_password_entry.set_sensitive(true);
|
partition_method_automatic_luks_password_entry.set_sensitive(true);
|
||||||
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
|
if partition_method_automatic_luks_password_entry.text() != partition_method_automatic_luks_password_confirm_entry.text() {
|
||||||
partition_method_automatic_luks_error_label.set_visible(true);
|
partition_method_automatic_luks_error2_label.set_visible(true)
|
||||||
bottom_next_button.set_sensitive(false);
|
|
||||||
} else {
|
|
||||||
partition_method_automatic_luks_error_label.set_visible(false);
|
|
||||||
if partition_method_automatic_disk_error_label.get_visible() {
|
|
||||||
//
|
|
||||||
} else {
|
} else {
|
||||||
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
|
partition_method_automatic_luks_error2_label.set_visible(false)
|
||||||
|
}
|
||||||
|
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
|
||||||
|
partition_method_automatic_luks_error_label.set_visible(true);
|
||||||
|
bottom_next_button.set_sensitive(false);
|
||||||
|
} else {
|
||||||
|
partition_method_automatic_luks_error_label.set_visible(false);
|
||||||
|
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
|
||||||
bottom_next_button.set_sensitive(true);
|
bottom_next_button.set_sensitive(true);
|
||||||
|
} else {
|
||||||
|
bottom_next_button.set_sensitive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
partition_method_automatic_luks_password_entry.set_sensitive(false);
|
||||||
|
partition_method_automatic_luks_error_label.set_visible(false);
|
||||||
|
partition_method_automatic_luks_error2_label.set_visible(false);
|
||||||
|
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
|
||||||
|
bottom_next_button.set_sensitive(true);
|
||||||
|
} else {
|
||||||
|
bottom_next_button.set_sensitive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}));
|
||||||
partition_method_automatic_luks_password_entry.set_sensitive(false);
|
|
||||||
partition_method_automatic_luks_error_label.set_visible(false);
|
partition_method_automatic_luks_password_confirm_entry.connect_changed(clone!(@weak partition_method_automatic_luks_error2_label,@weak partition_method_automatic_luks_checkbutton, @weak partition_method_automatic_luks_password_confirm_entry, @weak partition_method_automatic_luks_password_entry, @weak partition_method_automatic_disk_error_label, @weak partition_method_automatic_luks_error_label, @weak bottom_next_button, @weak partition_method_automatic_target_buffer, @weak partition_method_automatic_luks_buffer => move |_| {
|
||||||
if partition_method_automatic_disk_error_label.get_visible() {
|
if partition_method_automatic_luks_checkbutton.is_active() == true {
|
||||||
//
|
partition_method_automatic_luks_password_entry.set_sensitive(true);
|
||||||
|
if partition_method_automatic_luks_password_entry.text() != partition_method_automatic_luks_password_confirm_entry.text() {
|
||||||
|
partition_method_automatic_luks_error2_label.set_visible(true)
|
||||||
|
} else {
|
||||||
|
partition_method_automatic_luks_error2_label.set_visible(false)
|
||||||
|
}
|
||||||
|
if partition_method_automatic_luks_password_entry.text().to_string().is_empty() {
|
||||||
|
partition_method_automatic_luks_error_label.set_visible(true);
|
||||||
|
bottom_next_button.set_sensitive(false);
|
||||||
|
} else {
|
||||||
|
partition_method_automatic_luks_error_label.set_visible(false);
|
||||||
|
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
|
||||||
|
bottom_next_button.set_sensitive(true);
|
||||||
|
} else {
|
||||||
|
bottom_next_button.set_sensitive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
partition_method_automatic_luks_buffer.set_text(&partition_method_automatic_luks_password_entry.text().to_string());
|
partition_method_automatic_luks_password_entry.set_sensitive(false);
|
||||||
bottom_next_button.set_sensitive(true);
|
partition_method_automatic_luks_error_label.set_visible(false);
|
||||||
|
partition_method_automatic_luks_error2_label.set_visible(false);
|
||||||
|
if !partition_method_automatic_disk_error_label.get_visible() && !partition_method_automatic_luks_error_label.get_visible() && !partition_method_automatic_luks_error2_label.get_visible() {
|
||||||
|
bottom_next_button.set_sensitive(true);
|
||||||
|
} else {
|
||||||
|
bottom_next_button.set_sensitive(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
partition_method_automatic_luks_listbox.append(&partition_method_automatic_luks_password_entry);
|
partition_method_automatic_luks_listbox.append(&partition_method_automatic_luks_password_entry);
|
||||||
|
partition_method_automatic_luks_listbox
|
||||||
|
.append(&partition_method_automatic_luks_password_confirm_entry);
|
||||||
partition_method_automatic_luks_box.append(&partition_method_automatic_luks_checkbutton);
|
partition_method_automatic_luks_box.append(&partition_method_automatic_luks_checkbutton);
|
||||||
partition_method_automatic_luks_box.append(&partition_method_automatic_luks_listbox);
|
partition_method_automatic_luks_box.append(&partition_method_automatic_luks_listbox);
|
||||||
partition_method_automatic_header_box.append(&partition_method_automatic_header_text);
|
partition_method_automatic_header_box.append(&partition_method_automatic_header_text);
|
||||||
@ -270,6 +337,7 @@ pub fn automatic_partitioning(
|
|||||||
partition_method_automatic_main_box.append(&devices_selection_expander_row_viewport_listbox);
|
partition_method_automatic_main_box.append(&devices_selection_expander_row_viewport_listbox);
|
||||||
partition_method_automatic_main_box.append(&partition_method_automatic_luks_box);
|
partition_method_automatic_main_box.append(&partition_method_automatic_luks_box);
|
||||||
partition_method_automatic_main_box.append(&partition_method_automatic_luks_error_label);
|
partition_method_automatic_main_box.append(&partition_method_automatic_luks_error_label);
|
||||||
|
partition_method_automatic_main_box.append(&partition_method_automatic_luks_error2_label);
|
||||||
partition_method_automatic_main_box.append(&partition_method_automatic_disk_error_label);
|
partition_method_automatic_main_box.append(&partition_method_automatic_disk_error_label);
|
||||||
|
|
||||||
partitioning_stack.add_titled(
|
partitioning_stack.add_titled(
|
||||||
|
@ -6,7 +6,7 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
@ -128,7 +128,11 @@ pub fn build_ui(app: &adw::Application) {
|
|||||||
partitioning_page(&done_main_box, &install_main_box, &content_stack, &window);
|
partitioning_page(&done_main_box, &install_main_box, &content_stack, &window);
|
||||||
|
|
||||||
//// Add the install_main_box as page: install_page, Give it nice title
|
//// Add the install_main_box as page: install_page, Give it nice title
|
||||||
content_stack.add_titled(&install_main_box, Some("install_page"), &gettext("installation"));
|
content_stack.add_titled(
|
||||||
|
&install_main_box,
|
||||||
|
Some("install_page"),
|
||||||
|
&gettext("installation"),
|
||||||
|
);
|
||||||
|
|
||||||
// Add done_page.rs as a page for content_stack
|
// Add done_page.rs as a page for content_stack
|
||||||
content_stack.add_titled(&done_main_box, Some("done_page"), &gettext("done"));
|
content_stack.add_titled(&done_main_box, Some("done_page"), &gettext("done"));
|
||||||
|
@ -6,16 +6,13 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use crate::config::{DISTRO_ICON};
|
use crate::config::DISTRO_ICON;
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
pub fn done_page(
|
pub fn done_page(done_main_box: >k::Box, window: &adw::ApplicationWindow) {
|
||||||
done_main_box: >k::Box,
|
|
||||||
window: &adw::ApplicationWindow,
|
|
||||||
) {
|
|
||||||
// the header box for the installation_successful page
|
// the header box for the installation_successful page
|
||||||
let done_header_box = gtk::Box::builder()
|
let done_header_box = gtk::Box::builder()
|
||||||
.orientation(Orientation::Horizontal)
|
.orientation(Orientation::Horizontal)
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
use std::{
|
use std::{cell::RefCell, rc::Rc, sync::OnceLock};
|
||||||
cell::{RefCell},
|
|
||||||
rc::Rc,
|
|
||||||
sync::OnceLock,
|
|
||||||
};
|
|
||||||
|
|
||||||
use adw::{prelude::*, subclass::prelude::*, *};
|
use adw::{prelude::*, subclass::prelude::*, *};
|
||||||
use glib::{clone, subclass::Signal, Properties};
|
use glib::{clone, subclass::Signal, Properties};
|
||||||
use gtk::{glib, Orientation::Horizontal};
|
use gtk::{glib, Orientation::Horizontal};
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
// ANCHOR: custom_button
|
// ANCHOR: custom_button
|
||||||
// Object holding the state
|
// Object holding the state
|
||||||
|
@ -6,7 +6,7 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
pub fn efi_error_page(window: &adw::ApplicationWindow, content_stack: >k::Stack) {
|
pub fn efi_error_page(window: &adw::ApplicationWindow, content_stack: >k::Stack) {
|
||||||
// the header box for the efi_error page
|
// the header box for the efi_error page
|
||||||
|
@ -6,7 +6,7 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
pub fn eula_page(content_stack: >k::Stack) {
|
pub fn eula_page(content_stack: >k::Stack) {
|
||||||
// create the bottom box for next and back buttons
|
// create the bottom box for next and back buttons
|
||||||
|
@ -10,7 +10,7 @@ use gtk::*;
|
|||||||
use vte::prelude::*;
|
use vte::prelude::*;
|
||||||
use vte::*;
|
use vte::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use crate::done_page::done_page;
|
use crate::done_page::done_page;
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ use std::path::Path;
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use crate::manual_partitioning::DriveMount;
|
use crate::manual_partitioning::DriveMount;
|
||||||
use serde::*;
|
|
||||||
use duct::*;
|
use duct::*;
|
||||||
|
use serde::*;
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Eq, Hash, Clone, Serialize, Deserialize)]
|
#[derive(PartialEq, Debug, Eq, Hash, Clone, Serialize, Deserialize)]
|
||||||
struct CrypttabEntry {
|
struct CrypttabEntry {
|
||||||
@ -40,7 +40,9 @@ pub fn install_page(
|
|||||||
let mut _iter_count = 0;
|
let mut _iter_count = 0;
|
||||||
_iter_count = 0;
|
_iter_count = 0;
|
||||||
let mut unlocked_array: Vec<String> = Default::default();
|
let mut unlocked_array: Vec<String> = Default::default();
|
||||||
manual_drive_mount_array.borrow_mut().sort_by_key(|p| p.clone().mountpoint);
|
manual_drive_mount_array
|
||||||
|
.borrow_mut()
|
||||||
|
.sort_by_key(|p| p.clone().mountpoint);
|
||||||
for partitions in manual_drive_mount_array.borrow_mut().iter() {
|
for partitions in manual_drive_mount_array.borrow_mut().iter() {
|
||||||
let new_crypt = if partitions.mountpoint != "/"
|
let new_crypt = if partitions.mountpoint != "/"
|
||||||
&& !unlocked_array.contains(&partitions.partition)
|
&& !unlocked_array.contains(&partitions.partition)
|
||||||
@ -78,8 +80,7 @@ pub fn install_page(
|
|||||||
)
|
)
|
||||||
.build();
|
.build();
|
||||||
crypttab_dialog.add_response("crypttab_dialog_boot", &gettext("unlock_boot_manually"));
|
crypttab_dialog.add_response("crypttab_dialog_boot", &gettext("unlock_boot_manually"));
|
||||||
crypttab_dialog
|
crypttab_dialog.add_response("crypttab_dialog_auto", &gettext("unlock_boot_manual"));
|
||||||
.add_response("crypttab_dialog_auto", &gettext("unlock_boot_manual"));
|
|
||||||
crypttab_dialog.set_response_enabled("crypttab_dialog_auto", false);
|
crypttab_dialog.set_response_enabled("crypttab_dialog_auto", false);
|
||||||
crypttab_password.connect_apply(clone!(@weak crypttab_password, @strong partitions, @weak crypttab_dialog => move |_| {
|
crypttab_password.connect_apply(clone!(@weak crypttab_password, @strong partitions, @weak crypttab_dialog => move |_| {
|
||||||
let (luks_manual_password_sender, luks_manual_password_receiver) = async_channel::unbounded();
|
let (luks_manual_password_sender, luks_manual_password_receiver) = async_channel::unbounded();
|
||||||
@ -269,14 +270,15 @@ pub fn install_page(
|
|||||||
"/dev/".to_owned()
|
"/dev/".to_owned()
|
||||||
+ &partitions.partition
|
+ &partitions.partition
|
||||||
+ &gettext("mounted_on_detail")
|
+ &gettext("mounted_on_detail")
|
||||||
+ &partitions.mountpoint
|
+ &partitions.mountpoint,
|
||||||
)
|
)
|
||||||
.build();
|
.build();
|
||||||
install_confirm_details_boxed_list.append(&confirm_row);
|
install_confirm_details_boxed_list.append(&confirm_row);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let install_confirm_detail_target =
|
let install_confirm_detail_target = adw::ActionRow::builder()
|
||||||
adw::ActionRow::builder().title(gettext("install_target_detail")).build();
|
.title(gettext("install_target_detail"))
|
||||||
|
.build();
|
||||||
install_confirm_detail_target.set_subtitle(
|
install_confirm_detail_target.set_subtitle(
|
||||||
&fs::read_to_string("/tmp/pika-installer-gtk4-target-auto.txt")
|
&fs::read_to_string("/tmp/pika-installer-gtk4-target-auto.txt")
|
||||||
.expect("Unable to read file"),
|
.expect("Unable to read file"),
|
||||||
@ -338,7 +340,8 @@ pub fn install_page(
|
|||||||
} else {
|
} else {
|
||||||
_p1_row_text =
|
_p1_row_text =
|
||||||
"512 MB ".to_owned() + target_block_device + "1" + " as fat32" + " on /boot/efi";
|
"512 MB ".to_owned() + target_block_device + "1" + " as fat32" + " on /boot/efi";
|
||||||
_p2_row_text = "1 GB ".to_owned() + target_block_device + "2" + " as ext4" + " on /boot";
|
_p2_row_text =
|
||||||
|
"1 GB ".to_owned() + target_block_device + "2" + " as ext4" + " on /boot";
|
||||||
_p3_row_text = pretty_bytes::converter::convert(_target_p3_size)
|
_p3_row_text = pretty_bytes::converter::convert(_target_p3_size)
|
||||||
+ " "
|
+ " "
|
||||||
+ target_block_device
|
+ target_block_device
|
||||||
@ -352,10 +355,18 @@ pub fn install_page(
|
|||||||
+ " as btrfs"
|
+ " as btrfs"
|
||||||
+ " on /home";
|
+ " on /home";
|
||||||
}
|
}
|
||||||
let install_confirm_p1 = adw::ActionRow::builder().title(_p1_row_text.clone()).build();
|
let install_confirm_p1 = adw::ActionRow::builder()
|
||||||
let install_confirm_p2 = adw::ActionRow::builder().title(_p2_row_text.clone()).build();
|
.title(_p1_row_text.clone())
|
||||||
let install_confirm_p3 = adw::ActionRow::builder().title(_p3_row_text.clone()).build();
|
.build();
|
||||||
let install_confirm_p4 = adw::ActionRow::builder().title(_p4_row_text.clone()).build();
|
let install_confirm_p2 = adw::ActionRow::builder()
|
||||||
|
.title(_p2_row_text.clone())
|
||||||
|
.build();
|
||||||
|
let install_confirm_p3 = adw::ActionRow::builder()
|
||||||
|
.title(_p3_row_text.clone())
|
||||||
|
.build();
|
||||||
|
let install_confirm_p4 = adw::ActionRow::builder()
|
||||||
|
.title(_p4_row_text.clone())
|
||||||
|
.build();
|
||||||
// / install_confirm_selection_box appends
|
// / install_confirm_selection_box appends
|
||||||
//// add live and install media button to install page selections
|
//// add live and install media button to install page selections
|
||||||
install_confirm_details_boxed_list.append(&install_confirm_detail_language);
|
install_confirm_details_boxed_list.append(&install_confirm_detail_language);
|
||||||
|
@ -6,7 +6,7 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
@ -242,7 +242,11 @@ pub fn keyboard_page(content_stack: >k::Stack) {
|
|||||||
|
|
||||||
// / Content stack appends
|
// / Content stack appends
|
||||||
//// Add the keyboard_main_box as page: keyboard_page, Give it nice title
|
//// Add the keyboard_main_box as page: keyboard_page, Give it nice title
|
||||||
content_stack.add_titled(&keyboard_main_box, Some("keyboard_page"), &gettext("keyboard"));
|
content_stack.add_titled(
|
||||||
|
&keyboard_main_box,
|
||||||
|
Some("keyboard_page"),
|
||||||
|
&gettext("keyboard"),
|
||||||
|
);
|
||||||
|
|
||||||
let keyboard_data_buffer_clone = keyboard_data_buffer.clone();
|
let keyboard_data_buffer_clone = keyboard_data_buffer.clone();
|
||||||
|
|
||||||
|
10
src/main.rs
10
src/main.rs
@ -8,8 +8,8 @@ use gdk::Display;
|
|||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
mod config;
|
mod config;
|
||||||
|
use config::{APP_ID, GETTEXT_PACKAGE, LOCALEDIR};
|
||||||
use gettextrs::{gettext, LocaleCategory};
|
use gettextrs::{gettext, LocaleCategory};
|
||||||
use config::{GETTEXT_PACKAGE, LOCALEDIR, APP_ID};
|
|
||||||
|
|
||||||
mod automatic_partitioning;
|
mod automatic_partitioning;
|
||||||
mod build_ui;
|
mod build_ui;
|
||||||
@ -28,10 +28,7 @@ mod welcome_page;
|
|||||||
|
|
||||||
/// main function
|
/// main function
|
||||||
fn main() {
|
fn main() {
|
||||||
let application = adw::Application::new(
|
let application = adw::Application::new(Some(APP_ID), Default::default());
|
||||||
Some(APP_ID),
|
|
||||||
Default::default(),
|
|
||||||
);
|
|
||||||
application.connect_startup(|app| {
|
application.connect_startup(|app| {
|
||||||
// The CSS "magic" happens here.
|
// The CSS "magic" happens here.
|
||||||
let provider = CssProvider::new();
|
let provider = CssProvider::new();
|
||||||
@ -45,7 +42,8 @@ fn main() {
|
|||||||
);
|
);
|
||||||
// Prepare i18n
|
// Prepare i18n
|
||||||
gettextrs::setlocale(LocaleCategory::LcAll, "");
|
gettextrs::setlocale(LocaleCategory::LcAll, "");
|
||||||
gettextrs::bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind the text domain");
|
gettextrs::bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR)
|
||||||
|
.expect("Unable to bind the text domain");
|
||||||
gettextrs::textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain");
|
gettextrs::textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain");
|
||||||
// Fallback if no translation present
|
// Fallback if no translation present
|
||||||
if gettext("pikaos_installer") == "pikaos_installer" {
|
if gettext("pikaos_installer") == "pikaos_installer" {
|
||||||
|
@ -7,19 +7,18 @@ use glib::*;
|
|||||||
use gtk::*;
|
use gtk::*;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use std::cell::{RefCell};
|
use std::cell::RefCell;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
|
||||||
use duct::cmd;
|
use duct::cmd;
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashSet,
|
collections::HashSet,
|
||||||
hash::Hash,
|
hash::Hash,
|
||||||
io::{BufRead, BufReader},
|
io::{BufRead, BufReader},
|
||||||
process::{Command},
|
process::Command,
|
||||||
time::{Duration},
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::drive_mount_row::DriveMountRow;
|
use crate::drive_mount_row::DriveMountRow;
|
||||||
@ -132,7 +131,7 @@ pub fn manual_partitioning(
|
|||||||
partitioning_stack: >k::Stack,
|
partitioning_stack: >k::Stack,
|
||||||
bottom_next_button: >k::Button,
|
bottom_next_button: >k::Button,
|
||||||
manual_drive_mount_array: &Rc<RefCell<Vec<DriveMount>>>,
|
manual_drive_mount_array: &Rc<RefCell<Vec<DriveMount>>>,
|
||||||
) {
|
) -> gtk::Button {
|
||||||
let part_table_array: Rc<RefCell<Vec<String>>> = Default::default();
|
let part_table_array: Rc<RefCell<Vec<String>>> = Default::default();
|
||||||
|
|
||||||
let check_part_unique = Rc::new(RefCell::new(true));
|
let check_part_unique = Rc::new(RefCell::new(true));
|
||||||
@ -216,14 +215,14 @@ pub fn manual_partitioning(
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
let partition_method_manual_selection_text = gtk::Label::builder()
|
let partition_method_manual_selection_text = gtk::Label::builder()
|
||||||
.label(gettext("manual_part_note"))
|
.label(gettext("manual_part_note"))
|
||||||
.halign(gtk::Align::Center)
|
.halign(gtk::Align::Center)
|
||||||
.hexpand(true)
|
.hexpand(true)
|
||||||
.margin_top(15)
|
.margin_top(15)
|
||||||
.margin_bottom(15)
|
.margin_bottom(15)
|
||||||
.margin_start(15)
|
.margin_start(15)
|
||||||
.margin_end(15)
|
.margin_end(15)
|
||||||
.build();
|
.build();
|
||||||
partition_method_manual_selection_text.add_css_class("medium_sized_text");
|
partition_method_manual_selection_text.add_css_class("medium_sized_text");
|
||||||
|
|
||||||
let partition_refresh_button = gtk::Button::builder()
|
let partition_refresh_button = gtk::Button::builder()
|
||||||
@ -257,7 +256,6 @@ pub fn manual_partitioning(
|
|||||||
.valign(Align::End)
|
.valign(Align::End)
|
||||||
.vexpand(true)
|
.vexpand(true)
|
||||||
.visible(false)
|
.visible(false)
|
||||||
.label(gettext("fstab_status_valid"))
|
|
||||||
.build();
|
.build();
|
||||||
partition_method_manual_valid_label.add_css_class("small_valid_text");
|
partition_method_manual_valid_label.add_css_class("small_valid_text");
|
||||||
|
|
||||||
@ -291,7 +289,12 @@ pub fn manual_partitioning(
|
|||||||
partition_err_check(&partition_method_manual_error_label, &partition_method_manual_valid_label, &manual_drive_mount_array);
|
partition_err_check(&partition_method_manual_error_label, &partition_method_manual_valid_label, &manual_drive_mount_array);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
partition_refresh_button.connect_clicked(clone!(@weak drive_mounts_adw_listbox,@strong part_table_array, @strong manual_drive_mount_array => move |_| {
|
partition_refresh_button.connect_clicked(clone!(@weak partition_method_manual_error_label, @weak partition_method_manual_valid_label,@weak drive_mounts_adw_listbox,@strong part_table_array, @strong manual_drive_mount_array => move |_| {
|
||||||
|
partition_method_manual_error_label.set_label("");
|
||||||
|
partition_method_manual_error_label.set_widget_name("");
|
||||||
|
partition_method_manual_error_label.set_visible(false);
|
||||||
|
partition_method_manual_valid_label.set_label("");
|
||||||
|
partition_method_manual_valid_label.set_visible(false);
|
||||||
while let Some(row) = drive_mounts_adw_listbox.last_child() {
|
while let Some(row) = drive_mounts_adw_listbox.last_child() {
|
||||||
if row.widget_name() == "DriveMountRow" {
|
if row.widget_name() == "DriveMountRow" {
|
||||||
drive_mounts_adw_listbox.remove(&row);
|
drive_mounts_adw_listbox.remove(&row);
|
||||||
@ -423,7 +426,7 @@ pub fn manual_partitioning(
|
|||||||
"partition_method_manual_page",
|
"partition_method_manual_page",
|
||||||
);
|
);
|
||||||
|
|
||||||
//return(partition_method_manual_target_buffer, partition_method_manual_luks_buffer, partition_method_manual_luks_password_entry)
|
return partition_refresh_button;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn partition_err_check(
|
fn partition_err_check(
|
||||||
@ -459,9 +462,7 @@ fn partition_err_check(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if empty_mountpoint == false {
|
if empty_mountpoint == false {
|
||||||
if &partition_method_manual_error_label.widget_name()
|
if &partition_method_manual_error_label.widget_name() == "err1" {
|
||||||
== "err1"
|
|
||||||
{
|
|
||||||
partition_method_manual_error_label.set_visible(false);
|
partition_method_manual_error_label.set_visible(false);
|
||||||
}
|
}
|
||||||
if manual_drive_mount_array_ref.len()
|
if manual_drive_mount_array_ref.len()
|
||||||
@ -485,8 +486,7 @@ fn partition_err_check(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !partition_method_manual_error_label.is_visible() {
|
if !partition_method_manual_error_label.is_visible() {
|
||||||
partition_method_manual_error_label
|
partition_method_manual_error_label.set_label(&gettext("fstab_no_mountpoint_err"));
|
||||||
.set_label(&gettext("fstab_no_mountpoint_err"));
|
|
||||||
partition_method_manual_error_label.set_widget_name("err1");
|
partition_method_manual_error_label.set_widget_name("err1");
|
||||||
partition_method_manual_error_label.set_visible(true);
|
partition_method_manual_error_label.set_visible(true);
|
||||||
}
|
}
|
||||||
@ -494,14 +494,12 @@ fn partition_err_check(
|
|||||||
|
|
||||||
if empty_partition == true {
|
if empty_partition == true {
|
||||||
if !partition_method_manual_error_label.is_visible() {
|
if !partition_method_manual_error_label.is_visible() {
|
||||||
partition_method_manual_error_label
|
partition_method_manual_error_label.set_label(&gettext("fstab_no_partition_err"));
|
||||||
.set_label(&gettext("fstab_no_partition_err"));
|
|
||||||
partition_method_manual_error_label.set_widget_name("err2");
|
partition_method_manual_error_label.set_widget_name("err2");
|
||||||
partition_method_manual_error_label.set_visible(true);
|
partition_method_manual_error_label.set_visible(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if partition_method_manual_error_label.widget_name() == "err2"
|
if partition_method_manual_error_label.widget_name() == "err2" {
|
||||||
{
|
|
||||||
partition_method_manual_error_label.set_visible(false);
|
partition_method_manual_error_label.set_visible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -614,7 +612,11 @@ fn partition_err_check(
|
|||||||
partition_method_manual_error_label.set_visible(false);
|
partition_method_manual_error_label.set_visible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if partition_fs == "vfat" || partition_fs == "ntfs" || partition_fs == "swap" || partition_fs == "exfat" {
|
if partition_fs == "vfat"
|
||||||
|
|| partition_fs == "ntfs"
|
||||||
|
|| partition_fs == "swap"
|
||||||
|
|| partition_fs == "exfat"
|
||||||
|
{
|
||||||
if !partition_method_manual_error_label.is_visible() {
|
if !partition_method_manual_error_label.is_visible() {
|
||||||
partition_method_manual_error_label.set_label(
|
partition_method_manual_error_label.set_label(
|
||||||
&(gettext("fstab_badfs")
|
&(gettext("fstab_badfs")
|
||||||
@ -646,7 +648,11 @@ fn partition_err_check(
|
|||||||
partition_method_manual_error_label.set_visible(false);
|
partition_method_manual_error_label.set_visible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if partition_fs == "vfat" || partition_fs == "ntfs" || partition_fs == "swap" || partition_fs == "exfat" {
|
if partition_fs == "vfat"
|
||||||
|
|| partition_fs == "ntfs"
|
||||||
|
|| partition_fs == "swap"
|
||||||
|
|| partition_fs == "exfat"
|
||||||
|
{
|
||||||
if !partition_method_manual_error_label.is_visible() {
|
if !partition_method_manual_error_label.is_visible() {
|
||||||
partition_method_manual_error_label.set_label(
|
partition_method_manual_error_label.set_label(
|
||||||
&(gettext("fstab_badfs")
|
&(gettext("fstab_badfs")
|
||||||
@ -699,6 +705,7 @@ fn partition_err_check(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !partition_method_manual_error_label.is_visible() {
|
if !partition_method_manual_error_label.is_visible() {
|
||||||
|
partition_method_manual_valid_label.set_label(&gettext("fstab_status_valid"));
|
||||||
partition_method_manual_valid_label.set_visible(true)
|
partition_method_manual_valid_label.set_visible(true)
|
||||||
} else {
|
} else {
|
||||||
partition_method_manual_valid_label.set_visible(false)
|
partition_method_manual_valid_label.set_visible(false)
|
||||||
|
@ -7,7 +7,7 @@ use glob::glob;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use crate::automatic_partitioning::automatic_partitioning;
|
use crate::automatic_partitioning::automatic_partitioning;
|
||||||
use crate::install_page::install_page;
|
use crate::install_page::install_page;
|
||||||
@ -21,7 +21,7 @@ use std::rc::Rc;
|
|||||||
|
|
||||||
use duct::*;
|
use duct::*;
|
||||||
|
|
||||||
use crate::{manual_partitioning};
|
use crate::manual_partitioning;
|
||||||
|
|
||||||
use manual_partitioning::DriveMount;
|
use manual_partitioning::DriveMount;
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ pub fn partitioning_page(
|
|||||||
);
|
);
|
||||||
let partitioning_page_automatic_partitioning =
|
let partitioning_page_automatic_partitioning =
|
||||||
automatic_partitioning(&partitioning_stack, &bottom_next_button);
|
automatic_partitioning(&partitioning_stack, &bottom_next_button);
|
||||||
let _partitioning_page_manual_partitioning = manual_partitioning(
|
let partitioning_page_manual_partitioning = manual_partitioning(
|
||||||
&partitioning_stack,
|
&partitioning_stack,
|
||||||
&bottom_next_button,
|
&bottom_next_button,
|
||||||
&manual_drive_mount_array,
|
&manual_drive_mount_array,
|
||||||
@ -250,6 +250,7 @@ pub fn partitioning_page(
|
|||||||
content_stack.set_visible_child_name("keyboard_page");
|
content_stack.set_visible_child_name("keyboard_page");
|
||||||
partitioning_stack.set_visible_child_name("partition_method_select_page");
|
partitioning_stack.set_visible_child_name("partition_method_select_page");
|
||||||
bottom_next_button.set_sensitive(false);
|
bottom_next_button.set_sensitive(false);
|
||||||
|
partitioning_page_manual_partitioning.emit_clicked();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
bottom_next_button.connect_clicked(clone!(@weak content_stack, @weak partitioning_stack, @weak install_main_box, @weak window, @weak done_main_box => move |_| {
|
bottom_next_button.connect_clicked(clone!(@weak content_stack, @weak partitioning_stack, @weak install_main_box, @weak window, @weak done_main_box => move |_| {
|
||||||
|
@ -6,7 +6,7 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
@ -213,7 +213,11 @@ pub fn timezone_page(content_stack: >k::Stack) {
|
|||||||
|
|
||||||
// / Content stack appends
|
// / Content stack appends
|
||||||
//// Add the timezone_main_box as page: timezone_page, Give it nice title
|
//// Add the timezone_main_box as page: timezone_page, Give it nice title
|
||||||
content_stack.add_titled(&timezone_main_box, Some("timezone_page"), &gettext("timezone"));
|
content_stack.add_titled(
|
||||||
|
&timezone_main_box,
|
||||||
|
Some("timezone_page"),
|
||||||
|
&gettext("timezone"),
|
||||||
|
);
|
||||||
|
|
||||||
let timezone_data_buffer_clone = timezone_data_buffer.clone();
|
let timezone_data_buffer_clone = timezone_data_buffer.clone();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ use glib::*;
|
|||||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||||
use gtk::*;
|
use gtk::*;
|
||||||
|
|
||||||
use gettextrs::{gettext};
|
use gettextrs::gettext;
|
||||||
|
|
||||||
pub fn welcome_page(window: &adw::ApplicationWindow, content_stack: >k::Stack) {
|
pub fn welcome_page(window: &adw::ApplicationWindow, content_stack: >k::Stack) {
|
||||||
// the header box for the welcome page
|
// the header box for the welcome page
|
||||||
|
Loading…
Reference in New Issue
Block a user