https://github.com/mozgiii/fakegrub
Generate a fake grub.cfg with minimal content to be picked up by a real GRUB's osprober. Useful for passing kernel arguments to the OS in a multiboot environment when the real system GRUB is managed by other OS, and installing GRUB just to manage the configs is undesirable.
https://github.com/mozgiii/fakegrub
grub multiboot
Last synced: over 1 year ago
JSON representation
Generate a fake grub.cfg with minimal content to be picked up by a real GRUB's osprober. Useful for passing kernel arguments to the OS in a multiboot environment when the real system GRUB is managed by other OS, and installing GRUB just to manage the configs is undesirable.
- Host: GitHub
- URL: https://github.com/mozgiii/fakegrub
- Owner: MOZGIII
- Created: 2019-07-05T17:07:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-05T17:17:57.000Z (almost 7 years ago)
- Last Synced: 2025-01-21T06:28:50.376Z (over 1 year ago)
- Topics: grub, multiboot
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fakegrub
Generate a fake `grub.cfg` with minimal content to be picked up by a real GRUB's
`osprober`. Useful for passing kernel arguments to the OS in a multiboot
environment when the real system GRUB is managed by other OS, and installing
GRUB just to manage the configs is undesirable.
## Requirements
- bash
- cat
- xargs
- perl
## Installation
Currently only source installation method is available.
More install options are planned in the future.
### From source
1. Clone the repo.
2. Set system-wide fakegrub settings.
```shell
$ bin/fakegrub-default-settings | sudo tee /etc/fakegrub
$ sudo edit /etc/fakegrub
```
## Usage
To update `grub.cfg` using the system-wide fakegrub settings, use this:
> Warning: this command will try to write to `/boot/grub/grub.cfg` by default.
> Although it has a built-in safety-check to prevent overwriting the
> configuration when it's not generated by fakegrub, be careful when using it
> on a live system. It's a good idea to backup `/boot/grub/grub.cfg` before
> running the command below if you're not yet comfortable with fakegrub.
```shell
$ sudo bin/update-fakegrub
```
To just print the GRUB config generated with system fakegrub settings use
`fakegrub-mkconfig` (similar to `grub-mkconfig`, but doesn't require root):
```shell
$ bin/fakegrub-mkconfig
```
You can also invoke config generator directly passing custom settings:
```shell
$ bin/fakegrub-generate "My menuentry" "root=/dev/vg/lvroot"
```