View source for GentooQEMUBuildBox
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to GentooQEMUBuildBox.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to GentooQEMUBuildBox.
Gentoo, http://www.gentoo.org/doc/en/handbook/handbook-arm.xml
dd if=/dev/zero of=qemuarm-0.rootfs.ext2 count=16777216 dd if=/dev/zero of=qemuarm-0.swapfs count=524288 losetup -f qemuarm-0.rootfs.ext2 mkfs.ext2 /dev/loop0 mount /dev/loop0 /mnt tar -xjpf stage3-armv4tl-*.tar.bz2 -C /mnt tar -xjpf portage-*.tar.bz2 -C /mnt/usr umount /mnt mkswap qemuarm-0.swapfs
run-qemu-1:
#!/bin/bash CURDIR="/somedirwithqemuscriptsandrootfsimage" NUMBER=1 KERNEL="$CURDIR/zImage-2.6.23-pinky-3.1-qemuarm.bin" ROOTFS="$CURDIR/qemuarm-$NUMBER.gentoo.ext2" SWAPFS="$CURDIR/qemuarm-$NUMBER.swapfs" qemu-system-arm -kernel $KERNEL -net nic,vlan=0 -net tap,vlan=0,ifname=tap$NUMBER,script=$CURDIR/qemu-ifup-$NUMBER,downscript=$CURDIR/qemu-ifdown-$NUMBER \ -M versatilepb -hda $ROOTFS -hdb $SWAPFS -no-reboot -m 256 -show-cursor -serial stdio -parallel none \ -monitor unix:"$QEMU_MONITOR",server,nowait -nographic \ --append root=/dev/sda\ console=ttyAMA0\ ip=192.168.$NUMBER.10::192.168.$NUMBER.1:255.255.255.0\ mem=256M\ quiet
qemu-ifup-1:
#!/bin/sh /sbin/ifconfig tap1 192.168.1.1 echo 1 > /proc/sys/net/ipv4/ip_forward /sbin/iptables -I INPUT 1 -s 192.168.1.10 -j ACCEPT /sbin/iptables -I OUTPUT 1 -s 192.168.1.1 -j ACCEPT /sbin/iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.1.0/24
qemu-ifdown-1:
#!/bin/sh /sbin/ifconfig tap1 down echo 0 > /proc/sys/net/ipv4/ip_forward /sbin/iptables -D INPUT -s 192.168.1.10 -j ACCEPT /sbin/iptables -D OUTPUT -s 192.168.1.1 -j ACCEPT /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.1.0/24
tar -xjpf stage3-armv4tl-*.tar.bz2 -C NFSPATH tar -xjpf portage-*.tar.bz2 -C NFSPATH/usr
mount -n -o remount,rw /
source /etc/profiles; env-update
mknod /dev/ttyAMA0 c 204 64
mkdir -p /lib/modules/2.6.23
touch /lib/modules/2.6.23/modules.dep
sync
mount -n -o remount,ro /
init 0