Fix up triggers and gnomeos-make-image.sh

Now both do something.
This commit is contained in:
Colin Walters 2011-10-20 17:24:21 -04:00
parent a2880a6ddd
commit 4d39070efd
12 changed files with 28 additions and 21 deletions

View File

@ -16,8 +16,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
triggersdir = $(datadir)/ostree/triggers.d
triggers_DATA = \
triggersdir = $(libexecdir)/ostree/triggers.d
triggers_SCRIPTS = \
triggers.d/desktop-database.trigger \
triggers.d/gdk-pixbuf.trigger \
triggers.d/glib.trigger \

View File

@ -1,5 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_CPPFLAGS = -DDATADIR='"$(datadir)"'
AM_CPPFLAGS = -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"'
NULL =
BUILT_SOURCES =

View File

@ -32,30 +32,34 @@ case `uname -p` in
esac;
DEBTARGET=wheezy
KERNELPKG=linux-image-3.0.0-1-amd64
NOTSHARED_DIRS="dev bin etc lib lib32 lib64 proc media mnt run sbin selinux sys srv usr"
SHARED_DIRS="home root opt tmp var"
SHARED_DIRS="home root tmp var"
if ! test -d debootstrap-$DEBTARGET; then
echo "Creating $DEBTARGET.img"
mkdir -p debootstrap-$DEBTARGET.tmp
debootstrap --download-only --arch $ARCH $DEBTARGET debootstrap-$DEBTARGET.tmp
mv debootstrap-$DEBTARGET.tmp debootstrap-$DEBTARGET
fi
if ! test -f $DEBTARGET.img; then
echo "Creating $DEBTARGET.img"
mkdir -p debootstrap-$DEBTARGET
debootstrap --download-only --arch $ARCH $DEBTARGET debootstrap-$DEBTARGET
umount gnomeos-fs-$DEBTARGET || true
mkdir -p gnomeos-fs-$DEBTARGET
umount fs || true
mkdir -p fs
qemu-img create $DEBTARGET.img.tmp 2G
mkfs.ext2 -q -F $DEBTARGET.img.tmp
mount -o loop $DEBTARGET.img.tmp gnomeos-fs-$DEBTARGET
mkfs.ext4 -q -F $DEBTARGET.img.tmp
mount -o loop $DEBTARGET.img.tmp fs
for d in debootstrap-$DEBTARGET/var/cache/apt/archives/*.deb; do
tmpdir=`mktemp -d`
(cd tmpdir;
tmpdir=`mktemp --tmpdir=. -d`
(cd ${tmpdir};
ar x ../$d;
tar -x -z -C ../gnomeos-fs-$DEBTARGET -f data.tar.gz)
tar -x -z -C ../fs -f data.tar.gz)
rm -rf ${tmpdir}
done
umount gnomeos-fs-$DEBTARGET
umount fs
mv $DEBTARGET.img.tmp $DEBTARGET.img
fi
@ -65,9 +69,10 @@ fi
if ! test -f gnomeos.img; then
echo "Cloning gnomeos.img from $DEBTARGET.img"
cp -a --sparse=always $DEBTARGET.img gnomeos.img.tmp
umount gnomeos-fs || true
mount -o loop gnomeos.img.tmp gnomeos-fs
(cd gnomeos-fs;
mkdir -p fs
umount fs || true
mount -o loop gnomeos.img.tmp fs
(cd fs;
mkdir ostree
mkdir ostree/repo
mkdir ostree/gnomeos-origin
@ -89,7 +94,7 @@ if ! test -f gnomeos.img; then
ostree checkout --repo=repo HEAD gnomeos-${rev}
ln -s gnomeos-${rev} current)
)
umount gnomeos-fs
umount fs
mv gnomeos.img.tmp gnomeos.img
fi

View File

@ -194,6 +194,8 @@ run_trigger (OstreeCheckout *self,
path = g_file_get_path (trigger);
basename = g_path_get_basename (path);
args = g_ptr_array_new ();
if (requires_chroot)
{
@ -291,7 +293,7 @@ ostree_checkout_run_triggers (OstreeCheckout *self,
GFileInfo *file_info = NULL;
GFileEnumerator *enumerator = NULL;
triggerdir_path = g_build_filename (DATADIR, "ostree", "triggers.d", NULL);
triggerdir_path = g_build_filename (LIBEXECDIR, "ostree", "triggers.d", NULL);
triggerdir = ot_util_new_file_for_path (triggerdir_path);
enumerator = g_file_enumerate_children (triggerdir, "standard::name,standard::type,unix::*",

0
triggers.d/desktop-database.trigger Normal file → Executable file
View File

0
triggers.d/gdk-pixbuf.trigger Normal file → Executable file
View File

0
triggers.d/glib.trigger Normal file → Executable file
View File

0
triggers.d/gtk+.trigger Normal file → Executable file
View File

0
triggers.d/immodules.trigger Normal file → Executable file
View File

0
triggers.d/ldconfig.trigger Normal file → Executable file
View File

0
triggers.d/mime-database.trigger Normal file → Executable file
View File

0
triggers.d/pango.trigger Normal file → Executable file
View File