LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-27-2019, 11:23 PM   #1
cerber
LQ Newbie
 
Registered: Dec 2017
Posts: 21

Rep: Reputation: Disabled
Custom initramfs hooks


How can I add custom initramfs hooks in Slackware like it can be done by modifying files inside /etc/initcpio/hooks in Arch Linux?
 
Old 07-28-2019, 05:26 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,925

Rep: Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041
run mkinitrd -c ... ... as usual.
make your desired changes to the stuff in /boot/initrd-tree
run mkinitrd ... ... again, this time without the '-c' option.

Slackware doesn't have a "hooks" framework built into the initrd stuff.
 
1 members found this post helpful.
Old 07-28-2019, 05:56 AM   #3
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,071

Rep: Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305
Quote:
Originally Posted by GazL View Post
run mkinitrd -c ... ... as usual.
make your desired changes to the stuff in /boot/initrd-tree
run mkinitrd ... ... again, this time without the '-c' option.

Slackware doesn't have a "hooks" framework built into the initrd stuff.
You should continue with if the OP intends to reuse his initrd modifications for another initrd (i.e. for another kernel), he should reapply all modifications BY HAND on the new initrd tree. Which is a real hassle of time and errors prone.

Apparently, they believes that their initrd is absolutely perfect, it covers absolutely all use cases and nobody ever needs to modify it...

However, see this thread for more explanations about what could possible go wrong: https://www.linuxquestions.org/quest...it-4175655412/

Last edited by ZhaoLin1457; 07-28-2019 at 06:07 AM.
 
Old 07-28-2019, 06:24 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107
Quote:
Originally Posted by ZhaoLin1457 View Post
Apparently, they believes that their initrd is absolutely perfect, it covers absolutely all use cases and nobody ever needs to modify it...
From "mkinitrd -h":
Code:
mkinitrd creates an initial ramdisk (actually an initramfs cpio+gzip
archive) used to load kernel modules that are needed to mount the
root filesystem, or other modules that might be needed before the
root filesystem is available.  Other binaries may be added to the
initrd, and the script is easy to modify.  Be creative.  :-)
Quote:
However, see this thread for more explanations about what could possible go wrong: https://www.linuxquestions.org/quest...it-4175655412/
I see nothing in that thread that tells me what could go wrong. More and more people however, seem want to sit on their hands, requesting that Slackware do everything for them, and thus compromise the simplicity of this distro in an attempt to make it look more than Arch, or Ubuntu.
Another takeaway from the script-kiddie invasion is that I see more of the asking / demanding type of posts, and less of the 'here is a patch that will add desired behaviour' kind of posts. Obviously, the former is not going to help anyone, while the latter is how - historically - new functionality got added to Slackware.
 
3 members found this post helpful.
Old 07-28-2019, 06:43 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,925

Rep: Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041Reputation: 5041
Quote:
Originally Posted by ZhaoLin1457 View Post
You should continue with if the OP intends to reuse his initrd modifications for another initrd (i.e. for another kernel), he should reapply all modifications BY HAND on the new initrd tree. Which is a real hassle of time and errors prone.
When I was using a custom initrd I just made a script that did this:

mkinitrd -c blah blah
patch /boot/initrd-tree/init patchfile.patch
mkinitrd blah blah

That way I didn't have to concern myself with reapplying my changes. Slackware's mkinitrd could be improved, but it's really not as big a deal as you're making it.

Anyway, repeatedly complaining gets you nowhere. This is open source. If you don't like something fix it yourself. The code in the initrd that handles unlocking of multiple luks devices originally came from me: I had a need to do that and it wasn't supported, so I fixed it. It was eventually adopted into the stock package. You don't have to be a slackware team member to contribute, many of us have, and you only need to look at the changelog to see all the acknowledgements. Ofcourse, it helps if you're respectful. No one wants to deal with someone who makes it a habit to be a dick.
 
3 members found this post helpful.
Old 07-28-2019, 11:58 AM   #6
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 935

Rep: Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527
Hope this helps, mkinitrd has '-s' and '-o' options to use separate source trees and output initrd.gz files.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mounting root filesystem in custom initramfs : No such file or directory anon_16 Linux From Scratch 3 03-06-2015 04:03 AM
[SOLVED] Basic networking in custom initramfs anon_16 Linux - Networking 4 03-05-2015 01:54 PM
[SOLVED] initramfs genkernel vs custom kernel steve_pa Gentoo 8 01-25-2012 07:58 PM
Error while building initramfs image for custom kernel TDMBG Linux - Software 2 08-01-2008 05:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration