Dracut and how to specify names

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Dracut and how to specify names

Dale-46
Howdy,

I'm trying to rebuild a kernel to include new options, see other
thread.  I got the kernel built but dracut is giving me grief.  I hate
that thing and when a previous way that worked no longer works, it
doesn't help me like it any more.  Still, it is what it is even if I
don't like it.  I read the man page, the Gentoo wiki and tried different
methods but it just refuses to build a init thingy that I need.  It
either fails right away or gets to the end and errors out without
completing.

I name my kernels and such this way:

root@fireball /usr/src/linux # ls -al /boot/kernel*
-rw-r--r-- 1 root root 7061552 Oct 14  2018 /boot/kernel-4.18.12-1
-rw-r--r-- 1 root root 7082032 May 15  2019 /boot/kernel-4.19.40-1
-rw-r--r-- 1 root root 7102512 Jan  2 19:46 /boot/kernel-4.19.40-2
-rw-r--r-- 1 root root 5858496 Jun 17  2016 /boot/kernel-4.5.2-1
root@fireball /usr/src/linux #

I copy the kernels from the /usr/src/linux directory by hand as I've
always done.  I name them starting with kernel and then add the kernel
version with a sequence number on the end.  In the past, I've made it to
-4 before getting what I need.  Right now, I'm working on 4.19.40-2 and
building a init thingy for it.  This is how the init thingys end up, in
the past anyway:


root@fireball /usr/src/linux # ls -al /boot/initramfs*
-rw------- 1 root root 7752134 Oct 15  2018 /boot/initramfs-4.18.12-1.img
-rw------- 1 root root 8560993 May 15  2019 /boot/initramfs-4.19.40-1.img
-rw------- 1 root root 5377395 May 20  2016 /boot/initramfs-4.5.2-1.img
root@fireball /usr/src/linux #


What I need, the proper command with options to tell dracut I want to
build a init thingy for 4.19.40-2.  I've tried many different ways but
none of them work.  This includes commands I've used in the past that
did work.  If I have to specify the init thingy name and the location of
the kernel modules directory, that's fine.  I keep commands like this in
a file to refer back to because I do tend to forget specifics but in
this case, it seems dracut changed something.  Previous commands are not
working. 

Does anyone know how to accomplish this task?  Hopefully something that
will work even if dracut changes something with its defaults.  I figure
if I tell it all it needs to know, then it should work even if dracut
changes the default method.  I just can't seem to figure out what method
to use here.  Maybe I'm missing a option or something. 

Thanks much. 

Dale

:-)  :-) 

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

John Covici
On Thu, 02 Jan 2020 21:57:29 -0500,
Dale wrote:

>
> Howdy,
>
> I'm trying to rebuild a kernel to include new options, see other
> thread.  I got the kernel built but dracut is giving me grief.  I hate
> that thing and when a previous way that worked no longer works, it
> doesn't help me like it any more.  Still, it is what it is even if I
> don't like it.  I read the man page, the Gentoo wiki and tried different
> methods but it just refuses to build a init thingy that I need.  It
> either fails right away or gets to the end and errors out without
> completing.
>
> I name my kernels and such this way:
>
> root@fireball /usr/src/linux # ls -al /boot/kernel*
> -rw-r--r-- 1 root root 7061552 Oct 14  2018 /boot/kernel-4.18.12-1
> -rw-r--r-- 1 root root 7082032 May 15  2019 /boot/kernel-4.19.40-1
> -rw-r--r-- 1 root root 7102512 Jan  2 19:46 /boot/kernel-4.19.40-2
> -rw-r--r-- 1 root root 5858496 Jun 17  2016 /boot/kernel-4.5.2-1
> root@fireball /usr/src/linux #
>
> I copy the kernels from the /usr/src/linux directory by hand as I've
> always done.  I name them starting with kernel and then add the kernel
> version with a sequence number on the end.  In the past, I've made it to
> -4 before getting what I need.  Right now, I'm working on 4.19.40-2 and
> building a init thingy for it.  This is how the init thingys end up, in
> the past anyway:
>
>
> root@fireball /usr/src/linux # ls -al /boot/initramfs*
> -rw------- 1 root root 7752134 Oct 15  2018 /boot/initramfs-4.18.12-1.img
> -rw------- 1 root root 8560993 May 15  2019 /boot/initramfs-4.19.40-1.img
> -rw------- 1 root root 5377395 May 20  2016 /boot/initramfs-4.5.2-1.img
> root@fireball /usr/src/linux #
>
>
> What I need, the proper command with options to tell dracut I want to
> build a init thingy for 4.19.40-2.  I've tried many different ways but
> none of them work.  This includes commands I've used in the past that
> did work.  If I have to specify the init thingy name and the location of
> the kernel modules directory, that's fine.  I keep commands like this in
> a file to refer back to because I do tend to forget specifics but in
> this case, it seems dracut changed something.  Previous commands are not
> working. 
>
> Does anyone know how to accomplish this task?  Hopefully something that
> will work even if dracut changes something with its defaults.  I figure
> if I tell it all it needs to know, then it should work even if dracut
> changes the default method.  I just can't seem to figure out what method
> to use here.  Maybe I'm missing a option or something. 
>
> Thanks much. 

I think dracut uses the name of the /lib/modules directory, so just
execute dracut "" <module directory name> such as in my case
4.19.85-gentoo  .  If that does not work post here, maybe you have
spaces in your directory name, if so try using double quotes around
it.

--
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici wb2una
         [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

Dale-46
John Covici wrote:

> On Thu, 02 Jan 2020 21:57:29 -0500,
> Dale wrote:
>> Howdy,
>>
>> I'm trying to rebuild a kernel to include new options, see other
>> thread.  I got the kernel built but dracut is giving me grief.  I hate
>> that thing and when a previous way that worked no longer works, it
>> doesn't help me like it any more.  Still, it is what it is even if I
>> don't like it.  I read the man page, the Gentoo wiki and tried different
>> methods but it just refuses to build a init thingy that I need.  It
>> either fails right away or gets to the end and errors out without
>> completing.
>>
>> I name my kernels and such this way:
>>
>> root@fireball /usr/src/linux # ls -al /boot/kernel*
>> -rw-r--r-- 1 root root 7061552 Oct 14  2018 /boot/kernel-4.18.12-1
>> -rw-r--r-- 1 root root 7082032 May 15  2019 /boot/kernel-4.19.40-1
>> -rw-r--r-- 1 root root 7102512 Jan  2 19:46 /boot/kernel-4.19.40-2
>> -rw-r--r-- 1 root root 5858496 Jun 17  2016 /boot/kernel-4.5.2-1
>> root@fireball /usr/src/linux #
>>
>> I copy the kernels from the /usr/src/linux directory by hand as I've
>> always done.  I name them starting with kernel and then add the kernel
>> version with a sequence number on the end.  In the past, I've made it to
>> -4 before getting what I need.  Right now, I'm working on 4.19.40-2 and
>> building a init thingy for it.  This is how the init thingys end up, in
>> the past anyway:
>>
>>
>> root@fireball /usr/src/linux # ls -al /boot/initramfs*
>> -rw------- 1 root root 7752134 Oct 15  2018 /boot/initramfs-4.18.12-1.img
>> -rw------- 1 root root 8560993 May 15  2019 /boot/initramfs-4.19.40-1.img
>> -rw------- 1 root root 5377395 May 20  2016 /boot/initramfs-4.5.2-1.img
>> root@fireball /usr/src/linux #
>>
>>
>> What I need, the proper command with options to tell dracut I want to
>> build a init thingy for 4.19.40-2.  I've tried many different ways but
>> none of them work.  This includes commands I've used in the past that
>> did work.  If I have to specify the init thingy name and the location of
>> the kernel modules directory, that's fine.  I keep commands like this in
>> a file to refer back to because I do tend to forget specifics but in
>> this case, it seems dracut changed something.  Previous commands are not
>> working. 
>>
>> Does anyone know how to accomplish this task?  Hopefully something that
>> will work even if dracut changes something with its defaults.  I figure
>> if I tell it all it needs to know, then it should work even if dracut
>> changes the default method.  I just can't seem to figure out what method
>> to use here.  Maybe I'm missing a option or something. 
>>
>> Thanks much. 
> I think dracut uses the name of the /lib/modules directory, so just
> execute dracut "" <module directory name> such as in my case
> 4.19.85-gentoo  .  If that does not work post here, maybe you have
> spaces in your directory name, if so try using double quotes around
> it.
>


I decided to go back to a older version, just to see if it works.  The
first example I had saved didn't work but the second did.  First was
likely from a much older version of dracut.  Do you know what changed
between dracut-046-r1 and dracut-048-r1?  I ran into this once before
when a major version number changed. 

One reason I'd like to be able to specify everything is to avoid changes
in future versions.  That way I can use the same command each time
unless they completely change everything which I'm sure I'd read about
long before I needed to use it.  Just has a example:

dracut /boot/<kernel name> <initramfs name> -k <path to kernel modules>

With that, it knows where the kernel is, what to name the init thingy
and where to find the kernel modules.  Thing is, I can't find a way to
do it that way with what I see in the man page or the wiki.  I even
looked on non-Gentoo sites and didn't find anything like this. 

I did eventually help it find the modules.  Then it ran into another
issue that even google couldn't find.  I don't mean find a solution, it
couldn't find the problem either.  It returned zero, 0, results.  I was
floored.  It's rare to see google return a stupid look.  ROFL  I also
tried renaming the kernel to see if that would help.  No change.  I know
it is picky on names but one would think it would stay the same. 
Finding something with kernel on the front shouldn't be to hard. ;-)

May have to just bang away until I get lucky then document the new way. 
Whatever that way is.

Thanks.

Dale

:-)  :-) 

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

John Covici
On Fri, 03 Jan 2020 02:27:22 -0500,
Dale wrote:

>
> John Covici wrote:
> > On Thu, 02 Jan 2020 21:57:29 -0500,
> > Dale wrote:
> >> Howdy,
> >>
> >> I'm trying to rebuild a kernel to include new options, see other
> >> thread.  I got the kernel built but dracut is giving me grief.  I hate
> >> that thing and when a previous way that worked no longer works, it
> >> doesn't help me like it any more.  Still, it is what it is even if I
> >> don't like it.  I read the man page, the Gentoo wiki and tried different
> >> methods but it just refuses to build a init thingy that I need.  It
> >> either fails right away or gets to the end and errors out without
> >> completing.
> >>
> >> I name my kernels and such this way:
> >>
> >> root@fireball /usr/src/linux # ls -al /boot/kernel*
> >> -rw-r--r-- 1 root root 7061552 Oct 14  2018 /boot/kernel-4.18.12-1
> >> -rw-r--r-- 1 root root 7082032 May 15  2019 /boot/kernel-4.19.40-1
> >> -rw-r--r-- 1 root root 7102512 Jan  2 19:46 /boot/kernel-4.19.40-2
> >> -rw-r--r-- 1 root root 5858496 Jun 17  2016 /boot/kernel-4.5.2-1
> >> root@fireball /usr/src/linux #
> >>
> >> I copy the kernels from the /usr/src/linux directory by hand as I've
> >> always done.  I name them starting with kernel and then add the kernel
> >> version with a sequence number on the end.  In the past, I've made it to
> >> -4 before getting what I need.  Right now, I'm working on 4.19.40-2 and
> >> building a init thingy for it.  This is how the init thingys end up, in
> >> the past anyway:
> >>
> >>
> >> root@fireball /usr/src/linux # ls -al /boot/initramfs*
> >> -rw------- 1 root root 7752134 Oct 15  2018 /boot/initramfs-4.18.12-1.img
> >> -rw------- 1 root root 8560993 May 15  2019 /boot/initramfs-4.19.40-1.img
> >> -rw------- 1 root root 5377395 May 20  2016 /boot/initramfs-4.5.2-1.img
> >> root@fireball /usr/src/linux #
> >>
> >>
> >> What I need, the proper command with options to tell dracut I want to
> >> build a init thingy for 4.19.40-2.  I've tried many different ways but
> >> none of them work.  This includes commands I've used in the past that
> >> did work.  If I have to specify the init thingy name and the location of
> >> the kernel modules directory, that's fine.  I keep commands like this in
> >> a file to refer back to because I do tend to forget specifics but in
> >> this case, it seems dracut changed something.  Previous commands are not
> >> working. 
> >>
> >> Does anyone know how to accomplish this task?  Hopefully something that
> >> will work even if dracut changes something with its defaults.  I figure
> >> if I tell it all it needs to know, then it should work even if dracut
> >> changes the default method.  I just can't seem to figure out what method
> >> to use here.  Maybe I'm missing a option or something. 
> >>
> >> Thanks much. 
> > I think dracut uses the name of the /lib/modules directory, so just
> > execute dracut "" <module directory name> such as in my case
> > 4.19.85-gentoo  .  If that does not work post here, maybe you have
> > spaces in your directory name, if so try using double quotes around
> > it.
> >
>
>
> I decided to go back to a older version, just to see if it works.  The
> first example I had saved didn't work but the second did.  First was
> likely from a much older version of dracut.  Do you know what changed
> between dracut-046-r1 and dracut-048-r1?  I ran into this once before
> when a major version number changed. 
>
> One reason I'd like to be able to specify everything is to avoid changes
> in future versions.  That way I can use the same command each time
> unless they completely change everything which I'm sure I'd read about
> long before I needed to use it.  Just has a example:
>
> dracut /boot/<kernel name> <initramfs name> -k <path to kernel modules>
>
> With that, it knows where the kernel is, what to name the init thingy
> and where to find the kernel modules.  Thing is, I can't find a way to
> do it that way with what I see in the man page or the wiki.  I even
> looked on non-Gentoo sites and didn't find anything like this. 
>
> I did eventually help it find the modules.  Then it ran into another
> issue that even google couldn't find.  I don't mean find a solution, it
> couldn't find the problem either.  It returned zero, 0, results.  I was
> floored.  It's rare to see google return a stupid look.  ROFL  I also
> tried renaming the kernel to see if that would help.  No change.  I know
> it is picky on names but one would think it would stay the same. 
> Finding something with kernel on the front shouldn't be to hard. ;-)
>
> May have to just bang away until I get lucky then document the new way. 
> Whatever that way is.
>
> Thanks.

I think you are over complicating things, when I use dracut, I don't
specify any of those parameters, just the init thingy name which I
usually leave blank and the name of the  kernel I want to use, dracut
finds everything fine.  Why not do it that way and rename afterwards,
if you don't like the name.

--
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici wb2una
         [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

Neil Bothwick
In reply to this post by Dale-46
On Fri, 3 Jan 2020 01:27:22 -0600, Dale wrote:

> >> I name my kernels and such this way:
> >>
> >> root@fireball /usr/src/linux # ls -al /boot/kernel*
> >> -rw-r--r-- 1 root root 7061552 Oct 14  2018 /boot/kernel-4.18.12-1
> >> -rw-r--r-- 1 root root 7082032 May 15  2019 /boot/kernel-4.19.40-1
> >> -rw-r--r-- 1 root root 7102512 Jan  2 19:46 /boot/kernel-4.19.40-2
> >> -rw-r--r-- 1 root root 5858496 Jun 17  2016 /boot/kernel-4.5.2-1

> I decided to go back to a older version, just to see if it works.  The
> first example I had saved didn't work but the second did.  First was
> likely from a much older version of dracut.  Do you know what changed
> between dracut-046-r1 and dracut-048-r1?  I ran into this once before
> when a major version number changed. 

There was an elog message when the latest dracut emerged here, that was
to do with naming. I didn't read all of it as it clearly didn't apply
when using the default naming scheme of installkernel.
 
> One reason I'd like to be able to specify everything is to avoid changes
> in future versions.  That way I can use the same command each time
> unless they completely change everything which I'm sure I'd read about
> long before I needed to use it.  Just has a example:
>
> dracut /boot/<kernel name> <initramfs name> -k <path to kernel modules>

If you stick with the standard kernel naming schemes, dracut will follow
them and you shouldn't have such issues. Using make install to install
the kernel instead of copying it manually will ensure you have names that
dracut will find.

Unless you have a good reason to use non-standard naming, I would
recommend sticking with the defaults, there is less likelihood of this
type of breakage.

If you really want to plough your own furrow, try running dracut with the
--debug option. When had issues with dracut recently, -v didn't add
anything but --debug highlighted the problem immediately.


--
Neil Bothwick

Help put the "fun" back in "dysfunctional" !

attachment0 (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

Dale-46
In reply to this post by John Covici
John Covici wrote:

> On Fri, 03 Jan 2020 02:27:22 -0500,
> Dale wrote:
>> John Covici wrote:
>>> On Thu, 02 Jan 2020 21:57:29 -0500,
>>> Dale wrote:
>>>> Howdy,
>>>>
>>>> I'm trying to rebuild a kernel to include new options, see other
>>>> thread.  I got the kernel built but dracut is giving me grief.  I hate
>>>> that thing and when a previous way that worked no longer works, it
>>>> doesn't help me like it any more.  Still, it is what it is even if I
>>>> don't like it.  I read the man page, the Gentoo wiki and tried different
>>>> methods but it just refuses to build a init thingy that I need.  It
>>>> either fails right away or gets to the end and errors out without
>>>> completing.
>>>>
>>>> I name my kernels and such this way:
>>>>
>>>> root@fireball /usr/src/linux # ls -al /boot/kernel*
>>>> -rw-r--r-- 1 root root 7061552 Oct 14  2018 /boot/kernel-4.18.12-1
>>>> -rw-r--r-- 1 root root 7082032 May 15  2019 /boot/kernel-4.19.40-1
>>>> -rw-r--r-- 1 root root 7102512 Jan  2 19:46 /boot/kernel-4.19.40-2
>>>> -rw-r--r-- 1 root root 5858496 Jun 17  2016 /boot/kernel-4.5.2-1
>>>> root@fireball /usr/src/linux #
>>>>
>>>> I copy the kernels from the /usr/src/linux directory by hand as I've
>>>> always done.  I name them starting with kernel and then add the kernel
>>>> version with a sequence number on the end.  In the past, I've made it to
>>>> -4 before getting what I need.  Right now, I'm working on 4.19.40-2 and
>>>> building a init thingy for it.  This is how the init thingys end up, in
>>>> the past anyway:
>>>>
>>>>
>>>> root@fireball /usr/src/linux # ls -al /boot/initramfs*
>>>> -rw------- 1 root root 7752134 Oct 15  2018 /boot/initramfs-4.18.12-1.img
>>>> -rw------- 1 root root 8560993 May 15  2019 /boot/initramfs-4.19.40-1.img
>>>> -rw------- 1 root root 5377395 May 20  2016 /boot/initramfs-4.5.2-1.img
>>>> root@fireball /usr/src/linux #
>>>>
>>>>
>>>> What I need, the proper command with options to tell dracut I want to
>>>> build a init thingy for 4.19.40-2.  I've tried many different ways but
>>>> none of them work.  This includes commands I've used in the past that
>>>> did work.  If I have to specify the init thingy name and the location of
>>>> the kernel modules directory, that's fine.  I keep commands like this in
>>>> a file to refer back to because I do tend to forget specifics but in
>>>> this case, it seems dracut changed something.  Previous commands are not
>>>> working. 
>>>>
>>>> Does anyone know how to accomplish this task?  Hopefully something that
>>>> will work even if dracut changes something with its defaults.  I figure
>>>> if I tell it all it needs to know, then it should work even if dracut
>>>> changes the default method.  I just can't seem to figure out what method
>>>> to use here.  Maybe I'm missing a option or something. 
>>>>
>>>> Thanks much. 
>>> I think dracut uses the name of the /lib/modules directory, so just
>>> execute dracut "" <module directory name> such as in my case
>>> 4.19.85-gentoo  .  If that does not work post here, maybe you have
>>> spaces in your directory name, if so try using double quotes around
>>> it.
>>>
>>
>> I decided to go back to a older version, just to see if it works.  The
>> first example I had saved didn't work but the second did.  First was
>> likely from a much older version of dracut.  Do you know what changed
>> between dracut-046-r1 and dracut-048-r1?  I ran into this once before
>> when a major version number changed. 
>>
>> One reason I'd like to be able to specify everything is to avoid changes
>> in future versions.  That way I can use the same command each time
>> unless they completely change everything which I'm sure I'd read about
>> long before I needed to use it.  Just has a example:
>>
>> dracut /boot/<kernel name> <initramfs name> -k <path to kernel modules>
>>
>> With that, it knows where the kernel is, what to name the init thingy
>> and where to find the kernel modules.  Thing is, I can't find a way to
>> do it that way with what I see in the man page or the wiki.  I even
>> looked on non-Gentoo sites and didn't find anything like this. 
>>
>> I did eventually help it find the modules.  Then it ran into another
>> issue that even google couldn't find.  I don't mean find a solution, it
>> couldn't find the problem either.  It returned zero, 0, results.  I was
>> floored.  It's rare to see google return a stupid look.  ROFL  I also
>> tried renaming the kernel to see if that would help.  No change.  I know
>> it is picky on names but one would think it would stay the same. 
>> Finding something with kernel on the front shouldn't be to hard. ;-)
>>
>> May have to just bang away until I get lucky then document the new way. 
>> Whatever that way is.
>>
>> Thanks.
> I think you are over complicating things, when I use dracut, I don't
> specify any of those parameters, just the init thingy name which I
> usually leave blank and the name of the  kernel I want to use, dracut
> finds everything fine.  Why not do it that way and rename afterwards,
> if you don't like the name.
>


From what I recall when dracut first came out, I have to tell it what
kernel to build against since I have several kernels.  Otherwise, it
doesn't know which one I just built and want a init thingy for.  Usually
I pass the version including my sequence number to it and it builds it. 
This time it didn't do that.  What I don't want, rebuild the init thingy
for them all and something be wrong and they all fail.  If it builds
just one, I can still fall back to older ones that I've already tested. 

It may be a weird way but it's the way I been doing it pretty much ever
since I started using Gentoo about 15 years ago.  Ironically, one of the
biggest reasons I switched to Gentoo, no need for the init thingy. 
Trust me when I say this, dealing with the thing doesn't make me happy. 
It changing how it does its thing so often isn't helping.  It's like
having to learn it all over again each time I need to use it.

Thanks for the help.  I'll bang away at it until I make it submit or I
just put the older version in a overlay and use it until it no longer
works. 

Dale

:-)  :-) 

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

Dale-46
In reply to this post by Neil Bothwick
Neil Bothwick wrote:

> On Fri, 3 Jan 2020 01:27:22 -0600, Dale wrote:
>
>>>> I name my kernels and such this way:
>>>>
>>>> root@fireball /usr/src/linux # ls -al /boot/kernel*
>>>> -rw-r--r-- 1 root root 7061552 Oct 14  2018 /boot/kernel-4.18.12-1
>>>> -rw-r--r-- 1 root root 7082032 May 15  2019 /boot/kernel-4.19.40-1
>>>> -rw-r--r-- 1 root root 7102512 Jan  2 19:46 /boot/kernel-4.19.40-2
>>>> -rw-r--r-- 1 root root 5858496 Jun 17  2016 /boot/kernel-4.5.2-1
>> I decided to go back to a older version, just to see if it works.  The
>> first example I had saved didn't work but the second did.  First was
>> likely from a much older version of dracut.  Do you know what changed
>> between dracut-046-r1 and dracut-048-r1?  I ran into this once before
>> when a major version number changed. 
> There was an elog message when the latest dracut emerged here, that was
> to do with naming. I didn't read all of it as it clearly didn't apply
> when using the default naming scheme of installkernel.
>  


I'll go dig for that after I re-emerge the new version.  I cleaned out
that HUGE directory a while back.  I do that about once a year to free
up a little space. 


>> One reason I'd like to be able to specify everything is to avoid changes
>> in future versions.  That way I can use the same command each time
>> unless they completely change everything which I'm sure I'd read about
>> long before I needed to use it.  Just has a example:
>>
>> dracut /boot/<kernel name> <initramfs name> -k <path to kernel modules>
> If you stick with the standard kernel naming schemes, dracut will follow
> them and you shouldn't have such issues. Using make install to install
> the kernel instead of copying it manually will ensure you have names that
> dracut will find.
>
> Unless you have a good reason to use non-standard naming, I would
> recommend sticking with the defaults, there is less likelihood of this
> type of breakage.
>
> If you really want to plough your own furrow, try running dracut with the
> --debug option. When had issues with dracut recently, -v didn't add
> anything but --debug highlighted the problem immediately.
>
>


Can you post a ls -al /boot for both kernels and images?  That way I can
see how it names them when doing it your way.  If I can make sense of
it, I may try doing it that way.  Thing is, it'll change eventually
too.  lol 

I need to build a 2nd rig for my TV.  Between downloading stuff,
watching TV and the other stuff I do on this thing, rebooting is hard to
schedule.  I got a mobo, memory, CPU already.  Video card and a few
others things like ethernet cards and I'd be ready to build one. 

Thanks.

Dale

:-)  :-) 

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

Rich Freeman
On Fri, Jan 3, 2020 at 5:57 AM Dale <[hidden email]> wrote:
>
> Can you post a ls -al /boot for both kernels and images?  That way I can
> see how it names them when doing it your way.  If I can make sense of
> it, I may try doing it that way.  Thing is, it'll change eventually
> too.  lol

I use the standard kernel names:

config-4.19.92
initramfs-4.19.92.img
System.map-4.19.92
vmlinuz-4.19.92
/lib/modules/4.19.92

I create the initramfs using:
dracut "" 4.19.92

Dracut is going to need the path to the modules more than anything
else, so I suspect it will work if you substitute 4.19.92 with
whatever the path of your modules directory is, within /lib/modules.

Also, could you actually post the command lines you're using?  You
posted 4 fairly long emails elaborating on how everything isn't
working right, and I don't think you actually posted a single dracut
command line.  When something isn't working right it is usually best
to start with what you're actually doing, along with what is happening
and what you expected to happen.  You mainly covered the last bit of
those three but left out most of the first two.

I actually use a script to do my kernel updates - this is intended
mainly for bumps and isn't entirely suitable when I need to change
things, in which case I usually just build manually following the same
steps:
#!/bin/bash
cd /usr/src/linux || exit
git pull || exit
rm -rf /var/tmp/linux || exit
export KBUILD_OUTPUT=/var/tmp/linux
make O=/var/tmp/linux oldconfig || exit
nice -n20 make O=/var/tmp/linux -j12 -l20 || exit
make O=/var/tmp/linux modules_install || exit
make O=/var/tmp/linux install || exit
emerge @module-rebuild || exit
NEWVER=$(make --no-print-directory kernelversion) || exit
dracut "" $NEWVER || exit
grub-mkconfig -o /boot/grub/grub.cfg

(This does all the building in /var/tmp and leaves me with a clean
kernel source directory.  That is actually the upstream-recommended
way but it does create the issue that if any package that builds
kernel modules gets updated it will fail.  I usually just delay
updating these packages until I do my next kernel update, but I can
just run this script again to re-create /var/tmp/linux with the
necessary files to build further modules.  Note that you need a few GB
in /var/tmp for this to work, and this script doesn't clean up - I
usually want that directory left for any module updating, and it gets
cleared on reboot anyway which usually follows a kernel update.  This
works great on tmpfs if you have the space.

Note also that I'm using upstream stable vanilla sources - I checkout
a longterm branch which is what is getting pulled at the start.  This
should work with gentoo sources as well if you just tweak the start.
I like to maintain more control over what kernel I'm following as I
tend to use out-of-tree modules like zfs, or experimental ones like
btrfs, or newer CPUs like Ryzen - for one reason or another just
following random stable releases is problematic.)

--
Rich

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

Dale-46
Rich Freeman wrote:

> On Fri, Jan 3, 2020 at 5:57 AM Dale <[hidden email]> wrote:
>> Can you post a ls -al /boot for both kernels and images?  That way I can
>> see how it names them when doing it your way.  If I can make sense of
>> it, I may try doing it that way.  Thing is, it'll change eventually
>> too.  lol
> I use the standard kernel names:
>
> config-4.19.92
> initramfs-4.19.92.img
> System.map-4.19.92
> vmlinuz-4.19.92
> /lib/modules/4.19.92
>
> I create the initramfs using:
> dracut "" 4.19.92
>
> Dracut is going to need the path to the modules more than anything
> else, so I suspect it will work if you substitute 4.19.92 with
> whatever the path of your modules directory is, within /lib/modules.
>
> Also, could you actually post the command lines you're using?  You
> posted 4 fairly long emails elaborating on how everything isn't
> working right, and I don't think you actually posted a single dracut
> command line.  When something isn't working right it is usually best
> to start with what you're actually doing, along with what is happening
> and what you expected to happen.  You mainly covered the last bit of
> those three but left out most of the first two.
>
> I actually use a script to do my kernel updates - this is intended
> mainly for bumps and isn't entirely suitable when I need to change
> things, in which case I usually just build manually following the same
> steps:
> #!/bin/bash
> cd /usr/src/linux || exit
> git pull || exit
> rm -rf /var/tmp/linux || exit
> export KBUILD_OUTPUT=/var/tmp/linux
> make O=/var/tmp/linux oldconfig || exit
> nice -n20 make O=/var/tmp/linux -j12 -l20 || exit
> make O=/var/tmp/linux modules_install || exit
> make O=/var/tmp/linux install || exit
> emerge @module-rebuild || exit
> NEWVER=$(make --no-print-directory kernelversion) || exit
> dracut "" $NEWVER || exit
> grub-mkconfig -o /boot/grub/grub.cfg
>
> (This does all the building in /var/tmp and leaves me with a clean
> kernel source directory.  That is actually the upstream-recommended
> way but it does create the issue that if any package that builds
> kernel modules gets updated it will fail.  I usually just delay
> updating these packages until I do my next kernel update, but I can
> just run this script again to re-create /var/tmp/linux with the
> necessary files to build further modules.  Note that you need a few GB
> in /var/tmp for this to work, and this script doesn't clean up - I
> usually want that directory left for any module updating, and it gets
> cleared on reboot anyway which usually follows a kernel update.  This
> works great on tmpfs if you have the space.
>
> Note also that I'm using upstream stable vanilla sources - I checkout
> a longterm branch which is what is getting pulled at the start.  This
> should work with gentoo sources as well if you just tweak the start.
> I like to maintain more control over what kernel I'm following as I
> tend to use out-of-tree modules like zfs, or experimental ones like
> btrfs, or newer CPUs like Ryzen - for one reason or another just
> following random stable releases is problematic.)
>


Those names make sense but I wonder if I could add sequence numbers on
the end.  Most of the time, -1 works since I use oldconfig a lot.  On
occasion tho, I'll have a -2, like this time, or even a -3.  I don't get
that far as often as I used to tho.

The reason I didn't include a command that was tried, I had so many of
them that I tried and they were spread over several different tabs in
konsole.  I tried changing names of kernels, including locations and no
telling what else.  If I posted them, even I wouldn't be able to make
much sense of it. I'm sure no one else could if I couldn't.  I fiddled
with that for hours.  I don't like going back to a older version since
eventually it will be gone but I did in this case.  Still, I need to
figure out the new one since I will have to use it later on. 

I use gentoo-sources.  I update sometimes but given that I don't reboot
much, it may take a long while to test a kernel.  I've had times where I
build a kernel but later do a newer one and end up never using other
updated kernels.  I use uprecords to tell me what kernels I've used and
for how long. I keep two or three known and well tested kernels around
just in case.  Others I delete if /boot starts taking up to much space. 
I start by removing older kernels that have never been used, then older
kernels and work my way up until I'm left with three or so.  I also make
sure my video drivers will work with updated kernels as well.  Sometimes
the newest ones don't.  I have older cards as a general rule.

I'm going to play with this some more another day.  Health issues has me
staying off this thing a bit. 

Dale

:-)  :-)

Reply | Threaded
Open this post in threaded view
|

Re: Dracut and how to specify names

Neil Bothwick
On Sat, 4 Jan 2020 05:40:37 -0600, Dale wrote:

> Those names make sense but I wonder if I could add sequence numbers on
> the end.  Most of the time, -1 works since I use oldconfig a lot.  On
> occasion tho, I'll have a -2, like this time, or even a -3.  I don't get
> that far as often as I used to tho.

Look at the LOCALVERSION options in the kernel config.


--
Neil Bothwick

Hm..what's this red button fo|'\xBB.'NO CARRIER

attachment0 (849 bytes) Download Attachment