Have buildroot generate a root file system

This commit is contained in:
Palmer Dabbelt 2017-12-14 16:03:24 -08:00
parent f622fc4061
commit f4d32edd0f
2 changed files with 105 additions and 6 deletions

View File

@ -16,9 +16,11 @@ buildroot_srcdir := $(srcdir)/buildroot
buildroot_initramfs_wrkdir := $(wrkdir)/buildroot_initramfs
buildroot_initramfs_tar := $(buildroot_initramfs_wrkdir)/images/rootfs.tar
buildroot_initramfs_config := $(confdir)/buildroot_initramfs_config
buildroot_initramfs_sysroot_stamp := $(wrkdir)/.buildroot_initramfs_sysroot
buildroot_initramfs_sysroot := $(wrkdir)/buildroot_initramfs_sysroot
buildroot_rootfs_wrkdir := $(wrkdir)/buildroot_rootfs
buildroot_rootfs_ext := $(buildroot_rootfs_wrkdir)/images/rootfs.ext4
buildroot_rootfs_config := $(confdir)/buildroot_rootfs_config
linux_srcdir := $(srcdir)/linux
linux_wrkdir := $(wrkdir)/linux
@ -77,8 +79,25 @@ $(buildroot_initramfs_tar): $(buildroot_srcdir) $(buildroot_initramfs_wrkdir)/.c
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_initramfs_wrkdir)
.PHONY: buildroot_initramfs-menuconfig
buildroot_initramfs-menuconfig: $(buildroot_srcdir)
$(MAKE) -C $< O=$(buildroot_initramfs_wrkdir) menuconfig
buildroot_initramfs-menuconfig: $(buildroot_initramfs_wrkdir)/.config $(buildroot_srcdir)
$(MAKE) -C $(dir $<) O=$(buildroot_initramfs_wrkdir) menuconfig
$(MAKE) -C $(dir $<) O=$(buildroot_initramfs_wrkdir) savedefconfig
cp $(dir $<)/defconfig conf/buildroot_initramfs_config
$(buildroot_rootfs_wrkdir)/.config: $(buildroot_srcdir)
rm -rf $(dir $@)
mkdir -p $(dir $@)
cp $(buildroot_rootfs_config) $@
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_rootfs_wrkdir) olddefconfig
$(buildroot_rootfs_ext): $(buildroot_srcdir) $(buildroot_rootfs_wrkdir)/.config $(RISCV)/bin/$(target)-gcc $(buildroot_rootfs_config)
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_rootfs_wrkdir)
.PHONY: buildroot_rootfs-menuconfig
buildroot_rootfs-menuconfig: $(buildroot_rootfs_wrkdir)/.config $(buildroot_srcdir)
$(MAKE) -C $(dir $<) O=$(buildroot_rootfs_wrkdir) menuconfig
$(MAKE) -C $(dir $<) O=$(buildroot_rootfs_wrkdir) savedefconfig
cp $(dir $<)/defconfig conf/buildroot_rootfs_config
$(buildroot_initramfs_sysroot_stamp): $(buildroot_initramfs_tar)
mkdir -p $(buildroot_initramfs_sysroot)
@ -164,9 +183,8 @@ $(qemu): $(qemu_srcdir)
$(MAKE) -C $(qemu_wrkdir) install
touch -c $@
$(rootfs):
truncate --size=1G $@
mkfs.ext4 $@
$(rootfs): $(buildroot_rootfs_ext)
cp $< $@
.PHONY: buildroot_initramfs_sysroot vmlinux bbl
buildroot_initramfs_sysroot: $(buildroot_initramfs_sysroot)

View File

@ -0,0 +1,81 @@
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_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
BR2_TARGET_GENERIC_ROOT_PASSWD="sifive"
BR2_SYSTEM_DHCP="eth0"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_FFMPEG=y
BR2_PACKAGE_FFMPEG_GPL=y
BR2_PACKAGE_BONNIE=y
BR2_PACKA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BR2_PACKAGE_UTIL_LINUX_NOLOGIN=y
BR2_PACKAGE_UTIL_LINUX_NSENTER=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT=y
BR2_PACKAGE_UTIL_LINUX_RAW=y
BR2_PACKAGE_UTIL_LINUX_RENAME=y
BR2_PACKAGE_UTIL_LINUX_RESET=y
BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y
BR2_PACKAGE_UTIL_LINUX_SETPRIV=y
BR2_PACKAGE_UTIL_LINUX_SETTERM=y
BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT=y
BR2_PACKAGE_UTIL_LINUX_TUNELP=y
BR2_PACKAGE_UTIL_LINUX_UL=y
BR2_PACKAGE_UTIL_LINUX_UNSHARE=y
BR2_PACKAGE_UTIL_LINUX_UTMPDUMP=y
BR2_PACKAGE_UTIL_LINUX_UUIDD=y
BR2_PACKAGE_UTIL_LINUX_VIPW=y
BR2_PACKAGE_UTIL_LINUX_WALL=y
BR2_PACKAGE_UTIL_LINUX_WDCTL=y
BR2_PACKAGE_UTIL_LINUX_WRITE=y
BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_EXTRA_BLOCKS=10240
# BR2_TARGET_ROOTFS_TAR is not set