[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)



On Thu, 2012-08-23 at 08:31 +0100, Ian Campbell wrote:
> On Thu, 2012-08-23 at 08:04 +0100, Jan Beulich wrote:
> > >>> Ian Campbell <Ian.Campbell@xxxxxxxxxx> 08/23/12 8:40 AM >>>
> > >--- a/Makefile    Wed Aug 22 17:32:37 2012 +0100
> > >+++ b/Makefile    Thu Aug 23 07:38:10 2012 +0100
> > >@@ -228,8 +228,6 @@ uninstall:
> > >    rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
> > >    rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
> > >    rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
> > >-    rm -rf $(D)/boot/*xen*
> > 
> > But removing this line without replacement isn't right either - we at least
> > need to undo what "make install" did. That may imply adding an
> > uninstall-xen sub-target,
> 
> Right, I totally forgot about the hypervisor itself!
> 
> Perhaps this target should include a
>       $(MAKE) -C xen uninstall
> since that is the Makefile which knows how to undo its own install
> target.

Like this, which handles EFI too but not (yet) tools.

make dist-xen
make DESTDIR=$(pwd)/dist/install uninstall

Leaves just the dist/install/boot dir which I don't think we need to
bother cleaning up (I don't think rmdir --ignore-fail-on-non-empty is
portable).

8<------------------------------------
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1345708184 -3600
# Node ID 101956baa3469f5f338c661f1ceab23077bd432b
# Parent  9cb256660bfcfdf20f869ea28881115d622ef1a4
do not remove kernels or modules on uninstall.

The pattern used is very broad and will delete any kernel with xen in
its filename, likewise modules, including those which come packages
from the distribution etc.

I don't think this was ever the right thing to do but it is doubly
wrong now that Xen does not even build or install a kernel by default.

Push cleanup of the installed hypervisor down into xen/Makefile so that
it can cleanup exactly what it actually installs.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 9cb256660bfc -r 101956baa346 Makefile
--- a/Makefile  Thu Aug 23 08:28:42 2012 +0100
+++ b/Makefile  Thu Aug 23 08:49:44 2012 +0100
@@ -220,6 +220,7 @@ help:
 uninstall: D=$(DESTDIR)
 uninstall:
        [ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) 
$(D)$(XEN_CONFIG_DIR).old-`date +%s` || true
+       $(MAKE) -C xen uninstall
        rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
        rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons 
$(D)$(CONFIG_DIR)/init.d/xen-watchdog
        rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
@@ -228,8 +229,6 @@ uninstall:
        rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
        rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
        rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
-       rm -rf $(D)/boot/*xen*
-       rm -rf $(D)/lib/modules/*xen*
        rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
        rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
        rm -rf $(D)$(BINDIR)/xc_shadow
diff -r 9cb256660bfc -r 101956baa346 xen/Makefile
--- a/xen/Makefile      Thu Aug 23 08:28:42 2012 +0100
+++ b/xen/Makefile      Thu Aug 23 08:49:44 2012 +0100
@@ -20,8 +20,8 @@ default: build
 .PHONY: dist
 dist: install
 
-.PHONY: build install clean distclean cscope TAGS tags MAP gtags
-build install debug clean distclean cscope TAGS tags MAP gtags::
+.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags
+build install uninstall debug clean distclean cscope TAGS tags MAP gtags::
        $(MAKE) -f Rules.mk _$@
 
 .PHONY: _build
@@ -48,6 +48,21 @@ _install: $(TARGET).gz
                fi; \
        fi
 
+.PHONY: _uninstall
+_uninstall: D=$(DESTDIR)
+_uninstall: T=$(notdir $(TARGET))
+_uninstall:
+       rm -f $(D)/boot/$(T)-$(XEN_FULLVERSION).gz
+       rm -f $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).gz
+       rm -f $(D)/boot/$(T)-$(XEN_VERSION).gz
+       rm -f $(D)/boot/$(T).gz
+       rm -f $(D)/boot/$(T)-syms-$(XEN_FULLVERSION)
+       rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi
+       rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).efi
+       rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi
+       rm -f $(D)$(EFI_DIR)/$(T).efi
+       rm -f 
$(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi
+
 .PHONY: _debug
 _debug:
        objdump -D -S $(TARGET)-syms > $(TARGET).s




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.