Skip to contentSkip to conversation

linux: Fix User-Mode Linux build failures

PATCH New Worth 2 participants 2 messages May 2, 2013 – Dec 26, 2013

lore
Share & tools
lore

Worth

#0 lore raw

PATCH 1/1 linux: Fix User-Mode Linux build failures

Pass KERNEL_SUBARCH environment variable needed for User Mode Linux builds
e.g. build with 'make KERNEL_ARCH=um KERNEL_SUBARCH=i386'
Create $(KERNEL_ARCH_PATH)/configs/ if it doesn't exist (for arches like uml)
Otherwise build fails trying to cp to non-existent directory

---
 linux/linux.mk | 2 ++
 1 file changed, 2 insertions(+)
linux/linux.mk +2 -0
index 0352acd..db26fc6 100644
@@ -44,6 +44,7 @@ LINUX_MAKE_FLAGS = \
 	HOSTCC="$(HOSTCC)" \
 	HOSTCFLAGS="$(HOSTCFLAGS)" \
 	ARCH=$(KERNEL_ARCH) \
+	SUBARCH=$(KERNEL_SUBARCH) \
 	INSTALL_MOD_PATH=$(TARGET_DIR) \
 	CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
 	DEPMOD=$(HOST_DIR)/usr/sbin/depmod
@@ -156,6 +157,7 @@ KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
 endif
 
 define LINUX_CONFIGURE_CMDS
+	mkdir -p $(KERNEL_ARCH_PATH)/configs/
 	cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
 	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig
 	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
#1 lore raw

PATCH 1/1 linux: Fix User-Mode Linux build failures

Dear Worth, Kevin,

Quoted 23 lines · Kevin

Pass KERNEL_SUBARCH environment variable needed for User Mode Linux builds
e.g. build with 'make KERNEL_ARCH=um KERNEL_SUBARCH=i386'
Create $(KERNEL_ARCH_PATH)/configs/ if it doesn't exist (for arches like uml)
Otherwise build fails trying to cp to non-existent directory

---
 linux/linux.mk | 2 ++
 1 file changed, 2 insertions(+)
linux/linux.mk +1 -0
index 0352acd..db26fc6 100644
@@ -44,6 +44,7 @@ LINUX_MAKE_FLAGS = \
 	HOSTCC="$(HOSTCC)" \
 	HOSTCFLAGS="$(HOSTCFLAGS)" \
 	ARCH=$(KERNEL_ARCH) \
+	SUBARCH=$(KERNEL_SUBARCH) \
 	INSTALL_MOD_PATH=$(TARGET_DIR) \
 	CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
 	DEPMOD=$(HOST_DIR)/usr/sbin/depmod

linux/linux.mk KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) · line 163

Quoted 7 lines
linux/linux.mk +1 -0
@@ -156,6 +157,7 @@ KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
 endif
 
 define LINUX_CONFIGURE_CMDS
+	mkdir -p $(KERNEL_ARCH_PATH)/configs/
 	cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
 	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig
 	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig

Are you still interested in User Mode Linux support in Buildroot?

If so, I am not sure this is the right patch. You're manually passing KERNEL_ARCH and KERNEL_SUBARCH from the Buildroot make command-line, but they should be passed automatically by Buildroot.

So if we want to support User Mode Linux, maybe when the selected architecture is x86 or x86-64, there should be a sub-option in the Kernel menu to say that you want a UML kernel. In this case, linux.mk should pass ARCH=um and SUBARCH=$(KERNEL_ARCH) I believe.

Also, I don't understand why you need the mkdir for the configs directory. In my kernel tree, arch/um/configs/ does exist.

Please let us know if you're interested in pursuing this, so we can update the status of the patch accordingly.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com