1.修改LibreELEC系統(tǒng)鏡像
LibreELEC系統(tǒng)鏡像為只讀,無(wú)法創(chuàng)建opt文件夾。
mac系統(tǒng)下安裝brew,然后brew install squashfs
插入SD卡在終端中輸入如下:
cd /Volumes/LIBREELEC
mkdir -p new/opt
mksquashfs new SYSTEM -all-root
rm -rf new
現(xiàn)在LibreELEC系統(tǒng)鏡像就會(huì)生成一個(gè)opt文件夾,每次LibreELEC升級(jí)都需要重新創(chuàng)建這個(gè)opt文件夾。
2.啟動(dòng)LIbreELEC系統(tǒng)并登入SSH
在LibreELEC的系統(tǒng)設(shè)置中開(kāi)啟ssh,然后在終端中輸入ssh root@LibreELEC.local
輸入密碼后登入LibreELEC
3.安裝Entware
盡管/根目錄還是只讀,但是/storage是可讀寫的,所以先創(chuàng)建/storage/opt,然后把/opt掛載到/storage/opt,然后安裝opkg,在終端中輸入如下:
mkdir -p /storage/opt
mount -o bind /storage/opt /opt
wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | sh
export PATH=$PATH:/opt/bin:/opt/sbin
opkg update
opkg install coreutils-expr
這里面的安裝腳本需要根據(jù)你的設(shè)備來(lái)修改
可以到http://bin.entware.net/來(lái)查看支持的設(shè)備類型
可以選擇的有
[aarch64-k3.10/](http://bin.entware.net/aarch64-k3.10/)
[armv5sf-k3.2/](http://bin.entware.net/armv5sf-k3.2/)
[armv7sf-k2.6/](http://bin.entware.net/armv7sf-k2.6/)
[armv7sf-k3.2/](http://bin.entware.net/armv7sf-k3.2/)
[mipselsf-k3.4/](http://bin.entware.net/mipselsf-k3.4/)
[mipssf-k3.4/](http://bin.entware.net/mipssf-k3.4/)
[x64-k3.2/](http://bin.entware.net/x64-k3.2/)
修改啟動(dòng)項(xiàng),LibreELEC啟動(dòng)自動(dòng)掛載/opt到/storage/opt
輸入nano -w /storage/.config/system.d/opt.mount
[Unit]
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=/storage/opt
Where=/opt
Type=none
Options=bind
[Install]
WantedBy=local-fs.target
啟動(dòng)開(kāi)機(jī)自動(dòng)掛載
systemctl enable opt.mount
添加環(huán)境變量nano /storage/.profile
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export PATH=$PATH:/opt/bin:/opt/sbin
重啟系統(tǒng),ssh登入,檢查/opt是否掛載ls /opt看是否有相應(yīng)文件夾
輸入opkg list檢測(cè)環(huán)境變量是否設(shè)置成功
4.設(shè)置Entware啟動(dòng)項(xiàng)
輸入nano -w /storage/.config/system.d/entware.service
[Unit]
Requires=network-online.service
[Service]
Type=oneshot
ExecStart=/opt/etc/init.d/rc.unslung start
ExecStop=/opt/etc/init.d/rc.unslung stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
開(kāi)機(jī)自啟動(dòng)systemctl enable entware.service
啟動(dòng)服務(wù)systemctl start entware.service
5.安裝Entware應(yīng)用
opkg list
opkg list | grep package
opkg install package
opkg uninstall package