Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tbblgm119
lede
提交
db9b77a6
L
lede
项目概览
tbblgm119
/
lede
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
lede
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
db9b77a6
编写于
1月 04, 2020
作者:
T
Texot
提交者:
coolsnowwolf
1月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fstools: make extroot mount preparation more robust (#2675)
上级
251d6818
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
97 addition
and
0 deletion
+97
-0
package/system/fstools/patches/0010-fstools-block-make-extroot-mount-preparation-more-robust.patch
...ls-block-make-extroot-mount-preparation-more-robust.patch
+97
-0
未找到文件。
package/system/fstools/patches/0010-fstools-block-make-extroot-mount-preparation-more-robust.patch
0 → 100644
浏览文件 @
db9b77a6
From 1aa83d3cba087decaac34a1e845e301fe98d2abe Mon Sep 17 00:00:00 2001
From: "Kenneth J. Miller" <ken@miller.ec>
Date: Tue, 9 Apr 2019 19:49:35 +0200
Subject: [PATCH] fstools: block: make extroot mount preparation more robust
The extroot mount preparation code for r/w rootfs overlay discovery, and
determining the user-defined /etc/config/fstab location within, would only
discover overlays residing on JFFS2 or UBIFS MTD storage.
This led to attempts at loading the uci fstab configuration without the
required /tmp/overlay directory prefix on devices with a non-MTD r/w
rootfs overlay, and thus failure to find any custom fstab /overlay extroot
entries on PREINIT.
(example:
the default openwrt eMMC partition layout on the zyxel nbg6817)
Futher, with UBIFS_EXTROOT enabled (fstools package default), and no MTD
rootfs partitions present, check_extroot would not attempt rootfs
discovery on block devices, such as the ext4 mmcblk rootfs overlay on the
nbg6817.
With this patch:
1) main_extroot now attempts to load uci fstab configuration from an
already mounted overlay, before defaulting to the prefix-less uci
config dir when no MTD rootfs partitions are detected.
2) check_extroot now also attempts to find rootfs partitions on block
devices when no MTD rootfs partitions are detected.
Fixes: FS#2231
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2231
Signed-off-by: Kenneth J. Miller <ken@miller.ec>
---
block.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/block.c b/block.c
index 39212d2..3dfc4a5 100644
--- a/block.c
+++ b/block.c
@@ -1301,7 +1301,7 @@
static int find_block_ubi_RO(libubi_t libubi, char *name, char *part, int plen)
return err;
}
-#else
+#endif
static int find_root_dev(char *buf, int len)
{
@@ -1332,8 +1332,6 @@
static int find_root_dev(char *buf, int len)
return -1;
}
-#endif
-
static int test_fs_support(const char *name)
{
char line[128], *p;
@@ -1363,25 +1361,20 @@
static int check_extroot(char *path)
struct probe_info *pr = NULL;
char devpath[32];
-#ifdef UBIFS_EXTROOT
if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) {
int err = -1;
+#ifdef UBIFS_EXTROOT
libubi_t libubi;
libubi = libubi_open();
err = find_block_ubi_RO(libubi, "rootfs", devpath, sizeof(devpath));
libubi_close(libubi);
- if (err)
- return -1;
- }
-#else
- if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) {
- if (find_root_dev(devpath, sizeof(devpath))) {
+#endif
+ if (err && find_root_dev(devpath, sizeof(devpath))) {
ULOG_ERR("extroot: unable to determine root device\n");
return -1;
}
}
-#endif
list_for_each_entry(pr, &devices, list) {
if (!strcmp(pr->dev, devpath)) {
@@ -1585,7 +1578,7 @@
static int main_extroot(int argc, char **argv)
}
#endif
- return mount_extroot(NULL);
+ return mount_extroot("/tmp/overlay");
}
static int main_mount(int argc, char **argv)
--
2.21.0
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录