LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 09-16-2014, 07:36 AM   #1
ayyasprings
Member
 
Registered: Aug 2014
Posts: 118

Rep: Reputation: Disabled
Where to place kernel image in filesystem heirarchy for embedded environment?


Hi,

I have cross compiled kernel image and kernel modules with me.I will place kernel modules in /lib directory in root filesystem heirarchy and where to place kernel image? If to place it in /boot directory what should i ensure with my boot loader generally? Or if i should place anywhere what should i ensure with my bootloader generally?
I planned to use U-boot bootloader. But i need to know the common ideas that should I have so that if I have to use any other bootloader, I should be able to do.

Please help!
 
Old 09-17-2014, 04:36 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,991

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
kernels gradually moved from / to /boot over the years, because people had boot partitions. Everything needed to boot should be mounted under /, i.e. not under /usr, var, or /opt.

A quick google for FHS hierarchy will tell you all you need to know, and probably much more :-P.
 
Old 09-17-2014, 04:58 AM   #3
ayyasprings
Member
 
Registered: Aug 2014
Posts: 118

Original Poster
Rep: Reputation: Disabled
Hi business_kid,

If I have to place in /boot directory how to determine the start address for bootloader to fetch the kernel.
If I didnot place in filesystem heirarchy while building rootfs image and if I flash the kernel image and rootfs image separately into embedded board
at which address I have to specify for bootloader to place. Should it be the same as the address of /boot directory?

Please help!
 
Old 09-17-2014, 07:54 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,991

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
You can drop the kernel in the / directory. That's fine, and better if you are using offsets. a /boot would only get in the way.

As I understand it, if you're not offering a choice you don't need to worry about a bootloader. It depends how elementary you are going. You probably want a maintenance option. But these are design issues, and you should know answers, not trust some geek on a forum.
 
Old 09-22-2014, 10:35 AM   #5
ayyasprings
Member
 
Registered: Aug 2014
Posts: 118

Original Poster
Rep: Reputation: Disabled
Hi business_kid,

Do i have to place compressed image of the kernel(zImage) or uncompressed image(vmlinuz) in / directory?
In the desktop filesystem when I checked while running in the /directory it shows vmlinuz.o like that dont remember the exact name sorry.

Is it due to that while running it decompresses the zImage and hence showing vmlinuz or we have to place vmlinuz image only?

Please help!
 
Old 09-23-2014, 04:14 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,991

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
Provided you compiled compression for the format used into the kernel, you only need a compressed image = ~/arch/x86/boot/bzImage usually. If that's not there grab the smallest one.
 
Old 09-20-2016, 08:43 AM   #7
ayyasprings
Member
 
Registered: Aug 2014
Posts: 118

Original Poster
Rep: Reputation: Disabled
Address locating of kernel and rootfilesystem in Linux installed in PC

On comparing Linux installed in PC(laptop/desktop/workstation) with Linux installed in embedded boards, I got a doubt. ie) In embedded board we are passing exact physical address of kernel and root file system (in hexadecimal format) that resides in different partitions to embedded boot loader like Uboot or by specifying the partition information in board specific file that is in kernel source, so that boot loader loads kernel and then root file system was mounted.

In what mechanism for a Linux installed in PC loads kernel and root file system after boot loader?
How do we pass the information to boot loader for booting kernel and mounting of root file system(through which files)?
how does the boot loader locates the physical address of kernel image and root file system?

Does the kernel size can be modified on adding or removing drivers or modules or any features after installing in the PC? If it can be modified how the offset address info of root file system modified due to kernel size modified passed to Boot loader (through which files)?

Please reply! Thanks in Advance!
 
Old 09-21-2016, 03:33 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,991

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
I will reply but I'm not writing you a handbook.
This stuff is online in many guides. Look them up. The LinuxFromScratch book has detailed information on kernel builds and installs. http://www.linuxfromscratch.org
 
Old 09-21-2016, 10:45 AM   #9
ayyasprings
Member
 
Registered: Aug 2014
Posts: 118

Original Poster
Rep: Reputation: Disabled
Hi business_kid,

I see that booting information are passed as directory/file path starting from root partition ie mentioned as '/'. But I want to know where will be the physical starting address(in terms of hex) of the root partition and starting address of other path that requires to be mounted will translated and passed to the bootloader.

Please reply!
 
Old 09-22-2016, 03:05 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,991

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
Can't help you there. There are utilities that calculate the disk offset. Some are complex boot loaders, but even
Code:
DD skip=<some_number>
applies a disk offset
 
Old 09-22-2016, 10:58 AM   #11
ayyasprings
Member
 
Registered: Aug 2014
Posts: 118

Original Poster
Rep: Reputation: Disabled
Thanks business_kid. I got cleared now. Until your reply I was in assumption that Bootloader will be light weighted and utilities contained in binutils will not be supported by that. Now I am clear.

Thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to Place Image on Desktop sunveer Fedora 3 12-28-2013 10:36 AM
[SOLVED] Filesystem Mounts to Wrong Place profector21 Linux - Newbie 8 04-13-2012 09:15 AM
How to resize filesystem (image file)? how to truncate the image? nikov3 Linux - General 4 06-27-2006 04:02 AM
Is there a desktop environment w/ an embedded console? adam gorley Linux - Software 4 03-09-2006 11:20 AM
ISOLinux from Debian etch cannot find kernel image (but kernel is in its place)! Why? *Dark Dragon* Debian 4 11-07-2005 10:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

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