Skip to contentSkip to conversation

xen: use XEN_BOOT_DIR as xen.gz install location

PATCH Superseded Olaf Hering 4 participants 10 messages Apr 23, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: use XEN_BOOT_DIR as xen.gz install location

Xen is currently installed into /boot, which is a hardcoded path. This makes it impossible to install two xen.rpm packages from 'make rpmball' in parallel because rpm complains about conflicting files. Use XEN_BOOT_DIR to define the install path to make it possible to install xen.gz below --prefix=.

---
 xen/Makefile | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
xen/Makefile +12 -11
index 79fa8f2..fd82a94 100644
@@ -13,6 +13,7 @@ export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
 
 EFI_MOUNTPOINT ?= /boot/efi
+XEN_BOOT_DIR ?= /boot
 
 .PHONY: default
 default: build
@@ -36,12 +37,12 @@ _install: D=$(DESTDIR)
 _install: T=$(notdir $(TARGET))
 _install: Z=$(CONFIG_XEN_INSTALL_SUFFIX)
 _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
-	[ -d $(D)/boot ] || $(INSTALL_DIR) $(D)/boot
-	$(INSTALL_DATA) $(TARGET)$(Z) $(D)/boot/$(T)-$(XEN_FULLVERSION)$(Z)
-	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
-	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)-$(XEN_VERSION)$(Z)
-	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)$(Z)
-	$(INSTALL_DATA) $(TARGET)-syms $(D)/boot/$(T)-syms-$(XEN_FULLVERSION)
+	[ -d $(D)$(XEN_BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(XEN_BOOT_DIR)
+	$(INSTALL_DATA) $(TARGET)$(Z) $(D)$(XEN_BOOT_DIR)/$(T)-$(XEN_FULLVERSION)$(Z)
+	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(XEN_BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
+	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(XEN_BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z)
+	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(XEN_BOOT_DIR)/$(T)$(Z)
+	$(INSTALL_DATA) $(TARGET)-syms $(D)$(XEN_BOOT_DIR)/$(T)-syms-$(XEN_FULLVERSION)
 	if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
 		[ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
 		$(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi; \
@@ -60,11 +61,11 @@ _uninstall: D=$(DESTDIR)
 _uninstall: T=$(notdir $(TARGET))
 _uninstall: Z=$(CONFIG_XEN_INSTALL_SUFFIX)
 _uninstall:
-	rm -f $(D)/boot/$(T)-$(XEN_FULLVERSION)$(Z)
-	rm -f $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
-	rm -f $(D)/boot/$(T)-$(XEN_VERSION)$(Z)
-	rm -f $(D)/boot/$(T)$(Z)
-	rm -f $(D)/boot/$(T)-syms-$(XEN_FULLVERSION)
+	rm -f $(D)$(XEN_BOOT_DIR)/$(T)-$(XEN_FULLVERSION)$(Z)
+	rm -f $(D)$(XEN_BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
+	rm -f $(D)$(XEN_BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z)
+	rm -f $(D)$(XEN_BOOT_DIR)/$(T)$(Z)
+	rm -f $(D)$(XEN_BOOT_DIR)/$(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
#1 lore raw
Quoted 16 lines · Olaf Hering

Xen is currently installed into /boot, which is a hardcoded path. This makes it impossible to install two xen.rpm packages from 'make rpmball' in parallel because rpm complains about conflicting files. Use XEN_BOOT_DIR to define the install path to make it possible to install xen.gz below --prefix=.

---
 xen/Makefile | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
xen/Makefile +0 -0
index 79fa8f2..fd82a94 100644

xen/Makefile export BASEDIR := $(CURDIR) · line 16

Quoted 4 lines
xen/Makefile +1 -0
@@ -13,6 +13,7 @@ export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
 
 EFI_MOUNTPOINT ?= /boot/efi
+XEN_BOOT_DIR ?= /boot

IMHO config/StdGNU.mk seems like a better place to put this.

#7 lore raw
In reply to Olaf Hering

xen/Makefile export BASEDIR := $(CURDIR) · line 16

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 10:00, <[email protected]> wrote:
xen/Makefile +1 -0
@@ -13,6 +13,7 @@ export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
 
 EFI_MOUNTPOINT ?= /boot/efi
+XEN_BOOT_DIR ?= /boot

Did it not occur to you that the immediately preceding line then would also need changing? I'm also not certain about the need for the XEN_ prefix on the new variable - there's nothing Xen-specific about the location of the boot directory/partition.

Jan

#3 lore raw
In reply to Olaf Hering
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 10:24, <[email protected]> wrote:
Quoted 1 line · Roger Pau Monné

IMHO config/StdGNU.mk seems like a better place to put this.

Is that even sourced by xen/Makefile?

Yes, via the recursive make invocation using Rules.mk as the top level make file. Rules.mk then includes $(XEN_ROOT)/Config.mk, which in turn includes $(XEN_ROOT)/config/$(XEN_OS).mk.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw
In reply to Jan Beulich
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 10:00, <[email protected]> wrote:
xen/Makefile +0 -0
@@ -13,6 +13,7 @@ export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
 
Quoted 7 lines

xen/Makefile export BASEDIR := $(CURDIR) · line 16

Quoted 2 lines
xen/Makefile +1 -0
 EFI_MOUNTPOINT ?= /boot/efi
+XEN_BOOT_DIR ?= /boot

Did it not occur to you that the immediately preceding line then would also need changing? I'm also not certain about the need for the XEN_ prefix on the new variable - there's nothing Xen-specific about the location of the boot directory/partition.

Why would EFI_MOUNTPOINT need a change? If it does not fit it can be changed at build time. But I'm fine with something like

BOOT_DIR ?= /boot
EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi

Olaf

#4 lore raw
In reply to Jan Beulich
Quoted 10 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 10:24, <[email protected]> wrote:
Quoted 1 line · Roger Pau Monné

IMHO config/StdGNU.mk seems like a better place to put this.

Is that even sourced by xen/Makefile?

Yes, via the recursive make invocation using Rules.mk as the top level make file. Rules.mk then includes $(XEN_ROOT)/Config.mk, which in turn includes $(XEN_ROOT)/config/$(XEN_OS).mk.

Ok, so I will put it into StdGNU.mk.

Olaf

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
In reply to Olaf Hering
Quoted 17 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 11:39, <[email protected]> wrote:
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 10:00, <[email protected]> wrote:
xen/Makefile +0 -0
@@ -13,6 +13,7 @@ export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
 
Quoted 7 lines

xen/Makefile export BASEDIR := $(CURDIR) · line 16

Quoted 2 lines
xen/Makefile +1 -0
 EFI_MOUNTPOINT ?= /boot/efi
+XEN_BOOT_DIR ?= /boot

Did it not occur to you that the immediately preceding line then would also need changing? I'm also not certain about the need for the XEN_ prefix on the new variable - there's nothing Xen-specific about the location of the boot directory/partition.

Quoted 5 lines

Why would EFI_MOUNTPOINT need a change? If it does not fit it can be changed at build time. But I'm fine with something like

BOOT_DIR ?= /boot
EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi

Right - that's what I'd expect, irrespective of the RPM build not being supposed to pick up any files under /boot/efi/.

Jan

#5 lore raw
In reply to Jan Beulich
Quoted 10 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 10:24, <[email protected]> wrote:
Quoted 1 line · Roger Pau Monné

IMHO config/StdGNU.mk seems like a better place to put this.

Is that even sourced by xen/Makefile?

Yes, via the recursive make invocation using Rules.mk as the top level make file. Rules.mk then includes $(XEN_ROOT)/Config.mk, which in turn includes $(XEN_ROOT)/config/$(XEN_OS).mk.

*BSD includes StdGNU.mk. Interesting!

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
Quoted 6 lines · Ian Campbell
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 23.04.14 at 10:24, <[email protected]> wrote:
Quoted 1 line · Roger Pau Monné

IMHO config/StdGNU.mk seems like a better place to put this.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Is that even sourced by xen/Makefile?

Yes, via the recursive make invocation using Rules.mk as the top level make file. Rules.mk then includes $(XEN_ROOT)/Config.mk, which in turn includes $(XEN_ROOT)/config/$(XEN_OS).mk.

*BSD includes StdGNU.mk. Interesting!

Every OS that we support (except for Solaris) includes StdGNU.mk AFAICT, maybe it would be better to rename this to something like Defaults.mk to make it more clear.

Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel