LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-02-2023, 02:40 AM   #1
SMurf7
LQ Newbie
 
Registered: Feb 2004
Distribution: Alpine Linux 3.18
Posts: 27

Rep: Reputation: 0
Obtain a List of All Files Read by the Kernel During Boot


Hello,

Under Windows, if you go into the Safe Mode options and select "Enable Boot Logging", after booting a file called "ntbtlog.txt" appears in the Windows directory. The file contains entries like:-
Code:
...
Loaded driver \SystemRoot\system32\drivers\ACPI.sys
...
Is there a way that I can obtain a similar list of modules, firmware blobs, etc. in the order that the Linux kernel loads/reads them? (Timestamped would be even better)
 
Old 07-02-2023, 05:02 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,071

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
I don't think so.
First of all kernel is multithreaded, the order of the drivers may depend on a lot of things.
Some of the drivers are built into the kernel, it does not need to load it.
Some of the files are not accessed directly by the kernel, but a program which was started during the boot (like init or systemd ?).
But anyway all the files (including config files) are handled by the kernel (you may check the function access or open).
What about the virtual filesystems, like /proc, /dev ?
Kernel has no any idea when the boot itself is completed.
You can check the loaded modules with lsmod.

By the way: what do you want to achieve at all?
 
Old 07-02-2023, 06:35 AM   #3
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,686

Rep: Reputation: Disabled
For earlier parts of the boot process (i.e. kernel logging), see dmesg
 
Old 07-02-2023, 06:53 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,155

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Strictly speaking, the kernel doesn't read files - that's a user-space function. It does provide call-backs for filesystems to provide interfaces that can be called as needed. I suspect Windoze isolates functionality similarly although I haven't looked in a bunch of years.

It would pay to define what you mean by;
- kernel
- boot

User-space initiation is way after boot has completed ... there is even an argument that the kernel is not even involved in the booting process (of the hardware itself). Not necessarily just semantics either.
 
Old 07-02-2023, 09:59 AM   #5
SMurf7
LQ Newbie
 
Registered: Feb 2004
Distribution: Alpine Linux 3.18
Posts: 27

Original Poster
Rep: Reputation: 0
My intent is to determine what modules/firmware two x86 machines (one Intel, one AMD) load at boot and then trim the modloop so nothing else is included.
These machines are used for networking infrastructure, there is no expectation of connecting weird and wonderful PCI/USB devices.
I have tried manually removing files, but encountered problems (e.g. most of the AMD graphics firmware blobs are interdependent).
My definition of "boot" is "everything before init starts".
I think that Kernel Function Tracing may allow me to filter on file operations?
 
Old 07-03-2023, 12:10 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,071

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
Quote:
Originally Posted by SMurf7 View Post
My intent is to determine what modules/firmware two x86 machines (one Intel, one AMD) load at boot and then trim the modloop so nothing else is included.
That is lsmod. (list modules). But probably you can build your own kernel with all your required modules (as builtins) and without any other ones. (also without module loading functionality).
Quote:
Originally Posted by SMurf7 View Post
These machines are used for networking infrastructure, there is no expectation of connecting weird and wonderful PCI/USB devices.
I have tried manually removing files, but encountered problems (e.g. most of the AMD graphics firmware blobs are interdependent).
I don't really understand exactly what did you try?
Quote:
Originally Posted by SMurf7 View Post
My definition of "boot" is "everything before init starts".
And some modules probably loaded after init started.
Quote:
Originally Posted by SMurf7 View Post
I think that Kernel Function Tracing may allow me to filter on file operations?
yes, you can do that, just that won't help you.
 
  


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
Shell script to list all files in the specified directory which have only read permis farzanazhar Programming 7 01-30-2014 11:43 PM
Quick Way to Obtain List of Devices on Any Given Machine? SMurf7 Linux - General 6 04-05-2013 05:35 AM
I get a message "Authentication Failed during during boot . I cannot boot my system hirschi 3 score 1 Linux - Newbie 7 01-21-2010 11:08 PM
How to list all files recursively, in a non-broken list? nyle Linux - Newbie 1 12-16-2008 10:52 PM
How obtain daemons list? kokolisso Linux - Networking 1 10-07-2001 08:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:35 PM.

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