12.11晚课
宿主机内执行
sudo apt-get install bridge-utils uml-utilities
sudo brctl addbr br0
sudo ifconfig br0 192.168.122.1/24 up
sudo tunctl -t tap0
sudo ifconfig tap0 192.168.122.11/24 up
sudo brctl addif br0 tap0
sudo dnsmasq --strict-order --except-interface=lo --interface=br0 --listen-address=192.168.122.1 --bind-interfaces --dhcp-range=192.168.122.2,192.168.122.254 --conf-file="" --pid-file=/var/run/qemu-dhcp-virbr0.pid --dhcp-leasefile=/var/run/qemu-dhcp-virbr0.leases --dhcp-no-override
换到你下载的wheezy和qcow2在的文件夹
sudo qemu-system-mipsel \
-M malta \
-kernel vmlinux-3.2.0-4-4kc-malta \
-hda debian_wheezy_mipsel_standard.qcow2 \
-append "root=/dev/sda1 console=tty0" \
-netdev tap,id=tapnet,ifname=tap0,script=no \
-device rtl8139,netdev=tapnet \
-nographic
#in qemu
mkdir /firmware
sudo scp -r squashfs-root/* root@192.168.122.76:/firmware/
chroot /firmware /bin/sh
#after chroot
#fake a openvpn-cert
echo -e '#!/bin/sh\necho fake' > /bin/openvpn-cert
chmod +x /bin/openvpn-cert
/etc/init.d/lighttpd start

浙公网安备 33010602011771号