Nice time. # make uninstall ... rm -rf //boot/*xen* ... if somebody use "xen" in kernel name (maybe as suffix), so it will be deleted from /boot/ too. Thanks. Denis.
Ian Campbell
2012-Aug-23 06:39 UTC
[PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
On Wed, 2012-08-22 at 22:47 +0100, p.d@gmx.de wrote:> Nice time. > > # make uninstall > ... > rm -rf //boot/*xen* > ... > > if somebody use "xen" in kernel name (maybe as suffix), so it will be deleted from /boot/ too.Ouch! 8<------------------------- # HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1345703890 -3600 # Node ID b75970f4114ec72f744f5e7f979ab50401c4629f # Parent 89c8c855f1df234f9649e98a51724f018f4f92df 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. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r 89c8c855f1df -r b75970f4114e Makefile --- 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* - 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
Jan Beulich
2012-Aug-23 07:04 UTC
Re: [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
>>> Ian Campbell <Ian.Campbell@citrix.com> 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, if we don''t want to come up with a suitable pattern to do this here.>- 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_shadowThis may also be needed for the tools - wasn''t it that BINDIR, LIBDIR and the like are now dependent on configure options? Similarly I don''t the the EFI binaries get properly cleaned up here (and that also would better be done with a per-subdir uninstall). Jan
Ian Campbell
2012-Aug-23 07:31 UTC
Re: [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
On Thu, 2012-08-23 at 08:04 +0100, Jan Beulich wrote:> >>> Ian Campbell <Ian.Campbell@citrix.com> 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.> if we don''t want to come up with a suitable > pattern to do this here. > > >- 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 > > This may also be needed for the tools - wasn''t it that BINDIR, LIBDIR and > the like are now dependent on configure options?Yes, I think you are right here too. I think this needs to be pushed down too.> Similarly I don''t the the EFI binaries get properly cleaned up here (and > that also would better be done with a per-subdir uninstall).Right.
Ian Campbell
2012-Aug-23 07:59 UTC
Re: [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@citrix.com> 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@citrix.com> # 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@citrix.com> 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
Ian Campbell
2012-Aug-23 08:23 UTC
Re: [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
On Thu, 2012-08-23 at 08:59 +0100, Ian Campbell wrote:> 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@citrix.com> 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.Here is tools. This cleans up a superset of what was cleaned up before this change but still leaves a lot of detritus. See attached install.before, uninstall.before & uninstall.after (install.after is identical to install.before). This is a much bigger problem and probably requires proper recursive subdir-uninstall rules for everything under tools. That broader rework is certainly a post 4.2 thing IMHO. I''m in two minds about this patch as a 4.2 thing, but given that the regression happened due to the switch to autoconf in 4.2 I think it might be good to take, even though as a %age of what we install the delta is pretty insignificant. 8<--------------------------------------------------------- # HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1345710001 -3600 # Node ID eaf499f0f7071fc0bfd84901babfd1ae18227ebb # Parent 101956baa3469f5f338c661f1ceab23077bd432b uninstall: push tools uninstall down into tools/Makefile Many of the rules here depend on having run configure and the variables which it defines in config/Tools.mk Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r 101956baa346 -r eaf499f0f707 Makefile --- a/Makefile Thu Aug 23 08:49:44 2012 +0100 +++ b/Makefile Thu Aug 23 09:20:01 2012 +0100 @@ -229,34 +229,7 @@ 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)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount - rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen - rm -rf $(D)$(BINDIR)/xc_shadow - rm -rf $(D)$(BINDIR)/pygrub - rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl - rm -rf $(D)$(BINDIR)/xsls - rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace* - rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons - rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen - rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h - rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h - rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h - rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h - rm -rf $(D)$(INCLUDEDIR)/xen - rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl* - rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h - rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest* - rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil* - rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub - rm -rf $(D)$(LIBDIR)/xen/ - rm -rf $(D)$(LIBEXEC)/xen* - rm -rf $(D)$(SBINDIR)/setmask - rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm - rm -rf $(D)$(SHAREDIR)/doc/xen - rm -rf $(D)$(SHAREDIR)/xen - rm -rf $(D)$(SHAREDIR)/qemu-xen - rm -rf $(D)$(MAN1DIR)/xen* - rm -rf $(D)$(MAN8DIR)/xen* + make -C tools uninstall rm -rf $(D)/boot/tboot* # Legacy targets for compatibility diff -r 101956baa346 -r eaf499f0f707 tools/Makefile --- a/tools/Makefile Thu Aug 23 08:49:44 2012 +0100 +++ b/tools/Makefile Thu Aug 23 09:20:01 2012 +0100 @@ -71,6 +71,38 @@ install: subdirs-install $(INSTALL_DIR) $(DESTDIR)/var/lib/xen $(INSTALL_DIR) $(DESTDIR)/var/lock/subsys +.PHONY: uninstall +uninstall: D=$(DESTDIR) +uninstall: + rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount + rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen + rm -rf $(D)$(BINDIR)/xc_shadow + rm -rf $(D)$(BINDIR)/pygrub + rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl + rm -rf $(D)$(BINDIR)/xsls + rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace* + rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons + rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen + rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h + rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h + rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h + rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h + rm -rf $(D)$(INCLUDEDIR)/xen + rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl* + rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h + rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest* + rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil* + rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub + rm -rf $(D)$(LIBDIR)/xen/ + rm -rf $(D)$(LIBEXEC)/xen* + rm -rf $(D)$(SBINDIR)/setmask + rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm + rm -rf $(D)$(SHAREDIR)/doc/xen + rm -rf $(D)$(SHAREDIR)/xen + rm -rf $(D)$(SHAREDIR)/qemu-xen + rm -rf $(D)$(MAN1DIR)/xen* + rm -rf $(D)$(MAN8DIR)/xen* + .PHONY: clean clean: subdirs-clean
Ian Campbell
2012-Aug-23 08:24 UTC
Re: [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
On Thu, 2012-08-23 at 08:59 +0100, Ian Campbell wrote:> 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@citrix.com> 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.Here is tools. This cleans up a superset of what was cleaned up before this change but still leaves a lot of detritus. See attached install.before, uninstall.before & uninstall.after (install.after is identical to install.before). This is a much bigger problem and probably requires proper recursive subdir-uninstall rules for everything under tools. That broader rework is certainly a post 4.2 thing IMHO. I''m in two minds about this patch as a 4.2 thing, but given that the regression happened due to the switch to autoconf in 4.2 I think it might be good to take, even though as a %age of what we install the delta is pretty insignificant. 8<--------------------------------------------------------- # HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1345710001 -3600 # Node ID eaf499f0f7071fc0bfd84901babfd1ae18227ebb # Parent 101956baa3469f5f338c661f1ceab23077bd432b uninstall: push tools uninstall down into tools/Makefile Many of the rules here depend on having run configure and the variables which it defines in config/Tools.mk Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r 101956baa346 -r eaf499f0f707 Makefile --- a/Makefile Thu Aug 23 08:49:44 2012 +0100 +++ b/Makefile Thu Aug 23 09:20:01 2012 +0100 @@ -229,34 +229,7 @@ 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)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount - rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen - rm -rf $(D)$(BINDIR)/xc_shadow - rm -rf $(D)$(BINDIR)/pygrub - rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl - rm -rf $(D)$(BINDIR)/xsls - rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace* - rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons - rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen - rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h - rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h - rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h - rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h - rm -rf $(D)$(INCLUDEDIR)/xen - rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl* - rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h - rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest* - rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil* - rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub - rm -rf $(D)$(LIBDIR)/xen/ - rm -rf $(D)$(LIBEXEC)/xen* - rm -rf $(D)$(SBINDIR)/setmask - rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm - rm -rf $(D)$(SHAREDIR)/doc/xen - rm -rf $(D)$(SHAREDIR)/xen - rm -rf $(D)$(SHAREDIR)/qemu-xen - rm -rf $(D)$(MAN1DIR)/xen* - rm -rf $(D)$(MAN8DIR)/xen* + make -C tools uninstall rm -rf $(D)/boot/tboot* # Legacy targets for compatibility diff -r 101956baa346 -r eaf499f0f707 tools/Makefile --- a/tools/Makefile Thu Aug 23 08:49:44 2012 +0100 +++ b/tools/Makefile Thu Aug 23 09:20:01 2012 +0100 @@ -71,6 +71,38 @@ install: subdirs-install $(INSTALL_DIR) $(DESTDIR)/var/lib/xen $(INSTALL_DIR) $(DESTDIR)/var/lock/subsys +.PHONY: uninstall +uninstall: D=$(DESTDIR) +uninstall: + rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount + rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen + rm -rf $(D)$(BINDIR)/xc_shadow + rm -rf $(D)$(BINDIR)/pygrub + rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl + rm -rf $(D)$(BINDIR)/xsls + rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace* + rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons + rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen + rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h + rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h + rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h + rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h + rm -rf $(D)$(INCLUDEDIR)/xen + rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl* + rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h + rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest* + rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil* + rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub + rm -rf $(D)$(LIBDIR)/xen/ + rm -rf $(D)$(LIBEXEC)/xen* + rm -rf $(D)$(SBINDIR)/setmask + rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm + rm -rf $(D)$(SHAREDIR)/doc/xen + rm -rf $(D)$(SHAREDIR)/xen + rm -rf $(D)$(SHAREDIR)/qemu-xen + rm -rf $(D)$(MAN1DIR)/xen* + rm -rf $(D)$(MAN8DIR)/xen* + .PHONY: clean clean: subdirs-clean _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Jan Beulich
2012-Aug-24 20:00 UTC
Re: [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
>>> On 23.08.12 at 09:59, Ian Campbell <Ian.Campbell@citrix.com> wrote: > 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@citrix.com> 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.Looks good to me (also the tools one you sent later). Thanks, Jan> 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@citrix.com> > # 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@citrix.com> > > 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
Ian Jackson
2012-Aug-30 15:31 UTC
Re: [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
Ian Campbell writes ("Re: [Xen-devel] [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)"):> That broader rework is certainly a post 4.2 thing IMHO. I''m in two minds > about this patch as a 4.2 thing, but given that the regression happened > due to the switch to autoconf in 4.2 I think it might be good to take, > even though as a %age of what we install the delta is pretty > insignificant.I''m happy with both of these for 4.2. Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Ian.
Ian Campbell
2012-Aug-31 09:42 UTC
Re: [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)
On Thu, 2012-08-30 at 16:31 +0100, Ian Jackson wrote:> Ian Campbell writes ("Re: [Xen-devel] [PATCH] do not remove kernels or modules on uninstall. (Was: Re: make uninstall can delete xen-kernels)"): > > That broader rework is certainly a post 4.2 thing IMHO. I''m in two minds > > about this patch as a 4.2 thing, but given that the regression happened > > due to the switch to autoconf in 4.2 I think it might be good to take, > > even though as a %age of what we install the delta is pretty > > insignificant. > > I''m happy with both of these for 4.2. > > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>Thanks, applied with this and Looks-good: Jan Beulich <jbeulich@suse.com> Ian.
Maybe Matching Threads
- [PATCH 0/3] xen: various changes to what we install in /boot
- [PATCH] xen: arm: make zImage the default target which we install
- [PATCH] x86/EFI: define and use EFI_DIR make variable, defaulting to /usr/lib64/efi
- Xen 3.4 Hackery on Ubuntu 9.04 (aka Jaunty) Server
- Problem with tap:aio