It is currently Wed May 22, 2013 1:23 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: build-slackware-live.sh : Finding the script in the iso
PostPosted: Sun May 08, 2011 2:58 am 
Senior Zenwalker
Senior Zenwalker
User avatar

Joined: Wed Oct 18, 2006 1:46 am
Posts: 269
Location: Sydney, Australia
For various reasons, I was interested in having a look at the build-slackware-live.sh script that is used in the recent release of ZenLive 7.0. Just to make matters more interesting, or more complex I wanted to have a look at the script within the actual ZenLive 7.0 iso file without first having to create a CD and then boot my laptop into an operational copy of the live system. Any comments about my being in need of a social life will be ruefully acknowledged :-[

Since I didn't know where the script was on the iso, and neither could I find a recent copy of the script on the Web, it took some time to actually find it. For those who are interested in having a look inside the build-slackware-live.sh script and seeing what it is that it actually does, the following provides a quick HOWTO on finding it and looking at it.

This process assumes that you have already downloaded the zenlive-7.0.iso and have it available to have a look at. We will assume that the iso is located at /home/<user>/iso/zenlive-7.0.for the sake of convenience. Now the following steps need to be taken:

Code:
[Login as root
su -


Make a mount point for the iso

Code:
cd /media
mkdir iso


Mount the zenlive-7.0.iso on the new mount point

Code:
mount -o loop /home/<user>/iso/zenlive-7.0.iso /media/iso


You may get the message
"mount: Could not find any loop device. Maybe this kernel does not know about the loop device? (If so, recompile or `modprobe loop'.)" in which case you need to run the following commands

Code:
modprobe loop
mount -o loop /home/<user>/iso/zenlive-7.0.iso /media/iso


Make sure the iso has been mounted and is visble

Code:
cd iso
ls -al
total 6
drwxr-xr-x 2 root root 2048 2011-05-05 17:31 .
drwxrwxrwx 3 root root   53 2011-05-07 20:59 ..
-rw-r--r-- 1 root root  681 2011-05-05 17:31 ABOUT
drwxr-xr-x 2 root root 2048 2011-05-05 17:31 boot
-rwxr-xr-x 1 root root  963 2011-05-05 17:31 make_iso.sh


Change to the boot directory and re-list the contents

Code:
cd boot
ls -al
total 6952
drwxr-xr-x 2 root root    2048 2011-05-05 17:31 .
drwxr-xr-x 2 root root    2048 2011-05-05 17:31 ..
-rw-r--r-- 1 root root 2087158 2011-05-05 17:31 initrd.gz
drwxr-xr-x 2 root root    4096 2011-05-05 17:31 isolinux
-rw-r--r-- 1 root root      39 2011-05-05 17:31 liveboot
drwxr-xr-x 2 root root    2048 2011-05-05 17:31 modules
drwxr-xr-x 2 root root    2048 2011-05-05 17:31 optional
-rw-r--r-- 1 root root 5018144 2011-05-05 17:31 vmlinuz


The file we are interested in is the initrd.gz file. Now there are a number of ways of looking into this file but Archive Manager allows you actually get into the files that comprise the archive without physical having to expand the archive onto your disk

Either start Archive Manager from your desktop menu .... its under Accessories ... and open the initrd.gz file or, my preferred way, open Thunar, change directories to /media/iso/boot, right click on initrd.gz and Open with "Archive Manager". This will open the initrd.gz archive in read only mode and show the file initrd in the main panel. Click on the initrd listing and this should open a new window of Archive Manager with the contents of initrd extracted.

At the bottom of all the various folders you will see the build-slackware-live.sh file listed

Code:
build-slackware-live.sh     25.4 KB     shell script     etc etc etc


If you click on this listing it will now open the file in Mousepad and you can browse the file to your hearts content or to save a copy to you home directory for later appreciation.

If you click on the sli (slackware live install) folder, you will see the script that is used to install the running live version on the harddisk

Code:
install-slackware-live.sh     2.3 KB      shell script   etc etc etc


]which can also be viewed in Mousepad the same way.

Having seen what you need to see, close the various mousepad and Archive manage windows and move Thunar away from the iso ie so that the application is not reading data from the mount point and thus keeping it open. Back on the command line, do the following to unmount the iso

Code:
cd
umount /media/iso
exit



I realise that is a rather detailed and somewhat esoteric description of the procedure of how to read a shell script contained within an iso file, but I do believe that it is important to understand what various shell scripts do and how they do it. That can only be achieved by reading the code in the shell script and coming to grips with it And in some instances you may need to have the shell script available for evaluation and use independent of the running system

Regards

Michael


 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
 
cron