-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add a temporary fix for the shim-signed aur package
- Loading branch information
Showing
4 changed files
with
46 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ usage() | |
{ | ||
cat << USAGE | ||
LinuxLoops: Flexible linux distro installer. | ||
Usage: sudo bash linuxloops -distro <distribution name> -env <desktop environment> -dst <disk name or disk image path> [-s <total install size>] [-z <swap size>] [-b] [-e] [-a] [-L <locale>] [-K <keymap>] [-T <timezone>] [-n] [-S] [-c <custom_packages_list>] [-C <custom_script_path>] [-k <kernel_parameters_list>] | ||
Usage: sudo bash linuxloops -distro <distribution name> -env <desktop environment> -dst <disk name or disk image path> [-s <total install size>] [-z <swap size>] [-b] [-e] [-a] [-H <hostname>] [-L <locale>] [-K <keymap>] [-T <timezone>] [-n] [-S] [-c <custom_packages_list>] [-C <custom_script_path>] [-k <kernel_parameters_list>] | ||
-distro, --distribution <distribution name> (Distribution to install) | ||
-env, --environment <desktop environment> (Desktop environment to install) | ||
-dst, --destination <disk name or disk image path> (e.g. /dev/sda or /ubuntu.img) | ||
|
@@ -13,6 +13,7 @@ Usage: sudo bash linuxloops -distro <distribution name> -env <desktop environmen | |
-b, --btrfs (Use btrfs for the root filesystem) | ||
-e, --encrypt (Encrypt the root filesystem) | ||
-a, --autologin (Enable user autologin) | ||
-H, --hostname (Provide a specific hostname) | ||
-L, --locale <locale> (specify locale to be used, by default "en_US") | ||
-K, --keymap <keymap> (specify keymap to be used, by default "us") | ||
-T, --timezone <timezone> (specify timezone to be used, by default "UTC") | ||
|
@@ -8337,23 +8338,25 @@ else | |
cat >"${linuxloopsdir}"/chroot/bootstrap/linuxloops/install_fstab <<GENERATEFSTAB | ||
#!/bin/bash | ||
set -e | ||
if [ "${live}" == "Yes" ]; then rootfs_mount_flags="x-systemd.growfs"; fi | ||
rm -f /etc/fstab | ||
touch /etc/fstab | ||
chmod 0644 /etc/fstab | ||
if [ "${encryption}" == "Yes" ]; then | ||
if [ "${fstype}" == "btrfs" ]; then | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value /dev/mapper/luks-\$(blkid -s UUID -o value "${root_partition}")) / btrfs subvol=@,compress=zstd 0 0" >> /etc/fstab | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value /dev/mapper/luks-\$(blkid -s UUID -o value "${root_partition}")) / btrfs subvol=@,compress=zstd,\${rootfs_mount_flags} 0 0" >> /etc/fstab | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value /dev/mapper/luks-\$(blkid -s UUID -o value "${root_partition}")) /home btrfs subvol=@home,compress=zstd 0 0" >> /etc/fstab | ||
if [ ! -z "${swap_size}" ] && [ "${swap_size}" -ne 0 ]; then echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value /dev/mapper/luks-\$(blkid -s UUID -o value "${root_partition}")) /var/swap btrfs subvol=@swap 0 0" >> /etc/fstab; fi | ||
else | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value /dev/mapper/luks-\$(blkid -s UUID -o value "${root_partition}")) / ext4 errors=remount-ro 0 1" >> /etc/fstab | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value /dev/mapper/luks-\$(blkid -s UUID -o value "${root_partition}")) / ext4 errors=remount-ro,\${rootfs_mount_flags} 0 1" >> /etc/fstab | ||
fi | ||
else | ||
if [ "${fstype}" == "btrfs" ]; then | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value "${root_partition}") / btrfs subvol=@,compress=zstd 0 0" >> /etc/fstab | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value "${root_partition}") / btrfs subvol=@,compress=zstd,\${rootfs_mount_flags} 0 0" >> /etc/fstab | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value "${root_partition}") /home btrfs subvol=@home,compress=zstd 0 0" >> /etc/fstab | ||
if [ ! -z "${swap_size}" ] && [ "${swap_size}" -ne 0 ]; then echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value "${root_partition}") /var/swap btrfs subvol=@swap 0 0" >> /etc/fstab; fi | ||
else | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value "${root_partition}") / ext4 errors=remount-ro 0 1" >> /etc/fstab | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value "${root_partition}") / ext4 errors=remount-ro,\${rootfs_mount_flags} 0 1" >> /etc/fstab | ||
fi | ||
fi | ||
echo -e "/dev/disk/by-uuid/\$(blkid -s UUID -o value "${boot_partition}") /boot ext4 defaults 0 2" >> /etc/fstab | ||
|
@@ -9044,6 +9047,13 @@ REINSTALLBOOTLOADER | |
cat >>/boot/linuxloops/reinstall-bootloader <<REINSTALLBOOTLOADER | ||
pacman -Syu --noconfirm git fakeroot | ||
git clone https://aur.archlinux.org/shim-signed.git /tmp/shim-signed | ||
# Temporary fix for shim signed aur package | ||
sed -i '[email protected][email protected]+ubuntu+1.56@g' /tmp/shim-signed/PKGBUILD | ||
sed -i 's@532a97f7376ac8e5d7bedb8b2d4283769251266d19a78e3e12ec44f53a1dab6a@b2d84b300e68ac2139afee3f9a609857ef80f12eed9218087ced4b31ecb7fd76@g' /tmp/shim-signed/PKGBUILD | ||
sed -i 's@5f942542c21c41ffa14d22b890a6f51ccbfa0b3231f8a475265f90cb6e1cb924@375de6dd3a0419ed7ecd6465f2366ff5312e58c9ee7d67959ac57f59c81a0706@g' /tmp/shim-signed/PKGBUILD | ||
sed -i 's@de1c60b442d7484aa210c308ca422fe0d93439b50aeba192d2bbec7ec4d92779355d6ca838bb3d221fad8c4ea343dae37c13606200daf6f8f1436b120a4e9690@43ee11ec0ed04f224fb7452b2baaca45882a719063879f423c4118b6b99e99fd3fb20fa1a7de02af7b885f4d5c5e86e9868fb41557e74c52fbf04e3988199bd6@g' /tmp/shim-signed/PKGBUILD | ||
sed -i 's@ed0c856460c5a2aef8d9c4214ee9f2ba0c4926c4efec8add7171c0adada68f6c87f43461d67f8ca8747e9eaa037b2b90810d8daebecbc1c3a67bea34f781ea3e@10bbca68357de43ceb94605b7738873226aad4f91d47d6f3228694f1c2b08f020eb804915c496156554ac44917934266d2121989dafadbc996441e954ae64009@g' /tmp/shim-signed/PKGBUILD | ||
############################################ | ||
chown -R 'nobody':'nobody' /tmp/shim-signed | ||
su -s /bin/bash nobody -c "cd /tmp/shim-signed && makepkg -s" | ||
yes | pacman -U /tmp/shim-signed/*.pkg.tar.* | ||
|
@@ -9167,6 +9177,8 @@ lock-delay=0 | |
lock-enabled=false | ||
DCONF | ||
if [ ! -z "\$(command -v glib-compile-schemas)" ]; then glib-compile-schemas /usr/share/glib-2.0/schemas/; fi | ||
mkdir -p /etc/repart.d | ||
echo -e '[Partition]\nType=linux-generic' > /etc/repart.d/50-root.conf | ||
cat >/etc/systemd/system/live-configuration.service <<'LIVE_CONFIGURATION_SERVICE' | ||
[Unit] | ||
Description=Apply linuxloops live configuration | ||
|
@@ -9774,13 +9786,13 @@ set_credentials() | |
{ | ||
if [ "${distro}" == "BlissOS" ] || [ "${distro}" == "Brunch" ] || [ "${distro}" == "ChromeOS-Flex" ] || [ "${distro}" == "Tails" ]; then return; fi | ||
if [ "${test_distro}" == "Yes" ]; then | ||
hostname="$(echo "${distro}" | sed 's@[ !]@@g')-${RANDOM}" | ||
username="test" | ||
userpass="test" | ||
hostname="$(echo "${distro}" | sed 's@[ !]@@g')-${RANDOM}" | ||
elif [ "${live}" == "Yes" ]; then | ||
hostname="linuxloops" | ||
username="live" | ||
userpass="linuxloops" | ||
hostname="linuxloops" | ||
else | ||
if [ "${encryption}" == "Yes" ]; then | ||
encrypted_text="You have requested encryption, please input your username and the encryption password.\nYour user account password will be set as the encryption password but you can change it later." | ||
|
@@ -9789,7 +9801,15 @@ else | |
encrypted_text="Please input your username and user account password." | ||
password_text="user account password" | ||
fi | ||
if [ -z "${hostname}" ]; then hostname="$(echo "${distro}" | sed 's@[ !]@@g')-${RANDOM}"; fi | ||
if [ ! -z "${zenity}" ]; then | ||
if [ "${distro}" != "Qubes" ]; then | ||
until false; do | ||
hostname=$(sudo -u ${SUDO_USER} zenity --entry --height=480 --width=640 --title="LinuxLoops installer" --text="Which hostname should be used to identify this machine on the network ?" --entry-text "${hostname}" --ok-label="Next" 2>/dev/null) | ||
if [ -z "${hostname}" ] || echo "${hostname}" | grep -Pq '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$'; then sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --error --text="hostname contains unsupported characters.\n" 2>/dev/null; continue; fi | ||
break | ||
done | ||
fi | ||
until false; do | ||
form=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --forms --text="${encrypted_text}" --add-entry="Input your username" --add-password="Input your ${password_text}" --add-password="Confirm your ${password_text}" --ok-label="Next" 2>/dev/null) | ||
username="$(echo ${form} | cut -d'|' -f1)" | ||
|
@@ -9824,7 +9844,6 @@ else | |
break | ||
done | ||
fi | ||
hostname="$(echo "${distro}" | sed 's@[ !]@@g')-${RANDOM}" | ||
fi | ||
} | ||
|
||
|
@@ -9929,13 +9948,13 @@ if [ "${install_type}" == "disk" ]; then | |
if [ -z "${timezone}" ]; then exit 1; fi | ||
if [[ " ${btrfs_supported[*]} " =~ " ${distro} " ]]; then fstype=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Which filesystem format would you like for the rootfs partition ?" --column "Filesystem" "ext4" "btrfs" --ok-label="Next" 2>/dev/null); else fstype="ext4"; fi | ||
if [ -z "${fstype}" ]; then exit 1; fi | ||
encryption=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want the image to be encrypted ? This is highly recommended if you intend to keep sensitive data in it, however it will slightly impacts performance." --column "Encryption" "Yes" "No" --ok-label="Next" 2>/dev/null) | ||
encryption=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want the image to be encrypted ?\nThis is highly recommended if you intend to keep sensitive data." --column "Encryption" "Yes" "No" --ok-label="Next" 2>/dev/null) | ||
if [ -z "${encryption}" ]; then exit 1; fi | ||
swap_size=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --scale --text "Please select here the swap size (swap is not mandatory, if you do not know what swap is you can select 0).\n" --min-value=0 --max-value=$(( ${install_size} - 12 )) --value=0 --step 1 2>/dev/null) | ||
if [ -z "${swap_size}" ]; then exit 1; fi | ||
if [[ " ${nvidia_supported[*]} " =~ " ${distro} " ]]; then nvidia=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to automatically install the nvidia proprietary drivers ?" --column "Install nvidia driver" "No" "Yes" --ok-label="Next" 2>/dev/null); else nvidia="No"; fi | ||
if [ -z "${nvidia}" ]; then exit 1; fi | ||
if [[ " ${surface_supported[*]} " =~ " ${distro} " ]]; then surface=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to automatically install the surface device patches from https://github.com/linux-surface ? (enable this only if you have a Microsoft Surface device)" --column "Apply Surface patches" "No" "Yes" --ok-label="Next" 2>/dev/null); else surface="No"; fi | ||
if [[ " ${surface_supported[*]} " =~ " ${distro} " ]]; then surface=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to automatically install the surface device patches from https://github.com/linux-surface ?\n(enable this only if you have a Microsoft Surface device)" --column "Apply Surface patches" "No" "Yes" --ok-label="Next" 2>/dev/null); else surface="No"; fi | ||
if [ -z "${surface}" ]; then exit 1; fi | ||
customize=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to customize the install ?" --column "Customize install" "No" "Yes" --ok-label="Next" 2>/dev/null) | ||
if [ -z "${customize}" ]; then exit 1; fi | ||
|
@@ -10017,13 +10036,13 @@ else | |
if [ -z "${timezone}" ]; then exit 1; fi | ||
if [[ " ${btrfs_supported[*]} " =~ " ${distro} " ]]; then fstype=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Which filesystem format would you like for the rootfs partition ?" --column "Filesystem" "ext4" "btrfs" --ok-label="Next" 2>/dev/null); else fstype="ext4"; fi | ||
if [ -z "${fstype}" ]; then exit 1; fi | ||
encryption=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want the image to be encrypted ? This is highly recommended if you intend to keep sensitive data in it, however it will slightly impacts performance." --column "Encryption" "Yes" "No" --ok-label="Next" 2>/dev/null) | ||
encryption=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want the image to be encrypted ?\nThis is highly recommended if you intend to keep sensitive data." --column "Encryption" "Yes" "No" --ok-label="Next" 2>/dev/null) | ||
if [ -z "${encryption}" ]; then exit 1; fi | ||
swap_size=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --scale --text "Please select here the swap size (swap is not mandatory, if you do not know what swap is you can select 0).\n" --min-value=0 --max-value=$(( ${install_size} - 12 )) --value=0 --step 1 2>/dev/null) | ||
if [ -z "${swap_size}" ]; then exit 1; fi | ||
if [[ " ${nvidia_supported[*]} " =~ " ${distro} " ]]; then nvidia=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to automatically install the nvidia proprietary drivers ?" --column "Install nvidia driver" "No" "Yes" --ok-label="Next" 2>/dev/null); else nvidia="No"; fi | ||
if [ -z "${nvidia}" ]; then exit 1; fi | ||
if [[ " ${surface_supported[*]} " =~ " ${distro} " ]]; then surface=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to automatically install the surface device patches from https://github.com/linux-surface ? (enable this only if you have a Microsoft Surface device)" --column "Apply Surface patches" "No" "Yes" --ok-label="Next" 2>/dev/null); else surface="No"; fi | ||
if [[ " ${surface_supported[*]} " =~ " ${distro} " ]]; then surface=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to automatically install the surface device patches from https://github.com/linux-surface ?\n(enable this only if you have a Microsoft Surface device)" --column "Apply Surface patches" "No" "Yes" --ok-label="Next" 2>/dev/null); else surface="No"; fi | ||
if [ -z "${surface}" ]; then exit 1; fi | ||
customize=$(sudo -u ${SUDO_USER} zenity --height=480 --width=640 --title="LinuxLoops installer" --list --text "Do you want to customize the install ?" --column "Customize install" "No" "Yes" --ok-label="Next" 2>/dev/null) | ||
if [ -z "${customize}" ]; then exit 1; fi | ||
|
@@ -10111,6 +10130,7 @@ if grep -qi 'Microsoft' /proc/version; then wsl=1; fi | |
if [ "$(grep -o 'NAME=[^,]\+' /etc/os-release | cut -d'=' -f2)" == "Chrome OS" ]; then if [ -f /etc/brunch_version ]; then brunch=1; else chromeos=1; fi; fi | ||
} | ||
|
||
set +H | ||
check_dependencies | ||
set_base_parameters | ||
if [ ${#} -eq 0 ]; then | ||
|
@@ -10145,18 +10165,18 @@ else | |
-s | --size) | ||
shift | ||
if [ -z "${1##*[!0-9]*}" ] || [ "${1}" -lt 0 ]; then | ||
echo "Provided disk image size is not a positive integer: ${1}" | ||
echo "Provided disk image size is not a positive integer: ${1}." | ||
exit 1 | ||
elif [ "${1}" -lt 14 ] ; then | ||
echo "Disk image size cannot be lower than 14 GB" | ||
echo "Disk image size cannot be lower than 14 GB." | ||
exit 1 | ||
fi | ||
install_size="${1}" | ||
;; | ||
-z | --swapsize) | ||
shift | ||
if [ -z "${1##*[!0-9]*}" ] || [ "${1}" -lt 0 ]; then | ||
echo "Provided swap size is not a positive integer: ${1}" | ||
echo "Provided swap size is not a positive integer: ${1}." | ||
exit 1 | ||
fi | ||
swap_size="${1}" | ||
|
@@ -10170,6 +10190,11 @@ else | |
-e | --encrypt) | ||
encryption="Yes" | ||
;; | ||
-H | --hostname) | ||
shift | ||
if echo "${1}" | grep -Pq '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$'; then echo "Provided hostname contains invalid characters."; exit 1; fi | ||
hostname="${1}" | ||
;; | ||
-L | --locale) | ||
shift | ||
locale="${1}" | ||
|