entware无法正常安装或路由器重启后环境丢失——梅林entware环境与软件中心“虚拟内存”的冲突

entware无法正常安装或路由器重启后环境丢失——梅林entware环境与软件中心“虚拟内存”的冲突

由于梅林是基于Entware来安装插件的,因此需要安装entware环境。
一般而言entware环境需要安装在U盘/移动硬盘中(推荐EXT4文件系统,可以用“分区助手”格式化方式更改挂载盘文件系统类型)

# 检查
df -h

Filesystem                Size      Used Available Use% Mounted on
/dev/sda1               916.9G      2.0G    868.4G   0% /tmp/mnt/sda1
#安装entware环境
entware-setup.sh

在这里插入图片描述
按照官方的流程,在选择安装到U盘后,等待安装即可。安装完成后会在U盘创建entware相关的文件,你就可以安装使用entware插件了。但是在安装过程中经常会出现“cannot create directory ‘XXX’:File exists”这类报错,以至于无法正常安装entware环境。
在这里插入图片描述
或者在安装完环境,路由器重启后entware环境丢失。

基于上述问题,并经过排查,我发现在固件中的“软件中心”安装了“虚拟内存”后,上述问题将无法避免。

在这里插入图片描述
这是由于在“软件中心”安装“虚拟内存”后会导致jffs里的post-mount.sh在安装时不能正确产生,并且“虚拟内存”应用貌似卸载脚本有问题,正常卸载后相关的脚本仍然在jffs,这会致使entware环境重启后opt路径无效。同时本来安装 entware-ng就会创建虚拟内存。

因此:

情况一:先安装了“软件中心-虚拟内存”,后安装entware环境,entware将无法正常安装
情况二:先安装entware环境,后安装了“软件中心-虚拟内存”,路由器重启后entware环境丢失

解决方法:

还原路由器至出厂值,进入 “系统管理–系统设置”,按图示开启JFFS,重启路由器以初始化JFFS。

在这里插入图片描述

注意:重启后检查Format JFFS partition at next boot是否已经自动还原为”否“,如果没有,手动调成“否”,否则下次开机会再次还原配置。

 Info:  /tmp/mnt/sda1 selected.

 Info:  Creating /tmp/mnt/sda1/entware folder...
 * Warning:  Deleting old /tmp/opt symlink...
 Info:  Creating /tmp/opt symlink...
 Info:  Creating /jffs scripts backup...
 tar: removing leading \\'/\\' from member names
 Info:  Modifying start scripts...
 Info:  Starting Entware deployment....

Info: Creating folders...
Info: Deploying opkg package manager...
Downloading /opt/bin/opkg... success!
Downloading /opt/etc/opkg.conf... success!
Downloading /opt/etc/profile... success!
Downloading /opt/etc/init.d/rc.func... success!
Downloading /opt/etc/init.d/rc.unslung... success!
Info: Basic packages installation...
Downloading http://pkg.entware.net/binaries/mipsel/Packages.gz.
Updated list of available packages in /opt/var/opkg-lists/entware-ng.
Installing ldconfig (1.0.12-1) to root...
Downloading http://pkg.entware.net/binaries/mipsel/ldconfig_1.0.12-1_mipselsf.ipk.
Installing findutils (4.5.14-1) to root...
Downloading http://pkg.entware.net/binaries/mipsel/findutils_4.5.14-1_mipselsf.ipk.
Installing libc (1.0.12-1) to root...
Downloading http://pkg.entware.net/binaries/mipsel/libc_1.0.12-1_mipselsf.ipk.
Installing libgcc (4.8.5-1) to root...
Downloading http://pkg.entware.net/binaries/mipsel/libgcc_4.8.5-1_mipselsf.ipk.
Installing libssp (4.8.5-1) to root...
Downloading http://pkg.entware.net/binaries/mipsel/libssp_4.8.5-1_mipselsf.ipk.
Configuring ldconfig.
Configuring libgcc.
Configuring libc.
Configuring libssp.
Configuring findutils.
 
Congratulations! If there are no errors above then Entware-ng is successfully initialized.
 
Found a Bug? Please report at https://github.com/Entware-ng/Entware-ng/issues
 
Type \\'opkg install \\' to install necessary package.
发布了75 篇原创文章 · 获赞 505 · 访问量 68万+

猜你喜欢

转载自blog.csdn.net/deng_xj/article/details/96852108