当前位置:网站首页>在Ubuntu上体验最新版本EROFS
在Ubuntu上体验最新版本EROFS
2020-11-07 23:13:00 【写代码有信仰】
在Ubuntu上体验最新版本EROFS
目前Linux内核的已经迭代到5.9版本,同时EORFS文件系统驱动也做了特性和稳定性更新,一睹新版功能体验。
准备Linux内核代码,最好是和当前发行版内核一致
1. 获取Ubuntu内核版本
$ uname -a
Linux ubuntu 5.9.6-050906-generic #202011051230 SMP Thu Nov 5 17:35:33 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
2. 下载最新EROFS 源码
$ mkdir ~/erofs && cd erofs
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git linux-erofs
$ git checkout -b erofs-dev remotes/erofs/dev
$ git bra|grep erofs
* erofs-dev
erofs-master
remotes/erofs/dev
remotes/erofs/dev-test
remotes/erofs/fixes
remotes/erofs/master
3. 准备makefile
# SPDX-License-Identifier: GPL-2.0-only
EROFS_VERSION = "1.0"
ccflags-y += -DEROFS_VERSION=\"$(EROFS_VERSION)\"
CONFIG_EROFS_FS=y
CONFIG_EROFS_FS_DEBUG=y
CONFIG_EROFS_FS_XATTR=y
CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
CONFIG_EROFS_FS_ZIP=y
CONFIG_EROFS_FS_CLUSTER_PAGE_LIMIT=1
obj-m += erofs.o
erofs-objs := super.o inode.o data.o namei.o dir.o utils.o
erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o
erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o
ifneq ($(KERNELRELEASE),)
# call from kernel build system
obj-m := erofs.o
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := ~/linux-erofs/fs/erofs
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
echo ${KERNELRELEASE}
endif
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.symvers modules.order
depend .depend dep:
$(CC) $(EXTRA_CFLAGS) -M *.c > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
endif
4. 编译和安装erofs驱动
$ cd ~/erofs/linux-erofs
$ make
# 安装依赖模块
$ sudo modprobe libcrc32c
$ sudo insmod ~/erofs/linux-erofs/fs/erofs.ko
$ lsmod|grep erofs
erofs 33648640 0
libcrc32c 16384 1 erofs
5. 挂着打包好的EROFS镜像test.img
$ sudo mount -t erofs -o loop test.img erofsdir;md5sum erofsdir/*.* srcdir/*.*|sort;sudo umount erofsdir
[sudo] password for XX:
0a78b672c059739eaa1dd01cc846f685 erofsdir/dmesg.log
0a78b672c059739eaa1dd01cc846f685 srcdir/dmesg.log
52efd0d1126cd0dbf0e6b28b2cf85c3f erofsdir/inline.txt
52efd0d1126cd0dbf0e6b28b2cf85c3f srcdir/inline.txt
72b3924faa8f5801e2966c69ddaa7d99 erofsdir/file.list
72b3924faa8f5801e2966c69ddaa7d99 srcdir/file.list
7558009b9427ba921ea05e68c35e98b2 erofsdir/config.c
7558009b9427ba921ea05e68c35e98b2 srcdir/config.c
aa5ae2a4d5d71e32357159d9b32a5c2c erofsdir/dd_unrandom.bin
aa5ae2a4d5d71e32357159d9b32a5c2c srcdir/dd_unrandom.bin
c0f56976ed5e0fcf331d30e8d74053bc erofsdir/file_002.txt
c0f56976ed5e0fcf331d30e8d74053bc srcdir/file_002.txt
f127e2ae77c615cd7391c5b4d1194d2c erofsdir/dd_unrandom2.bin
f127e2ae77c615cd7391c5b4d1194d2c srcdir/dd_unrandom2.bin
fdd480f87d40828ecc561cfa9e371a78 erofsdir/liberofs_la-cache.o
fdd480f87d40828ecc561cfa9e371a78 srcdir/liberofs_la-cache.o
版权声明
本文为[写代码有信仰]所创,转载请带上原文链接,感谢
https://my.oschina.net/230/blog/4707752
边栏推荐
- [C + + learning notes] how about the simple use of the C + + standard library STD:: thread?
- supervisor和Python多进程multiprocessing使用 子进程残留问题
- Data structure and sorting algorithm
- C语言I博客作业03
- Download, installation and configuration of Sogou input method in Ubuntu
- 尾-递
- 你的主机中的软件中止了一个已建立的连接。解决方法
- 【解决方案】分布式定时任务解决方案
- IDEA-项目未自动生成 .iml 文件
- 工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
猜你喜欢

计组-总线通信控制之异步串行通信的数据传输
![[original] the influence of arm platform memory and cache on the real-time performance of xenomai](/img/cb/0395507ece572556b2bab373f013a5.jpg)
[original] the influence of arm platform memory and cache on the real-time performance of xenomai

Cryptography - Shangsi Valley

Data transmission of asynchronous serial communication controlled by group bus communication

团灭 LeetCode 股票买卖问题

手撕算法-手写单例模式

WPF personal summary on drawing

16. File transfer protocol, vsftpd service

使用 Xunit.DependencyInjection 改造测试项目

These core technology of object-oriented, after you master it, you can have a good interview
随机推荐
ECMAScript7规范中的instanceof操作符
Web安全(四)---XSS攻击
2020天翼智能生态博览会中国电信宣布5G SA正式规模商用
Web Security (4) -- XSS attack
Git code submission operation, and git push prompt failed to push some refs'xxx '
C++在C的基础上改进了哪些细节
你的主机中的软件中止了一个已建立的连接。解决方法
Face recognition: attack types and anti spoofing techniques
14000 word distributed transaction principle analysis, master all of them, are you afraid of being asked in the interview?
Static + code block + polymorphism + exception
Thinkphp6中where条件中字段与字段比较条件的写法
Cpp(四) Boost安装及基本使用 for Mac
ubuntu实时显示cpu、内存占用率
Problems of Android 9.0/p WebView multi process usage
关于晋升全栈工程师,从入门到放弃的神功秘籍,不点进来看一看?
Got timeout reading communication packets解决方法
Face recognition: attack types and anti spoofing techniques
数据库基本操作
Adobe Prelude /Pl 2020软件安装包(附安装教程)
ROS learning: remote start ROS node