From 18a44bd13b1c2b4048966fbe949dd7becda1540a Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 16 Jun 2024 14:55:55 +0000 Subject: [PATCH 1/3] start testing firefox latest in the loaded builds --- .../install-firefox-latest.hook.chroot | 42 +++++++++++++++++++ .../install-firefox-latest.hook.chroot | 42 +++++++++++++++++++ python_modules/conf.py | 4 +- 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100755 iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot create mode 100755 iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot diff --git a/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot new file mode 100755 index 00000000..d0483d91 --- /dev/null +++ b/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot @@ -0,0 +1,42 @@ +#!/bin/bash + +# Script adapted for use as a hook in Debian Live-Build +# to install and allow automatic updates for Firefox + +# Set default locale to English (US) +locale="en-US" + +# Download the latest version of Firefox +firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') +firefox_filename="firefox-${firefox_version}.tar.bz2" +wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" + +# Extract and install Firefox +tar -C /opt -xvf /tmp/${firefox_filename} + +# Create a symbolic link for Firefox +ln -sf /opt/firefox/firefox /usr/bin/firefox + +# Set permissions to allow automatic updates +# Grant write permissions to the group and others (non-root users). +# This allows Firefox to update itself while maintaining system security. +chmod -R 775 /opt/firefox + +# Ensure the directory is owned by a user who can perform updates, +# typically it is good practice to associate it with the group of the users who will use the system. +chown -R root:users /opt/firefox + +# Create a .desktop entry for Firefox +echo "[Desktop Entry] +Name=Firefox +Comment=Web Browser +GenericName=Web Browser +Exec=/usr/bin/firefox +Icon=firefox +Terminal=false +Type=Application +Categories=Network;WebBrowser; +MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true" > /usr/share/applications/firefox.desktop + +echo "Firefox latest installed successfully and is ready for auto-updates." diff --git a/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot new file mode 100755 index 00000000..d0483d91 --- /dev/null +++ b/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot @@ -0,0 +1,42 @@ +#!/bin/bash + +# Script adapted for use as a hook in Debian Live-Build +# to install and allow automatic updates for Firefox + +# Set default locale to English (US) +locale="en-US" + +# Download the latest version of Firefox +firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') +firefox_filename="firefox-${firefox_version}.tar.bz2" +wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" + +# Extract and install Firefox +tar -C /opt -xvf /tmp/${firefox_filename} + +# Create a symbolic link for Firefox +ln -sf /opt/firefox/firefox /usr/bin/firefox + +# Set permissions to allow automatic updates +# Grant write permissions to the group and others (non-root users). +# This allows Firefox to update itself while maintaining system security. +chmod -R 775 /opt/firefox + +# Ensure the directory is owned by a user who can perform updates, +# typically it is good practice to associate it with the group of the users who will use the system. +chown -R root:users /opt/firefox + +# Create a .desktop entry for Firefox +echo "[Desktop Entry] +Name=Firefox +Comment=Web Browser +GenericName=Web Browser +Exec=/usr/bin/firefox +Icon=firefox +Terminal=false +Type=Application +Categories=Network;WebBrowser; +MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true" > /usr/share/applications/firefox.desktop + +echo "Firefox latest installed successfully and is ready for auto-updates." diff --git a/python_modules/conf.py b/python_modules/conf.py index 503f2824..a9c33f4c 100644 --- a/python_modules/conf.py +++ b/python_modules/conf.py @@ -270,8 +270,8 @@ LOADED_LIST = ('xfce4\n' 'transmission-gtk\n' 'thunderbird\n' 'thunderbird-l10n-all\n' - 'firefox-esr\n' - 'firefox-esr-l10n-all\n' + #'firefox-esr\n' start testing firefox latest install + #'firefox-esr-l10n-all\n' 'libreoffice\n' 'libreoffice-gtk3\n' 'libreoffice-l10n*\n' From 0cc3dfae47a2f7a37047da2fad2cae47acb66544 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 16 Jun 2024 18:27:16 +0000 Subject: [PATCH 2/3] update firefox install hook --- .../install-firefox-latest.hook.chroot | 43 +++++++++---- .../install-firefox-latest.hook.chroot | 43 +++++++++---- .../install-firefox-latest.hook.chroot | 63 +++++++++++++++++++ .../install-firefox-latest.hook.chroot | 63 +++++++++++++++++++ 4 files changed, 190 insertions(+), 22 deletions(-) create mode 100755 iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot create mode 100755 iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot diff --git a/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot index d0483d91..7cd14f90 100755 --- a/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot +++ b/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot @@ -1,15 +1,15 @@ #!/bin/bash # Script adapted for use as a hook in Debian Live-Build -# to install and allow automatic updates for Firefox +# to install Firefox with all available language packs -# Set default locale to English (US) -locale="en-US" +# Set default locale to English (US) for initial Firefox download +default_locale="en-US" # Download the latest version of Firefox -firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') +firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') firefox_filename="firefox-${firefox_version}.tar.bz2" -wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" +wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" # Extract and install Firefox tar -C /opt -xvf /tmp/${firefox_filename} @@ -18,12 +18,7 @@ tar -C /opt -xvf /tmp/${firefox_filename} ln -sf /opt/firefox/firefox /usr/bin/firefox # Set permissions to allow automatic updates -# Grant write permissions to the group and others (non-root users). -# This allows Firefox to update itself while maintaining system security. chmod -R 775 /opt/firefox - -# Ensure the directory is owned by a user who can perform updates, -# typically it is good practice to associate it with the group of the users who will use the system. chown -R root:users /opt/firefox # Create a .desktop entry for Firefox @@ -39,4 +34,30 @@ Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true" > /usr/share/applications/firefox.desktop -echo "Firefox latest installed successfully and is ready for auto-updates." +# Download and install all available language packs +lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" +tmp_dir="/tmp/firefox-languages" + +# Create a temporary directory for language packs +mkdir -p ${tmp_dir} + +# List of all language codes available for Firefox +lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + +# Loop through each language code and download the language pack +for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi +done + +# Create the directory for language packs in the Firefox installation +lang_pack_dir="/opt/firefox/browser/extensions" + +# Move all language packs to the Firefox extensions directory +mkdir -p ${lang_pack_dir} +mv ${tmp_dir}/*.xpi ${lang_pack_dir} + +# Clean up the temporary directory +rm -rf ${tmp_dir} + +echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + diff --git a/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot index d0483d91..7cd14f90 100755 --- a/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot +++ b/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot @@ -1,15 +1,15 @@ #!/bin/bash # Script adapted for use as a hook in Debian Live-Build -# to install and allow automatic updates for Firefox +# to install Firefox with all available language packs -# Set default locale to English (US) -locale="en-US" +# Set default locale to English (US) for initial Firefox download +default_locale="en-US" # Download the latest version of Firefox -firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') +firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') firefox_filename="firefox-${firefox_version}.tar.bz2" -wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${locale}" +wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" # Extract and install Firefox tar -C /opt -xvf /tmp/${firefox_filename} @@ -18,12 +18,7 @@ tar -C /opt -xvf /tmp/${firefox_filename} ln -sf /opt/firefox/firefox /usr/bin/firefox # Set permissions to allow automatic updates -# Grant write permissions to the group and others (non-root users). -# This allows Firefox to update itself while maintaining system security. chmod -R 775 /opt/firefox - -# Ensure the directory is owned by a user who can perform updates, -# typically it is good practice to associate it with the group of the users who will use the system. chown -R root:users /opt/firefox # Create a .desktop entry for Firefox @@ -39,4 +34,30 @@ Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true" > /usr/share/applications/firefox.desktop -echo "Firefox latest installed successfully and is ready for auto-updates." +# Download and install all available language packs +lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" +tmp_dir="/tmp/firefox-languages" + +# Create a temporary directory for language packs +mkdir -p ${tmp_dir} + +# List of all language codes available for Firefox +lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + +# Loop through each language code and download the language pack +for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi +done + +# Create the directory for language packs in the Firefox installation +lang_pack_dir="/opt/firefox/browser/extensions" + +# Move all language packs to the Firefox extensions directory +mkdir -p ${lang_pack_dir} +mv ${tmp_dir}/*.xpi ${lang_pack_dir} + +# Clean up the temporary directory +rm -rf ${tmp_dir} + +echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + diff --git a/iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot new file mode 100755 index 00000000..7cd14f90 --- /dev/null +++ b/iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot @@ -0,0 +1,63 @@ +#!/bin/bash + +# Script adapted for use as a hook in Debian Live-Build +# to install Firefox with all available language packs + +# Set default locale to English (US) for initial Firefox download +default_locale="en-US" + +# Download the latest version of Firefox +firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') +firefox_filename="firefox-${firefox_version}.tar.bz2" +wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" + +# Extract and install Firefox +tar -C /opt -xvf /tmp/${firefox_filename} + +# Create a symbolic link for Firefox +ln -sf /opt/firefox/firefox /usr/bin/firefox + +# Set permissions to allow automatic updates +chmod -R 775 /opt/firefox +chown -R root:users /opt/firefox + +# Create a .desktop entry for Firefox +echo "[Desktop Entry] +Name=Firefox +Comment=Web Browser +GenericName=Web Browser +Exec=/usr/bin/firefox +Icon=firefox +Terminal=false +Type=Application +Categories=Network;WebBrowser; +MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true" > /usr/share/applications/firefox.desktop + +# Download and install all available language packs +lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" +tmp_dir="/tmp/firefox-languages" + +# Create a temporary directory for language packs +mkdir -p ${tmp_dir} + +# List of all language codes available for Firefox +lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + +# Loop through each language code and download the language pack +for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi +done + +# Create the directory for language packs in the Firefox installation +lang_pack_dir="/opt/firefox/browser/extensions" + +# Move all language packs to the Firefox extensions directory +mkdir -p ${lang_pack_dir} +mv ${tmp_dir}/*.xpi ${lang_pack_dir} + +# Clean up the temporary directory +rm -rf ${tmp_dir} + +echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + diff --git a/iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot new file mode 100755 index 00000000..7cd14f90 --- /dev/null +++ b/iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot @@ -0,0 +1,63 @@ +#!/bin/bash + +# Script adapted for use as a hook in Debian Live-Build +# to install Firefox with all available language packs + +# Set default locale to English (US) for initial Firefox download +default_locale="en-US" + +# Download the latest version of Firefox +firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') +firefox_filename="firefox-${firefox_version}.tar.bz2" +wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" + +# Extract and install Firefox +tar -C /opt -xvf /tmp/${firefox_filename} + +# Create a symbolic link for Firefox +ln -sf /opt/firefox/firefox /usr/bin/firefox + +# Set permissions to allow automatic updates +chmod -R 775 /opt/firefox +chown -R root:users /opt/firefox + +# Create a .desktop entry for Firefox +echo "[Desktop Entry] +Name=Firefox +Comment=Web Browser +GenericName=Web Browser +Exec=/usr/bin/firefox +Icon=firefox +Terminal=false +Type=Application +Categories=Network;WebBrowser; +MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true" > /usr/share/applications/firefox.desktop + +# Download and install all available language packs +lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" +tmp_dir="/tmp/firefox-languages" + +# Create a temporary directory for language packs +mkdir -p ${tmp_dir} + +# List of all language codes available for Firefox +lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + +# Loop through each language code and download the language pack +for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi +done + +# Create the directory for language packs in the Firefox installation +lang_pack_dir="/opt/firefox/browser/extensions" + +# Move all language packs to the Firefox extensions directory +mkdir -p ${lang_pack_dir} +mv ${tmp_dir}/*.xpi ${lang_pack_dir} + +# Clean up the temporary directory +rm -rf ${tmp_dir} + +echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + From 4f3b8ac73042661284cbd6972fd200eadcd54cb4 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 16 Jun 2024 18:36:44 +0000 Subject: [PATCH 3/3] update firefox istall hook to work in 32 and 64 bit --- .../install-firefox-latest.hook.chroot | 99 ++++++++++++------- .../install-firefox-latest.hook.chroot | 99 ++++++++++++------- .../install-firefox-latest.hook.chroot | 99 ++++++++++++------- .../install-firefox-latest.hook.chroot | 99 ++++++++++++------- 4 files changed, 256 insertions(+), 140 deletions(-) diff --git a/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot index 7cd14f90..8943440e 100755 --- a/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot +++ b/iso_configs/hooks/normal/debld_32/install-firefox-latest.hook.chroot @@ -1,28 +1,47 @@ #!/bin/bash -# Script adapted for use as a hook in Debian Live-Build +# Script for use as a hook in Debian Live-Build # to install Firefox with all available language packs +# Supports both 32-bit and 64-bit architectures -# Set default locale to English (US) for initial Firefox download -default_locale="en-US" +# Function to download and install Firefox +install_firefox() { + local architecture="$1" + local default_locale="en-US" -# Download the latest version of Firefox -firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -firefox_filename="firefox-${firefox_version}.tar.bz2" -wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" + # Determine the appropriate URL and file paths based on architecture + if [ "$architecture" == "32bit" ]; then + arch_url="linux" + lang_pack_arch="linux-i686" + else + arch_url="linux64" + lang_pack_arch="linux-x86_64" + fi -# Extract and install Firefox -tar -C /opt -xvf /tmp/${firefox_filename} + # URL to download the latest Firefox + firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}" -# Create a symbolic link for Firefox -ln -sf /opt/firefox/firefox /usr/bin/firefox + # Get the latest version number + firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -# Set permissions to allow automatic updates -chmod -R 775 /opt/firefox -chown -R root:users /opt/firefox + # Construct the filename for download + firefox_filename="firefox-${firefox_version}.tar.bz2" -# Create a .desktop entry for Firefox -echo "[Desktop Entry] + # Download the latest version of Firefox + wget -O /tmp/${firefox_filename} ${firefox_url} + + # Extract and install Firefox to /opt/firefox + tar -C /opt -xvf /tmp/${firefox_filename} + + # Create a symbolic link for Firefox in /usr/bin + ln -sf /opt/firefox/firefox /usr/bin/firefox + + # Set permissions to allow automatic updates + chmod -R 775 /opt/firefox + chown -R root:users /opt/firefox + + # Create a .desktop entry for Firefox + echo "[Desktop Entry] Name=Firefox Comment=Web Browser GenericName=Web Browser @@ -34,30 +53,40 @@ Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true" > /usr/share/applications/firefox.desktop -# Download and install all available language packs -lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" -tmp_dir="/tmp/firefox-languages" + # Download and install all available language packs + lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi" + tmp_dir="/tmp/firefox-languages" -# Create a temporary directory for language packs -mkdir -p ${tmp_dir} + # Create a temporary directory for language packs + mkdir -p ${tmp_dir} -# List of all language codes available for Firefox -lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + # List of all language codes available for Firefox + lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') -# Loop through each language code and download the language pack -for lang_code in ${lang_codes}; do - wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi -done + # Loop through each language code and download the language pack + for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi + done -# Create the directory for language packs in the Firefox installation -lang_pack_dir="/opt/firefox/browser/extensions" + # Create the directory for language packs in the Firefox installation + lang_pack_dir="/opt/firefox/browser/extensions" -# Move all language packs to the Firefox extensions directory -mkdir -p ${lang_pack_dir} -mv ${tmp_dir}/*.xpi ${lang_pack_dir} + # Move all language packs to the Firefox extensions directory + mkdir -p ${lang_pack_dir} + mv ${tmp_dir}/*.xpi ${lang_pack_dir} -# Clean up the temporary directory -rm -rf ${tmp_dir} + # Clean up the temporary directory + rm -rf ${tmp_dir} -echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates." +} + +# Detect system architecture and install the appropriate version +if [ "$(uname -m)" == "x86_64" ]; then + echo "Installing Firefox for 64-bit architecture" + install_firefox "64bit" +else + echo "Installing Firefox for 32-bit architecture" + install_firefox "32bit" +fi diff --git a/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot index 7cd14f90..8943440e 100755 --- a/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot +++ b/iso_configs/hooks/normal/debld_64/install-firefox-latest.hook.chroot @@ -1,28 +1,47 @@ #!/bin/bash -# Script adapted for use as a hook in Debian Live-Build +# Script for use as a hook in Debian Live-Build # to install Firefox with all available language packs +# Supports both 32-bit and 64-bit architectures -# Set default locale to English (US) for initial Firefox download -default_locale="en-US" +# Function to download and install Firefox +install_firefox() { + local architecture="$1" + local default_locale="en-US" -# Download the latest version of Firefox -firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -firefox_filename="firefox-${firefox_version}.tar.bz2" -wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" + # Determine the appropriate URL and file paths based on architecture + if [ "$architecture" == "32bit" ]; then + arch_url="linux" + lang_pack_arch="linux-i686" + else + arch_url="linux64" + lang_pack_arch="linux-x86_64" + fi -# Extract and install Firefox -tar -C /opt -xvf /tmp/${firefox_filename} + # URL to download the latest Firefox + firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}" -# Create a symbolic link for Firefox -ln -sf /opt/firefox/firefox /usr/bin/firefox + # Get the latest version number + firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -# Set permissions to allow automatic updates -chmod -R 775 /opt/firefox -chown -R root:users /opt/firefox + # Construct the filename for download + firefox_filename="firefox-${firefox_version}.tar.bz2" -# Create a .desktop entry for Firefox -echo "[Desktop Entry] + # Download the latest version of Firefox + wget -O /tmp/${firefox_filename} ${firefox_url} + + # Extract and install Firefox to /opt/firefox + tar -C /opt -xvf /tmp/${firefox_filename} + + # Create a symbolic link for Firefox in /usr/bin + ln -sf /opt/firefox/firefox /usr/bin/firefox + + # Set permissions to allow automatic updates + chmod -R 775 /opt/firefox + chown -R root:users /opt/firefox + + # Create a .desktop entry for Firefox + echo "[Desktop Entry] Name=Firefox Comment=Web Browser GenericName=Web Browser @@ -34,30 +53,40 @@ Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true" > /usr/share/applications/firefox.desktop -# Download and install all available language packs -lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" -tmp_dir="/tmp/firefox-languages" + # Download and install all available language packs + lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi" + tmp_dir="/tmp/firefox-languages" -# Create a temporary directory for language packs -mkdir -p ${tmp_dir} + # Create a temporary directory for language packs + mkdir -p ${tmp_dir} -# List of all language codes available for Firefox -lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + # List of all language codes available for Firefox + lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') -# Loop through each language code and download the language pack -for lang_code in ${lang_codes}; do - wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi -done + # Loop through each language code and download the language pack + for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi + done -# Create the directory for language packs in the Firefox installation -lang_pack_dir="/opt/firefox/browser/extensions" + # Create the directory for language packs in the Firefox installation + lang_pack_dir="/opt/firefox/browser/extensions" -# Move all language packs to the Firefox extensions directory -mkdir -p ${lang_pack_dir} -mv ${tmp_dir}/*.xpi ${lang_pack_dir} + # Move all language packs to the Firefox extensions directory + mkdir -p ${lang_pack_dir} + mv ${tmp_dir}/*.xpi ${lang_pack_dir} -# Clean up the temporary directory -rm -rf ${tmp_dir} + # Clean up the temporary directory + rm -rf ${tmp_dir} -echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates." +} + +# Detect system architecture and install the appropriate version +if [ "$(uname -m)" == "x86_64" ]; then + echo "Installing Firefox for 64-bit architecture" + install_firefox "64bit" +else + echo "Installing Firefox for 32-bit architecture" + install_firefox "32bit" +fi diff --git a/iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot index 7cd14f90..8943440e 100755 --- a/iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot +++ b/iso_configs/hooks/normal/devld_32/install-firefox-latest.hook.chroot @@ -1,28 +1,47 @@ #!/bin/bash -# Script adapted for use as a hook in Debian Live-Build +# Script for use as a hook in Debian Live-Build # to install Firefox with all available language packs +# Supports both 32-bit and 64-bit architectures -# Set default locale to English (US) for initial Firefox download -default_locale="en-US" +# Function to download and install Firefox +install_firefox() { + local architecture="$1" + local default_locale="en-US" -# Download the latest version of Firefox -firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -firefox_filename="firefox-${firefox_version}.tar.bz2" -wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" + # Determine the appropriate URL and file paths based on architecture + if [ "$architecture" == "32bit" ]; then + arch_url="linux" + lang_pack_arch="linux-i686" + else + arch_url="linux64" + lang_pack_arch="linux-x86_64" + fi -# Extract and install Firefox -tar -C /opt -xvf /tmp/${firefox_filename} + # URL to download the latest Firefox + firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}" -# Create a symbolic link for Firefox -ln -sf /opt/firefox/firefox /usr/bin/firefox + # Get the latest version number + firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -# Set permissions to allow automatic updates -chmod -R 775 /opt/firefox -chown -R root:users /opt/firefox + # Construct the filename for download + firefox_filename="firefox-${firefox_version}.tar.bz2" -# Create a .desktop entry for Firefox -echo "[Desktop Entry] + # Download the latest version of Firefox + wget -O /tmp/${firefox_filename} ${firefox_url} + + # Extract and install Firefox to /opt/firefox + tar -C /opt -xvf /tmp/${firefox_filename} + + # Create a symbolic link for Firefox in /usr/bin + ln -sf /opt/firefox/firefox /usr/bin/firefox + + # Set permissions to allow automatic updates + chmod -R 775 /opt/firefox + chown -R root:users /opt/firefox + + # Create a .desktop entry for Firefox + echo "[Desktop Entry] Name=Firefox Comment=Web Browser GenericName=Web Browser @@ -34,30 +53,40 @@ Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true" > /usr/share/applications/firefox.desktop -# Download and install all available language packs -lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" -tmp_dir="/tmp/firefox-languages" + # Download and install all available language packs + lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi" + tmp_dir="/tmp/firefox-languages" -# Create a temporary directory for language packs -mkdir -p ${tmp_dir} + # Create a temporary directory for language packs + mkdir -p ${tmp_dir} -# List of all language codes available for Firefox -lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + # List of all language codes available for Firefox + lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') -# Loop through each language code and download the language pack -for lang_code in ${lang_codes}; do - wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi -done + # Loop through each language code and download the language pack + for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi + done -# Create the directory for language packs in the Firefox installation -lang_pack_dir="/opt/firefox/browser/extensions" + # Create the directory for language packs in the Firefox installation + lang_pack_dir="/opt/firefox/browser/extensions" -# Move all language packs to the Firefox extensions directory -mkdir -p ${lang_pack_dir} -mv ${tmp_dir}/*.xpi ${lang_pack_dir} + # Move all language packs to the Firefox extensions directory + mkdir -p ${lang_pack_dir} + mv ${tmp_dir}/*.xpi ${lang_pack_dir} -# Clean up the temporary directory -rm -rf ${tmp_dir} + # Clean up the temporary directory + rm -rf ${tmp_dir} -echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates." +} + +# Detect system architecture and install the appropriate version +if [ "$(uname -m)" == "x86_64" ]; then + echo "Installing Firefox for 64-bit architecture" + install_firefox "64bit" +else + echo "Installing Firefox for 32-bit architecture" + install_firefox "32bit" +fi diff --git a/iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot b/iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot index 7cd14f90..8943440e 100755 --- a/iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot +++ b/iso_configs/hooks/normal/devld_64/install-firefox-latest.hook.chroot @@ -1,28 +1,47 @@ #!/bin/bash -# Script adapted for use as a hook in Debian Live-Build +# Script for use as a hook in Debian Live-Build # to install Firefox with all available language packs +# Supports both 32-bit and 64-bit architectures -# Set default locale to English (US) for initial Firefox download -default_locale="en-US" +# Function to download and install Firefox +install_firefox() { + local architecture="$1" + local default_locale="en-US" -# Download the latest version of Firefox -firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -firefox_filename="firefox-${firefox_version}.tar.bz2" -wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" + # Determine the appropriate URL and file paths based on architecture + if [ "$architecture" == "32bit" ]; then + arch_url="linux" + lang_pack_arch="linux-i686" + else + arch_url="linux64" + lang_pack_arch="linux-x86_64" + fi -# Extract and install Firefox -tar -C /opt -xvf /tmp/${firefox_filename} + # URL to download the latest Firefox + firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}" -# Create a symbolic link for Firefox -ln -sf /opt/firefox/firefox /usr/bin/firefox + # Get the latest version number + firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g') -# Set permissions to allow automatic updates -chmod -R 775 /opt/firefox -chown -R root:users /opt/firefox + # Construct the filename for download + firefox_filename="firefox-${firefox_version}.tar.bz2" -# Create a .desktop entry for Firefox -echo "[Desktop Entry] + # Download the latest version of Firefox + wget -O /tmp/${firefox_filename} ${firefox_url} + + # Extract and install Firefox to /opt/firefox + tar -C /opt -xvf /tmp/${firefox_filename} + + # Create a symbolic link for Firefox in /usr/bin + ln -sf /opt/firefox/firefox /usr/bin/firefox + + # Set permissions to allow automatic updates + chmod -R 775 /opt/firefox + chown -R root:users /opt/firefox + + # Create a .desktop entry for Firefox + echo "[Desktop Entry] Name=Firefox Comment=Web Browser GenericName=Web Browser @@ -34,30 +53,40 @@ Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true" > /usr/share/applications/firefox.desktop -# Download and install all available language packs -lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi" -tmp_dir="/tmp/firefox-languages" + # Download and install all available language packs + lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi" + tmp_dir="/tmp/firefox-languages" -# Create a temporary directory for language packs -mkdir -p ${tmp_dir} + # Create a temporary directory for language packs + mkdir -p ${tmp_dir} -# List of all language codes available for Firefox -lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') + # List of all language codes available for Firefox + lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//') -# Loop through each language code and download the language pack -for lang_code in ${lang_codes}; do - wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi -done + # Loop through each language code and download the language pack + for lang_code in ${lang_codes}; do + wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi + done -# Create the directory for language packs in the Firefox installation -lang_pack_dir="/opt/firefox/browser/extensions" + # Create the directory for language packs in the Firefox installation + lang_pack_dir="/opt/firefox/browser/extensions" -# Move all language packs to the Firefox extensions directory -mkdir -p ${lang_pack_dir} -mv ${tmp_dir}/*.xpi ${lang_pack_dir} + # Move all language packs to the Firefox extensions directory + mkdir -p ${lang_pack_dir} + mv ${tmp_dir}/*.xpi ${lang_pack_dir} -# Clean up the temporary directory -rm -rf ${tmp_dir} + # Clean up the temporary directory + rm -rf ${tmp_dir} -echo "Firefox latest installed successfully with all language packs and is ready for auto-updates." + echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates." +} + +# Detect system architecture and install the appropriate version +if [ "$(uname -m)" == "x86_64" ]; then + echo "Installing Firefox for 64-bit architecture" + install_firefox "64bit" +else + echo "Installing Firefox for 32-bit architecture" + install_firefox "32bit" +fi