Rename the buildroot output, so I can have two of them
This commit is contained in:
		
							
								
								
									
										40
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								Makefile
									
									
									
									
									
								
							| @@ -13,11 +13,12 @@ toolchain_wrkdir := $(wrkdir)/riscv-gnu-toolchain | |||||||
| toolchain_dest := $(CURDIR)/toolchain | toolchain_dest := $(CURDIR)/toolchain | ||||||
|  |  | ||||||
| buildroot_srcdir := $(srcdir)/buildroot | buildroot_srcdir := $(srcdir)/buildroot | ||||||
| buildroot_wrkdir := $(wrkdir)/buildroot | buildroot_initramfs_wrkdir := $(wrkdir)/buildroot_initramfs | ||||||
| buildroot_tar := $(buildroot_wrkdir)/images/rootfs.tar | buildroot_initramfs_tar := $(buildroot_initramfs_wrkdir)/images/rootfs.tar | ||||||
|  | buildroot_initramfs_config := $(confdir)/buildroot_initramfs_config | ||||||
|  |  | ||||||
| sysroot_stamp := $(wrkdir)/.sysroot | buildroot_initramfs_sysroot_stamp := $(wrkdir)/.buildroot_initramfs_sysroot | ||||||
| sysroot := $(wrkdir)/sysroot | buildroot_initramfs_sysroot := $(wrkdir)/buildroot_initramfs_sysroot | ||||||
|  |  | ||||||
| linux_srcdir := $(srcdir)/linux | linux_srcdir := $(srcdir)/linux | ||||||
| linux_wrkdir := $(wrkdir)/linux | linux_wrkdir := $(wrkdir)/linux | ||||||
| @@ -66,17 +67,22 @@ $(toolchain_dest)/bin/$(target)-gcc: $(toolchain_srcdir) | |||||||
| 	$(MAKE) -C $(toolchain_wrkdir) | 	$(MAKE) -C $(toolchain_wrkdir) | ||||||
| 	sed 's/^#define LINUX_VERSION_CODE.*/#define LINUX_VERSION_CODE 263682/' -i $(toolchain_dest)/sysroot/usr/include/linux/version.h | 	sed 's/^#define LINUX_VERSION_CODE.*/#define LINUX_VERSION_CODE 263682/' -i $(toolchain_dest)/sysroot/usr/include/linux/version.h | ||||||
|  |  | ||||||
| $(buildroot_tar): $(buildroot_srcdir) $(RISCV)/bin/$(target)-gcc | $(buildroot_initramfs_wrkdir)/.config: $(buildroot_srcdir) | ||||||
| 	$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_wrkdir) riscv64_defconfig | 	rm -rf $(dir $@) | ||||||
| 	$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_wrkdir) | 	mkdir -p $(dir $@) | ||||||
|  | 	cp $(buildroot_initramfs_config) $@ | ||||||
|  | 	$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_initramfs_wrkdir) olddefconfig | ||||||
|  |  | ||||||
| .PHONY: buildroot-menuconfig | $(buildroot_initramfs_tar): $(buildroot_srcdir) $(buildroot_initramfs_wrkdir)/.config $(RISCV)/bin/$(target)-gcc $(buildroot_initramfs_config) | ||||||
| buildroot-menuconfig: $(buildroot_srcdir) | 	$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_initramfs_wrkdir) | ||||||
| 	$(MAKE) -C $< O=$(buildroot_wrkdir) menuconfig |  | ||||||
|  |  | ||||||
| $(sysroot_stamp): $(buildroot_tar) | .PHONY: buildroot_initramfs-menuconfig | ||||||
| 	mkdir -p $(sysroot) | buildroot_initramfs-menuconfig: $(buildroot_srcdir) | ||||||
| 	tar -xpf $< -C $(sysroot) --exclude ./dev --exclude ./usr/share/locale | 	$(MAKE) -C $< O=$(buildroot_initramfs_wrkdir) menuconfig | ||||||
|  |  | ||||||
|  | $(buildroot_initramfs_sysroot_stamp): $(buildroot_initramfs_tar) | ||||||
|  | 	mkdir -p $(buildroot_initramfs_sysroot) | ||||||
|  | 	tar -xpf $< -C $(buildroot_initramfs_sysroot) --exclude ./dev --exclude ./usr/share/locale | ||||||
| 	touch $@ | 	touch $@ | ||||||
|  |  | ||||||
| $(linux_wrkdir)/.config: $(linux_defconfig) $(linux_srcdir) | $(linux_wrkdir)/.config: $(linux_defconfig) $(linux_srcdir) | ||||||
| @@ -95,9 +101,9 @@ ifeq ($(ISA),$(filter rv32%,$(ISA))) | |||||||
| 	$(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) ARCH=riscv olddefconfig | 	$(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) ARCH=riscv olddefconfig | ||||||
| endif | endif | ||||||
|  |  | ||||||
| $(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(sysroot_stamp) | $(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(buildroot_initramfs_sysroot_stamp) | ||||||
| 	$(MAKE) -C $< O=$(linux_wrkdir) \ | 	$(MAKE) -C $< O=$(linux_wrkdir) \ | ||||||
| 		CONFIG_INITRAMFS_SOURCE="$(confdir)/initramfs.txt $(sysroot)" \ | 		CONFIG_INITRAMFS_SOURCE="$(confdir)/initramfs.txt $(buildroot_initramfs_sysroot)" \ | ||||||
| 		CONFIG_INITRAMFS_ROOT_UID=$(shell id -u) \ | 		CONFIG_INITRAMFS_ROOT_UID=$(shell id -u) \ | ||||||
| 		CONFIG_INITRAMFS_ROOT_GID=$(shell id -g) \ | 		CONFIG_INITRAMFS_ROOT_GID=$(shell id -g) \ | ||||||
| 		ARCH=riscv \ | 		ARCH=riscv \ | ||||||
| @@ -162,8 +168,8 @@ $(rootfs): | |||||||
| 	truncate --size=1G $@ | 	truncate --size=1G $@ | ||||||
| 	mkfs.ext4 $@ | 	mkfs.ext4 $@ | ||||||
|  |  | ||||||
| .PHONY: sysroot vmlinux bbl | .PHONY: buildroot_initramfs_sysroot vmlinux bbl | ||||||
| sysroot: $(sysroot) | buildroot_initramfs_sysroot: $(buildroot_initramfs_sysroot) | ||||||
| vmlinux: $(vmlinux) | vmlinux: $(vmlinux) | ||||||
| bbl: $(bbl) | bbl: $(bbl) | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										19
									
								
								conf/buildroot_initramfs_config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								conf/buildroot_initramfs_config
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | BR2_riscv64=y | ||||||
|  | BR2_TOOLCHAIN_EXTERNAL=y | ||||||
|  | BR2_TOOLCHAIN_EXTERNAL_PATH="$(RISCV)" | ||||||
|  | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu" | ||||||
|  | BR2_TOOLCHAIN_EXTERNAL_GCC_7=y | ||||||
|  | BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_6=y | ||||||
|  | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y | ||||||
|  | # BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set | ||||||
|  | BR2_TOOLCHAIN_EXTERNAL_CXX=y | ||||||
|  | BR2_TARGET_ROOTFS_EXT2=y | ||||||
|  | BR2_TARGET_ROOTFS_EXT2_2r1=y | ||||||
|  | BR2_PACKAGE_DROPBEAR=y | ||||||
|  | BR2_PACKAGE_DROPBEAR_CLIENT=y | ||||||
|  | BR2_PACKAGE_DROPBEAR_SMALL=y | ||||||
|  | BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y | ||||||
|  | BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y | ||||||
|  | BR2_TARGET_GENERIC_ROOT_PASSWD="sifive" | ||||||
|  | BR2_SYSTEM_DHCP="eth0" | ||||||
|  | BR2_PACKAGE_PCIUTILS=y | ||||||
		Reference in New Issue
	
	Block a user