bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
602 stars 65 forks source link

Install script refuses to hijack after grub deletion (with fix) #246

Closed EiseZ closed 2 years ago

EiseZ commented 2 years ago

I have tried bedrock linux in a vm, and I think it's a magnificent piece of software, thus I want to install it on my main pc.

I had installed the infamous duo grub + btrfs, so ofc the install script didn't work. Then I deleted grub from my system (voidlinux), all the packages via xbps and all the folders/files belonging to grub in the /boot directory. And I install refind.

But still, the install script gives the following message: "ERROR: Detected BTRFS mount and GRUB reference in /boot. GRUB can get confused when updating its configuration in this scenario. Either use another filesystem or another bootloader."

Which is obviously weird, because I removed grub.

So I did some digging in the source code of the install script. And found that on line 2024 (line 112 in the installer.sh source code) there is an elif statement which will always return true when the users uses btrfs. Because the find function will always return true, even if there is no matching file found.

So to prevent this it should be rewritten from "elif grep -qi 'btrfs' '/proc/mounts' && find /boot -iname "grub" >/dev/null 2>&1; then" to "elif grep -qi 'btrfs' '/proc/mounts' && find /boot -iname "grub" >/dev/null 2>&1 | grep .; then" Because "grep ." will return false if there is no output from the find command.

But idk how to make a pull request so I just made this issue because it's such a small change.

EiseZ commented 2 years ago

I have just compiled the script with the changes I described and can confirm what I have now a working bedrock linux system.

paradigm commented 2 years ago

Thanks for not only the complement, and not only reporting the issue, but performing due diligence to hunt down exactly what the issue was and providing a viable fix. I just pushed the fix here: https://github.com/bedrocklinux/bedrocklinux-userland/commit/bb8381a6d30f922568f3d1e635ca5e5e04266150

I'm closing the issue assuming I got it right. Feel free to re-open if you think I missed or misunderstood something.

Enjoy your Bedrock install :)