-
Notifications
You must be signed in to change notification settings - Fork 66
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
Firmware: Add multiple other options to move firmware to Linux #533
Conversation
@soopyc , any chance the changes in this PR can be useful for nixOS? |
This PR adds 2 new options:
I don't know how to make rpm packages, would need @sharpenedblade 's help |
docs/tools/firmware.sh
Outdated
prerequisite_packages () { | ||
cat <<EOF | ||
|
||
Prerequisites needed to continue: | ||
|
||
1. Python 3 | ||
2. ${additional_requirement} | ||
|
||
Python 3 is a part of Xcode command line tools. You can also use Homebrew, MacPorts etc. | ||
Continue when you have the prerequisites installed. | ||
|
||
Continue? (Y/n) | ||
EOF | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only ask people to install stuff if they dont already have it:
if ! command -v COMMAND &> /dev/null; then
# ask to install it here, then return a error
fi
Also do this where you ask people to install python later in the script. You don't need to ask people to continue, just exit if the command is not available.
docs/tools/firmware.sh
Outdated
echo -e "\nPrerequisites needed to continue:" | ||
echo -e "\n1. Python 3" | ||
echo -e "\nPython 3 is a part of Xcode command line tools. You can also use Homebrew, MacPorts etc." | ||
echo "Continue when you have the prerequisites installed." | ||
echo -e "\nContinue? (Y/n)" | ||
read input | ||
if [[ ($input = n) || ($input = N) ]] | ||
then | ||
echo -e "\nRun the script again when you have installed the prerequisites." | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run the prerequisite_packages
function here instead, it does the same thing.
docs/tools/firmware.sh
Outdated
read input | ||
if [[ ($input = n) || ($input = N) ]] | ||
then | ||
echo -e "\nRun the script again when you have installed the prerequisites." | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make prerequisite_packages
return a non-zero exit status if dependencies are not installed, then remove this code and replace it with prerequisite_packages || exit 1
docs/tools/firmware.sh
Outdated
sudo python3 "$0" $workdir $workdir/firmware-renamed.tar ${verbose} | ||
sudo python3 $0 $workdir $workdir/firmware-renamed.tar ${verbose} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Word splitting can cause problems here, leave it in double quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, that change was unintentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good now, just change the sudo python3
command
Latest commit adds Arch package as well. @NoaHimesaka1873 @Redecorating , can you test the Arch bit whenever you get time? |
Looks like dnf wants to connect to the internet first and then install the .rpm package. Better to use rpm -i
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you merge #536, otherwise this looks good. If the other maintainers are fine with it then LGTM
A final request for review before we can merge this. IMO its complete now. |
I just remembered, the wiki will also have to be updated:( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine apart from the headings.
When I tried installing on a Live EOS ISO, it was trying to remake the initramfs inspite of not specifying it. But since the live CD doesn't have a vmlinuz in /boot, it was failing. So I thought on a real installation, Pacman maybe smart enough to reprobe the driver. I don't think there is anything wrong in simply running a modprobe -r brcmfmac after installing firmware. Why force a user to reboot when there is a simpler way. I guess we should try not to complicate things for users just for sake of standardization or it works but doesn't belong here. |
Co-authored-by: Cassie Cheung <[email protected]>
Fixed |
AFAIK modprobe doesnt call any package manager stuff and just tells the kernel to load a module, but I guess its fine to leave it in, just add a note to the arch/eos section to reboot. |
I guess PKGBUILD has a post_install section as well. I'll probably add it later. Will also have to test on an Arch installation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my end.
@AdityaGarg8 It works. LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Is it reloading the driver automatically? |
No. For that you have to create |
Should apple-firmware.install be in the same directory as PKGBUILD? |
Yes. |
Can you test now @NoaHimesaka1873 . I've pushed a change. |
It's regarding automatic reloading of driver btw |
The latest commit (4037f5e) seems to be reloading the driver on atleast EOS live environment on a VM. I would be nice if I could get a feed back from a bare metal installation. |
@soopyc , do you want to make changes to the nixOS guide alongwith this PR? I've noticed something regarding wifi over there. |
On 5/23/24 18:14, Aditya Garg wrote:
@soopyc , do you want to make changes to the nixOS guide alongwith this PR? I've noticed something regarding wifi over their.
Sure, I'll work on that now.
--
Best regards,
Cassie Cheung (she/they)
|
Tested on a EOS installation, it works |
Alright I am merging this, @soopyc you can open a new PR for nixos. If you want to add support in some way to the script, you can do that as well. |
No description provided.