On Wed, Jul 17, 2002 at 01:56:31PM -0400, 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.

Every script is a solution to a problem; I don't see the problem, but
anyway...

> #!/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

What if the image file is 1722?

> s=`date +%s`
> mnt='lrp-mnt-'$s
> mkdir $mnt
> 
> super='lrp-super-'$s
> mkdir $super
> 
> mount -oloop $1 $mnt
> 
> cd $super
> pkgs=`ls ../$mnt/*lrp | sed -e 's/^.*initrd.lrp//'`

How about:

pkgs=`ls ../$mnt/*lrp | grep -v initrd.lrp`

> for pkg in $pkgs ; do
>         name=`echo $pkg | sed -e 's/^.*\///' -e 's/.lrp$//'`

How about:

name=`basename $pkg .lrp`

>         mkdir $name
>         cd $name
>         tar xzf ../$pkg
>         cd ../
> done
> cd ..
> rm -rf lrp-super
> mv $super lrp-super
> umount $mnt ; rm -rf $mnt
> exit 0

Sounds like it populates an image with packages, eh?



-------------------------------------------------------
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

Reply via email to