Skip to content

Instantly share code, notes, and snippets.

@jannson
Last active August 29, 2015 13:57
Show Gist options
  • Save jannson/9633745 to your computer and use it in GitHub Desktop.
Save jannson/9633745 to your computer and use it in GitHub Desktop.
#!/bin/sh
#./mipsel-softmmu/qemu-system-mipsel -bios ~/project/source/malta_le/examples/hello -S -s -nographic -net nic -net socket,udp=127.0.0.1:11110,localaddr=127.0.0.1:11210
#./mipsel-softmmu/qemu-system-mipsel -bios /home/gan/project/source/malta_le/examples/hello -S -s -nographic -net nic -net tap,ifname=tap1,script=no
#./mipsel-softmmu/qemu-system-mipsel -bios ~/project/source/malta_le/examples/hello -S -s -nographic -net nic -net socket,udp=127.0.0.1:11100,localaddr=127.0.0.1:21015
./mipsel-softmmu/qemu-system-mipsel -bios /home/gan/project/source/malta_le/examples/ping -S -s -nographic -net nic -net tap,ifname=tap1,script=no
brctl addbr br0
tunctl -b -u gan
tunctl -b -u gan
ifconfig br0 up
ifconfig tap0 up
ifconfig tap1 up
brctl addif br0 tap0
brctl addif br0 tap1
ifconfig br0 192.168.10.254 netmask 255.255.255.0
虚似机上外网方法:
将eth0 添加到br0
设置br0为外网地址
设置: route add default gw [ip]
vi /etc/resolv:
nameserver [ip]
1) 创建rootfs img
qemu-img create rootfs.img 5G
mkfs.ext3 -b 2048 rootfs.img
sudo mount -o loop rootfs.img /mnt
-hda rootfs.img
qemu-system-mipsel -kernel bin/malta/openwrt-malta-le-vmlinux-initramfs.elf -m 256 -nographic -net nic -net tap,ifname=tap0,script=no -hda test.img
-usb -usbdevice host:xxxx:yyyy
../configure --target-list="mipsel-softmmu mips-softmmu mipsn32el-linux-user mipsn32-linux-user mips64el-softmmu mips64-softmmu mips64-linux-user mips64el-linux-user" --enable-libusb
/usr/lib64/pkgconfig/libusb-1.0.pc
#!/bin/bash
export LD_LIBRARY_PATH=/usr/local/lib
export STAGING_DIR=/opt/openwrt/trunk/staging_dir
CROSS_TOOLCHAINS_DIR=$STAGING_DIR/toolchain-mipsel_mips32_gcc-4.8-linaro_uClibc-0.9.33.2
export PATH=$PATH:$CROSS_TOOLCHAINS_DIR/bin
export ARCH=mips
export CROSS_COMPILE=$CROSS_TOOLCHAINS_DIR/bin/mipsel-openwrt-linux-uclibc-
#export CFLAGS="-w -fomit-frame-pointer -Dlinux -D__linux__ -Dunix -DEMBED -I$UCLIBC_SOURCE/include -I$MTK_SOURCE/lib/include -I$MTK_SOURCE $EXTRA_LDFLAGS"
#export CC=mipsel-linux-cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment