Skip to content

Instantly share code, notes, and snippets.

@udienz
Created May 9, 2009 12:48
Show Gist options
  • Save udienz/109255 to your computer and use it in GitHub Desktop.
Save udienz/109255 to your computer and use it in GitHub Desktop.
#!/bin/bash
# building dvd ubuntu release
# Mahyuddin Susanto <udienz@unej.ac.id>
# use ./dvd-repo-ubuntu.sh $ARCH $RELEASE
# example ./dvd-repo-ubuntu.sh i386 hardy
SRC=/ftp/ubuntu/
BASE=`pwd`
#RELEASE=hardy
RELEASE="$2"
ARCH="$1"
mount=/home/ftp
TO=/ftp/pub/iso/ubuntu-repository/unofficial/
echo "debpartial is under action!"
echo ""
/usr/bin/debpartial --arch=$ARCH --nosource --dirprefix=dvd \
--section=main,restricted,universe,multiverse,main/debian-installer \
--dist=$RELEASE,$RELEASE-updates,$RELEASE-security,$RELEASE-backports \
--size=DVD $SRC $BASE/$RELEASE/
NAME=$RELEASE-$ARCH-`date +%d%m%Y`
for i in `ls $BASE/$RELEASE/`; do
echo "making repository using debcopy"
echo ""
debcopy -l $SRC $BASE/$RELEASE/$i
cp README.txt $BASE/$RELEASE/$i
mkdir -p $BASE/$RELEASE/$i/project/trace
date -u > $BASE/$RELEASE/$i/project/trace/`hostname -f`
SIMPAN=$TO/$RELEASE/`date +%d%m%Y`
if [ ! -d "$SIMPAN" ]; then
mkdir -p $SIMPAN
cp README.txt $TO
cp README.txt $SIMPAN
fi
echo "building iso images"
echo ""
mkisofs -f -J -r -joliet-long -V "$i-$NAME" -o $SIMPAN/$NAME-$i.iso $BASE/$RELEASE/$i
echo "mount $SIMPAN/$NAME-$i.iso to $SIMPAN/$i"
echo ""
sudo mount -o loop $SIMPAN/$NAME-$i.iso $mount
echo "generate jigdo file"
echo ""
jigdo-file make-template --image=$SIMPAN/$NAME-$i.iso \
--jigdo=$SIMPAN/$NAME-$i.jigdo \
--template=$SIMPAN/$NAME-$i.template --label Debian=$mount \
--uri Debian=ftp://mirror.unej.ac.id/ubuntu $mount//
echo "umount /mnt"
sudo umount $mount
done
echo "finally we will remove $BASE/$RELEASE/"
rm -rf $BASE/$RELEASE/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment