[SOLVED]Need to modify /etc/default/grub before 1st boot

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
big-red-cow
Level 1
Level 1
Posts: 5
Joined: Sun May 02, 2021 3:08 pm

[SOLVED]Need to modify /etc/default/grub before 1st boot

Post by big-red-cow »

I'm installing linuxmint 20.1 xfce to an Acer Chromebook 11 C740. When booting from the live USB, I must first edit the boot parameters for Casper by adding the line i915.fastboot=1, otherwise the screen flashes on and off constantly.

Also, during the install, I need to keep the display active, so I install xscreensaver and set for random screensavers after 1 minute.

All is well, I get the release installed, but after rebooting, there is no way for me to intercept grub and modify the boot parameters prior to getting into the system and adjusting /etc/default/grub and then running update-grub.

Pressing the "normal" keys doesn't help me: I can press Esc or Right-Shift, and the bootup may pause, but I never get into the grub edit.

I realize this is likely a quirk of my Chromebook, as it's not using UEFI unless I'm willing to remove the write-protect and flash the bios.

If I were clever enough, I would chroot into the freshly installed system and fix it myself while I'm still in the live usb. But I'm not quite there yet.

Any ideas?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
spamegg
Level 14
Level 14
Posts: 5040
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Need to modify /etc/default/grub before 1st boot

Post by spamegg »

By holding Shift, you can go into Advanced Options/Recovery Mode, then "drop to root shell" and you can use a command-line editor like nano to edit /etc/default/grub and update-grub.

But you shouldn't have to do all this stuff you are doing. There must be some other solution, some alternative to the i915.fastboot=1 trick.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by rene »

He said he can't get into the Grub menu...

Does it have a regular SATA drive? If so and if it's /dev/sda and your newly installed rootfs is on /dev/sda1 with /boot not split off and, seemingly, in your case no separate EFI system partition on /boot/efi, from a terminal on the Live USB post-install

Code: Select all

$ sudo -s
# mount /dev/sda1 /mnt
# vi /mnt/etc/default/grub 
# mount --bind /dev /mnt/dev
# mount --bind /sys /mnt/sys
# mount --bind /proc /mnt/proc
# chroot /mnt update-grub
# exit
$
Feel free of course to use e.g. nano rather than vi if you like.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by rene »

Oh, wait. But he also said explicitly Right-Shift and it in fact needs to be specifically Left-Shift at least on normal legacy systems.
User avatar
spamegg
Level 14
Level 14
Posts: 5040
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Need to modify /etc/default/grub before 1st boot

Post by spamegg »

Right, it should be Left Shift.

I understood that he could not get into Grub-edit, not Grub. I guess I don't get it.
big-red-cow
Level 1
Level 1
Posts: 5
Joined: Sun May 02, 2021 3:08 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by big-red-cow »

spamegg wrote: Sun May 02, 2021 5:00 pm By holding Shift, you can go into Advanced Options/Recovery Mode, then "drop to root shell" and you can use a command-line editor like nano to edit /etc/default/grub and update-grub.

But you shouldn't have to do all this stuff you are doing. There must be some other solution, some alternative to the i915.fastboot=1 trick.
nomodeset is the typical way around incompatible video cards or situations, but this yields a very slow system with the wrong screen dimensions. i915 works great, once I get grub setup. Thanks for your reply.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by rene »

Have you done the above to edit post-install from the live system?
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by rene »

spamegg wrote: Sun May 02, 2021 6:01 pm I understood that he could not get into Grub-edit, not Grub. I guess I don't get it.
There is no such thing as boot-time "Grub-edit" other than edting the Grub commands from the Grub menu; the same menu you'd pick those 'Advanced Options' from.
big-red-cow
Level 1
Level 1
Posts: 5
Joined: Sun May 02, 2021 3:08 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by big-red-cow »

rene wrote: Sun May 02, 2021 5:11 pm He said he can't get into the Grub menu...

Does it have a regular SATA drive? If so and if it's /dev/sda and your newly installed rootfs is on /dev/sda1 with /boot not split off and, seemingly, in your case no separate EFI system partition on /boot/efi, from a terminal on the Live USB post-install

Code: Select all

$ sudo -s
# mount /dev/sda1 /mnt
# vi /mnt/etc/default/grub 
# mount --bind /dev /mnt/dev
# mount --bind /sys /mnt/sys
# mount --bind /proc /mnt/proc
# chroot /mnt update-grub
# exit
$
Feel free of course to use e.g. nano rather than vi if you like.
This is exactly what I was looking for! I had to wait until after I chrooted to modify /etc/default/grub, because the changes I made were not getting saved. This is the simplest explanation for using chroot into an existing system. Thank you so much!
big-red-cow
Level 1
Level 1
Posts: 5
Joined: Sun May 02, 2021 3:08 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by big-red-cow »

rene wrote: Sun May 02, 2021 8:40 pm Have you done the above to edit post-install from the live system?
Yes! Thanks for asking.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by rene »

big-red-cow wrote: Sun May 02, 2021 9:09 pm I had to wait until after I chrooted to modify /etc/default/grub, because the changes I made were not getting saved.
I expect you didn't before the chroot say /mnt/etc/default/grub rather than just /etc/default/grub then. But in any case good that it worked; I followed up due to being momentarily "scared" that my own next "Oh, wait" post was taken literally to mean that the chroot advise wouldn't work.
big-red-cow
Level 1
Level 1
Posts: 5
Joined: Sun May 02, 2021 3:08 pm

Re: Need to modify /etc/default/grub before 1st boot

Post by big-red-cow »

rene wrote: Sun May 02, 2021 9:17 pm
big-red-cow wrote: Sun May 02, 2021 9:09 pm I had to wait until after I chrooted to modify /etc/default/grub, because the changes I made were not getting saved.
I expect you didn't before the chroot say /mnt/etc/default/grub rather than just /etc/default/grub then. But in any case good that it worked; I followed up due to being momentarily "scared" that my own next "Oh, wait" post was taken literally to mean that the chroot advise wouldn't work.
Duhhh... Yeah, you are correct. I'm pretty sure I left off the /mnt.

No key works at the grub menu: Left-Shift, Right-Shift, or Esc: to stop the boot on my quirky little Chromebook.

Most distros I've seen set the timeout to zero, and the timeout style to hidden, so there is no way I could have solved this without your chroot advice. I've printed this out and saved it in a Linux notebook I keep. Thanks, I can't wait to play around with this idea some more.
Locked

Return to “Installation & Boot”