You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.0 KiB
58 lines
1.0 KiB
14 years ago
|
#!/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!"
|
||
14 years ago
|
exit 1
|
||
14 years ago
|
fi
|
||
|
|
||
|
if [ x$NAME = x ]; then
|
||
|
echo "Name not given!"
|
||
14 years ago
|
exit 1
|
||
14 years ago
|
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
|
||
|
mount -o loop,offset=$((63*512)) qubeized_images/$NAME-root.img mnt || exit 1
|
||
|
|
||
|
echo "--> Installing RPMs..."
|
||
14 years ago
|
rpm --force --nodeps --root=$(pwd)/mnt -ihv rpms_to_install_netvm/*
|
||
14 years ago
|
|
||
|
|
||
|
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
|
||
|
|
||
14 years ago
|
if ! [ -d netvm/apps.templates ] ; then
|
||
|
echo "--> ERROR: Missing netvm/apps.templates directory."
|
||
|
exit 1
|
||
14 years ago
|
fi
|
||
|
|
||
|
echo "--> Unmounting $IMG"
|
||
|
umount mnt
|
||
|
|
||
|
echo "Qubeized image stored at: $IMG"
|
||
|
|