qubes-linux-template-builder/qubeize_image
Joanna Rutkowska bdea9a6e2b Revert "qubize_image: also copy qubes-specific-appmenus to VM's app template dir"
This reverts commit 3f6889c345.
This has been done in core instead, see this commit:

http://git.qubes-os.org/?p=joanna/core.git;a=commit;h=ffa3d8732c7d0acba3cda2e855e47910b7d7d221

... which is a correct way of doing this, as the Template's apps.template direcotry gets recreated after each yum update/install in the VM.
2012-06-22 15:31:34 +02:00

74 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
CLEANIMG=$1
NAME=$2
set -e
if [ $# -eq 0 ]; then
echo "usage $0 <clean_image_file> <template_name>"
exit
fi
if [ x$CLEANIMG = x ]; then
echo "Image file not specified!"
exit 1
fi
if [ x$NAME = x ]; then
echo "Name not given!"
exit 1
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 $IMG mnt || exit 1
mount -t proc proc mnt/proc
echo "--> Installing RPMs..."
rpm --force --root=$(pwd)/mnt -ihv rpms_to_install/*
echo "--> Installing 3rd party apps"
./add_3rd_party_software.sh
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
echo "--> Createing the Apps Menu templates..."
./create_apps_templates.sh $APPSORIG $APPSTEMPL
echo "--> Copying DispVM dotfiles dir..."
cp dispvm-dotfiles.tbz mnt/etc/
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
echo "--> Unmounting $IMG"
umount mnt/proc mnt
echo "Qubeized image stored at: $IMG"
echo "Reducing image size (calling cleanup_image)..."
./cleanup_image $IMG