Contents

Openwrt opkg常用命令

0.部署

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
wget https://downloads.openwrt.org/releases/21.02.0/targets/x86/64/openwrt-21.02.0-x86-64-generic-ext4-combined.img.gz
#gzip压缩保留源文件的方法:
#gzip –c filename > filename.gz
gzip -c openwrt-21.02.0-x86-64-generic-ext4-combined.img > openwrt-21.02.0-x86-64-generic-ext4-combined.img.gz.2 
#gzip解压缩保留源文件的方法:
#gzip –c filename.gz > filename
#gzip -d openwrt-21.02.0-x86-64-generic-ext4-combined.img.gz 
gzip -c openwrt-21.02.0-x86-64-generic-ext4-combined.img.gz > openwrt-21.02.0-x86-64-generic-ext4-combined.img
qemu-img convert -f raw openwrt-21.02.0-x86-64-generic-ext4-combined.img -O vmdk openwrt-21.02.0-x86-64-generic-ext4-combined.vmdk
#Vmware加载vmdk,并扩容分区,在另外的Linux VM中备份disk2,从新分区以后拷贝回来即可
#也可以使用fdisk进行操作,但是要记住之前的sector
#https://openwrt.org/docs/guide-user/installation/openwrt_x86

1.更新源

opkg update

2.查找软件

opkg list | grep "$name"

3./etc/init.d/启动脚本相关

1
2
3
4
5
6
7
8
9
start	Start the service
stop	Stop the service
restart	Restart the service
reload	Reload configuration files (or restart if service does not implement reload)
enable	Enable service autostart
disable	Disable service autostart
enabled	Check if service is started on boot
running	Check if service is running
status	Service status