Pārlūkot izejas kodu

Makefile: install linux module build ko driver to rootfs /lib/modules

Currently mailly for mailbox and e24 ko driver
And Update README.md

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
Andy Hu 1 gadu atpakaļ
vecāks
revīzija
55a640cd29
2 mainītis faili ar 15 papildinājumiem un 5 dzēšanām
  1. 11 1
      Makefile
  2. 4 4
      README.md

+ 11 - 1
Makefile

@@ -37,6 +37,7 @@ linux_defconfig := $(linux_srcdir)/arch/riscv/configs/starfive_jh7110_defconfig
 vmlinux := $(linux_wrkdir)/vmlinux
 vmlinux_stripped := $(linux_wrkdir)/vmlinux-stripped
 vmlinux_bin := $(wrkdir)/vmlinux.bin
+module_install_path:=$(wrkdir)/module_install_path
 
 its_file=$(confdir)/$(HWBOARD)-fit-image.its
 uboot_its_file=$(confdir)/$(HWBOARD)-uboot-fit-image.its
@@ -150,6 +151,7 @@ $(buildroot_rootfs_wrkdir)/.config: $(buildroot_srcdir) $(buildroot_initramfs_ta
 
 $(buildroot_rootfs_ext): $(buildroot_srcdir) $(buildroot_rootfs_wrkdir)/.config $(target_gcc) $(buildroot_rootfs_config)
 	$(MAKE) -C $< RISCV=$(RISCV) PATH=$(RVPATH) O=$(buildroot_rootfs_wrkdir)
+	cp -r $(module_install_path)/lib/modules $(buildroot_rootfs_wrkdir)/target/lib/
 
 .PHONY: buildroot_rootfs
 buildroot_rootfs: $(buildroot_rootfs_ext)
@@ -184,15 +186,22 @@ $(uboot_wrkdir)/.config: $(uboot_defconfig)
 	cp -p $< $@
 	$(MAKE) -C $(uboot_srcdir) O=$(uboot_wrkdir) ARCH=riscv olddefconfig
 
+vmlinu:$(vmlinux)
 $(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(target_gcc)
 	$(MAKE) -C $< O=$(linux_wrkdir) \
 		ARCH=riscv \
 		CROSS_COMPILE=$(CROSS_COMPILE) \
 		PATH=$(RVPATH) \
-		vmlinux		\
 		HWBOARD_FLAG=$(HWBOARD_FLAG) \
+		vmlinux \
 		all \
 		modules
+	$(MAKE) -C $< O=$(linux_wrkdir) \
+		ARCH=riscv \
+		CROSS_COMPILE=$(CROSS_COMPILE) \
+		PATH=$(RVPATH) \
+		INSTALL_MOD_PATH=$(module_install_path) \
+		modules_install
 
 # vpu building depend on the $(vmlinux), $(vmlinux) depend on $(buildroot_initramfs_sysroot)
 # so vpubuild should be built seperately
@@ -247,6 +256,7 @@ $(initramfs).d: $(buildroot_initramfs_sysroot)
 	$(linux_srcdir)/usr/gen_initramfs_list.sh -l $(confdir)/initramfs.txt $(buildroot_initramfs_sysroot) > $@
 
 $(initramfs): $(buildroot_initramfs_sysroot) $(vmlinux)
+	cp -r $(module_install_path)/lib/modules $(buildroot_initramfs_sysroot)/lib/
 	cd $(linux_wrkdir) && \
 		$(linux_srcdir)/usr/gen_initramfs_list.sh \
 		-o $@ -u $(shell id -u) -g $(shell id -g) \

+ 4 - 4
README.md

@@ -39,11 +39,11 @@ $ cd opensbi && git checkout master && cd ..
 After update submodules, run `make` or `make -jx` and the complete toolchain and
 `evb_fw_payload.img` & `image.fit` will be built. The completed build tree will consume about 14G of disk space.
 
-By default, the above generated image does not contain VPU module (wave511, the video hard decode driver and wave420l, the video hard encode driver) , JPU module (codaj12, the jpeg/mjpeg hard decode&encode driver), mailbox test app, e24 test app.  The following instructions will add VPU module, JPU module, mailbox test app and e24 test app according to your requirement:
+By default, the above generated image does not contain VPU driver module(wave511, the video hard decode driver and wave420l, the video hard encode driver)and JPU driver module(codaj12,the jpeg/mjpeg hard decode&encode driver).  The following instructions will add VPU driver module and JPU driver module according to your requirement:
 
 	$ make -jx
-	$ ./build_soft_3rdpart.sh
-	$ rm -rf work/initramfs.cpio.gz
+	$ make vpudriver-build
+	$ rm -rf work/buildroot_initramfs/images/rootfs.tar
 	$ make -jx
 
 Then the below target files will be generated, copy files to tftp server workspace path:
@@ -181,7 +181,7 @@ Please insert the TF card to the host and run command `df -h` to check the devic
 ```
 $ make -jx
 $ make buildroot_rootfs -jx
-$ ./build_soft_3rdpart.sh rootfs
+$ make vpudriver-build-rootfs
 $ rm work/buildroot_rootfs/images/rootfs.ext*
 $ make buildroot_rootfs -jx
 $ make DISK=/dev/sdX format-rootfs-image && sync