Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
EFI install - barebones
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jeff-g
n00b
n00b


Joined: 23 May 2018
Posts: 5

PostPosted: Thu May 24, 2018 6:28 pm    Post subject: EFI install - barebones Reply with quote

G'day, folks

Allow me to ramble for a bit to do a mental dump....

New to gentoo, not linux (7 years with a few ubuntus and bodhi). This is my 1st rodeo playing from source - I'm looking to avoid systemd and use enlightenment >e17.
Strike 1, I think, can't use enlightenment w/o systemd now, but thats a small snivel.
Some simple (ha) entry questions.
I want no loader if possible so thinking stub-kernel needed - haven't gotten that far yet.
I have a 100 mg /sda1, /sda2 swap, and /sda3 / .
Handbook says make /sda1 EFI and tag it boot - parted marks it esp. Then it says to create /boot dir on root and mount sd1 on it. This doesn't sound quite intuitive to me, but my intuition doesn't work here. Is this structure correct for a pure EFI?

I happily fell over menuconfig just when I was getting totally confused and set my config to accomadate efifvarfs. I'm doing this on a lenovo t530 with 4 core Intel chip (ivybridge). BIOS offers legacy, UEFI only, or UEFI/legacy, whichever works.. The computer won't boot on UEFI only with the gentoo live stick. Stumbling around Sakaki's docs, I ran into a tool which said the computer wasn't EFI capable but lost what that package was right now - I went back to the handbook figuring I'd find out soon enough (after4 days and 3 total redos) - Sakaki, helpful as hell, just added to my confusion since he is into heavy security, systemd, and sys admin documentation - I'm still at 'Jack and Jill' level.

Finally got a kernel through stage1/part 1 or whatever it said, and went on to 'make module_install' - errored out with 2 - "No rule to make target 'module_install'. Aside from advice to be in the linux directory, which I am, I can find zero explanation for this in the gentoo docs. google shows I'm not alone but I can't find a solution to this yet.

What should I offer here as info to help me suss this out.

Any help appreciated - my helmet is on.
jg
Back to top
View user's profile Send private message
tuggbuss
Apprentice
Apprentice


Joined: 20 Mar 2017
Posts: 200

PostPosted: Thu May 24, 2018 6:44 pm    Post subject: Reply with quote

Hi, and welcome to Gentoo

First gentoo minimal iso is not able to boot in EFI-mode. I use systemrescuecd, works great.

For the partitioning EFI-style i use /dev/nvmen0n1p1 +512M (EF00)
and the usual for the rest, according to taste. (i actually use Funtoos partitioning (from Funtoo installation guide)
Think it's kind of easy, but nowadays i do it by heart.


For EFI-stub, it's a piece of cake. Just follow EFI-stub Wiki https://wiki.gentoo.org/wiki/EFI_stub_kernel
Back to top
View user's profile Send private message
jeff-g
n00b
n00b


Joined: 23 May 2018
Posts: 5

PostPosted: Thu May 24, 2018 7:46 pm    Post subject: Reply with quote

tuggbuss wrote:
Hi, and welcome to Gentoo

"First gentoo minimal iso is not able to boot in EFI-mode."

surprise - how did I miss that...

" I use systemrescuecd, works great."

I've seen that mentioned in a couple spots - I thought it was really a rescue disk.
Is that a disk that needs to be used off a peripheral drive?

"For the partitioning EFI-style i use /dev/nvmen0n1p1 +512M (EF00) "

I've seen that in passing somewhere - was that in the handbook?
Something positive to do after dinner..

"and the usual for the rest, according to taste. (i actually use Funtoos partitioning (from Funtoo installation guide)
Think it's kind of easy, but nowadays i do it by heart."

For me, GPT is kiss with minimal pieces...

"For EFI-stub, it's a piece of cake. Just follow EFI-stub Wiki https://wiki.gentoo.org/wiki/EFI_stub_kernel
"

piece of cake, huh?
ob quirk

Thanks for the input...
Back to top
View user's profile Send private message
tuggbuss
Apprentice
Apprentice


Joined: 20 Mar 2017
Posts: 200

PostPosted: Thu May 24, 2018 7:53 pm    Post subject: Reply with quote

Ah, sorry, didn't mean to sound that way.

I did it for the first time the other week, and actually it was simple following wiki, i don't use initramfs thou.
Took around 5-10 minutes and i rebooted thinking iv'e certainly messed things up, but, naah. Works great.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 12366

PostPosted: Fri May 25, 2018 1:51 am    Post subject: Re: EFI install - barebones Reply with quote

jeff-g wrote:
Finally got a kernel through stage1/part 1 or whatever it said, and went on to 'make module_install' - errored out with 2 - "No rule to make target 'module_install'. Aside from advice to be in the linux directory, which I am, I can find zero explanation for this in the gentoo docs. google shows I'm not alone but I can't find a solution to this yet.
The target is spelled modules_install, plural. You used singular. ;)

Although common advice is to be in the Linux source directory, that advice is actually wrong, in my opinion. It only works that way if you build the kernel as root. You should not build as root, and if you do not, then you cannot start from the Linux source directory. Set that aside for now, but make a note to come back and use $KBUILD_OUTPUT and friends when you are farther along.
Back to top
View user's profile Send private message
jeff-g
n00b
n00b


Joined: 23 May 2018
Posts: 5

PostPosted: Fri May 25, 2018 3:31 pm    Post subject: Re: EFI install - barebones Reply with quote

Hu wrote:
The target is spelled modules_install, plural. You used singular. ;)


:oops:
Hu wrote:

Although common advice is to be in the Linux source directory, that advice is actually wrong, in my opinion. It only works that way if you build the kernel as root. You should not build as root, and if you do not, then you cannot start from the Linux source directory. Set that aside for now, but make a note to come back and use $KBUILD_OUTPUT and friends when you are farther along.


Setting that aside for the moment...

Typos are deadly in linux - I dropped an equal sign in make.conf on day 1 and it took all night finding it...

Thank you for the tips - I'll be back!

jg
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 587

PostPosted: Sat May 26, 2018 1:03 am    Post subject: Re: EFI install - barebones Reply with quote

jeff-g wrote:
G'day, folks

Handbook says make /sda1 EFI and tag it boot - parted marks it esp. Then it says to create /boot dir on root and mount sd1 on it. This doesn't sound quite intuitive to me, but my intuition doesn't work here. Is this structure correct for a pure EFI?

I happily fell over menuconfig just when I was getting totally confused and set my config to accomadate efifvarfs. I'm doing this on a lenovo t530 with 4 core Intel chip (ivybridge). BIOS offers legacy, UEFI only, or UEFI/legacy, whichever works.. The computer won't boot on UEFI only with the gentoo live stick.
I know nothing about your particular hardware, however you can usually set your bios to boot in CMS mode or pure UEFI on most modern systems. Unless you will be installing an older OS that only works in MBR mode than set your bios to boot in UEFI only and disable secure boot. To boot in UEFI mode you have to have media capable of doing so, and IIRC the Gentoo Live media doesn't support booting in UEFI mode. Use the SystemRescueCD. Its Gentoo based and you can use it from a USB stick or a DVD drive if you have one handy, Just follow the instructions on the site to set up the media of your choice. The GUI mode gives you access to web browsers for accessing the handbook and other docs and a host of other useful tools.

You would want /dev/sda to be a gtp partitioned drive. Where you mount /dev/sda1-(ESP) doesn't really matter as long as you know where it is, but mounting it at /boot is traditional and easily remembered. Device /sda1 should large enough to handle a couple of kernels and possibly an additional OS installation, formatted as a fat32 fs and have the esp,boot flags set on it. GParted works well for this. It is only necessary to mount /dev/sda1 when you need to add or modify directories or files on it, otherwise it should never be mounted IMO.

I don't even know how many methods there has to be to set up a booting UEFI system. I have done at least four different types of setups, but I'm lazy and don't like installing and maintaining additional software to do something I can do without it. This is how I do it with my hardware/firmware, a stub kernel and efibootmgr.

Device /sda my primary drive using a gpt partition table.
Device /sda1 (ESP) a 512MB, fat32 fs, flaged as esp,boot.
Device /sda2 when necessary a linux swap partition, size is dependent on available ram but in my case usually never larger than 2GB.
Device /sda3 is the / partition and the remaining portion of /sda using an ext4 fs.
Device /sdb1 is my /home partition.

On Device /sda1 I create the directories /EFI/gentoo and I copy the configured and built stub-kernel bzImage into the /EFI/gentoo/ directory with a file name like gs41212x64.efi. The name I choose lets me know what kernel-sources and version number it is. The device is mounted at /boot during the directory creation and kernel copy command. I configure my kernels with all necessary system hardware drivers and device support built-in never as modules. Once the kernel has been copied to the correct location I use efibootmgr to create the boot option in my firmware:
Code:
efibootmgr -c -d /dev/sda -p 1 -L Gentoo-<???> -l '\EFI\gentoo\gs<???>x64.efi'
adjusting the Gentoo<Label> and gs<???>x64.efi to match the name I used for the kernel I just copied over.

A typical fstab for my system might look something like:
Code:

# <fs>         <mountpoint>      <type>   <opts>            <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1       /boot            vfat    noauto,noatime      0 2
/dev/sda3      /               ext4   noatime            0 1
/dev/sda2      none   swap      sw                     0 0
/dev/sdb2      /mnt/windows      ntfs   defaults,umask=022   0 0
/dev/sdc1      /home            ext4   defaults,noatime    0 2    
/dev/sdd1      /home/shared      ext4   noatime,user,rw    0 1

proc         /proc            proc   defaults         0 0
shm            /dev/shm         tmpfs   nodev,nosuid,noexec   0 0

I use this method because I multi boot several OS's, I like testing a variety of kernels and it's simple.

Using my UEFI method the handbook and the wiki documentation for the EFI_stub_kernel it should be relatively painless to install gentoo. The hardest part will be selecting a kernel that fully supports your hardware and configuring it to boot properly. If your not using bleeding edge hardware the latest stable gentoo kernel should suit you well

:wink:
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 587

PostPosted: Sat May 26, 2018 2:19 am    Post subject: Reply with quote

When I use to do a fresh (clean) install of Gentoo on a new system I would do the bare basics before I ever installed additional software or packages. I generally followed the handbook and docs except I chose a basic default profile, like:
Code:
default/linux/amd64/17.0
Set up a simple make.conf
Code:


CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop"

USE=""

PORTAGE_ELOG_CLASSES="warn error log"
PORTAGE_ELOG_SYSTEM="save"
LINGUAS="en en_US"

MAKEOPTS="-j9"

The above config would optimize the system for my AMD-FX8350 processor. Using a generic profile and leaving the USE="" empty avoids installing and updating a lot of additional packages during the initial install phase, which can be very time consuming (several hours) on some hardware. Once I had the base system installed, updated and booting, I would complete the make.conf and start emerging the DE of choice along with it's dependices and a browser, adjusting the use flags as necessary. Get X working and start the desktop where I would continue adding packages and configuring the system to suit my needs.

Because I always use the same packages on workstations or servers today, I simply duplicate my current installs and then migrate them to new hardware.
Back to top
View user's profile Send private message
jeff-g
n00b
n00b


Joined: 23 May 2018
Posts: 5

PostPosted: Sun May 27, 2018 4:43 pm    Post subject: Re: EFI install - barebones Reply with quote

[quote="OldTango"]
jeff-g wrote:
G'day, folks

Handbook says make /sda1 EFI and tag it boot - parted marks it esp. Then it says to create /boot dir on root and mount sd1 on it. This doesn't sound quite intuitive to me, but my intuition doesn't work here. Is this structure correct for a pure EFI?

I happily fell over menuconfig just when I was getting totally confused and set my config to accomadate efifvarfs. I'm doing this on a lenovo t530 with 4 core Intel chip (ivybridge). BIOS offers legacy, UEFI only, or UEFI/legacy, whichever works.. The computer won't boot on UEFI only with the gentoo live stick.


"I know nothing about your particular hardware, however you can usually set your bios to boot in CMS mode or pure UEFI on most modern systems. Unless you will be installing an older OS that only works in MBR mode than set your bios to boot in UEFI only and disable secure boot. To boot in UEFI mode you have to have media capable of doing so, and IIRC the Gentoo Live media doesn't support booting in UEFI mode."

I have just about the same setup you do,

sda GPT
sda1 named EFI vfat tagged boot, esp.
sda2 swap
sda3 /

I think I went off course here for boot. I really understand the statement "gentoo minimal install can't boot in UEFI." I saw nothing of that in the handbook that I can recollect

"Use the SystemRescueCD. Its Gentoo based and you can use it from a USB stick or a DVD drive if you have one handy, Just follow the instructions on the site to set up the media of your choice. The GUI mode gives you access to web browsers for accessing the handbook and other docs and a host of other useful tools."

I may need to try that if I go over the deep end but want to try a little more since I've already put in a couple days.

"you would want /dev/sda to be a gtp partitioned drive."

see above

"Where you mount /dev/sda1-(ESP) doesn't really matter as long as you know where it is, but mounting it at /boot is traditional and easily remembered. Device /sda1 should large enough to handle a couple of kernels and possibly an additional OS installation, formatted as a fat32 fs and have the esp,boot flags set on it."

I think I did this incorrectly - am looking into it this A.M.

"GParted works well for this. It is only necessary to mount /dev/sda1 when you need to add or modify directories or files on it, otherwise it should never be mounted IMO."

Your fstab lists it - doesn't that mount it at boot?


"I don't even know how many methods there has to be to set up a booting UEFI system. I have done at least four different types of setups"

I'm still working on 1 - I have the kernel installed - make put the kernel in SDA1, which it should have, but I don't have the sub directories.

My computer is a lenovo thinkpad T530 - its "mature" but not old, Intel Core I5.


"On Device /sda1 I create the directories /EFI/gentoo and I copy the configured and built stub-kernel bzImage into the /EFI/gentoo/ directory with a file name like gs41212x64.efi."

I made my sda1 100 mg, thinking it needed to hold the kernel, but not all the extra ones

Thats all for now - wanna try some of these settings.

Thanks for all your time in putting this down - I'm sorta catching on ..
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 587

PostPosted: Sun May 27, 2018 9:49 pm    Post subject: Reply with quote

jeff-g wrote:
I think I went off course here for boot. I really understand the statement "gentoo minimal install can't boot in UEFI." I saw nothing of that in the handbook that I can recollect
Most modern systems can boot in CMS (uefi/legacy) or UEFI only modes. If you wish to use pure UEFI you should set your BIOS (UEFI Firmware) to boot in UEFI only and use "Live Media" capable of booting in UEFI. I am just recalling from memory that the "gentoo minimal install media" doesn't support booting in UEFI mode and boots legacy mode. I don't use that particular media and can't say for sure if that statement is true or not, but I intend to download a copy and have a look at it myself.

jeff-g wrote:
Your fstab lists it - doesn't that mount it at boot?

No, because I have the "noauto" option set. Having an fstab entry allows me to mount it quickly when necessary, with
Code:
mount /boot
Otherwise I would need to
Code:
mount /dev/sda1 /boot
or some other location like, /mnt. Having the entry in fstab saves me some typing and possible typos in the process.

jeff-g wrote:
I'm still working on 1 - I have the kernel installed - make put the kernel in SDA1, which it should have, but I don't have the sub directories.
You would have to create the directories on sad1 yourself. The Gentoo Wiki has some very good guide lines for setting this up. A standard layout for the ESP looks like this:
Code:

/boot
 └── EFI
     ├── Boot
     │   └── bootx64.efi
     ├── Gentoo
     │   └── vmlinuz-4.9.76-r1.efi
     └── Microsoft
         ├── Boot
         └── Recovery

I used the standard method when I first started using UEFI and the stub-kernel and created /boot/EFI/gentoo directories (as per docs) on my sda1, but mounting it at /boot on sda3 and then having /boot/boot/EFI/gentoo seemed redundant and confused me at times so I stopped doing it that way. Now on my system(s) the first /boot is only a mount point on my root file system on sda3. The /EFI and sud directories on sda1 are created by me or another OS during it's install process. The sda1, on a system where I just completed a migration that only contains a Gentoo install at this point looks like this:
Code:

EFI
└── gentoo
    └── gs4165x64.efi

I created the /EFI/gentoo directories and installed (copied) my kernel into the /gentoo sub directory.

jeff-g wrote:
I made my sda1 100 mg, thinking it needed to hold the kernel, but not all the extra ones
That is plenty. I don't have any concerns about drive or space limitations on my system(s). I build monolithic kernels that average about 6MB in size, one working and a few testing, along with either or both win7 and win10 installed. When windows finds an existing "ESP" it will use it by default even if it is on a different drive from where you intend to install windows.

This is just the method I prefer and certainly not the only way there is. The current Gentoo Wiki Docs are very good and if you follow them you can't go wrong. Just keep track of the docs you use and how you set it up. If after you get gentoo installed and you can't boot it or have other issues post the info here to get additional help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum