Linux 工作记录

-------------------------------------------------------------------
+ the ~/linux is the kernel 4.12.* the new

+ the ~/rpmbuild/BUILD/kernel-3.10.0-6*/linux-3.10.0*/ is the old kernel and
  my job is to test while the bug will review in the old kernel. In what case
  will the bug review. All the test job is suggested try in the VirtualBox.

7/11/2017 17:57:51 by @Ding Weiqin
------------------------------------------------------------------

-------------------------------------------------------------------
+ the kernel 4.12.* is located in the user viking.
+ the kernel-3.10.0-6.* is located in the user root.

7/12/2017 09:26:01 by @Ding Weiqin
--------------------------------------------------------------------

--------------------------------------------------------------------
+ install VirtualBox
+ build virtual linux system in VB, detail: RHEL-7.4-20170504.0-Server-x85_64
+ test ssh viking@192.168.56.1 at virtual system. Re: connect: Network is unreachable
+ reset the ifcfg-enp0s3 at /etc/sysconfig/network-scripts/ as:
    + IPADDR = 192.168.56.2
    + NETMAS = 255.255.255.0
    + GATEWEY = 192.168.56.1
    + DNS1 = 192.168.1.1
    - BOOTPROTO = dhcp
    + BOOTPROTO = static
+ save the change
+ input command: service network restart
+ Re: connect: Network is unreachable

7/13/2017 09:48:28 by @Ding Weiqin
---------------------------------------------------------------------



---------------------------------------------------------------------
+ reset the ifcfg-enp0s3 at /etc/sysconfig/network-scripts/ as:
    - IPADDR = 192.168.56.2
    + IPADDR = 192.168.56.101
    - NETMAS = 255.255.255.0
    - GATEWEY = 192.168.56.1    
    - DNS1 = 192.168.1.1
+ save the change
+ input command: service network restart
+ try ping 192.168.56.1
+ Re: PING 192.168.56.1 (192.168.56.1) 56(84) bytes of data.
+ so the link of the host and the ghost is connect
+ The reason: VirtualBox is required the ip addr at least x.x.x.100

7/13/2017 11:05:09 by @Ding Weiqin
----------------------------------------------------------------------


----------------------------------------------------------------------
+ do it at host
+ send the kernel source to ghost
+ the source file is "kernel-3.10.0-663.el7.src.rpm"
+ use command :
    scp kernel-3.10.0-663.el7.src.rpm root@192.168.56.101
+ to send the file to virtual linux RH

7/13/2017 11:34:00 by @Ding Weiqin
---------------------------------------------------------------------


---------------------------------------------------------------------
+ software install source is based on the files in "/etc/yum.repos.d/"
+ the command "dnf" will check those files and use the urls to download
+ or install by local packages

7/13/2017 11;44;24 by @Ding Weiqin
---------------------------------------------------------------------


---------------------------------------------------------------------
+ try to install kernel in the virtual linux
+ sleeping...
07/13/17 13:52:04 by @Ding Weiqin
---------------------------------------------------------------------


------------------------------------------------------------------------
+ add quick insert time module
+ " 在插入状态下按下输入  xtime  后Enter来插入当前系统时间"
+ iab xtime <c-r>=strftime("%m/%d/%y %H:%M:%S by @Ding Weiqin")<cr>
+ add quick insert division line module
+ " 在插入状态下按下输入 xdivision 后Enter插入一行分割线"
+ iab xdivision <c-r>=strftime("------------------------------------------------------------------------")<cr>
07/13/17 14:03:20 by @Ding Weiqin
------------------------------------------------------------------------

------------------------------------------------------------------------
+ prepare jobs for install kernel
+ 1.get the suitable kernel from www.kernel.org
+ 2.yum groupinstall Development toos        #安装开发包组
+ 3.rpm -ivh kernel-3.10.0-663.e17.src.rpm    #安装内核模块
+   显示warning: user mockbuild does not exist - using root    
    warning: group mockbuild does not exist - using root
    暂可忽略

+ 4.make help                        #查看make help 文件
+ 以下命令在修改内核代码后重做
+ 5.make localmodconfig                #加载安装参照,仅按照当前本地模块进行来进行编译
+ 6.make                            #编译
+ 7.make modules_install            #进行模块安装
+ 8.make install                    #安装
+ 以上---

07/13/17 15:54:00 by @Ding Weiqin

+ 此项操作路径在虚拟机下:/root/rpmbuild/BUILD/kernel-3.10.0-663.el7/linux-3.10.0-663.el7.x86_64/
07/13/17 16:58:15 by @Ding Weiqin
------------------------------------------------------------------------


------------------------------------------------------------------------
+ new mession                        #在虚拟机环境下搭建一个网桥
+ build a bridge

07/13/17 15:56:13 by @Ding Weiqin
------------------------------------------------------------------------

------------------------------------------------------------------------
+ 因为缺少ISO9660模块,虚拟机中网桥相关的软件无法从镜像挂载。因此重新
+ 安装内核。
+ 此次安装在虚拟机初始内核版本中使用如下命令
+ make menuconfig
+ make
+ make modules_install
+ make install
+ 以上
+ 成功以后重启虚拟机,进入新内核版本
+ 挂载/dev/sr0 到/mnt/iso
+ 下载网桥相关软件
+ #注意:每次重启Fedora后,要重新挂载所有的镜像,不然虚拟机无法启动?

07/13/17 17:34:41 by @Ding Weiqin

+ 对于注意,其实只是虚拟机会报提醒,但是对于虚拟机的启动没有影响,是否有其他影响目前未知
07/14/17 09:07:09 by @Ding Weiqin


+ 对于注意,可能会导致虚拟机内的cdrom无法访问,无法从本地软件源安装软件
+ 先在Fedora下挂载nfs文件,命令如下
    mount -t nfs 193.160.34.166:/data/sdb2 /mnt/nfs
+ 之后再进入虚拟机,挂载/dev/sr0 到 /mnt/iso
    mount /dev/sr0 /mnt/iso
+ 这样虚拟机下才能成功挂载安装源并且能从cdrom所指示url安装软件

07/14/17 09:56:42 by @Ding Weiqin

+ 挂载安装源后,虚拟机确实可以从本地软件源安装,但是对于没有本地安装包
的软件显然无能为力,对此,由于虚拟机设置的是Host-only模式,因此,我先
尝试在虚拟机下把网桥搭建起来,考虑通过网桥访问本机的网络,以实现虚拟机
的网络访问
07/14/17 10:03:57 by @Ding Weiqin

------------------------------------------------------------------------


------------------------------------------------------------------------
+ reading 'man brctl'
+ brctl addbr <name>  ::= creates a new instance of the ethernet bridge.
The network interface corresponding to the bridge will be called <name>
+ brctl delbr <name>  ::= deletes the instance <name> of the ethernet
bridge. bridge must be down before deleted
+ brctl show  ::= show all
+ brctl addif <brname> <ifname>  ::= make the interface <ifname> a port
of the bridge <brname>
+ brctl delif <brname> <ifname>  ::= will detach the interface <ifname>
from the bridge <brname>
07/14/17 09:03:40 by @Ding Weiqin


+ create a new instance of the ethernet bridge in virtual linux.
+ brctl addbr bridge1
07/14/17 09:41:07 by @Ding Weiqin

+ 当在虚拟机中执行了: brctl addif bridge1 enp0s3 后,主机与虚拟机之间的通信就断开了,猜测是占用了enp0s3网卡的原因,现在开始尝试新建一个网卡用于桥接
07/14/17 10:24:15 by @Ding Weiqin


+ 退出虚拟机,直接使用VirtualBox,在setting>Network中可以看到,当前只是用了一个虚拟网卡,VirtualBox自身支持建立4个虚拟网卡,此处我令Adapter2为Enable Network Adapter,从而新添加了一个网卡,用于测试桥接模式。
+ 当然,还有另外一种方法,直接在虚拟机里设置新的虚拟网卡(为映射过来的物理网卡添加一个新的地址,因为同一个网卡可以绑定多个IP地址),方法如下:
+ ip address add ::= 添加一个新的协议地址
+ 如:ip addr add local 192.168.4.1/48 brd + label eth0:1 dev eth0

------------------------------------------------------------------------

------------------------------------------------------------------------
+ ip 命令已经取代了 ifconfig
+ 如下替代:
    ifconfig        => ip link
    ifconfig -a        => ip addr show
    ifconfig --help    => ip help
    ifconfig -s        => ip -s link
    ifconfig eth0 up=> ip link set eth0 up
    ipmaddr            => ip maddr
    netstat            => ss
    netstat -i        => ip -s link
    route add/del    => ip route add/del/show
+ 略...
+ 虚拟机中有ip 命令,没有ifconfig....

07/14/17 10:50:45 by @Ding Weiqin
------------------------------------------------------------------------

------------------------------------------------------------------------
+ 解压xz文件的方法
    xz -d *.tar.xz
    tar -xvf *.tar

07/14/17 11:15:45 by @Ding Weiqin
------------------------------------------------------------------------

------------------------------------------------------------------------
+ install CLion
+ install c++ compiler
+ clone a virtual X as the other part of the bridge
+ change the IP Addr of the X_bak_7/17/2017 to 192.168.56.111

07/17/17 09:54:00 by @Ding Weiqin
------------------------------------------------------------------------

------------------------------------------------------------------------
+ the original X use 192.168.56.101/102/103
+ the X_bak_7/17/2017 use 162.168.56.111/112/113
+ add the "printf("module is used") " at the vlan.c where changed in the new kernel
+ try to use the original X as the bridge, to link the X_bak_7/17/2017 and the Fedora.

07/17/17 10:22:02 by @Ding Weiqin
------------------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值