No grub file

27 respostas [Última entrada]
GNUbahn
Desconectado
Joined: 02/19/2016

Disclaimer: This question is about Debian. I have unsuccessfully tried to install Trisquel on my Libreboot x200. I have so far succeeded to install Debian - I hope to be able to install Trisquel 8, when it's here.

As said, I have successfully installed Debian. Libreboot searches for a libreboot_grub.cfg which should be created (renamed and/or modified) from grub.cfg. But I can't fin any grub.cfg file. It's not in /boot /boot/grub /etc/default/grub or where ever I have searched.

Running "update-grub" in terminal gives me "command not found" response and sudo'ing gives the response "[username] is not sudoersfile (translated from Danish: [username] er ikke sudoersfilen.)

If I understand correctly, this means that I don't have access as superuser. That on earth do I do about that?

hack and hack
Desconectado
Joined: 04/02/2015

Modify grub.cfg (CBFS)
Now you need to set it up so that the system will automatically boot, without having to type a bunch of commands.
Modify your grub.cfg (in the firmware) using this tutorial (https://libreboot.org/docs/gnulinux/grub_cbfs.html)
-
The GRUB configuration file (where your GRUB menu comes from) is stored directly alongside libreboot and its GRUB payload executable, inside the flash chip.

https://libreboot.org/docs/gnulinux/encrypted_debian.html

Trisquel on Librebooted X200 worked just fine for me, by the way.

Can you mount your HDD with the suggested commands ? (cryptomount etc.)

GNUbahn
Desconectado
Joined: 02/19/2016

From https://libreboot.org/docs/gnulinux/grub_cbfs.html, 1st option says:

---
1st option: don't re-flash

By default, GRUB in libreboot is configured to scan all partitions on the main storage for /boot/grub/libreboot_grub.cfg or /grub/libreboot_grub.cfg(for systems where /boot is on a dedicated partition), and then use it automatically.

Simply create your custom GRUB configuration and save it to /boot/grub/libreboot_grub.cfg on the running system. The next time you boot, GRUB (in libreboot) will automatically switch to this configuration file. This means that you do not have to re-flash, recompile or otherwise modify libreboot at all!

Ideally, your distribution should automatically generate a libreboot_grub.cfg file that is written specifically under the assumption that it will be read and used on a libreboot system that uses GRUB as a payload. If your distribution does not do this, then you can try to add that feature yourself or politely ask someone involved with or otherwise knowledgeable about the distribution to do it for you. The libreboot_grub.cfg could either contain the full configuration, or it could chainload another GRUB ELF executable (built to be used as a coreboot payload) that is located in a partition on the main storage.

If you want to adapt a copy of the existing libreboot GRUB configuration and use that for the libreboot_grub.cfg file, then follow #tools, #rom and #extract_testconfig to get the grubtest.cfg. Rename grubtest.cfg to libreboot_grub.cfg and save it to /boot/grub/ on the running system where it is intended to be used. Modify the file at that location however you see fit, and then stop reading this guide (the rest of this page is irrelevant to you); in libreboot_grub.cfg on disk, if you are adapting it based on grub.cfg from CBFS then remove the check for libreboot_grub.cfg otherwise it will loop..
---

Am I wrong to understand, that I should find the grub.cfg file and modify it?

Are you suggesting to go with the 2nd option?

When installing Trisquel, did you encounter any problems which you know how you came about?

hack and hack
Desconectado
Joined: 04/02/2015

Definitely don't reflash (you don't have to).

I just remembered how these instructions lacked clarity sometimes, so here's something better: https://trisquel.info/en/forum/shorter-and-thorough-guide-updating-libreboot-x200

See #3, but before modifying GRUB, make sure you can manually boot with those same commands. Else it's pointless.
So allow me to insist: did you manage to boot with those cryptomount commands?

For Trisquel, the truth is I didn't flash Libreboot, it was already done. I updated it twice though.
The gigantic problem I've faced is documented here:
https://libreboot.org/docs/gnulinux/encrypted_debian.html#troubleshooting

That user is me ;)
This ridiculously stupid problem blocked me for months...

GNUbahn
Desconectado
Joined: 02/19/2016

The cryptomount commands booted just fine and I am running Debian by now.

In your guide you write: "See here for instructions, rather straightforward: https://libreboot.org/docs/gnulinux/grub_cbfs.html"

"Rather straightforward" probably depends on one's knowledge and skills. Does this mean, that if I don't have such file, I should just create one containing those specific commands, by use of e.g. gedit?

You really make me want to try with Trisquel again (thanks), but I have spend so much time on this. I just want it to work now, so I'll stick to Debian for the moments,

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

If there is a root account you can open a root terminal with 'su' (input the root password) and then execute 'update-grub' (no 'sudo').

GNUbahn
Desconectado
Joined: 02/19/2016

I don't think that I've seen this before, but in the system menu I found the entrance 'root-terminal' which solved the problem, i.e. let me update GRUB. Thanks

GNUbahn
Desconectado
Joined: 02/19/2016

Ok, so now I have a grub.cfg.

Is it correctly understood, that I now have to reboot and when at the GRUB menu enter 'c' to be able to work at GRUB level?

Hack and Hack, you wrote that

---
This means toreplace everything that's between the {} in that section by this:

cryptomount -a
set root='lvm/volumegroup-logicalvolume'
linux /vmlinuz root=/dev/mapper/volumegroup-logicalvolume cryptdevice=/dev/mapper/volumegroup-logicalvolume:root
initrd /initrd.img
---

If I understand correctly, what you mean is to modify the grub.cfg file in the above manner and save it as grubtest.cfg.

In my grub.cfg I have more than 208 lines and plenty of {}'s. Do you suggest to erase all that, or do I misunderstand totally?

hack and hack
Desconectado
Joined: 04/02/2015

You missed something here, as I'vee written that :
"just change the default menu entry 'Load Operating System' to say this inside (again, modify it according according to the way you named your volumegroup and logical volume). This means toreplace everything that's between the {} in that section by this:"

Well, everything between those specific brackets (Load Operating System), yes.
This was (IMO) badly worded on the Libreboot website.

I agree that "rather straightforward" is more subjective than I thought, but what I meant was that the Libreboot instructions were clear enough if you read carefully. But I should update the wiki page and add this in there.

GNUbahn
Desconectado
Joined: 02/19/2016

Ok, thanks.

When I'm at the GRUB menu, the first possible choice is 'Load Operating System (incl. fully encrypted disks) [o]'

Is it correctly understood, that I should mark this entrance and enter 'e' to "edit commands before booting"?

If so, I must say, that I don't see a {} that is specifically related to 'Load Operating System' (as I see it).

hack and hack
Desconectado
Joined: 04/02/2015

It seems you extracted grubtest.cfg from the Libreboot ROM.
And that you're stuck with modifying grubtest.cfg because you don't find the "Load Operating System" section.
Inside, you have "Load Operating System" followed by brackets {} with a bunch of stuff related to booting an OS.
Erase what's inside those brackets only, and paste in or write down your cryptomount commands that allowed you to manually boot.

I don't think I have what you"re describing having at the GRUB menu. "Load Operating System" is inside a TEXT file, which you must extract from Libreboot ROM.

Ok, not that straightforward to find, but here's the command: https://libreboot.org/docs/gnulinux/grub_cbfs.html#extract_testconfig

Something I should have explained better: these are scripts, so your ROM and the script must be in the same folder.

You can also try without reflashing (didn't work for me, but I might have misunderstood something): "Simply create your custom GRUB configuration and save it to /boot/grub/libreboot_grub.cfg on the running system. The next time you boot, GRUB (in libreboot) will automatically switch to this configuration file. This means that you do not have to re-flash, recompile or otherwise modify libreboot at all!"

GNUbahn
Desconectado
Joined: 02/19/2016

Ok, now things are getting clearer:

All the time you've been talking about the "2nd option: re-flash", while I've been talking about the "1st option: don't re-flash".

It seems to me, that option 2 is a bit harder. Can I do option 2 without actually upgrading the libreboot? I.e. can I jump directly to the section you linked to, "Extract grubtest.cfg from the ROM image"?

GNUbahn
Desconectado
Joined: 02/19/2016

Or ideally, can you help me to get this to work:

---
1st option: don't re-flash

By default, GRUB in libreboot is configured to scan all partitions on the main storage for /boot/grub/libreboot_grub.cfg or /grub/libreboot_grub.cfg(for systems where /boot is on a dedicated partition), and then use it automatically.

Simply create your custom GRUB configuration and save it to /boot/grub/libreboot_grub.cfg on the running system. The next time you boot, GRUB (in libreboot) will automatically switch to this configuration file. This means that you do not have to re-flash, recompile or otherwise modify libreboot at all!

Ideally, your distribution should automatically generate a libreboot_grub.cfg file that is written specifically under the assumption that it will be read and used on a libreboot system that uses GRUB as a payload. If your distribution does not do this, then you can try to add that feature yourself or politely ask someone involved with or otherwise knowledgeable about the distribution to do it for you. The libreboot_grub.cfg could either contain the full configuration, or it could chainload another GRUB ELF executable (built to be used as a coreboot payload) that is located in a partition on the main storage.

If you want to adapt a copy of the existing libreboot GRUB configuration and use that for the libreboot_grub.cfg file, then follow #tools, #rom and #extract_testconfig to get the grubtest.cfg. Rename grubtest.cfg to libreboot_grub.cfg and save it to /boot/grub/ on the running system where it is intended to be used. Modify the file at that location however you see fit, and then stop reading this guide (the rest of this page is irrelevant to you); in libreboot_grub.cfg on disk, if you are adapting it based on grub.cfg from CBFS then remove the check for libreboot_grub.cfg otherwise it will loop..
---

PS, how do you format to those yellowish boxes?

hack and hack
Desconectado
Joined: 04/02/2015

Yeah sorry, I'm not sure it was completely clear for me.

I theory, you should be able to extract grubtest.cfg, modify it, and place it in your boot folder with the right name and at the exact right place.

That's how I understand the first option, a.k.a. non reflash.
But I might be wrong. But there's no harm in trying.

Basically it's this, but for some reason it didn't work for me (should have insisted):
If you want to adapt a copy of the existing libreboot GRUB configuration and use that for the libreboot_grub.cfg file, then follow #tools, #rom and #extract_testconfig to get the grubtest.cfg. Rename grubtest.cfg to libreboot_grub.cfg and save it to /boot/grub/ on the running system where it is intended to be used.

Oh, and to get those yellow rectangles, see here https://trisquel.info/en/wiki/formatting-trisquel-forum

GNUbahn
Desconectado
Joined: 02/19/2016

What does following "#tools, #rom and #extract_testconfig to get the grubtest.cfg" mean...?

just testing, thanks

GNUbahn
Desconectado
Joined: 02/19/2016

To extract the GRUB file one has to

Acquire the necessary utilities
Use cbfstool and flashrom. There are available in the libreboot_util release archive...

How do I access or acquire files from 'libreboot_util'?

Anonymous (non verificado)
Anonymous
GNUbahn
Desconectado
Joined: 02/19/2016

Thanks. After downloading, how do I install the programs?

hack and hack
Desconectado
Joined: 04/02/2015

Nothing to install, just extract the files, then find the script you need in one of the folders.
You need to move the script and the rom to one folder (or just move the rom in the folder where the script is).

GNUbahn
Desconectado
Joined: 02/19/2016

I don't get this:

The guide says to

$ sudo flashrom -p internal -r libreboot.rom

Doesn't that suggest, that flashrom has to be started/run? Nothing seems to happen, when I run this command.

Anonymous (non verificado)
Anonymous

Replace "flashrom" in that command with the full path to flashrom.
For example: /home/GNUbahn/Downloads/libreboot_util/flashrom

GNUbahn
Desconectado
Joined: 02/19/2016

I opened a terminal in the folder where the flashrom file is. Wouldn't that give the same result?

GNUbahn
Desconectado
Joined: 02/19/2016

root@jb-x200:/home/jb/Hentninger/LB_util/libreboot_r20160907_util/flashrom/x86_64# ls -l
totalt 4836
-rwxr-xr-x 1 jb jb 1649884 sep 2 15:42 flashrom
-rwxr-xr-x 1 jb jb 1649884 sep 2 15:42 flashrom_lenovobios_macronix
-rwxr-xr-x 1 jb jb 1649884 sep 2 15:42 flashrom_lenovobios_sst
root@jb-x200:/home/jb/Hentninger/LB_util/libreboot_r20160907_util/flashrom/x86_64# flashrom -p internal -r libreboot.rom
bash: flashrom: kommando ikke fundet
root@jb-x200:/home/jb/Hentninger/LB_util/libreboot_r20160907_util/flashrom/x86_64#

Anonymous (non verificado)
Anonymous

No, if you want to execute something you downloaded which isn't symlinked to /usr/bin (symlinking something to /usr/bin is what makes "regular" commands work like ls and such), you have to either type the full path to it (/home/jb/Hentninger/LB_util/libreboot_r20160907_util/flashrom/x86_64/flashrom) or if you are already in the directory where the executable is located: ./flashrom

GNUbahn
Desconectado
Joined: 02/19/2016

Sorry, my bad. That was exactly what I did in comment #19.

Yet nothing seemed to happen

Anonymous (non verificado)
Anonymous

Sorry, but why are you trying to reflash? I skimmed through the thread, but I don't see how that would help with getting a libreboot_grub.cfg on your newly installed system. Could you shed some light on that, please? I might be able to help a bit then.

GNUbahn
Desconectado
Joined: 02/19/2016

I understand that my explanations so far are not very clear. Let me try like this:

I have an x200 on which Minifree has installed libreboot.

I have successfully installed Debian with full disk encryption by this guide at: https://libreboot.org/docs/gnulinux/encrypted_debian.html

I have successfully booted and is now with no issues as such running Debian with Cinnamon.

The next step is to modify GRUB, but I don't understand the guide: https://libreboot.org/docs/gnulinux/grub_cbfs.html

I see others find it straightforward but I don't (due to my lack of knowledge and skills).

It seems that 1st option should be the easier, but it requires knowledge about how to "create your custom GRUB configuration".

My distribution (Deb8) did not "automatically generate a libreboot_grub.cfg file". Can I just create one by means of Gedit? Can I create one and end it with a link to the original grub file?

hack and hack
Desconectado
Joined: 04/02/2015

This part isn't straightforward for me either, so I can't help. And there's no such file on my Debian nor on my Trisquel.

But reading it again, you can still do as it was suggested, and extract it from the ROM, modify it, re-import it in the ROM, and (sorry for not being more clear earlier) flash it, but not with hardware, only software.
It's about flashing the ROM from the CLI.

For details, please read above.