small changes in the daemon.
m4/ltversion.m4
m4/lt~obsolete.m4
stamp-h1
+update-initramfs.sh
vmlinuz.*
fs_DATA = $(INITRAMFSIMG) $(VMLINUZ)
-$(VMLINUZ) $(INITRAMFSIMG): initramfs.timestamp
+$(INITRAMFSIMG) $(VMLINUZ): initramfs/fakeroot.log
-#initramfs.timestamp: make-initramfs.sh.in daemon/guestfsd
-initramfs.timestamp: make-initramfs.sh.in
+initramfs/fakeroot.log: make-initramfs.sh.in
+ -mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak
+ -mv $(VMLINUZ) $(VMLINUZ).bak
+ bash $(builddir)/make-initramfs.sh || rm -f $@
+
+$(INITRAMFSIMG): initramfs/fakeroot.log daemon/guestfsd
rm -f $@
- bash $(builddir)/make-initramfs.sh
+ bash $(builddir)/update-initramfs.sh
touch $@
# Make clean.
-CLEANFILES = $(fs_DATA) initramfs.timestamp emptydisk
+CLEANFILES = $(fs_DATA) emptydisk
clean-local:
rm -rf initramfs
dnl Produce output files.
AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile make-initramfs.sh])
+AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile
+ make-initramfs.sh update-initramfs.sh])
AC_OUTPUT
dnl WTF?
# Decide on names for the final output. These have to match Makefile.am.
output=initramfs.@REPO@.@host_cpu@.img
koutput=vmlinuz.@REPO@.@host_cpu@
-rm -f $output $koutput
+rm -f $output
+rm -f $koutput
# Create the basic initramfs.
@FEBOOTSTRAP@ $modules @REPO@ initramfs @MIRROR@
# Modules take up nearly half of the image. It's a rough guess that
# we don't need any drivers (which take up most of the space).
# (We need to keep kernel/net/sunrpc for NFS)
-rm -rf initramfs/lib/modules/*/kernel/{drivers,sound}
+#rm -rf initramfs/lib/modules/*/kernel/{drivers,sound}
rm -rf initramfs/lib/modules/*/kernel/arch/x86/kvm
# Pull the kernel out into the current directory. We don't want it in
@FEBOOTSTRAP_RUN@ initramfs -- touch /etc/fstab
fi
-# Copy the daemon into the filesystem.
-#cp daemon/guestfsd initramfs/sbin
-
# Create the init script.
cat > initramfs/init.new <<'__EOF__'
#!/bin/sh
@FEBOOTSTRAP_RUN@ initramfs -- install -m 0755 -o root -g root /init.new /init
rm initramfs/init.new
+# Copy the daemon into the filesystem.
+cp @abs_builddir@/daemon/guestfsd initramfs/sbin/guestfsd.new
+@FEBOOTSTRAP_RUN@ initramfs -- \
+ install -m 0755 -o root -g root /sbin/guestfsd.new /sbin/guestfsd
+rm initramfs/sbin/guestfsd.new
+
# Generate final image.
@FEBOOTSTRAP_TO_INITRAMFS@ initramfs > $output-t
mv $output-t $output
--- /dev/null
+#!/bin/bash -
+# @configure_input@
+# Copyright (C) 2009 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Update the daemon inside an existing initramfs. Avoids the
+# timeconsuming rebuild.
+
+set -e
+
+output=initramfs.@REPO@.@host_cpu@.img
+
+# Copy the daemon into the filesystem.
+cp @abs_builddir@/daemon/guestfsd initramfs/sbin/guestfsd.new
+@FEBOOTSTRAP_RUN@ initramfs -- \
+ install -m 0755 -o root -g root /sbin/guestfsd.new /sbin/guestfsd
+rm initramfs/sbin/guestfsd.new
+
+# Generate final image.
+@FEBOOTSTRAP_TO_INITRAMFS@ initramfs > $output-t
+mv $output-t $output
+ls -lh $output