梅林固件安装软件初体验

  |   0 评论   |   0 浏览

背景

在梅林固件的路由器上,安装opkg包,来安装软件。

初体验

打开jffs

  1. 进入路由器设置界面
  2. 选择系统管理,然后选择系统设置,修改下面几项为开启

  1. 点击底部的应用修改,然后等几秒直接重启路由器。 这样路由器就打开SSH和JFFS了。
  2. 使用putty等SSH管理工具连接192.168.1.1 登录账户admin 密码是你的路由器密码

我这里已经打开过了,就不再重复打开了。

安装entware

准备工作

找一个U盘或读卡器 内存卡,我们要把entware安装到里面。 (必须接USB存储设备,不然安装会退出,提示没有可用的存储设备)

  1. 格式化U盘为ext4分区,entware只支持ext2/ext3/ext4分区格式。
  2. 输入 df -h ,确认U盘存在。

安装

SSH里执行命令 entware-setup.sh 回车。

结果

# entware-setup.sh
 Info:  This script will guide you through the Entware installation.
 Info:  Script modifies "entware" folder only on the chosen drive,
 Info:  no other data will be changed. Existing installation will be
 Info:  replaced with this one. Also some start scripts will be installed,
 Info:  the old ones will be saved on Entware partition with name
 Info:  like /tmp/mnt/sda1/jffs_scripts_backup.tgz

 Info:  Looking for available partitions...
[1] --> /tmp/mnt/sda1
 =>  Please enter partition number or 0 to exit
[0-1]: 1
 Info:  /tmp/mnt/sda1 selected.

 Info:  Creating /tmp/mnt/sda1/entware folder...
 Info:  Creating /tmp/opt symlink...
 Info:  Creating /jffs scripts backup...
tar: removing leading '/' from member names
 Info:  Modifying start scripts...
...
Info: Basic packages installation...
Downloading http://bin.entware.net/armv7sf-k2.6/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Installing entware-opt (227000-3) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/entware-opt_227000-3_all.ipk
Installing libgcc (8.4.0-11) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libgcc_8.4.0-11_armv7-2.6.ipk
Installing libc (2.23-11) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libc_2.23-11_armv7-2.6.ipk
...

使用

opkg update
opkg search xxx
opkg install xxx

无U盘下的安装Entware

梅林安装entware到jffs
ssh下运行以下代码。

[2]

mkdir /jffs/entware-ng.arm
ln -nsf /jffs/entware-ng.arm /tmp/opt
wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | /bin/sh
echo "#!/bin/sh" > /jffs/scripts/services-start
echo "sleep 20" >> /jffs/scripts/services-start
echo "ln -ns /jffs/entware-ng.arm /tmp/opt" >> /jffs/scripts/services-start
echo "/opt/etc/init.d/rc.unslung start" >> /jffs/scripts/services-start
echo "#!/bin/sh" > /jffs/scripts/services-stop
echo "/opt/etc/init.d/rc.unslung stop" >> /jffs/scripts/services-stop
chmod a+rx /jffs/scripts/*

安装ngrep

opkg find ngrep
opkg install ngrep

参考

  1. 梅林固件打开JFFS分区安装Entware来安装软件
  2. 梅林安装entware到jffs