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

Add functionality for Rocky Linux #20

Open
jakDev003 opened this issue Jan 10, 2025 · 0 comments
Open

Add functionality for Rocky Linux #20

jakDev003 opened this issue Jan 10, 2025 · 0 comments

Comments

@jakDev003
Copy link

jakDev003 commented Jan 10, 2025

Is your feature request related to a problem? Please describe.
I am using Rocky Linux 9. Your install script is only expecting Fedora for the DNF package manager. Rocky has grub in "/boot/grub2/grub.cfg" not "/boot/efi/EFI/fedora/grub.cfg". I tried making a new branch with a PR but I was blocked so I am posting here.

Describe the solution you'd like
Enable the ability to look not just for package manager but also Distribution name to know the path to install

Describe alternatives you've considered
Not using your script. But i would like to use it.

Additional context
Here is my code change:
From this:

function update_grub() {
    # Update grub config
    echo_primary 'Updating grub config...'
    if [[ -x "$(command -v update-grub)" ]]; then
        echo_info 'update-grub'
        update-grub

    elif [[ -x "$(command -v grub-mkconfig)" ]]; then
        echo_info 'grub-mkconfig -o /boot/grub/grub.cfg'
        grub-mkconfig -o /boot/grub/grub.cfg

    elif [[ -x "$(command -v grub2-mkconfig)" ]]; then
        if [[ -x "$(command -v zypper)" ]]; then
            echo_info 'grub2-mkconfig -o /boot/grub2/grub.cfg'
            grub2-mkconfig -o /boot/grub2/grub.cfg

        elif [[ -x "$(command -v dnf)" ]]; then
            echo_info 'grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg'
            grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
        fi
    fi
}

To this:

function update_grub() {
    # Update grub config
    echo_primary 'Updating grub config...'
    if [[ -x "$(command -v update-grub)" ]]; then
        echo_info 'update-grub'
        update-grub

    elif [[ -x "$(command -v grub-mkconfig)" ]]; then
        echo_info 'grub-mkconfig -o /boot/grub/grub.cfg'
        grub-mkconfig -o /boot/grub/grub.cfg

    elif [[ -x "$(command -v grub2-mkconfig)" ]]; then
        if [[ -x "$(command -v zypper)" ]]; then
            echo_info 'grub2-mkconfig -o /boot/grub2/grub.cfg'
            grub2-mkconfig -o /boot/grub2/grub.cfg

        elif [[ -x "$(command -v dnf)" ]]; then
	    # Check if the Distro is Rocky Linux
	    if grep -q 'Rocky Linux' /etc/os-release; then
		echo_info 'grub2-mkconfig -o /boot/grub2/grub.cfg'
                grub2-mkconfig -o /boot/grub2/grub.cfg
	    else
		echo_info 'grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg'
                grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
	    fi
        fi
    fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant