diff options
| author | Jeremy Katz <katzj@redhat.com> | 2007-12-19 11:37:59 -0500 |
|---|---|---|
| committer | Jeremy Katz <katzj@redhat.com> | 2007-12-19 11:37:59 -0500 |
| commit | 5cbb637cf30aa29a871adf6fb59b2f6948931e14 (patch) | |
| tree | 757c9afc279b48b9ed731b2050e353cd1f16e3f5 | |
| download | live-scripts-5cbb637cf30aa29a871adf6fb59b2f6948931e14.tar.gz live-scripts-5cbb637cf30aa29a871adf6fb59b2f6948931e14.tar.xz live-scripts-5cbb637cf30aa29a871adf6fb59b2f6948931e14.zip | |
Initial add
| -rw-r--r-- | genrawhidelive.sh | 19 | ||||
| -rwxr-xr-x | getlivelist.sh | 17 | ||||
| -rw-r--r-- | livesizediff.py | 39 | ||||
| -rwxr-xr-x | mylive.sh | 48 |
4 files changed, 123 insertions, 0 deletions
diff --git a/genrawhidelive.sh b/genrawhidelive.sh new file mode 100644 index 0000000..20b0ce2 --- /dev/null +++ b/genrawhidelive.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# +# Generate a full set of rawhide live images + +date=-$(date +%Y%m%d) +label="rawhide" + +export LIVEOUTDIR=/mnt/firewire/live/$label$date + +i386 sh -x ./mylive.sh /usr/share/livecd-tools/livecd-fedora-desktop.ks $label-i686$date +#i386 sh ./mylive.sh ../config/livecd-fedora-kde.ks $label-KDE-i686$date +#sh ./mylive.sh ../config/livecd-fedora-desktop.ks $label-x86_64$date +#sh ./mylive.sh ../config/livecd-fedora-kde.ks $label-KDE-x86_64$date +#i386 sh ./mylive.sh ../config/livecd-fedora-electronic-lab.ks $label-FEL-i686$date +#i386 sh ./mylive.sh ../config/livecd-fedora-developer.ks $label-Developer$date +#i386 sh ./mylive.sh ../config/livecd-fedora-games.ks $label-games-i686$date + + +ls -lh $LIVEOUTDIR diff --git a/getlivelist.sh b/getlivelist.sh new file mode 100755 index 0000000..966d7cb --- /dev/null +++ b/getlivelist.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "need an image" +fi + +mount -o loop,ro "$1" /mnt/tmp +mount -o loop,ro -t squashfs /mnt/tmp/LiveOS/squashfs.img /mnt/tmp +mount -o loop,ro /mnt/tmp/LiveOS/ext3fs.img /mnt/tmp + +if [ -n "$GET_SHELL" ]; then bash ; fi +rpm --root=/mnt/tmp -qa --qf "%{SIZE}\t%{NAME}\n" +#rpm --root=/mnt/tmp -qa --qf "%{NAME}-%{SIZE}-%{RELEASE}\n" + +umount /mnt/tmp +umount /mnt/tmp +umount /mnt/tmp diff --git a/livesizediff.py b/livesizediff.py new file mode 100644 index 0000000..195f58b --- /dev/null +++ b/livesizediff.py @@ -0,0 +1,39 @@ +#!/usr/bin/python -tt +# takes two manifest files and compares to find where things grew +# manifests should be created with +# rpm -qa --qf "%{SIZE}\t%{NAME}\n" +# + +import os, sys, string + +THRESH = 0.01 + +def readfile(fn): + pkgs = {} + f = open(fn, "r") + lines = f.readlines() + f.close() + for l in lines: + (size, name) = l.split() + pkgs[name] = size + return pkgs + +old = sys.argv[1] +new = sys.argv[2] + +oldpkgs = readfile(old) +newpkgs = readfile(new) + +for (pkg, size) in newpkgs.items(): + if not oldpkgs.has_key(pkg): + print "new package %s: %s" %(pkg, size) + continue + oldsize = oldpkgs[pkg] + if oldsize == "0": + continue + deltapct = (int(size) - int(oldsize)) / float(oldsize) + if deltapct > THRESH: + print "%s grew by %.2f%% (%s->%s)" %(pkg, deltapct*100, oldsize, size) + +print "old has %d packages" %(len(oldpkgs),) +print "new has %d packages" %(len(newpkgs),) diff --git a/mylive.sh b/mylive.sh new file mode 100755 index 0000000..b2fd626 --- /dev/null +++ b/mylive.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +ulimit -c unlimited +export CONFIG=$(readlink -f $1) +export FSLABEL=$2 +if [ -z "$LIVEOUTDIR" ]; then + LIVEOUTDIR="/mnt/firewire/live" +fi +if [ ! -d "$LIVEOUTDIR" ]; then + mkdir -p $LIVEOUTDIR +fi + +clean() { + exit 0 +} + +if [ -z $CONFIG -o -z $FSLABEL ]; then + echo "Need a config and an fslabel" + exit 1 +fi +shift; shift + +trap clean SIGINT SIGTERM + +thisdir=$(pwd) +if [ -x $thisdir/livecd-creator ]; then + CREATOR=$thisdir/livecd-creator +else + CREATOR=/usr/bin/livecd-creator +fi +pushd $LIVEOUTDIR +$CREATOR --config=$CONFIG --fslabel=$FSLABEL --tmpdir=/mnt/firewire/tmp --cache=/mnt/firewire/tmp/cache-$(uname -m) $* +if [ ! -e $FSLABEL.iso ]; then + exit 1 +fi + +date=$(date +%Y%m%d) +outlabel=$(echo $FSLABEL | sed -e "s/-$date//") + +for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do + outiso=$LIVEOUTDIR/$outlabel-$date.$i.iso + if [ ! -e $outiso ]; then break; fi +done +echo "Live image moving to $outiso" +mv $FSLABEL.iso $outiso +chcon -t httpd_sys_content_t $outiso +popd +clean |
