编译Openwrt
参考如下文章,注意事项见后 Ubuntu20.04(WSL2)编译OpenWrt 19.07和21.02_bobo的博客-CSDN博客WSL编译Openwrthttps://blog.csdn.net/u010687717/article/details/117949379
注意1:按下图选择target
注意2:编译中出现如下错误,在Windows的环境变量中将相关Path删除
?
运行自己的docker image
遗留问题:我编译的rootfs会hang up ,无法进入shell...但是官方的docker image就正常
sudo apt install docker.io
sudo dockerd &
cat openwrt/bin/targets/x86/64/openwrt-x86-64-generic-rootfs.tar.gz |sudo docker import - openwrt
sudo docker run --rm -it --privileged 81bdece0cea7 /sbin/init
--rm:等价于在容器退出后,执行docker rm -v
-it:以交互式启动
--privileged:我理解是以root身份运行
81bdece0cea7:通过sudo docker images看到的ID
运行官方的docker image
注意:不加--entrypoint /bin/ash? ?eth0无法从docker0获取IP,参考如下 链接:docker interface eth0 has no ip when run with --privilege flag · Issue #76 · openwrt/docker · GitHubWhen I execute docker run command, it has below impacts Without privileged flag -- ($ docker run -itd openwrtorg/rootfs:x86-64) Internet is accessible on container Ip was assigned to docker eth0 interface With privileged flag -- ($ docke...https://github.com/openwrt/docker/issues/76
sudo docker run --rm -it --privileged --entrypoint /bin/ash openwrtorg/rootfs:x86_64
|