endeavouros-team / calamares

Distribution-independent installer framework
https://calamares.io
14 stars 10 forks source link

eos_bootloader: crash if package not endswith(".zst") #26

Open Valeria-Fadeeva opened 8 months ago

Valeria-Fadeeva commented 8 months ago

for other package archive

file: src/modules/eos_bootloader/main.py string:

if file.startswith(package + "-") and file.endswith(".zst"):

replace:

if (file.startswith(package + "-") and "pkg.tar" in file and ".sig" not in file):

example

#!/usr/bin/env python3

file_list = """
dracut-059-3-x86_64.pkg.tar.zst
dracut-059-3-x86_64.pkg.tar.zst.sig
grub-2:2.12rc1-5-x86_64.pkg.tar.zst
grub-2:2.12rc1-5-x86_64.pkg.tar.zst.sig
grub-dracut-1.2.1-1-any.pkg.tar.xz
grub-dracut-1.2.1-1-any.pkg.tar.xz.sig
libxvmc-1.0.13-2-x86_64.pkg.tar.zst
libxvmc-1.0.13-2-x86_64.pkg.tar.zst.sig
linux-6.5.9.arch2-1-x86_64.pkg.tar.zst
linux-6.5.9.arch2-1-x86_64.pkg.tar.zst.sig
linux-api-headers-6.4-1-any.pkg.tar.zst
linux-api-headers-6.4-1-any.pkg.tar.zst.sig
linux-headers-6.5.9.arch2-1-x86_64.pkg.tar.zst
linux-headers-6.5.9.arch2-1-x86_64.pkg.tar.zst.sig
linux-xanmod-anbox-6.5.10-1-x86_64.pkg.tar.xz
linux-xanmod-anbox-6.5.10-1-x86_64.pkg.tar.xz.sig
linux-xanmod-anbox-headers-6.5.10-1-x86_64.pkg.tar.xz
linux-xanmod-anbox-headers-6.5.10-1-x86_64.pkg.tar.xz.sig
melawy-dracut-initramfs-1.21-1-any.pkg.tar.xz
melawy-dracut-initramfs-1.21-1-any.pkg.tar.xz.sig
melawy-dracut-ukify-1.24-1-any.pkg.tar.xz
melawy-dracut-ukify-1.24-1-any.pkg.tar.xz.sig
melawy-plymouth-theme-nier-a2-1.8-1-any.pkg.tar.xz
melawy-plymouth-theme-nier-a2-1.8-1-any.pkg.tar.xz.sig
melawy-refind-menu-generator-1.29-1-any.pkg.tar.xz
melawy-refind-menu-generator-1.29-1-any.pkg.tar.xz.sig
melawy-refind-theme-nier-a2-1.5-1-any.pkg.tar.xz
melawy-refind-theme-nier-a2-1.5-1-any.pkg.tar.xz.sig
os-prober-1.81-1-x86_64.pkg.tar.zst
os-prober-1.81-1-x86_64.pkg.tar.zst.sig
packages_here
refind-0.14.0.2-1-any.pkg.tar.zst
refind-0.14.0.2-1-any.pkg.tar.zst.sig
systemd-boot-dracut-1.9.1.18-1-any.pkg.tar.xz
systemd-boot-dracut-1.9.1.18-1-any.pkg.tar.xz.sig
update-grub-0.0.1-8-any.pkg.tar.zst
update-grub-0.0.1-8-any.pkg.tar.zst.sig
xf86-video-intel-1:2.99.917+923+gb74b67f0-1-x86_64.pkg.tar.zst
xf86-video-intel-1:2.99.917+923+gb74b67f0-1-x86_64.pkg.tar.zst.sig
"""

packages = ["grub", "grub-dracut", "os-prober"]
package_files = []

for package in packages:
    for file in file_list.splitlines():
        if (file.startswith(package + "-") and "pkg.tar" in file and ".sig" not in file):
            package_files.append(file)

package_files = set(package_files)
package_files = list(package_files)
print(package_files)

to avoid pacman error - duplicate target (file.startswith(package + "-"))

package_files = set(package_files)

to return list (for future checking data type)

package_files = list(package_files)

before

['grub-2:2.12rc1-5-x86_64.pkg.tar.zst', 'grub-dracut-1.2.1-1-any.pkg.tar.xz', 'grub-dracut-1.2.1-1-any.pkg.tar.xz', 'os-prober-1.81-1-x86_64.pkg.tar.zst']

after

['grub-2:2.12rc1-5-x86_64.pkg.tar.zst', 'os-prober-1.81-1-x86_64.pkg.tar.zst', 'grub-dracut-1.2.1-1-any.pkg.tar.xz']
dalto8 commented 8 months ago

eos_bootloader was never intended to be a general purpose module to be used by others. It was built to serve a very specific purpose so the current functionality is correct for that intended purpose.

That being said, I am not opposed to adding support for more package formats if it helps you. It would probably not come until after our upcoming release though.

killajoe commented 8 months ago

only to mention.. this is only the fork of calamares we do use downstream for EndeavourOS, also stuff will may went into main calamares.. https://github.com/calamares/calamares

Valeria-Fadeeva commented 8 months ago

I have been developing my own distribution based on Arch Linux for 1.5 years. https://github.com/Melawy https://git.melawy.ru/explore/repos

The last problem was the installation.

Of all the distributions, I liked the installation approach from EndeavourOS.

I made a local fork and began to combine Calamares from 4 providers: Calamares original, EndeavourOS, CachyOS, KaOS.

And ArchISO configuration from EndeavourOS, CachyOS, XeroLinux, ArcoLinux.

Since I have packages for installing and designing rEFInd bootloader, I added it there.

Now I have the first Beta release and I am testing installation from disk and over the network in 3 options: rEFInd (with design), Systemd-boot, Grub2 (I also want with design).

I also want to make the rEFInd, Systemd-boot, Grub2 bootloaders create a boot menu based on the kernel located in (root)/EFI/Linux. And so that bootloaders, design and menus are on the EFI partition due to LUKS blocking.

I would be glad if my code could be added to your project and help others.

Thank you.