[gentoo-user] Re: Kernel did not finding root partition

2017-05-30 Thread Kai Krakow
Am Tue, 30 May 2017 09:26:03 +0100
schrieb Peter Humphrey :

> On Monday 29 May 2017 21:42:28 Kai Krakow wrote:
> > Am Mon, 29 May 2017 19:16:11 +0100
> > 
> > schrieb Neil Bothwick :  
> > > On Mon, 29 May 2017 15:07:48 -0300, Raphael MD wrote:  
> [...]
>  [...]  
> > > 
> > > You said you were using rEFInd, why have you got GRUB as well.
> > > rEFInd can work without a config, GRUB cannot.  
> > 
> > This puzzles me, too... Maybe rEFInd was installed to sda and grub
> > installed to sda1, so rEFInd would chain-boot through grub.
> > 
> > Grub, however, won't work without a config file. I'd also suggest to
> > skip grub completely and use just one loader.  
> 
> Not only that, but for some reason I couldn't get grub to work at all
> on my Asus UEFI system. I use systemd-boot only, with a separate
> config file for each kernel I might want to boot. (I do not have the
> rest of systemd in this openrc system; just its boot program.)
> 
> It might not help the OP but this is my script for compiling a kernel:
> 
> # cat /usr/local/bin/kmake 
> #!/bin/bash 
> mount /boot 
> cd /usr/src/linux 
> time (make -j12 && make modules_install && make install &&\ 
>   /bin/ls -lh --color=auto /boot &&\ 
>   echo &&\ 
>   cp -v ./arch/x86/boot/bzImage /boot/EFI/Boot/bootX64.efi
> ) &&\ 
> echo; echo "Rebuilding modules..."; echo &&\ 
> emerge --jobs --load-average=48 @module-rebuild @x11-module-rebuild
> 
> He may be missing the copying step; that would explain his inability
> either to boot or to supply the info you asked him for.

I hooked into the install hook infrastructure of the kernel instead:

$ cat /etc/kernel/postinst.d/70_rebuild-modules
#!/bin/bash
exec env -i PATH=$PATH /usr/bin/emerge -1v --usepkg=n @module-rebuild

$ cat /etc/kernel/postinst.d/90_systemd
#!/bin/bash
/usr/bin/kernel-install remove $1 $2
/usr/bin/kernel-install add $1 $2

This takes care of everything and the kernel-install script from
systemd also rebuilds the dracut initrd (because it installed hooks
to /usr/lib/kernel/install.d).

eclean-kernel can then be used to properly clean up obsolete kernel
versions. I'm running it through cron to keep only the most recent 5
kernels at weekly intervals.

For the hooks to properly execute at the right time, it is important to
give the "make install" target last:

$ cd /usr/src/linux
$ make oldconfig
# make -j9 
# make modules_install firmware_install install

The "install" target triggers the hooks, so modules have to be already
installed at that time.

Additionally I have a script to rebuild dracut easily on demand (e.g.,
when early boot components were updated or changed):

$ cat /usr/local/sbin/rebuild-dracut.sh
#!/bin/bash
set -e
if [ "$1" == "-a" ]; then
versions=$(cd /boot && ls vmlinuz-* | fgrep -v .old | sed 
's/vmlinuz-//')
else
versions="$@"
fi
versions=${versions:=$(uname -r)}
for hook in $(ls /etc/kernel/postinst.d/*_{dracut,grub,systemd} 2>/dev/null); do
for version in $versions; do
${hook} ${version%.old} /boot/vmlinuz-${version}
done
done


-- 
Regards,
Kai

Replies to list-only preferred.




Re: [gentoo-user] Re: Kernel did not finding root partition

2017-05-30 Thread Mick
On Tuesday 30 May 2017 14:08:08 Raphael MD wrote:
> Thank you all, for the help until now.
> 
> I didn't solve my problem yet, but I realised some troubles and mistakes
> that I've being made.
> 
> First I'll divide those problematic situations I've suffered:
> 
> 1.I was using Genkernel to configure and build the kernel, but Genkernel’s
> menuconfig doesn’t work like make menuconfig. Genkernel replace my .config
> everytime I run genkernel –menuconfig all, with this, I my .config has lost
> XFS build-in, because default Genkernel .config has setted XFS as a module.

I don't use genkernel myself, but in capable hands can be a quick process 
compared to manual kernel configuration and installation.  You probably did 
not read this guide which should help you build what you need:

 https://wiki.gentoo.org/wiki/Genkernel


> 2. I’m using rEFInd, installed from Windows 10, I’ll need dual boot. Now I
> understand that rEFInd can substitute GRUB, but I’ve read a lots of wikis,
> and it became a little bit confusing. Based on wikis I’ve configured my
> kernel with EFI stub thinking that is necessary to boot with GRUB only
> because UEFI.

rEFInd is a fine tool, if you need to multiboot.  I don't know what wikis you 
may have read, but here you go:

 https://wiki.gentoo.org/wiki/Refind


> 3. GRUB has booted my kernel, but this EFI Stub’s over-configured kernel,
> maybe has complicated the situation with GRUB. (I've only supposed that).
> 
> Expose that, or I configure kernel to use GRUB or rEFInd.

You can use either rEFInd or GRUB.  It does not make sense to use both, unless 
you enjoy slowing your boot process by chainloading one boot manager after 
another.

If for some reason you want to use GRUB, then have a read here:

 https://wiki.gentoo.org/wiki/GRUB2


> I’m leaned to use on rEFInd, but I suffered to create initramfs with
> gernkernel once, in fact I do not like genkernel at all.

Genkernel will create an initramfs for you and some people use genkernel 
mainly for this reason alone.  Have a read here to get some grounding on 
initramfs:

 https://wiki.gentoo.org/wiki/Initramfs/Guide

and here to use dracut as an alternative initramfs builder application:

 https://wiki.gentoo.org/wiki/Dracut

HTH.
-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: Kernel did not finding root partition

2017-05-30 Thread Raphael MD
Thank you all, for the help until now.

I didn't solve my problem yet, but I realised some troubles and mistakes
that I've being made.

First I'll divide those problematic situations I've suffered:

1.I was using Genkernel to configure and build the kernel, but Genkernel’s
menuconfig doesn’t work like make menuconfig. Genkernel replace my .config
everytime I run genkernel –menuconfig all, with this, I my .config has lost
XFS build-in, because default Genkernel .config has setted XFS as a module.

2. I’m using rEFInd, installed from Windows 10, I’ll need dual boot. Now I
understand that rEFInd can substitute GRUB, but I’ve read a lots of wikis,
and it became a little bit confusing. Based on wikis I’ve configured my
kernel with EFI stub thinking that is necessary to boot with GRUB only
because UEFI.

3. GRUB has booted my kernel, but this EFI Stub’s over-configured kernel,
maybe has complicated the situation with GRUB. (I've only supposed that).

Expose that, or I configure kernel to use GRUB or rEFInd.

I’m leaned to use on rEFInd, but I suffered to create initramfs with
gernkernel once, in fact I do not like genkernel at all.


Re: [gentoo-user] Re: Kernel did not finding root partition

2017-05-30 Thread Peter Humphrey
On Monday 29 May 2017 21:42:28 Kai Krakow wrote:
> Am Mon, 29 May 2017 19:16:11 +0100
> 
> schrieb Neil Bothwick :
> > On Mon, 29 May 2017 15:07:48 -0300, Raphael MD wrote:
[...]
> > > 3. boot-loader config
> > > 
> > > Grub, without any different config.
> > 
> > You said you were using rEFInd, why have you got GRUB as well. rEFInd
> > can work without a config, GRUB cannot.
> 
> This puzzles me, too... Maybe rEFInd was installed to sda and grub
> installed to sda1, so rEFInd would chain-boot through grub.
> 
> Grub, however, won't work without a config file. I'd also suggest to
> skip grub completely and use just one loader.

Not only that, but for some reason I couldn't get grub to work at all on my 
Asus UEFI system. I use systemd-boot only, with a separate config file for 
each kernel I might want to boot. (I do not have the rest of systemd in this 
openrc system; just its boot program.)

It might not help the OP but this is my script for compiling a kernel:

# cat /usr/local/bin/kmake 
#!/bin/bash 
mount /boot 
cd /usr/src/linux 
time (make -j12 && make modules_install && make install &&\ 
/bin/ls -lh --color=auto /boot &&\ 
echo &&\ 
cp -v ./arch/x86/boot/bzImage /boot/EFI/Boot/bootX64.efi
) &&\ 
echo; echo "Rebuilding modules..."; echo &&\ 
emerge --jobs --load-average=48 @module-rebuild @x11-module-rebuild

He may be missing the copying step; that would explain his inability either 
to boot or to supply the info you asked him for.

-- 
Regards
Peter




[gentoo-user] Re: Kernel did not finding root partition

2017-05-29 Thread Kai Krakow
Am Mon, 29 May 2017 19:16:11 +0100
schrieb Neil Bothwick :

> On Mon, 29 May 2017 15:07:48 -0300, Raphael MD wrote:
> 
>  [...]  
> 
> > > 1. partition layout
> > > 2. kernel cmdline
> > > 3. boot-loader config
> > > 4. exact error message on screen  
> 
> > 1. partition layout
> > /dev/sda1 vfat boot
> > /dev/sda3 xfs   root
> > /dev/sda2 swap  
> 
> That looks OK.

Yes, but I am missing some info:

Is sda1 marked as ESP?

Also, you should mark sda3 as root partition through gptfdisk.

That way, any modern EFI boot loader should be able to auto-configure
everything.

> > > 2. kernel cmdline
> > None  
> 
> Are you letting rEFInd auto-detect it? Maybe you need to configure it
> manually with a root= setting.

I think you need a working initrd for auto-detection to work. At least,
systemd is able to assemble the partitions from GPT partition type
settings and can autodetect boot, swap and rootfs.

Otherwise, you should give at least a root= cmdline.

> > > 3. boot-loader config
> > Grub, without any different config.  
> 
> You said you were using rEFInd, why have you got GRUB as well. rEFInd
> can work without a config, GRUB cannot.

This puzzles me, too... Maybe rEFInd was installed to sda and grub
installed to sda1, so rEFInd would chain-boot through grub.

Grub, however, won't work without a config file. I'd also suggest to
skip grub completely and use just one loader.

> > > 4. exact error message on screen
> > Kernel boot up, start to load drivers and stop asking for root
> > partition.  
> 
> That's a summary, not an exact message. As such it gives no useful
> information.

Yes, this is not helpful. How could one expect us to be helpful if
she/he refuses to give details? Nobody requires to copy the screen
contents by hand. For me, a useful screen shot taken with a mobile
phone camera would be a first step.

I think there are even services which can OCR such a screen shot...


-- 
Regards,
Kai

Replies to list-only preferred.


pgpcttxRPkMin.pgp
Description: Digitale Signatur von OpenPGP


Re: [gentoo-user] Re: Kernel did not finding root partition

2017-05-29 Thread Neil Bothwick
On Mon, 29 May 2017 15:07:48 -0300, Raphael MD wrote:

> > > PS.: Appear to be very simple configure UEFI, because I'm using
> > > Refind and it was working with Funtoo, and I realized this problem
> > > is with gentoo kernel's config, but I do not know where I need to
> > > config.

> > 1. partition layout
> > 2. kernel cmdline
> > 3. boot-loader config
> > 4. exact error message on screen

> 1. partition layout
> /dev/sda1 vfat boot
> /dev/sda3 xfs   root
> /dev/sda2 swap

That looks OK.

> > 2. kernel cmdline  
> None

Are you letting rEFInd auto-detect it? Maybe you need to configure it
manually with a root= setting.
 
> > 3. boot-loader config  
> Grub, without any different config.

You said you were using rEFInd, why have you got GRUB as well. rEFInd can
work without a config, GRUB cannot.

> > 4. exact error message on screen  
> Kernel boot up, start to load drivers and stop asking for root
> partition.

That's a summary, not an exact message. As such it gives no useful
information.


-- 
Neil Bothwick

Life's a cache, and then you flush...


pgpx32DrOE4aZ.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Kernel did not finding root partition

2017-05-29 Thread Raphael MD
On May 29, 2017 14:51, "Kai Krakow"  wrote:
>
> Am Mon, 29 May 2017 08:09:02 -0300
> schrieb Raphael MD :
>
> > I'm trying to install Gentoo in my notebook, but kernel, during the
> > boot, do not find the root partition.
> >
> > I'm using UEFI boot, I've tried Genkernel, I've checked XFS's support
> > in kernel's menuconfig and re-cheked GRUB config files, but is a
> > pain, do not work.
> >
> > I've installed Funtoo with Debian Kernel first, but Funtoo KDE's
> > ebuild was pointing to a invalid URL and I've switched to Gentoo and
> > now I'm suffering this problem to boot.
> >
> > Have anyone some information, about this Kernel's boot didn't finding
> > root partition? Is better configure kernel without Genkernel? I need
> > to pass some commands to Kernel via GRUB?
> >
> > PS.: Appear to be very simple configure UEFI, because I'm using
> > Refind and it was working with Funtoo, and I realized this problem is
> > with gentoo kernel's config, but I do not know where I need to config.
> >
> > Any suggestions?
>
> For UEFI boot the best way is to install the kernel to the ESP,
> especially if it is directly loaded by EFI. Which exact message do you
> see? It is not clear if the kernel already booted and just cannot find
> the rootfs, or if even the kernel cannot load.
>
> I don't know reFind, but some EFI loaders like gummiboot / systemd-boot
> expect the kernel to have an EFI stub because the kernel is
> chain-loaded through EFI...
>
> So we need to know a few things:
>
> 1. partition layout
> 2. kernel cmdline
> 3. boot-loader config
> 4. exact error message on screen
>
>
> --
> Regards,
> Kai
>
> Replies to list-only preferred.
>
>

1. partition layout
/dev/sda1 vfat boot
/dev/sda3 xfs   root
/dev/sda2 swap

> 2. kernel cmdline
None

> 3. boot-loader config
Grub, without any different config.

> 4. exact error message on screen
Kernel boot up, start to load drivers and stop asking for root partition.


[gentoo-user] Re: Kernel did not finding root partition

2017-05-29 Thread Kai Krakow
Am Mon, 29 May 2017 08:09:02 -0300
schrieb Raphael MD :

> I'm trying to install Gentoo in my notebook, but kernel, during the
> boot, do not find the root partition.
> 
> I'm using UEFI boot, I've tried Genkernel, I've checked XFS's support
> in kernel's menuconfig and re-cheked GRUB config files, but is a
> pain, do not work.
> 
> I've installed Funtoo with Debian Kernel first, but Funtoo KDE's
> ebuild was pointing to a invalid URL and I've switched to Gentoo and
> now I'm suffering this problem to boot.
> 
> Have anyone some information, about this Kernel's boot didn't finding
> root partition? Is better configure kernel without Genkernel? I need
> to pass some commands to Kernel via GRUB?
> 
> PS.: Appear to be very simple configure UEFI, because I'm using
> Refind and it was working with Funtoo, and I realized this problem is
> with gentoo kernel's config, but I do not know where I need to config.
> 
> Any suggestions?

For UEFI boot the best way is to install the kernel to the ESP,
especially if it is directly loaded by EFI. Which exact message do you
see? It is not clear if the kernel already booted and just cannot find
the rootfs, or if even the kernel cannot load.

I don't know reFind, but some EFI loaders like gummiboot / systemd-boot
expect the kernel to have an EFI stub because the kernel is
chain-loaded through EFI...

So we need to know a few things:

1. partition layout
2. kernel cmdline
3. boot-loader config
4. exact error message on screen


-- 
Regards,
Kai

Replies to list-only preferred.