LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2016, 10:04 AM   #1
mrigendra
LQ Newbie
 
Registered: Dec 2014
Posts: 22

Rep: Reputation: Disabled
How to remove unnecessary files from kernel


Hi all,

I have currently kernel 3.8 that I am using for beaglebone black. I see that there are a lot of files that beaglebone doesn't use and funtions with same names, that makes it difficult to search.
Is there a way to get rid of all this unnecessary files?
 
Old 07-24-2016, 10:26 AM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
If you build your own custom kernel on the device there's make localmodconfig. Which will create a .config with only the modules for the hardware you have. Caveat, and only the filesystems currently available on attached storage things.
 
Old 07-25-2016, 04:31 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The short answer is "No".

The longer answer is that the kernel build procedure only builds the ones called for by the configuration. The others are/will be checked to see if they are needed.
 
Old 07-25-2016, 07:49 AM   #4
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
Originally Posted by mrigendra View Post
Hi all,

I have currently kernel 3.8 that I am using for beaglebone black. I see that there are a lot of files that beaglebone doesn't use and funtions with same names, that makes it difficult to search.
Is there a way to get rid of all this unnecessary files?
Read this first, there are related helpful links in it, and this one too. There are many sources and guides available in the internet.

Good luck.
 
Old 07-25-2016, 05:13 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Just remember - once you start deleting things from the kernel distribution you then responsible for all maintenance afterward. You won't be able to add patches very well afterward.

Most people consider this prohibitive.
 
Old 07-25-2016, 05:47 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Can you post some of the examples of names you wish to remove?
 
Old 07-26-2016, 12:15 AM   #7
mrigendra
LQ Newbie
 
Registered: Dec 2014
Posts: 22

Original Poster
Rep: Reputation: Disabled
There are many config, .c and .h files for other architecture such as mips, powerpc. If I am building for BBB, I don't want to see them in my kernel workspace because many functions have same name in those files. What I wish to do this is I don't have any hardware debugger or any sort of method to step in the code so I have to find the files manually and guess how booting is happening and document it.

So the scenario I am looking for is
write the configuration and parse all the useful files for BBB to another directory with this configuration and then build. So I can have one untouched kernel and one another directory named as kernel-BBB inside(or outside) it.

If there is a solution in some scripting language, I just need a small example. Rest I can figure it out.
 
Old 07-26-2016, 06:07 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
If you are using find to locate files it is relatively simple to exclude... Just exclude the architcture name.

Removing the configuration files is a good bit more complex as you have to remove the references from files that refer to them...

As I said, removing files is a complex operation.
 
Old 07-26-2016, 07:48 AM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
The files in the /arch directory apply to different processor architectures. The names are identical because they are "the same files" for different types of CPUs. Only one of them applies to your system.

As my Spanish friend would say: "¡No joda!"

Don't mess around with the content or the arrangement of the kernel source files. Yeah, there are a whole lot of 'em, delicately arranged.

Last edited by sundialsvcs; 07-26-2016 at 07:51 AM.
 
Old 07-26-2016, 10:02 AM   #10
mrigendra
LQ Newbie
 
Registered: Dec 2014
Posts: 22

Original Poster
Rep: Reputation: Disabled
Ok.
So its a complex task basically and same files may be used at different architectures using #define at build time.
I can close this discussion.
thanks to all.
 
Old 07-26-2016, 06:26 PM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
Exactly: there are a set of "very(!) low-level Linux modules" which are written more-or-less in architecture-specific assembly code," meant to be processed by an also architecture-specific compiler. (These modules are, so to speak, "where the rubber meets the road.") One, and only one, of these alternatives will actually be used when compiling Linux for a ("your ...") particular architecture.

BTW: I happen to find these modules quite fascinating. They are the secret of why "Linux" is now available for over twenty(!) entirely-different architectures ... "and yet, it works the same."

That is, if I may say, "a truly astonishing(!) Software Engineering Achievement!" But ... such is Linux.

Last edited by sundialsvcs; 07-26-2016 at 06:30 PM.
 
Old 07-26-2016, 06:33 PM   #12
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by sundialsvcs View Post
Exactly: there are a set of "very(!) low-level Linux modules" which are written more-or-less in architecture-specific assembly code," meant to be processed by an also architecture-specific compiler. (These modules are, so to speak, "where the rubber meets the road.") One, and only one, of these alternatives will actually be used when compiling Linux for a ("your ...") particular architecture.

BTW: I happen to find these modules quite fascinating. They are the secret of why "Linux" is now available for over twenty(!) entirely-different architectures ... "and yet, it works the same."

That is, if I may say, "a truly astonishing(!) Software Engineering Achievement!" But ... such is Linux.
As an extension to that is the GNU C compiler - which is used on all 20+ architectures... and can be used for the purpose of cross compiling from one architecture targeting another.
 
  


Reply

Tags
kernel 3, uboot



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] how to use 'apt-get autoremove' to remove unnecessary packages Gregg Bell Linux - Newbie 6 12-05-2014 01:44 AM
Ubuntu Netbook - remove all unnecessary packages to run a server role fantasygoat Linux - Server 5 11-25-2010 12:55 PM
remove unnecessary contents divyashree Linux - Newbie 4 06-15-2009 06:20 AM
Remove unnecessary packages on a Fedora 10 install Roflcopter Linux - Software 5 04-12-2009 11:01 AM
kernel compilation : to remove a kernel which files should be deleted b0nd Linux - Newbie 2 08-17-2005 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:18 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