On Wed, 17 Jul 2002, George Georgalis wrote:
> Below is a little script to mount and extract an image in a way that will
> allow for editing and repackaging of the lrp modules.
This is neat. I normally extract the contents of the package I am
interested in, since I navigate the actual router filesystem and read its
/var/lib/lrpkg/*.list files to find out which package I am interested in.
ssh is my friend. :)
> It uses tmp files but eventually creates (replaces) a directory called
> lrp-super, which contains a directory for each lrp module and the root
> filesystem per the package below it. (see the second find output below)
>
> I plan to borrow some code from lrcfg to repackage and add some new code
> to manage the other critical files and reconstruct the image.
Sounds useful.
> I wanted to post this now for comments.
[...]
> #!/bin/sh
>
> [ -z $1 ] && echo 'Supply image file to mount and extract' && exit
> [ -z '`du $1 | grep 1688`' ] && echo 'Supply image file to mount and extract' && exit
>
> s=`date +%s`
> mnt='lrp-mnt-'$s
> mkdir $mnt
>
> super='lrp-super-'$s
> mkdir $super
>
> mount -oloop $1 $mnt
# I think this should be:
mount -t msdos -oloop $1 $mnt
>
> cd $super
> pkgs=`ls ../$mnt/*lrp | sed -e 's/^.*initrd.lrp//'`
# Not all packages on the disk get loaded:
pkgs=`grep PKGPATH ../$mnt/syslinux.cfg \
| tr ' ' '\n' | grep LRP | sed -e 's/LRP=//' | tr ',' ' '`
> for pkg in $pkgs ; do
> name=`echo $pkg | sed -e 's/^.*\///' -e 's/.lrp$//'`
> mkdir $name
The philosophy of extracting all of them, yet keeping their contents
separate, seems odd. Certainly this would share little in common with
lrpkg.
I can see wanting tools to manipulate specific packages.
I can see wanting to see how the packages all overlay each
other.
But this approach seems to confound these needs. Perhaps a tool to grab
the files out of the image, another tool to manipulate the packages, and
another to do a unpack/merge would lead to more re-use?
I rarely use floppies once I have the system working, since the dust kills
them. Thus, I normally back up the files that comprise my system rather
than images.
> cd $name
> tar xzf ../$pkg
> cd ../
> done
> cd ..
> rm -rf lrp-super
> mv $super lrp-super
> umount $mnt ; rm -rf $mnt
> exit 0
Cool script. :)
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<[EMAIL PROTECTED]> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...2k
---------------------------------------------------------------------------
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel