diff --git a/.gitignore b/.gitignore index 542cc2e242393c868f30281f0ac5ae179bad4ec3..532755c38acf52fb9a3306ff3bbad946eaa50144 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ loongnix-3.10 tglx-linux-history force-* .lock +.tmp diff --git a/Makefile b/Makefile index 26e9c8fe11712f3890a073f5a672142770d25f9f..ffba68005b08f72652ddeb20e2772fb668ce3242 100644 --- a/Makefile +++ b/Makefile @@ -1372,6 +1372,7 @@ endif # Force app building for current building targets can not auto detect code update ifeq ($(filter $(first_target),$(1) $(1)-build build), $(first_target)) $(1)-build: _$(1) + $$(Q)touch $$(call __stamp_$(1),build) else $(1)-build: $$(call __stamp_$(1),build) endif @@ -1701,7 +1702,7 @@ else endif ifeq ($(firstword $(MAKECMDGOALS)),bsp) -bsp: force-bsp-checkout +bsp: bsp-cleanstamp bsp-checkout PHONY += bsp endif @@ -2042,7 +2043,9 @@ root-rd: root-rd-rebuild: FORCE @echo "LOG: Generating ramdisk image with $(ROOT_GENRD_TOOL) ..." - ROOTDIR=$(ROOTDIR) FSTYPE=$(FSTYPE) HROOTFS=$(HROOTFS) INITRD=$(IROOTFS) USER=$(USER) $(ROOT_GENRD_TOOL) + $(Q)rm -rf $(IROOTFS).tmp + $(Q)ROOTDIR=$(ROOTDIR) FSTYPE=$(FSTYPE) HROOTFS=$(HROOTFS) INITRD=$(IROOTFS).tmp USER=$(USER) $(ROOT_GENRD_TOOL) + $(Q)mv $(IROOTFS).tmp $(IROOTFS) ROOT_GENDISK_TOOL := $(TOOL_DIR)/root/dir2$(DEV_TYPE).sh @@ -2050,11 +2053,19 @@ ifeq ($(prebuilt_root_dir), 1) ROOT_DIR := root-dir endif +ifeq ($(DEV_TYPE),rd) + XROOTFS := $(IROOTFS) +else + XROOTFS := $(HROOTFS) +endif + # This is used to repackage the updated root directory, for example, `make r-i` just executed. root-rebuild: $(ROOT_DIR) ifeq ($(prebuilt_root_dir), 1) @echo "LOG: Generating $(DEV_TYPE) with $(ROOT_GENDISK_TOOL) ..." - ROOTDIR=$(ROOTDIR) INITRD=$(IROOTFS) HROOTFS=$(HROOTFS) FSTYPE=$(FSTYPE) USER=$(USER) $(ROOT_GENDISK_TOOL) + $(Q)rm -rf $(XROOTFS).tmp + $(Q)ROOTDIR=$(ROOTDIR) INITRD=$(IROOTFS).tmp HROOTFS=$(HROOTFS).tmp FSTYPE=$(FSTYPE) USER=$(USER) $(ROOT_GENDISK_TOOL) + $(Q)if [ -f $(XROOTFS).tmp ]; then mv $(XROOTFS).tmp $(XROOTFS); fi $(Q)if [ $(build_root_uboot) -eq 1 ]; then make $(S) _root-ud-rebuild; fi else $(call make_root) @@ -2101,7 +2112,9 @@ root-dir-rebuild: rootdir rootdir: ifneq ($(ROOTDIR), $(BUILDROOT_ROOTDIR)) @echo "LOG: Generating rootfs directory with $(ROOT_GENDIR_TOOL) ..." - ROOTDIR=$(ROOTDIR) USER=$(USER) HROOTFS=$(HROOTFS) INITRD=$(IROOTFS) $(ROOT_GENDIR_TOOL) + $(Q)rm -rf $(ROOTDIR).tmp + $(Q)ROOTDIR=$(ROOTDIR).tmp USER=$(USER) HROOTFS=$(HROOTFS) INITRD=$(IROOTFS) $(ROOT_GENDIR_TOOL) + $(Q)mv $(ROOTDIR).tmp $(ROOTDIR) endif rootdir-install: root-install @@ -2125,7 +2138,9 @@ root-hd: root-hd-rebuild: FORCE @echo "LOG: Generating harddisk image with $(ROOT_GENHD_TOOL) ..." - ROOTDIR=$(ROOTDIR) FSTYPE=$(FSTYPE) HROOTFS=$(HROOTFS) INITRD=$(IROOTFS) $(ROOT_GENHD_TOOL) + $(Q)rm -rf $(HROOTFS).tmp + $(Q)ROOTDIR=$(ROOTDIR) FSTYPE=$(FSTYPE) HROOTFS=$(HROOTFS).tmp INITRD=$(IROOTFS) $(ROOT_GENHD_TOOL) + $(Q)mv $(HROOTFS).tmp $(HROOTFS) PHONY += root-hd root-hd-rebuild @@ -2329,7 +2344,7 @@ endif kernel-modules-list: kernel-modules-list-full kernel-modules-list-full: - $(Q)find $(EXT_MODULE_DIR) -name "Makefile" | $(PF) | xargs -i egrep -iH "^obj-m[[:space:]]*[+:]*=[[:space:]]*.*($(IMF)).*\.o" {} | sed -e "s%$(PWD)/\(.*\)/Makefile:obj-m[[:space:]]*[+:]*=[[:space:]]*\(.*\).o%m=\2 ; M=\$$PWD/\1%g" | cat -n + $(Q)find $(EXT_MODULE_DIR) -name "Makefile" | $(PF) | xargs -i egrep -iH "^obj-m[[:space:]]*[+:]*=[[:space:]]*.*($(IMF)).*\.o" {} | sed -e "s%$(PWD)\(.*\)/Makefile:obj-m[[:space:]]*[+:]*=[[:space:]]*\(.*\).o%m=\2 ; M=\$$PWD/\1%g" | cat -n ifeq ($(internal_search),1) $(Q)find $(KERNEL_SEARCH_PATH) -name "Makefile" | $(PF) | xargs -i egrep -iH "^obj-.*_($(IMF))(\)|_).*[[:space:]]*[+:]*=[[:space:]]*($(IMF)).*\.o" {} | sed -e "s%$(KERNEL_MODULE_DIR)/\(.*\)/Makefile:obj-\$$(CONFIG_\(.*\))[[:space:]]*[+:]*=[[:space:]]*\(.*\)\.o%c=\2 ; m=\3 ; M=\1%g" | cat -n endif @@ -2346,7 +2361,7 @@ endif # From linux-stable/scripts/depmod.sh, v5.1 SCRIPTS_DEPMOD := $(TOP_DIR)/tools/kernel/depmod.sh -kernel-modules-install-km: +kernel-modules-install-km: $(M_I_ROOT) $(Q)if [ "$(shell $(SCRIPTS_KCONFIG) --file $(DEFAULT_KCONFIG) -s MODULES)" = "y" ]; then \ $(call make_kernel,modules_install $(KM) INSTALL_MOD_PATH=$(ROOTDIR)); \ if [ ! -f $(KERNEL_ABS_SRC)/scripts/depmod.sh ]; then \ diff --git a/README.md b/README.md index a2e33432329dafc8ceca79db3d36850e9569a418..76eaa225ccdb974a4fe7038da8300e7ca8a894ca 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ - [6.4.5 unable to create file: net/netfilter/xt_dscp.c](#645-unable-to-create-file-netnetfilterxt_dscpc) - [6.4.6 how to run as root](#646-how-to-run-as-root) - [6.4.7 not in supported list](#647-not-in-supported-list) + - [6.4.8 is not a valid rootfs directory](#648-is-not-a-valid-rootfs-directory) - [7. Contact and Sponsor](#7-contact-and-sponsor) @@ -976,13 +977,17 @@ Build all internel kernel modules: List available modules in `src/modules/`, `boards//bsp/modules/`: - $ make module-list + $ make modules-list If `m` argument specified, list available modules in `src/modules/`, `boards//bsp/modules/` and `src/linux-stable/`: - $ make module-list m=hello + $ make modules-list m=hello +<<<<<<< HEAD 1 m=hello ; M=$PWD/modules/hello - $ make module-list m=tun,minix +======= + 1 m=hello ; M=$PWD/src/modules/hello +>>>>>>> 22f86cc6c7fb756cc13287010a789e98d4737f85 + $ make modules-list m=tun,minix 1 c=TUN ; m=tun ; M=drivers/net 2 c=MINIX_FS ; m=minix ; M=fs/minix @@ -1002,14 +1007,14 @@ Enable one kernel module: Build one kernel module (e.g. minix.ko): - $ make module M=fs/minix/ + $ make modules M=fs/minix/ Or - $ make module m=minix + $ make modules m=minix Install and clean the module: - $ make module-install M=fs/minix/ - $ make module-clean M=fs/minix/ + $ make modules-install M=fs/minix/ + $ make modules-clean M=fs/minix/ More flexible usage: @@ -1020,7 +1025,7 @@ More flexible usage: Build external kernel modules (the same as internel modules): - $ make module m=hello + $ make modules m=hello Or $ make kernel x=$PWD/modules/hello/hello.ko @@ -1613,6 +1618,11 @@ Read more: * [Why Using Linux Lab V1.0 (In Chinese)](http://tinylab.org/why-linux-lab) * [Why Using Linux Lab V2.0 (In Chinese)](http://tinylab.org/why-linux-lab-v2) +* [Linux Lab Loongson Manual V0.2](http://tinylab.org/pdfs/linux-lab-loongson-manual-v0.2.pdf) +* Linux Lab Open Video + * [CCTALK](https://www.cctalk.com/m/group/88948325) + * [Bilibili](https://space.bilibili.com/687228362/channel/detail?cid=152574) + * [Zhihu](https://www.zhihu.com/people/wuzhangjin) # 5. Linux Lab Development @@ -2155,7 +2165,7 @@ By default, no password required to run as root with: Such information means the specified value is not supported currently: - $ make boot ROOTDEV=vda + $ make boot ROOTDEV=/dev/vda ERR: /dev/vda not in supported ROOTDEV list: /dev/sda /dev/ram0 /dev/nfs, update may help: 'make bsp B=mips64el/ls3a7a'. Stop. $ make boot LINUX=v5.8 @@ -2174,6 +2184,14 @@ There are two main types: * This board may not support such type of device or just nobody verify and add it * This differs from board and kernel version +### 6.4.8 is not a valid rootfs directory + +If using prebuilt filesystem, this error means the rootfs dir, ramdisk or harddisk creating procedure has been interrupted by `CTRL+C` or similar operations and it means the filesystem is not complete. If no important changes in BSP repository, reset it may help: + + $ make bsp-cleanup + +If using external filesystem, please make sure the filesystem architecture follows the Linux standards. + # 7. Contact and Sponsor Our contact wechat is **tinylab**, welcome to join our user & developer discussion group. diff --git a/README_zh.md b/README_zh.md index f3600632ecc8a19422af2a6a5971340030e76828..86f89f6c99ab9d4861f8992a86e0ec6a8ac3dda1 100644 --- a/README_zh.md +++ b/README_zh.md @@ -126,6 +126,7 @@ - [6.4.5 unable to create file: net/netfilter/xt_dscp.c](#645-unable-to-create-file-netnetfilterxt_dscpc) - [6.4.6 如何切到 root 用户](#646-如何切到-root-用户) - [6.4.7 提示指定的版本或者配置不存在](#647-提示指定的版本或者配置不存在) + - [6.4.8 is not a valid rootfs directory](#648-is-not-a-valid-rootfs-directory) - [7. 联系并赞助我们](#7-联系并赞助我们) @@ -1052,13 +1053,17 @@ Linux 内核提供了一个脚本 `scripts/config`,可用于非交互方式获 列出 `src/modules/` 和 `boards//bsp/modules/` 路径下的所有模块: - $ make module-list + $ make modules-list 如果加上 `m` 参数,除了列出 `src/modules/` 和 `boards//bsp/modules/` 路径下的所有模块外,还会列出 `src/linux-stable/` 下的所有模块: - $ make module-list m=hello + $ make modules-list m=hello +<<<<<<< HEAD 1 m=hello ; M=$PWD/modules/hello - $ make module-list m=tun,minix +======= + 1 m=hello ; M=$PWD/src/modules/hello +>>>>>>> 22f86cc6c7fb756cc13287010a789e98d4737f85 + $ make modules-list m=tun,minix 1 c=TUN ; m=tun ; M=drivers/net 2 c=MINIX_FS ; m=minix ; M=fs/minix @@ -1078,14 +1083,14 @@ Linux 内核提供了一个脚本 `scripts/config`,可用于非交互方式获 编译一个内核模块(例如:minix.ko) - $ make module M=fs/minix/ + $ make modules M=fs/minix/ 或 - $ make module m=minix + $ make modules m=minix 安装和清理模块: - $ make module-install M=fs/minix/ - $ make module-clean M=fs/minix/ + $ make modules-install M=fs/minix/ + $ make modules-clean M=fs/minix/ 其他用法: @@ -1096,7 +1101,7 @@ Linux 内核提供了一个脚本 `scripts/config`,可用于非交互方式获 编译外部内核模块(类似编译内部模块): - $ make module m=hello + $ make modules m=hello 或 $ make kernel x=$PWD/src/modules/hello/hello.ko @@ -1683,6 +1688,11 @@ Linux Lab 支持通过形如 `-run` 方式访问 Makefile 中定义的目 * [Linux Lab:难以抗拒的十大理由 V1.0](http://tinylab.org/why-linux-lab) * [Linux Lab:难以抗拒的十大理由 V2.0](http://tinylab.org/why-linux-lab-v2) +* [Linux Lab 龙芯实验手册 V0.2](http://tinylab.org/pdfs/linux-lab-loongson-manual-v0.2.pdf) +* Linux Lab 视频公开课 + * [CCTALK](https://www.cctalk.com/m/group/88948325) + * [B 站](https://space.bilibili.com/687228362/channel/detail?cid=152574) + * [知乎](https://www.zhihu.com/people/wuzhangjin) # 5. Linux Lab 开发 @@ -2226,7 +2236,7 @@ Web 连接可能由于某些未知原因而挂起,导致 Linux Lab 有时可 如果看到如下信息: - $ make boot ROOTDEV=vda + $ make boot ROOTDEV=/dev/vda ERR: /dev/vda not in supported ROOTDEV list: /dev/sda /dev/ram0 /dev/nfs, update may help: 'make bsp B=mips64el/ls3a7a'. Stop. $ make boot LINUX=v5.8 @@ -2247,6 +2257,14 @@ Web 连接可能由于某些未知原因而挂起,导致 Linux Lab 有时可 * vda 可能根本不支持或者需要重新配置内核后才支持 * 这个因板子和内核版本而异,需要具体对待 +### 6.4.8 is not a valid rootfs directory + +如果当前使用的是预制文件系统,说明操作过程中可能有类似 `CTRL+C` 中断了正常根文件系统目录、Ramdisk 或 Hardisk 镜像的创建过程,导致文件系统不完整,在确保 BSP 目录无其他紧要修改的情况下,可以通过如下命令恢复 BSP 仓库为默认设置: + + $ make bsp-cleanup + +如果当前使用的是用户自己构建的文件系统,请确保文件系统符合 Linux 的规范,确保相关的基础目录均存在。 + # 7. 联系并赞助我们 我们的联系微信是 **tinylab**,欢迎加入 Linux Lab 的用户和开发人员讨论组。 diff --git a/boards/arm/vexpress-a9/bsp b/boards/arm/vexpress-a9/bsp index 76b9a135db8afce9150f53f41b40525fc133bb18..8e29123cf5f5777dd4beb08230fb4a4b6dc85a3b 160000 --- a/boards/arm/vexpress-a9/bsp +++ b/boards/arm/vexpress-a9/bsp @@ -1 +1 @@ -Subproject commit 76b9a135db8afce9150f53f41b40525fc133bb18 +Subproject commit 8e29123cf5f5777dd4beb08230fb4a4b6dc85a3b diff --git a/boards/i386/pc/Makefile b/boards/i386/pc/Makefile index 2470c5e4dff26d701aece029cc1e683c7adda1ac..778ab14a273b649dee0b8f2a279fb5aef484c4c4 100644 --- a/boards/i386/pc/Makefile +++ b/boards/i386/pc/Makefile @@ -19,7 +19,7 @@ GCC[QEMU_v0.10.6] = 4.4 endif SMP ?= 4 -LINUX ?= v5.1 +LINUX ?= v5.8 BUILDROOT?= 2019.02.2 # Add board detailed configuration diff --git a/boards/i386/pc/bsp b/boards/i386/pc/bsp index a95f9266e93a5aea68baa4e162bd885806604531..bf2175c1882f21aa92600578bcd05a0ed6142290 160000 --- a/boards/i386/pc/bsp +++ b/boards/i386/pc/bsp @@ -1 +1 @@ -Subproject commit a95f9266e93a5aea68baa4e162bd885806604531 +Subproject commit bf2175c1882f21aa92600578bcd05a0ed6142290 diff --git a/boards/mips64el/ls3a7a/Makefile b/boards/mips64el/ls3a7a/Makefile index f7aeceac16bc8c27fe8705927d46d02a1a016819..6836e8ca3aa1046b4e32879148e8e9b9c7743b5f 100644 --- a/boards/mips64el/ls3a7a/Makefile +++ b/boards/mips64el/ls3a7a/Makefile @@ -3,7 +3,7 @@ _BASE = 1 ARCH = mips XARCH = mips64el CPU ?= mips64r2 -BUILDROOT?= 2016.05 +BUILDROOT?= 2020.08 MEM ?= 1024M SERIAL ?= ttyS0 diff --git a/boards/mips64el/ls3a7a/bsp b/boards/mips64el/ls3a7a/bsp index 54af60219f2925098dbc20fee71a3ff0af6e7dd9..86063e02e95dc5c3a8e35907123318ad3883ee37 160000 --- a/boards/mips64el/ls3a7a/bsp +++ b/boards/mips64el/ls3a7a/bsp @@ -1 +1 @@ -Subproject commit 54af60219f2925098dbc20fee71a3ff0af6e7dd9 +Subproject commit 86063e02e95dc5c3a8e35907123318ad3883ee37 diff --git a/boards/x86_64/pc/Makefile b/boards/x86_64/pc/Makefile index 3041b39ca8d778e1d6250e1cd1837212d6ab7981..918bebb42ad0950146b811654a661164fc580ae0 100644 --- a/boards/x86_64/pc/Makefile +++ b/boards/x86_64/pc/Makefile @@ -7,7 +7,7 @@ XARCH = x86_64 CPU ?= qemu64 MEM ?= 128M SMP ?= 4 -LINUX ?= v5.1 +LINUX ?= v5.8 GCC = 8 GCC[LINUX_v3.2] = 4.8 diff --git a/boards/x86_64/pc/bsp b/boards/x86_64/pc/bsp index a1c040c22c655b469a5a49c5533485d1d28f29bf..ad1fad65c4f66d26c8f00a69ae20154c22119457 160000 --- a/boards/x86_64/pc/bsp +++ b/boards/x86_64/pc/bsp @@ -1 +1 @@ -Subproject commit a1c040c22c655b469a5a49c5533485d1d28f29bf +Subproject commit ad1fad65c4f66d26c8f00a69ae20154c22119457 diff --git a/src/linux-stable b/src/linux-stable index 92d21ac74a9e3c09b0b01c764e530657e4c85c49..bcf876870b95592b52519ed4aafcf9d95999bc9c 160000 --- a/src/linux-stable +++ b/src/linux-stable @@ -1 +1 @@ -Subproject commit 92d21ac74a9e3c09b0b01c764e530657e4c85c49 +Subproject commit bcf876870b95592b52519ed4aafcf9d95999bc9c diff --git a/src/loongsonlab-qemu b/src/loongsonlab-qemu new file mode 160000 index 0000000000000000000000000000000000000000..4159c8ddaa8c74e2afc86995b6298fd23f61f1f7 --- /dev/null +++ b/src/loongsonlab-qemu @@ -0,0 +1 @@ +Subproject commit 4159c8ddaa8c74e2afc86995b6298fd23f61f1f7 diff --git a/src/qemu b/src/qemu index 3913d3707e3debfbf0d2d014a1a793394993b088..99c5874a9b6c9f70aef285d6eff85d4f46de3c52 160000 --- a/src/qemu +++ b/src/qemu @@ -1 +1 @@ -Subproject commit 3913d3707e3debfbf0d2d014a1a793394993b088 +Subproject commit 99c5874a9b6c9f70aef285d6eff85d4f46de3c52 diff --git a/tools/root/rd2hd.sh b/tools/root/rd2hd.sh index a54d21aa15cdb1fe9075eb201161bdc322bd86d9..2877219139fadd4ed6122a0b605cb6da8a35ea8e 100755 --- a/tools/root/rd2hd.sh +++ b/tools/root/rd2hd.sh @@ -17,7 +17,7 @@ [ -z "${USER}" ] && USER=$(whoami) -ROOTDIR=$(echo ${HROOTFS} | sed -e "s%.${FSTYPE}%%g") +ROOTDIR=$(echo ${HROOTFS} | sed -e "s%.${FSTYPE}.*%%g") FS_CPIO_GZ=${ROOTDIR}.cpio.gz FS_CPIO=${ROOTDIR}.cpio