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-24-2013, 08:20 PM   #1
TheGreyGhost
LQ Newbie
 
Registered: May 2013
Posts: 2

Rep: Reputation: Disabled
Customise a live boot linux ISO - editing initrd (squashfs)


Hi All.

I am trying to customise a live boot linux ISO which I downloaded (LPS). This distro is customised for secure internet banking - basically all it does is provide firefox, and there is no persistent storage at all - for example the kernel code necessary to access local hard disks has been removed.

All I want to do is add a few custom bookmarks to the browser and a couple of files containing notes to the desktop.

Being almost totally new to linux, I thought this would be a simple matter of editing a couple of the files in the ISO.

I managed to get as far as identifying initrd as the file to modify, and figuring out that it is a squashfs format.

But here's where I get stuck because when I try to unsquashfs it (in Ubuntu or Cygwin binary), I get a stack of errors about not being superuser and permission denied, so many of the folders don't extract. Even if I could find an in-place editing tool for squashfs (I couldn't), I don't think it would help because the files I'm looking for weren't in the extracted folders.

Any thoughts/clues?

Cheers
Richard
 
Old 05-25-2013, 12:52 AM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Hi!

Quote:
I get a stack of errors about not being superuser and permission denied, so many of the folders don't extract.
There are certain funtions that you may want to perform on your system that required 'root' permission.
Depending on which file you want to change or modify you must be 'root' to accomplish the task.

A for example; let's say that you just installed Linux Mint but you need to update your newly installed OS. In order to do that you would have to be operating as 'root' and provide the terminal your password.
Like this:
Code:
Jamesdoe@localhost :~$ su (or) sudo su
put in your password
Jamesdoe@localhost :~# apt-get update
Another example could be your sources.list
You would open a terminal as 'root' by typing in your password and than you would be able to edit that file with your favorite text editor. I use Nano-
Code:
:~$ nano /etc/apt/sources.list
That file would open in the terminal and you would be able to modify it--
BTW, when you type your root password into the terminal the character/cursor will not move.

If your using Fedora or another Red Hat based distribution you would use 'yum'
Apt is the commandline utility for Ubuntu, Debian and many other distributions.
You didn't mention what distribution you are using so I geralized with the commandline utility--

http://www.linux.com/learn/tutorials...le-permissions
http://www.tuxfiles.org/linuxhelp/filepermissions.html
http://www.cyberciti.biz/faq/how-lin...missions-work/

Hope that helps-
http://www.linuxquestions.org/linux/...le_Permissions

Last edited by Ztcoracat; 05-25-2013 at 12:58 AM.
 
1 members found this post helpful.
Old 05-25-2013, 05:35 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
The squashfs file you mentioned contains a complete Linux file-system, including device nodes and special files. to extract them you have to be root, otherwise you don't have the permission to create those special devices in your normal file system. Just do it as root.
 
1 members found this post helpful.
Old 05-25-2013, 12:13 PM   #4
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Looked it up to help-

Device nodes - a special file is an interface for a device driver.

https://en.wikipedia.org/wiki/Device_file
 
1 members found this post helpful.
Old 05-25-2013, 01:24 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
I used puppy linux to modify it. The LPS used an older version of squashfs and puppy mounts it easily. I use a virtual machine to modify it and add drives and re-squash it. Just rename the squashfile to the puppy extension. As puppy booted you will then have control over root and all file permissions within the squash.

Well, actually unsquash it and modify it and then resquash it and put it back to the original name to use on usb or cd.

I did mess with some stuff and you can't easily fix some of the busybox stuff. There is a way to add in commands outside but I think I noticed some relationship between busybox version and the init.

All I really started out to do was get rid of the warning box at boot. That was the easy part. Then I added a hosts file and changed background desktop. I guess it would have been easier to email the guys that made it and ask for their sources and just rebuild it all.

Last edited by jefro; 05-25-2013 at 01:26 PM.
 
1 members found this post helpful.
Old 05-25-2013, 04:17 PM   #6
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Best way to edit a ubuntu distro, you should use ubuntu customization kit, this will extract everything needed and then give you a chroot into the extracted squashfs, you can then remove and add things to your liking, It will then rebuild the iso for you.
 
1 members found this post helpful.
Old 05-28-2013, 08:47 AM   #7
TheGreyGhost
LQ Newbie
 
Registered: May 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks guys! Using those pointers as a starting point (and a lot of scrabbling up the learning curve) I have managed to add the customisations I wanted. -->Richard
 
Old 05-31-2013, 02:06 PM   #8
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
glad to hear it's all worked
 
Old 03-22-2014, 06:27 AM   #9
joeviocoe
LQ Newbie
 
Registered: Mar 2014
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
I used puppy linux to modify it. The LPS used an older version of squashfs and puppy mounts it easily. I use a virtual machine to modify it and add drives and re-squash it. Just rename the squashfile to the puppy extension. As puppy booted you will then have control over root and all file permissions within the squash.

Well, actually unsquash it and modify it and then resquash it and put it back to the original name to use on usb or cd.

I did mess with some stuff and you can't easily fix some of the busybox stuff. There is a way to add in commands outside but I think I noticed some relationship between busybox version and the init.

All I really started out to do was get rid of the warning box at boot. That was the easy part. Then I added a hosts file and changed background desktop. I guess it would have been easier to email the guys that made it and ask for their sources and just rebuild it all.
Is there a good step-by-step for this?

I have LPS 1.5.0 now... and never unsquashed or used mksquashfs before.

I want to enable the root account which seems disabled with !! in the /etc/passwd file (no /etc/shadow or /etc/security/passwd files)
 
Old 03-22-2014, 02:52 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
You'd have to find the version of squash that 1.5 used. I'd have to play with this again to remember exact steps. Didn't take long as I recall. I played with it inside a vm since I don't have a free system to mess with.

I think I changed the file name to a squash extension.
I think I used a unsquash command to expand it to a folder. Made changes and then re-squashed it. Change the file name back to the LPS and put it back on the iso.


Like I said, I didn't think it very hard. Just play with it and you'll get it.

As I recall, I did get to root but it defeated the use of the drive. I get the feeling I could access root from the distro.

I'd have to set it all up and play with it again.


I used puppy because it had the version of squash installed. If 1.5 uses a newer version or went to a different compression then you could use almost any newer distro I'd think. There were some issues running older squash on newer distro's.

There was some way to find the version of squash. Maybe file command. It's on the web.

Last edited by jefro; 03-22-2014 at 02:57 PM.
 
Old 08-15-2014, 11:46 AM   #11
sherrako
LQ Newbie
 
Registered: Aug 2014
Posts: 11

Rep: Reputation: Disabled
So I am attempting to do the exact same thing as the OP did, but as a first time ever user of linux ever, I have no idea where to start. I've got a version of puppy linux up and running but from there I have no idea where to go or how to start, any help would be greatly appreciated.
 
Old 08-15-2014, 03:38 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Let's stop this thread and how about you starting a new post on the issue? It may make it more clear to us. Tell us which version of LPS or other distro you are trying to edit.

Also howdy and welcome to lq.
 
  


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
initrd image created with cpio doesnt boot the livecd (linux-live script) robertjinx Linux - Server 2 07-06-2011 02:53 PM
Mount ISO as specific device (ie: /dev/sda1) with GRUB2 to boot KNOPPIX live cd iso BLuFeNiX Linux - General 2 12-23-2009 01:31 AM
Live CD not proceeding to second stage of boot after squashfs image editing cyber_apostle Programming 0 11-13-2009 02:34 AM
Making an initrd for a squashfs steveo_mcg Linux - General 1 09-12-2006 10:06 AM
How To boot from an Linux live CD ISO from HD! Marrokinooo Linux - General 2 07-01-2006 04:59 PM

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

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