From 6dc4502825c06aad9d1e9492184a047b0cf9f51e Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns Date: Sun, 29 Sep 2024 17:54:02 +0200 Subject: [PATCH 01/11] Adding Fedora ISO download. --- core/tabs/utils/create-bootable-usb.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index 0e59440d..1abc9e82 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -66,6 +66,14 @@ fetch_debian_latest_iso() { printf "%b\n" "${GREEN} Selected Debian Linux (latest) ISO URL: ${RC} $DEBIAN_URL" } +# Function to fetch the latest Fedora Workstation ISO +fetch_fedora_latest_iso() { + FEDORA_BASE_URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Workstation/x86_64/iso/" + FEDORA_ISO=$(curl -s -L "$FEDORA_BASE_URL" | grep -oP 'Fedora-Workstation-Live-x86_64-[\d.-]+\.iso' | sort -V | tail -1) + FEDORA_URL="${FEDORA_BASE_URL}${FEDORA_ISO}" + printf "%b\n" "${GREEN} Selected Fedora Workstation (latest) ISO URL: ${RC} $FEDORA_URL" +} + # Function to ask whether to use local or online ISO choose_iso_source() { printf "%b\n" "${YELLOW} Do you want to use a local ISO or download online? ${RC}" @@ -101,8 +109,9 @@ fetch_iso_urls() { printf "%b\n" "1) Arch Linux (latest)" printf "%b\n" "2) Arch Linux (older versions)" printf "%b\n" "3) Debian Linux (latest)" + printf "%b\n" "4) Fedora 40 Workstation (latest)" printf "\n" - printf "%b" "Select the ISO you want to download (1-3): " + printf "%b" "Select the ISO you want to download (1-4): " read -r ISO_OPTION case $ISO_OPTION in @@ -118,6 +127,10 @@ fetch_iso_urls() { fetch_debian_latest_iso ISO_URL=$DEBIAN_URL ;; + 4) + fetch_fedora_latest_iso + ISO_URL=$FEDORA_URL + ;; *) printf "%b\n" "${RED}Invalid option selected.${RC}" exit 1 From 4e09e5a8d696347b9ca33205dfd67615f8e609b0 Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:28:24 +0200 Subject: [PATCH 02/11] Allow 'y', 'yes', and case-insensitive variants for confirmation --- core/tabs/utils/create-bootable-usb.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index 1abc9e82..8539201b 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -170,7 +170,8 @@ write_iso(){ printf "%b" "${RED}WARNING: This will erase all data on ${USB_DEVICE}. Are you sure you want to continue? (y/N): ${RC}" read -r CONFIRMATION - if [ "$CONFIRMATION" != "yes" ]; then + # Convert the input to lowercase and compare + if [ "$(echo "$CONFIRMATION" | tr '[:upper:]' '[:lower:]')" != "yes" ] && [ "$(echo "$CONFIRMATION" | tr '[:upper:]' '[:lower:]')" != "y" ]; then printf "%b\n" "${YELLOW}Operation cancelled.${RC}" exit 1 fi @@ -204,4 +205,4 @@ write_iso(){ checkEnv checkEscalationTool -write_iso \ No newline at end of file +write_iso From 090dff1e45305f63b79f2c51fa9527bed76a53b0 Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Mon, 30 Sep 2024 11:21:14 +0200 Subject: [PATCH 03/11] Removing comments --- core/tabs/utils/create-bootable-usb.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index 8539201b..df1eb18d 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -66,7 +66,6 @@ fetch_debian_latest_iso() { printf "%b\n" "${GREEN} Selected Debian Linux (latest) ISO URL: ${RC} $DEBIAN_URL" } -# Function to fetch the latest Fedora Workstation ISO fetch_fedora_latest_iso() { FEDORA_BASE_URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Workstation/x86_64/iso/" FEDORA_ISO=$(curl -s -L "$FEDORA_BASE_URL" | grep -oP 'Fedora-Workstation-Live-x86_64-[\d.-]+\.iso' | sort -V | tail -1) @@ -170,7 +169,6 @@ write_iso(){ printf "%b" "${RED}WARNING: This will erase all data on ${USB_DEVICE}. Are you sure you want to continue? (y/N): ${RC}" read -r CONFIRMATION - # Convert the input to lowercase and compare if [ "$(echo "$CONFIRMATION" | tr '[:upper:]' '[:lower:]')" != "yes" ] && [ "$(echo "$CONFIRMATION" | tr '[:upper:]' '[:lower:]')" != "y" ]; then printf "%b\n" "${YELLOW}Operation cancelled.${RC}" exit 1 From 92286cc5313a501fd9d12f130e442169b661a9f7 Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Mon, 30 Sep 2024 11:25:18 +0200 Subject: [PATCH 04/11] Getting FEDORA_URL via https://www.fedoraproject.org/releases.json --- core/tabs/utils/create-bootable-usb.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index df1eb18d..68d36fb1 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -67,9 +67,7 @@ fetch_debian_latest_iso() { } fetch_fedora_latest_iso() { - FEDORA_BASE_URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Workstation/x86_64/iso/" - FEDORA_ISO=$(curl -s -L "$FEDORA_BASE_URL" | grep -oP 'Fedora-Workstation-Live-x86_64-[\d.-]+\.iso' | sort -V | tail -1) - FEDORA_URL="${FEDORA_BASE_URL}${FEDORA_ISO}" + FEDORA_URL=$(curl -s 'https://www.fedoraproject.org/releases.json' | jq -r '.[] | select(.version == "40" and .arch == "x86_64" and .variant == "Workstation") | select(.link | match(".*Live-x86_64*")) | .link') printf "%b\n" "${GREEN} Selected Fedora Workstation (latest) ISO URL: ${RC} $FEDORA_URL" } From bf84259a1f05325ac31cf51ef323bd911ab2742c Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:50:39 +0200 Subject: [PATCH 05/11] Adding line for create-bootable-usb.sh --- docs/userguide.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/userguide.md b/docs/userguide.md index b72a9aa0..640a3e73 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -55,6 +55,7 @@ - **Wifi Control**: Controls WiFi settings. - **Numlock Control**: Sets up Numlock on boot. - **Bluetooth Control**: Controls Bluetooth settings. +- **Create Bootable USB**: Makes a USB Stick that can be used to install the selected Linux distribution. ### Monitor control From 82e99d21428c3728b46bbaa29cee7ec35154414d Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:27:57 +0200 Subject: [PATCH 06/11] Apply suggestions from code review Co-authored-by: Adam Perkowski --- core/tabs/utils/create-bootable-usb.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index 68d36fb1..8c75bd05 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -67,7 +67,16 @@ fetch_debian_latest_iso() { } fetch_fedora_latest_iso() { - FEDORA_URL=$(curl -s 'https://www.fedoraproject.org/releases.json' | jq -r '.[] | select(.version == "40" and .arch == "x86_64" and .variant == "Workstation") | select(.link | match(".*Live-x86_64*")) | .link') + FEDORA_URL=$(curl -s 'https://www.fedoraproject.org/releases.json' | + grep -o '"link": "[^"]*' | + sed -e 's/"link": "//' | + awk -v version="40" -v arch="x86_64" -v variant="Workstation" ' BEGIN { FS="," } + { + if ($0 ~ version && $0 ~ arch && $0 ~ variant && $0 ~ "Live-x86_64") { + print $0 + } + }' | + head -n 1) printf "%b\n" "${GREEN} Selected Fedora Workstation (latest) ISO URL: ${RC} $FEDORA_URL" } From 01690ed97dca38d05887b512c3f231947b4f6593 Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:52:39 +0200 Subject: [PATCH 07/11] Update create-bootable-usb.sh --- core/tabs/utils/create-bootable-usb.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index 8c75bd05..59ea9f32 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -71,11 +71,10 @@ fetch_fedora_latest_iso() { grep -o '"link": "[^"]*' | sed -e 's/"link": "//' | awk -v version="40" -v arch="x86_64" -v variant="Workstation" ' BEGIN { FS="," } - { - if ($0 ~ version && $0 ~ arch && $0 ~ variant && $0 ~ "Live-x86_64") { - print $0 - } - }' | + { + if ($0 ~ version && $0 ~ arch && $0 ~ variant && $0 ~ "Live-x86_64") + { print $0 } + }' | head -n 1) printf "%b\n" "${GREEN} Selected Fedora Workstation (latest) ISO URL: ${RC} $FEDORA_URL" } From 9c759cd2a45c5932d333749c363a306edbc6e497 Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:43:49 +0200 Subject: [PATCH 08/11] Update userguide.md --- docs/userguide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/userguide.md b/docs/userguide.md index 640a3e73..6414eff0 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -55,7 +55,7 @@ - **Wifi Control**: Controls WiFi settings. - **Numlock Control**: Sets up Numlock on boot. - **Bluetooth Control**: Controls Bluetooth settings. -- **Create Bootable USB**: Makes a USB Stick that can be used to install the selected Linux distribution. +- **Bootable USB Creator**: Makes a USB Stick that can be used to install the selected Linux distribution. ### Monitor control From 517baffb42a5a473db107e61b9378d27a2e7b564 Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:30:30 +0200 Subject: [PATCH 09/11] Adding description for Bootable USB Creator --- core/tabs/utils/tab_data.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/core/tabs/utils/tab_data.toml b/core/tabs/utils/tab_data.toml index 7cfc3ed7..a500fc8a 100644 --- a/core/tabs/utils/tab_data.toml +++ b/core/tabs/utils/tab_data.toml @@ -117,6 +117,7 @@ task_list = "I SS" [[data]] name = "Bootable USB Creator" +description = "Makes a USB Stick that can be used to install the selected Linux distribution." script = "create-bootable-usb.sh" task_list = "D" From 01e5e770a03e6fc2f361a80f6f94a7c43ec4850b Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:31:50 +0200 Subject: [PATCH 10/11] Adding description for Bootable USB Creator --- core/tabs/utils/tab_data.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/utils/tab_data.toml b/core/tabs/utils/tab_data.toml index a500fc8a..8da1ae96 100644 --- a/core/tabs/utils/tab_data.toml +++ b/core/tabs/utils/tab_data.toml @@ -117,7 +117,7 @@ task_list = "I SS" [[data]] name = "Bootable USB Creator" -description = "Makes a USB Stick that can be used to install the selected Linux distribution." +description = "Makes a USB Stick that can be used to install the selected Linux distribution" script = "create-bootable-usb.sh" task_list = "D" From d703bdf682631ecf814b8f7b7c6abb8f6b096998 Mon Sep 17 00:00:00 2001 From: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:45:22 +0200 Subject: [PATCH 11/11] Update core/tabs/utils/create-bootable-usb.sh Co-authored-by: Adam Perkowski --- core/tabs/utils/create-bootable-usb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index 59ea9f32..d825d443 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -76,7 +76,7 @@ fetch_fedora_latest_iso() { { print $0 } }' | head -n 1) - printf "%b\n" "${GREEN} Selected Fedora Workstation (latest) ISO URL: ${RC} $FEDORA_URL" + printf "%b\n" "${GREEN} Selected Fedora Workstation (latest) ISO URL:${RC} $FEDORA_URL" } # Function to ask whether to use local or online ISO