2010-04-05 22:25:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
CLEANIMG=$1
|
|
|
|
NAME=$2
|
|
|
|
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
echo "usage $0 <clean_image_file> <template_name>"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ x$CLEANIMG = x ]; then
|
|
|
|
echo "Image file not specified!"
|
2010-06-18 23:43:52 +00:00
|
|
|
exit 1
|
2010-04-05 22:25:37 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ x$NAME = x ]; then
|
|
|
|
echo "Name not given!"
|
2010-06-18 23:43:52 +00:00
|
|
|
exit 1
|
2010-04-05 22:25:37 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
ID=$(id -ur)
|
|
|
|
|
|
|
|
if [ $ID != 0 ] ; then
|
|
|
|
echo "This script should be run as root user."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
IMG=qubeized_images/$NAME-root.img
|
|
|
|
echo "--> Copying $CLEANIMG to $IMG..."
|
|
|
|
cp $CLEANIMG $IMG || exit 1
|
|
|
|
|
|
|
|
echo "--> Mouting $IMG"
|
|
|
|
|
|
|
|
mkdir -p mnt
|
2011-03-19 02:30:23 +00:00
|
|
|
mount -o loop $IMG mnt || exit 1
|
2010-04-05 22:25:37 +00:00
|
|
|
|
|
|
|
echo "--> Installing RPMs..."
|
2011-03-16 08:52:21 +00:00
|
|
|
rpm --force --root=$(pwd)/mnt -ihv rpms_to_install/*
|
2010-04-05 22:25:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
echo "--> Copying the Apps Menu shortcuts..."
|
|
|
|
APPSORIG=qubeized_images/$NAME-apps.orig
|
|
|
|
APPSTEMPL=qubeized_images/$NAME-apps.templates
|
|
|
|
mkdir -p $APPSORIG
|
|
|
|
cp -r $(pwd)/mnt/usr/share/applications/* $APPSORIG
|
|
|
|
|
2010-06-18 23:43:52 +00:00
|
|
|
echo "--> Createing the Apps Menu templates..."
|
|
|
|
./create_apps_templates.sh $APPSORIG $APPSTEMPL
|
2010-04-05 22:25:37 +00:00
|
|
|
|
2010-06-18 23:43:52 +00:00
|
|
|
echo "--> Installing 3rd party apps"
|
|
|
|
./add_3rd_party_software.sh
|
2010-04-05 22:25:37 +00:00
|
|
|
|
2010-07-27 11:57:31 +00:00
|
|
|
echo "--> Copying DispVM dotfiles dir..."
|
|
|
|
cp dispvm-dotfiles.tbz mnt/etc/
|
2010-04-05 22:25:37 +00:00
|
|
|
|
2010-10-04 17:59:11 +00:00
|
|
|
echo "--> Linking /home to /rw/home..."
|
|
|
|
mv mnt/home mnt/home.orig
|
|
|
|
ln -sf /rw/home mnt/home
|
|
|
|
|
|
|
|
echo "--> Linking /usr/local to /rw/usrlocal..."
|
|
|
|
mv mnt/usr/local mnt/usr/local.orig
|
|
|
|
ln -sf /rw/usrlocal mnt/usr/local
|
|
|
|
|
2010-04-05 22:25:37 +00:00
|
|
|
echo "--> Unmounting $IMG"
|
|
|
|
umount mnt
|
|
|
|
|
|
|
|
echo "Qubeized image stored at: $IMG"
|
|
|
|
|
2010-10-04 17:18:58 +00:00
|
|
|
echo "Reducing image size (calling cleanup_image)..."
|
|
|
|
./cleanup_image $IMG
|