LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-18-2015, 03:47 PM   #1
jsh121988
LQ Newbie
 
Registered: May 2015
Posts: 2

Rep: Reputation: Disabled
Add files to a PXE image


Hello,

I am new to Linux images (pxe, livecd). I would like to add files to a linux image, like something under etc or var, and have the files be available on the client.
The server I am working on was already configured with a pxe image, and only 2 files are present under the pxe client folder: initrd and vmlinuz. So I am wondering if either of these files contain the dirs /etc, /var, etc..., and how I could add files to them.

To give some background, I have done the same thing in Windows. An image in Windows is typically either boot.img or install.img. You can mount either of these to a folder using the Windows SDK tool imagex.exe /mountrw <img file> 1 <mount point>. From here you can add/remove/modify any files you want. Then commit the changes with imagex.exe /unmount <mountpoint> /commit.

Can someone provide insight to the linux image creation process, which of the files (initrd, vmlinuz/vmlinux, etc...) contain what for the client boot, or something similar to the Windows Image editing process?

I know I'm asking for a range of info, but pointers to any material to help my understanding will be greatly appreciated.

Thanks,
Jon
 
Old 05-18-2015, 05:07 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
vmlinuz is the kernel, so no files there.
initrd is the ramdisk image. You can modify that if you know what you are doing:

http://www.thegeekstuff.com/2009/07/...te-initrd-img/
 
1 members found this post helpful.
Old 05-18-2015, 08:49 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
It would depend on how you are booting this image. Some images rely on a type of compressed image like squashfs. If that is the type of file you mean you wish to edit then you mount the file with the same version of squashfs. Mount the image, copy off the files to a folder, and then add the ones you wish. Then re-squash them back.
 
Old 05-18-2015, 10:46 PM   #4
jsh121988
LQ Newbie
 
Registered: May 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks!

Both posts have given some insight. I will do some more research on squashfs. There is a line in the boot loader specifying loop=/livecd.squashfs. I will do a find tomorrow, but do you happen to know where /livecd.squashfs resides as it is not in / ?
 
Old 05-19-2015, 04:20 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Telling us about this distro would help a lot.
 
Old 05-19-2015, 04:31 PM   #6
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,380

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Likely in /tftpboot or whatever is the specified dir in the PXEboot setup.
 
Old 05-19-2015, 08:49 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Yes, the source would be someplace depending on what you have. It could be in the iso image, unfolded to a folder like in tftp or nfs or where ever you boot to.

Pretty sure it means that /livecd.squashfs will reside in / after it boots.
 
  


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
[SOLVED] How to add text on image files in bash script bal_nair1 Programming 10 07-26-2012 06:55 AM
Custom Fedora image for PXE baddah Fedora 1 04-30-2008 08:46 PM
How to add image in MP3 files SeRGeiSarov Linux - Software 2 05-19-2007 02:37 PM
boot from pxe image jcai Linux - General 1 06-21-2006 08:08 AM
How can i add files 2 an iso image? Braveheart1980 Linux - Software 4 02-29-2004 07:30 PM


All times are GMT -5. The time now is 09:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration