LinuxQuestions.org
Help answer threads with 0 replies.
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 05-18-2015, 02: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, 04:07 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,148

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
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, 07:49 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,997

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
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, 09: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, 03:20 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,997

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

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

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
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



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

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

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