Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Valeria-Fadeeva opened this issue Nov 5, 2023 · 3 comments
Open

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

Valeria-Fadeeva opened this issue Nov 5, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Valeria-Fadeeva
Copy link

Valeria-Fadeeva commented Nov 5, 2023

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']
@Valeria-Fadeeva Valeria-Fadeeva changed the title Crach if package not endswith(".zst") Crash if package not endswith(".zst") Nov 5, 2023
@Valeria-Fadeeva Valeria-Fadeeva changed the title Crash if package not endswith(".zst") eos_bootloader: Crash if package not endswith(".zst") Nov 5, 2023
@Valeria-Fadeeva Valeria-Fadeeva changed the title eos_bootloader: Crash if package not endswith(".zst") eos_bootloader: crash if package not endswith(".zst") Nov 5, 2023
@dalto8 dalto8 added the enhancement New feature or request label Nov 5, 2023
@dalto8
Copy link

dalto8 commented Nov 5, 2023

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
Copy link
Member

killajoe commented Nov 5, 2023

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants