Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3547239
  • 博文数量: 1805
  • 博客积分: 135
  • 博客等级: 入伍新兵
  • 技术积分: 3345
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-19 20:01
文章分类

全部博文(1805)

文章存档

2017年(19)

2016年(80)

2015年(341)

2014年(438)

2013年(349)

2012年(332)

2011年(248)

分类: LINUX

2015-02-24 09:54:20

858 gdb ./vmlinux
  859 target remote localhost:1234
  860 gdbserver 1234
  861 yum install gdbserver
  862 gdb vmlinux
  863 gdb vmlinux
  864 gdb vmlinux
  865 vi .config
  866 vi .config
  867 make menuconfig
  868 vi .config
  869 make
  870 gdb vmlinux
  871 make menuconfig
  872 vi .config
  873 vi .config
  874 make
  875 vi .config
  876 make
  877 gdb vmlinux
  878 poweroff;exit
  879 cd /opt/linux-2.6/
  880 ls
  881 git pull
  882 cd /opt/
  883 ls
  884 cd /qemu/
  885 ls
  886 history |grep qemu
  887 qemu --help
  888 qemu --kernel linux-0.2.img
  889 qemu --kernel linux-0.2.img
  890 qemu -hda linux-0.2.img
  891 qemu -hda linux-0.2.img
  892 qemu -hda linux-0.2.img
  893 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img
  894 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage --initrd initrd.img.gz -hda linux-0.2.img
  895 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage --initrd initrd.img.gz
  896 qemu --kernel linux-0.2.img
  897 qemu -hda linux-0.2.img
  898 qemu -hda linux-0.2.img
  899 qemu -hda linux-0.2.img
  900 qemu -hda linux-0.2.img -net nic
  901 qemu -hda linux-0.2.img -net user
  902 qemu -hda linux-0.2.img -net nice,bridge
  903 qemu -hda linux-0.2.img -net nice,mode=bridge
  904 qemu -hda linux-0.2.img -net nic,mode=bridge
  905 qemu -hda linux-0.2.img -user-net
  906 qemu -hda linux-0.2.img -net user
  907 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  908 ifconfig
  909 qemu -hda linux-0.2.img -net nic -net tun,ifname=tap0,script=/etc/qemu-ifup
  910 qemu -hda linux-0.2.img -net nic -net /dev/net/tun,ifname=tap0,script=/etc/qemu-ifup
  911 vi /dev/net/tun
  912 ll /dev/net/tun
  913 vi /etc/qemu-ifup
  914 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  915 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  916 modprobe tun
  917 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  918 ifconfig
  919 qemu -hda linux-0.2.img -net nic,macaddr=00:00:00:00:00:04 -net user
  920 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage --initrd initrd.img.gz
  921 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  922 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img -append "root/dev/hda"
  923 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img -append "root/dev/hda"
  924 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -sda linux-0.2.img -append "root/dev/hda"
  925 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img -append "root/dev/hda"
  926 cd
  927 ls
  928 cp /home/liuqi/busybox-initramfs-dist.tar.bz2 .
  929 tarjxvf busybox-initramfs-dist.tar.bz2
  930 tar jxvf busybox-initramfs-dist.tar.bz2
  931 ls
  932 ls busybox-initramfs
  933 ls
  934 yum install bridge-utils uml-utilities vtun
  935 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero
  936 yum install bridge-utils uml-utilities vtun
  937 modprobe tun
  938 /etc/init.d/vtun start
  939 chmod a+rw /dev/net/tun
  940 brctl addbr br0
  941 ifconfig br0 192.168.99.1 netmask 255.255.255.0 up
  942 for ((i=0; i < NUM_OF_DEVICES ; i++)); do echo -n "Setting up "; tunctl -b -u $USERID -t qtap$i; brctl addif br0 qtap$i; ifconfig qtap$i up 0.0.0.0 promisc; done
  943 /etc/init.d/vtund start
  944 /etc/init.d/kvm-network stop
  945 ifconfig
  946 ifconfig br0 192.168.1.198 netmask 255.255.255.0 up
  947 qemu -kernel arch/i386/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  948 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  949 ifconfig br0 192.168.99.1 netmask 255.255.255.0 u
  950 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  951 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  952 lsmod |grep tun
  953 ls -l /dev/net/tun
  954 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap
  955 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tun
  956 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  957 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=/etc/qemu-ifup
  958 vi /etc/qemu-ifup:
  959 vi /etc/qemu-ifup
  960 vi /etc/qemu-ifup
  961 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=/etc/qemu-ifup
  962 vi /etc/qemu-ifup
  963 chmod 777 /etc/qemu-ifup
  964 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=/etc/qemu-ifup
  965 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  966 /etc/init.d/kvm-network stop
  967 chmod 777 /etc/init.d/kvm-network
  968 /etc/init.d/kvm-network stop
  969 ls /lib/modules/`uname -r`/kernel/drivers/net/tun.ko
  970 /etc/init.d/kvm-network start
  971 yum install tunctl
  972 /etc/init.d/kvm-network start
  973 yum install vtun
  974 vtund
  975 vi /etc/init.d/kvm-network
  976 /etc/init.d/kvm-network start
  977 ifconfig
  978 /etc/init.d/kvm-network stop
  979 vi /etc/init.d/kvm-network
  980 /etc/init.d/kvm-network stop
  981 /etc/init.d/kvm-network start
  982 ifconfig
  983 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  984 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -serial "stdio" -serial "pty" -append '$console kgdbwait kgdboc=ttyS1'
  985 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  986 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  987 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -serial "stdio" -serial "pty" -append
  988 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -serial "stdio" -serial "pty"
  989 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  990 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  991 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  992 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  993 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  994 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  995 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  996 service network restart
  997 ls
  998 history
[root@localhost liuqi]# cat /etc/init.d/vtund
#!/bin/sh
#
# vtund     Startup script for the virtual tunnel daemon
#
# chkconfig: - 55 45
# description: Virtual Tunnel Daemon provides the facility to create \
# virtual tunnels over TCP/IP networks and allows for \
# shaping, compression, and encryption of tunneled traffic.

### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description:
# Description:
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

exec="/usr/sbin/vtund"
prog="vtund"
config="/etc/vtund.conf"

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

lockfile=/var/lock/subsys/$prog

start() {
    [ -x $exec ] || exit 5
    [ -f $config ] || exit 6
    echo -n $"Starting $prog: "
    daemon $exec -s
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    echo -n $"Reloading config for $prog: "
    killproc $prog -HUP
    retval=$?
    echo
    return $retval
}

force_reload() {
    restart
}

rh_status() {
    # run checks to determine if the service is running or use generic status
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}


case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?
[root@localhost liuqi]# cat /etc/init.d/kvm-network
#!/bin/bash
# id of the user running qemu (kvm). Make sure you change it appropriately.
USERID=1000

# number of TUN/TAP devices to setup
NUM_OF_DEVICES=1

case $1 in
start)
        modprobe tun
        /etc/init.d/vtund start
        chmod a+rw /dev/net/tun
        echo -n "Setting up bridge device br0"
        brctl addbr br0
        ifconfig br0 192.168.99.1 netmask 255.255.255.0 up
        for ((i=0; i < NUM_OF_DEVICES ; i++)); do
                echo -n "Setting up "
                tunctl -b -u $USERID -t qtap$i
                brctl addif br0 qtap$i
                ifconfig qtap$i up 0.0.0.0 promisc
        done
        ;;
stop)
        for ((i=0; i < NUM_OF_DEVICES ; i++)); do
                ifconfig qtap$i down
                brctl delif br0 qtap$i
                tunctl -d qtap$i
        done
        ifconfig br0 down
        brctl delbr br0
        /etc/init.d/vtund stop
        ;;
*)
        echo "Usage: $(basename $0) (start|stop)"
        ;;
esac

[root@localhost liuqi]#

阅读(570) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~