-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.xml
executable file
·252 lines (252 loc) · 82.9 KB
/
search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title><![CDATA[Postman工具在openbmc中的使用举例]]></title>
<url>%2F2020%2F05%2F19%2FPostman%E5%B7%A5%E5%85%B7%E5%9C%A8openbmc%E4%B8%AD%E7%9A%84%E4%BD%BF%E7%94%A8%E4%B8%BE%E4%BE%8B%2F</url>
<content type="text"><![CDATA[一、用root账号登录并生成token1.创建一个用例,路径是 https://IP/login,post方法2.声明数据格式,在Header的Tab页中输入一组key/valueContent-Type/ application/json3.为登录口令创建加密串,openbmc登录用的加密串,将生成的串存储为参数。在pre-request-script的Tab页输入 var pw = CryptoJS.enc.Utf8.parse(“xxx”)var base64 = CryptoJS.enc.Base64.stringify(pw)pm.environment.set(“originPassword”, base64) 4.输入post方法的参数,使用上一步生成的originPassword参数在Body的Tab页输入 {“username” : “root”, “password” : “{ {originPassword} }” } 5.完成测试代码,并生成root-token全局变量,这个变量可以在所有的用例中作为登录认证来使用在Test的Tab页输入 var data = JSON.parse(responseBody);if (data.token) { tests[“Body has token”] = true; pm.globals.set(“root-token”, data.token);}else { tests[“Body has token”] = false;} 二、在用例中使用root-token,以生成oper用户为例1.创建一个用例,路径是 https://IP/redfish/v1/AccountService/Accounts,POST方法2.在Header的Tab页除了声明数据格式Content-Type/ application/json,再输入一组key/value,X-Auth-Token:NaN3.如果有加密数据,仍需要为加密后的串设置参数。如果post参数中没有加密串,可以跳过这一步在pre-request-script的Tab页输入 var pw = CryptoJS.enc.Utf8.parse(“xxx”)var base64 = CryptoJS.enc.Base64.stringify(pw)pm.environment.set(“password”, base64) 4.输入post方法的参数,使用上一步生成的root-password参数在Body的Tab页输入 {“UserName”:”oper”,”RoleId”:”Operator”,”Enabled”:true,”Password”:”{ {password} }”} 5.完成测试代码,确保输出信息中有成功信息在Test的Tab页输入 tests[“create oper “] = responseBody.has(“The resource has been created successfully”); 三、以此类推1.可以对root之外的用户生成token,不同角色的账号权限不同2.POST\GET\PATCH\DELETE,只要是登录状态的用例,都要在Header的X-Auth-Tokentoken项输入对应的用户token]]></content>
<categories>
<category>bmc</category>
</categories>
<tags>
<tag>bmc</tag>
<tag>postman</tag>
</tags>
</entry>
<entry>
<title><![CDATA[一键同步git库和文本中commit号到编译服务器]]></title>
<url>%2F2020%2F05%2F08%2F%E4%B8%80%E9%94%AE%E5%90%8C%E6%AD%A5git%E5%BA%93%E5%92%8C%E6%96%87%E6%9C%AC%E4%B8%ADcommit%E5%8F%B7%E5%88%B0%E7%BC%96%E8%AF%91%E6%9C%8D%E5%8A%A1%E5%99%A8%2F</url>
<content type="text"><![CDATA[经常要将bmcweb的git库同步到编译服务器上,并更新服务器上的commit号,太繁琐,忍无可忍,拼凑了几个脚本,可以实现自动同步git库和更新commit号的功能,记下来,供大家参考。 主体是4个脚本,不会写大脚本,分开写,再合并为一个脚本命令一键执行,所有脚本创建后都要chmod +x *.sh授予执行权限。 脚本及以下操作都在本地的bmcweb目录中进行。 先查看本地bmcweb中.git/config文件配置如下: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = [email protected]:openbmc-v28/github.com.openbmc.bmcweb.git fetch = +refs/heads/*:refs/remotes/origin/* [remote "v28"] url = [email protected]:/home/kunlun/rxsunSource/openbmc-v28/build/downloads/git2/github.com.openbmc.bmcweb.git/ fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [credential] helper = store ```其中的v28远程库对应着编译服务器,origin对应着gitlab开发服务器,这里不用。 第一个脚本01-git-push.sh 是将本地的git库push到服务器上,push的目的地v28,-f选项是强制提交,bios是v28远程库所在机器的用户kunlun的口令 ###01-git-push.sh #!/usr/bin/expect spawn git push v28 master -f expect "password" send "bios\r" expect eof第二个脚本02-scp-from-18.sh 是将v28服务器上的bmcweb_git.bb复制到本地bmcweb目录下 ###02-scp-from-18.sh #!/usr/bin/expect spawn scp [email protected]:/home/kunlun/rxsunSource/openbmc-v28/meta-phosphor/recipes-phosphor/interfaces/bmcweb_git.bb . expect "password" send "bios\r" expect eof第三个脚本03-sed-commitId.sh 是将bmcweb_git.bb中commit号替换为最新的commit号,因为sed不能保存,所以重定向到临时文件再重命名 ###03-sed-commitId.sh #!/bin/bash newCommitId=`git rev-parse HEAD` originCommitId=`cat bmcweb_git.bb | grep SRCREV | gawk -F= '{ print $2}' | sed 's/"//g'` echo change $originCommitId to $newCommitId sed "s/$originCommitId/$newCommitId/g" bmcweb_git.bb > bmcweb_git.bb.tmp mv bmcweb_git.bb.tmp bmcweb_git.bb第四个脚本04-scp-to-18.sh 是将改后的bmcweb_git.bb拷贝到远程服务器上,可以覆盖目的地的同名文件 ###04-scp-to-18.sh #!/usr/bin/expect spawn scp bmcweb_git.bb [email protected]:/home/kunlun/rxsunSource/openbmc-v28/meta-phosphor/recipes-phosphor/interfaces/ expect "password" send "bios\r" expect eof 将以上四个脚本的执行命令写到一个文件里,命名为a.sh ,记得执行chmod +x a.sh ./01-git-push.sh && ./02-scp-from-18.sh && ./03-sed-commitId.sh && ./04-scp-to-18.sh 执行时只要./a.sh就可以完成以前的很多步操作。 使用注意事项: 1.配置本地的.git/config文件,添加编译服务器的目录为远程库; 2.将01-git-push.sh中的“spawn git push v28 master -f”的“v28”改自己的远程库名称; 3.在02-scp-from-18.sh、03-sed-commitId.sh和04-scp-to-18.sh中bb文件的位置和名称,要替换成自己工作文件的位置和名称; 4.将所有send后面的bios替换为自己远程库用户的口令; 5.我的有些服务器可接受客户端公钥文件内容到authorized_keys中,免口令scp,也可以先自己服务器上尝试一下; 6.本地机器上需要有expect包,用apt-get install expect安装。]]></content>
<categories>
<category>git</category>
</categories>
<tags>
<tag>git</tag>
<tag>openbmc</tag>
<tag>bmc</tag>
<tag>build</tag>
<tag>shell</tag>
</tags>
</entry>
<entry>
<title><![CDATA[在.6服务器上改ftpServer配置]]></title>
<url>%2F2019%2F09%2F30%2F%E5%9C%A8-6%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E6%94%B9ftpServer%E9%85%8D%E7%BD%AE%2F</url>
<content type="text"><![CDATA[为bmc在0.6上开一个用户: useradd -d /home/bmc -s /sbin/nologin bmcusermod -g ftpuser bmc以及 zkxiao jdzhang htliu vi /etc/vsftpd/vsftpd.conf主要参数:chroot_local_user=YES —只能访问自己的目录chroot_list_enable=YES 可以跃出自己的目录chroot_list_file=/etc/vsftpd/chroot_list (但是chroot_list 的内容为空)userlist_enable=YES —-写每个用户的固有目录user_config_dir=/etc/vsftpd/userconfig在userconfig目录下 vim zhaoxin 写一行 local_root=/home/zhaoxin同样vim bmc 写一行 local_root=/home/bmc systemctl restart vsftpd 以下是为了改为默认的被动模式:vi /etc/vsftpd/vsftpd.confpasv_enable=YESpasv_min_port=10060pasv_max_port=10090再开放端口[root@kunlunweb userconfig]# firewall-cmd –permanent –zone=public –add-port=10060-10090/tcpsuccess[root@kunlunweb userconfig]# firewall-cmd –reloadsuccess]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>ftp</tag>
</tags>
</entry>
<entry>
<title><![CDATA[为openbmc生成认证文件]]></title>
<url>%2F2019%2F08%2F30%2F%E4%B8%BAopenbmc%E7%94%9F%E6%88%90%E8%AE%A4%E8%AF%81%E6%96%87%E4%BB%B6%2F</url>
<content type="text"><![CDATA[openbmc的新版webui有升级openssl、如何自己创建证书、配置证书到服务器和自建CA。 验证版本kunlun@kunlunsec:$ mkdir certificate_bmckunlun@kunlunsec:$ cd certificate_bmc/kunlun@kunlunsec:~/certificate_bmc$ openssl version -aOpenSSL 1.1.0h 27 Mar 2018 (Library: OpenSSL 1.1.1c 28 May 2019)built on: Fri May 31 12:25:41 2019 UTCplatform: debian-amd64options: bn(64,64) rc4(16x,int) des(int) blowfish(ptr)compiler: gcc -fPIC -pthread -m64 -Wa,–noexecstack -Wall -Wa,–noexecstack -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2OPENSSLDIR: “/usr/lib/ssl”ENGINESDIR: “/usr/lib/x86_64-linux-gnu/engines-1.1” 要求版本大于1.0.1g,本机是OpenSSL 1.1.1c 生成私钥使用命名openssl genrsa -des3 -out private.key 2048其中-des3代表加上了加密,后面的2048是代表生成的密钥的位数kunlun@kunlunsec:~/certificate_bmc$ openssl genrsa -des3 -out private.key 2048Generating RSA private key, 2048 bit long modulus……+++++……………+++++e is 65537 (0x010001)Enter pass phrase for private.key:Verifying - Enter pass phrase for private.key:这里的口令随意输入,比如dddd。 kunlun@kunlunsec:~/certificate_bmc$ ll –查看文件名-rw——- 1 kunlun kunlun 1751 8月 30 15:32 private.key 可见,private.key是个私钥文件。 生成证书请求kunlun@kunlunsec:~/certificate_bmc$ openssl req -new -key private.key -out server.csEnter pass phrase for private.key:You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value, If you enter ‘.’, the field will be left blank.Country Name (2 letter code) [AU]:State or Province Name (full name) [Some-State]:Locality Name (eg, city) []:Organization Name (eg, company) [Internet Widgits Pty Ltd]:Organizational Unit Name (eg, section) []:Common Name (e.g. server FQDN or YOUR name) []:192.168.200.40Email Address []: Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []:An optional company name []: 只有第一个输入口令“dddd”,以及Common Name输入了服务器地址,其它都回车了。 kunlun@kunlunsec:~/certificate_bmc$ ll-rw——- 1 kunlun kunlun 1751 8月 30 15:32 private.key-rw-rw-r– 1 kunlun kunlun 993 8月 30 15:43 server.csr 可见,server.csr是个请求文件。 生成服务器的私钥kunlun@kunlunsec:/certificate_bmc$ openssl rsa -in private.key -out server.keyEnter pass phrase for private.key:writing RSA key口令还是“dddd”kunlun@kunlunsec:/certificate_bmc$ ll-rw——- 1 kunlun kunlun 1751 8月 30 15:32 private.key-rw-rw-r– 1 kunlun kunlun 993 8月 30 15:43 server.csr-rw——- 1 kunlun kunlun 1679 8月 30 15:46 server.key 可见,server.key 是个服务器的私钥文件。 使用私钥为证书请求签名,生成给服务器签署的证书,格式是x509的PEM格式kunlun@kunlunsec:/certificate_bmc$ openssl x509 -req -in server.csr -out server.crt -outform pem -signkey server.key -days 3650Signature oksubject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = 192.168.200.40Getting Private keykunlun@kunlunsec:/certificate_bmc$ ll-rw——- 1 kunlun kunlun 1751 8月 30 15:32 private.key-rw-rw-r– 1 kunlun kunlun 1176 8月 30 15:49 server.crt-rw-rw-r– 1 kunlun kunlun 993 8月 30 15:43 server.csr-rw——- 1 kunlun kunlun 1679 8月 30 15:46 server.key 可见,server.crt是给服务器的签过名的证书文件 将这些文件移动到目录新创建的privateKey中。 因为bmcserver只认可pem证书,而且要用CA证书进行签名,而不是用自己的私钥为证书请求签名,上面生成的server.crt不能用户bmcserver,能用于普通的http等服务器。 下面使用CA.pl创建CA根证书 查找openssl.cnf文件kunlun@kunlunsec:/certificate_bmc$ ll /usr/lib/ssl/总用量 20drwxr-xr-x 3 root root 4096 10月 18 2018 ./drwxr-xr-x 174 root root 12288 8月 8 14:43 ../lrwxrwxrwx 1 root root 14 3月 17 2017 certs -> /etc/ssl/certs/drwxr-xr-x 2 root root 4096 10月 18 2018 misc/lrwxrwxrwx 1 root root 20 5月 12 2018 openssl.cnf -> /etc/ssl/openssl.cnflrwxrwxrwx 1 root root 16 3月 17 2017 private -> /etc/ssl/private/kunlun@kunlunsec:/certificate_bmc$ vim /usr/lib/ssl/openssl.cnf核实default_bits=2048 创建私钥和证书执行./CA.pl -newca命令CA.pl会使用/usr/lib/ssl/openssl.cnf中的配置来创建私钥和证书。创建CA证书过程中,不输入信息,直接回车,填写加密私钥的密码和生成CA证书的相关信息。创建完之后会生成demoCA目录,查看 kunlun@kunlunsec:~/certificate_bmc$ ./CA.pl -newcaCA certificate filename (or enter to create) Making CA certificate …openssl req -new -keyout ./demoCA/private/cakey.pem -out ./demoCA/careq.pemGenerating a 2048 bit RSA private key……………………………………………………………………………….+++++…………+++++writing new private key to ‘./demoCA/private/cakey.pem’Enter PEM pass phrase: Verifying - Enter PEM pass phrase:You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value, If you enter ‘.’, the field will be left blank.Country Name (2 letter code) [AU]:CHINAstring is too long, it needs to be no more than 2 bytes longCountry Name (2 letter code) [AU]:CHState or Province Name (full name) [Some-State]:BEIJINGLocality Name (eg, city) []:BEIJINGOrganization Name (eg, company) [Internet Widgits Pty Ltd]:ZDKJOrganizational Unit Name (eg, section) []:BIOSCommon Name (e.g. server FQDN or YOUR name) []:192.168.200.40Email Address []:[email protected] Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []:ddddAn optional company name []:zdkj ==> 0====openssl ca -create_serial -out ./demoCA/cacert.pem -days 1095 -batch -keyfile ./demoCA/private/cakey.pem -selfsign -extensions v3_ca -infiles ./demoCA/careq.pemUsing configuration from /usr/lib/ssl/openssl.cnfEnter pass phrase for ./demoCA/private/cakey.pem:Can’t open ./demoCA/index.txt.attr for reading, No such file or directory139984384927488:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:72:fopen(‘./demoCA/index.txt.attr’,’r’)139984384927488:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:79:Check that the request matches the signatureSignature okCertificate Details: Serial Number: 8b:a7:7b:6f:f9:07:db:81 Validity Not Before: Aug 30 08:47:46 2019 GMT Not After : Aug 29 08:47:46 2022 GMT Subject: countryName = CH stateOrProvinceName = BEIJING organizationName = ZDKJ organizationalUnitName = BIOS commonName = 192.168.200.40 emailAddress = [email protected] X509v3 extensions: X509v3 Subject Key Identifier: 9B:8F:B3:47:98:55:F8:42:3F:82:F3:C4:EF:55:19:E3:37:D2:AE:85 X509v3 Authority Key Identifier: keyid:9B:8F:B3:47:98:55:F8:42:3F:82:F3:C4:EF:55:19:E3:37:D2:AE:85 X509v3 Basic Constraints: critical CA:TRUECertificate is to be certified until Aug 29 08:47:46 2022 GMT (1095 days) Write out database with 1 new entriesData Base Updated ==> 0CA certificate is in ./demoCA/cacert.pem 输入口令的地方都是“dddd”。 kunlun@kunlunsec:/certificate_bmc$ sudo openssl genrsa -des3 -out private.key 2048Generating RSA private key, 2048 bit long modulus………………….+++++…………………………………………………………………+++++e is 65537 (0x010001)Enter pass phrase for private.key:Verifying - Enter pass phrase for private.key:kunlun@kunlunsec:/certificate_bmc$ sudo openssl req -new -key private.key -out server.csrEnter pass phrase for private.key:You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value, If you enter ‘.’, the field will be left blank.Country Name (2 letter code) [AU]:CHState or Province Name (full name) [Some-State]:BEIJINGLocality Name (eg, city) []:BEIJINGOrganization Name (eg, company) [Internet Widgits Pty Ltd]:ZDKJOrganizational Unit Name (eg, section) []:BIOSCommon Name (e.g. server FQDN or YOUR name) []:192.168.200.40Email Address []:[email protected] Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []:ddddAn optional company name []:zdkj kunlun@kunlunsec:/certificate_bmc$ sudo openssl rsa -in private.key -out server.keyEnter pass phrase for private.key:writing RSA keykunlun@kunlunsec:/certificate_bmc$ cp server.csr newreq.pemkunlun@kunlunsec:~/certificate_bmc$ ll总用量 40drwxrwxr-x 4 kunlun kunlun 4096 8月 30 16:51 ./drwxr-xr-x 54 kunlun kunlun 4096 8月 30 15:28 ../-rwxrwxrwx 1 kunlun kunlun 6754 8月 30 16:00 CA.pl*drwxrwxr-x 6 kunlun kunlun 4096 8月 30 16:47 demoCA/-rw-r–r– 1 kunlun kunlun 1110 8月 30 16:51 newreq.pem-rw——- 1 root root 1751 8月 30 16:50 private.keydrwxrwxr-x 2 kunlun kunlun 4096 8月 30 16:35 privateKey/-rw-r–r– 1 root root 1110 8月 30 16:50 server.csr-rw——- 1 root root 1679 8月 30 16:51 server.key kunlun@kunlunsec:~/certificate_bmc$ ./CA.pl -signopenssl ca -policy policy_anything -out newcert.pem -infiles newreq.pemUsing configuration from /usr/lib/ssl/openssl.cnfEnter pass phrase for ./demoCA/private/cakey.pem:Check that the request matches the signatureSignature okCertificate Details: Serial Number: 8b:a7:7b:6f:f9:07:db:82 Validity Not Before: Aug 30 08:51:43 2019 GMT Not After : Aug 29 08:51:43 2020 GMT Subject: countryName = CH stateOrProvinceName = BEIJING localityName = BEIJING organizationName = ZDKJ organizationalUnitName = BIOS commonName = 192.168.200.40 emailAddress = [email protected] X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: B6:25:F8:1C:62:AC:23:0B:67:C2:E7:56:88:D4:1E:0D:BF:AE:F4:58 X509v3 Authority Key Identifier: keyid:9B:8F:B3:47:98:55:F8:42:3F:82:F3:C4:EF:55:19:E3:37:D2:AE:85 Certificate is to be certified until Aug 29 08:51:43 2020 GMT (365 days)Sign the certificate? [y/n]:y1 out of 1 certificate requests certified, commit? [y/n]yWrite out database with 1 new entriesData Base Updated ==> 0Signed certificate is in newcert.pemkunlun@kunlunsec:~/certificate_bmc$ ll-rwxrwxrwx 1 kunlun kunlun 6754 8月 30 16:00 CA.pl*drwxrwxr-x 6 kunlun kunlun 4096 8月 30 16:52 demoCA/-rw-rw-r– 1 kunlun kunlun 4669 8月 30 16:52 newcert.pem-rw-r–r– 1 kunlun kunlun 1110 8月 30 16:51 newreq.pem-rw——- 1 root root 1751 8月 30 16:50 private.keydrwxrwxr-x 2 kunlun kunlun 4096 8月 30 16:35 privateKey/-rw-r–r– 1 root root 1110 8月 30 16:50 server.csr-rw——- 1 root root 1679 8月 30 16:51 server.key 以上参考了https://blog.csdn.net/pz0605/article/details/51954876]]></content>
</entry>
<entry>
<title><![CDATA[搭建NBD Server的过程]]></title>
<url>%2F2019%2F08%2F28%2F%E6%90%AD%E5%BB%BANBD-Server%E7%9A%84%E8%BF%87%E7%A8%8B%2F</url>
<content type="text"><![CDATA[服务器192.×.×.84,客户端192.×.×.86 在84机器上安装nbd-serversudo apt install nbd-server 创建一个300MB的文件当做块设备/home/kunlun/rxsunSource/tmp下执行dd if=/dev/zero of=nbd-disk0 bs=104857600 count=3 启动nbd-server,监听9999端口,挂载刚刚创建的nbd-disk0设备kunlun@kunlunsec:~/rxsunSource/tmp$ sudo nbd-server 9999 /home/kunlun/rxsunSource/tmp/nbd-disk0 ** (process:22663): WARNING **: Specifying an export on the command line no longer uses the oldstyle protocol.查看nbd端口和进程:kunlun@kunlunsec:~/rxsunSource/tmp$ sudo netstat -antpl | grep 9999 tcp6 0 0 :::9999 :::* LISTEN 13444/nbd-serverkunlun@kunlunsec:~/rxsunSource/tmp$ ps -ef | grep nbd nbd 13444 13922 0 15:46 ? 00:00:00 nbd-server 9999 /home/kunlun/rxsunSource/tmp/nbd-disk0 kunlun 13474 32318 0 15:47 pts/25 00:00:00 grep --color=auto nbd在86机器上sudo apt install nbd-clientmodprobe nbd 载入模块$ lsmod | grep nbd 查看nbd设备是否建立. nbd 20480 0$ ls /dev/nbd* -hl 查看设备 brw-rw---- 1 root disk 43, 0 8月 28 14:02 /dev/nbd0 ......... brw-rw---- 1 root disk 43, 240 8月 28 14:02 /dev/nbd15 ......... brw-rw---- 1 root disk 43, 144 8月 28 14:02 /dev/nbd9$ sudo nbd-client 192.168.200.84 9999 /dev/nbd0 将nbd设备关联到nbd服务器端 Warning: the oldstyle protocol is no longer supported. This method now uses the newstyle protocol with a default export Negotiation: ..size = 300MB bs=1024, sz=314572800 bytes$ ps -ef | grep nbd 查看nbd-client进程. root 4957 1 0 14:04 ? 00:00:00 nbd-client 192.168.200.84 9999 /dev/nbd0 root 4959 2 0 14:04 ? 00:00:00 [nbd0]$ mkdir /mnt/nbd0$ mount /dev/nbd0 /mnt/nbd0 将/dev/nbd0设备挂载到/mnt/nbd0目录下,不理睬提示信息 mount: /dev/nbd0 is write-protected, mounting read-only mount: wrong fs type, bad option, bad superblock on /dev/nbd0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.$ cd /mnt/nbd0/ 进入目录$ touch a.txt 创建一个文件$ ll 验证文件创建成功 total 8 drwxr-xr-x 2 root root 4096 8月 28 14:13 ./ drwxr-xr-x 3 root root 4096 8月 28 14:10 ../ -rw-r--r-- 1 root root 0 8月 28 14:13 a.txt执行以下命令结束nbd设备和连接$ umount /mnt/nbd0/$ nbd-client -d /dev/nbd0 用于断开到nbd server的连接 =====================================================================================================]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>linux</tag>
<tag>nbdserver</tag>
<tag>nbd</tag>
</tags>
</entry>
<entry>
<title><![CDATA[填补openbmc编译过程中的一个坑]]></title>
<url>%2F2019%2F08%2F24%2F%E5%A1%AB%E8%A1%A5openbmc%E7%BC%96%E8%AF%91%E8%BF%87%E7%A8%8B%E4%B8%AD%E7%9A%84%E4%B8%80%E4%B8%AA%E5%9D%91%2F</url>
<content type="text"><![CDATA[编译老版本同方代码: 1.注意要替换为meta-haiguang2的环境变量export TEMPLATECONF=meta-haiguang/meta-haiguang2/conf/ 2.报错pflash的库就是skiboot库 是skiboot中的一部分WARNING: pflash-v6.1-r0 do_fetch: Failed to fetch URL git://github.com/open-power/skiboot.git;nobranch=1, attempting MIRRORS if availableERROR: pflash-v6.1-r0 do_fetch: Fetcher failure: Unable to find revision bb7ae1ade9e06a854771b8ed1e26f7d58b508e84 in branch master even from upstreamERROR: pflash-v6.1-r0 do_fetch: Fetcher failure for URL: ‘git://github.com/open-power/skiboot.git;nobranch=1’. Unable to fetch URL from any source.ERROR: pflash-v6.1-r0 do_fetch: Function failed: base_do_fetchERROR: Logfile of failure stored in: /home/kunlun/rxsunSource/openbmc-origin/build/tmp/work/armv6-openbmc-linux-gnueabi/pflash/v6.1-r0/temp/log.do_fetch.65823ERROR: Task (/home/kunlun/rxsunSource/openbmc-origin/meta-openpower/recipes-bsp/skiboot/pflash.bb:do_fetch) failed with exit code ‘1’一直报错 核实各文件内容的一致性没有问题 3.删掉build下的tmp cache sstate-cache三个临时目录重编译 报错改为fatal: Refusing to fetch into current branch refs/heads/master of non-bare repositoryERROR: pflash-v6.1-r0 do_fetch: Fetcher failure for URL: ‘git://github.com/open-power/skiboot.git;nobranch=1’. Unable to fetch URL from any source.ERROR: pflash-v6.1-r0 do_fetch: Function failed: base_do_fetchERROR: Logfile of failure stored in: /home/kunlun/rxsunSource/openbmc-origin/build/tmp/work/armv6-openbmc-linux-gnueabi/pflash/v6.1-r0/temp/log.do_fetch.10559ERROR: Task (/home/kunlun/rxsunSource/openbmc-origin/meta-openpower/recipes-bsp/skiboot/pflash.bb:do_fetch) failed with exit code ‘1’ 4.发现问题所在分析上面的fatal提示发现download里除了我克隆下来github.com.open-power.skiboot,还多出来一个 github.com.open-power.skiboot.git,但是这里没有refs/heads/master文件,结合报错提示,想到可能是编译程序试图构建一个带.git后缀的目录失败.也就是git库的目录名称错了,干脆把目录重命名.不知道为什么以前不报这个错?目前为止,已知的bmcweb.git webui.git skiboot.git 一共有三个库是带.git后缀的,其它不用. 5.还发现一个问题当报错的时候 试图通过gitSource 里的源代码pull origin 再push到local的做法是行不通的 ,除非用shell脚本先检查该库是否还存在, 因为刚刚的出错行为会删掉这个库 .这种情况还需要用. openbmc-env重新生成conf目录 6.事后分析查找文件bitbake/lib/bb/tests/fetch.py中有一行代码:self.git(‘update-ref refs/heads/master refs/heads/master~1’, cwd=ud.clonedir)应该就是这个操作导致的,大概bitbake认为不带.git后缀的库不是bare 仓库.可是其它不带.git后缀的库为什么能编译过去呢,还是skiboot这个库的配置文件有什么特别的?以及webui库的配置文件?这些代码需要仔细研究. =====================================================================================================]]></content>
<categories>
<category>bmc</category>
</categories>
<tags>
<tag>openbmc</tag>
<tag>bmc</tag>
<tag>build</tag>
<tag>bitbake</tag>
</tags>
</entry>
<entry>
<title><![CDATA[自动化构建工具的需求描述]]></title>
<url>%2F2019%2F08%2F23%2F%E8%87%AA%E5%8A%A8%E5%8C%96%E6%9E%84%E5%BB%BA%E5%B7%A5%E5%85%B7%E7%9A%84%E9%9C%80%E6%B1%82%E6%8F%8F%E8%BF%B0%2F</url>
<content type="text"><![CDATA[一.环境:1.gitlab代码库是中心代码服务器2.编译服务器bmcCompileBak的openbmc/build/downloads/git2目录下是裸库3.编译服务器bmcCompileBak的gitSource目录下是源代码,源代码库里的每一个.git/config文件中都有两个remote push地址,一个是缺省的master,指向中心代码库,另一个是手工增加的,命名为local,指向openbmc/build/downloads/git2里对应的裸库地址 二.思路1.开发机器,例如kunlunsec上的改动能通过192.168.120.200中心代码服务器同步到编译服务器bmcCompileBak上的源代码库里2.编译服务器bmcCompileBak上同步后的源代码库能推送(git push)到编译服务器bmcCompileBak下的/home/kunlun/rxsunSource/openbmc/build/downloads/git2 三.所需要参数:1.一级版本: 如下文中的meta-haiguang2.二级版本: 如下文中的meta-haiguang13.一个数组input_repo[]: 库名repo_name;分支名branch_name; 提交号commit_id; 文件名file_name; 四.代码同步的脚本在编译服务器的gitSource目录下,循环数组input_repo cd input_repo[i].repo_name git pull origin input_repo[i].branch_name git push local input_repo[i].branch_name cd ..五.传递commit变更的脚本在编译服务器的openbmc目录下,循环数组input_repo修改file_name,如meta-phosphor/recipes-phosphor/datetime/phosphor-time-manager_git.bb 中的两个参数:KBRANCH ?= input_repo[i].branch_nameSRCREV = input_repo[i].commit_id 六.构建的脚本在openbmc目录下运行这个sh文件: cd build rm conf/ -rf export TEMPLATECONF=meta-haiguang/meta-haiguang1/conf/ cd .. . openbmc-env bitbake obmc-phosphor-image 七.传到服务器的脚本要将地址路径和日期作为参数传入. lftp 192.168.200.*** cd rxsun/openbmc-v28 mput ~/rxsunSource/openbmc-v28/build/tmp/deploy/images/haiguang1/obmc-phosphor-image-haiguang1-20190822*.static.mtd . exit lftp bmc:***@192.168.120.*** cd openbmc/tmp/rxsun/openbmc-v28 mput ~/rxsunSource/openbmc-v28/build/tmp/deploy/images/haiguang1/obmc-phosphor-image-haiguang1-20190822*.static.mtd . exit=====================================================================================================]]></content>
<categories>
<category>bmc</category>
</categories>
<tags>
<tag>openbmc</tag>
<tag>bmc</tag>
<tag>build</tag>
</tags>
</entry>
<entry>
<title><![CDATA[Redhat上openbmc构建步骤]]></title>
<url>%2F2019%2F08%2F22%2FRedhat%E4%B8%8Aopenbmc%E6%9E%84%E5%BB%BA%E6%AD%A5%E9%AA%A4%2F</url>
<content type="text"><![CDATA[redhat7 自带git 生成公钥并放到git服务器上ssh-keygencat ~/.ssh/id_rsa.pub 拷贝到gitlab服务器的用户ssh key下 克隆openbmc构建所用的库mkdir ~/rxsunSourcecd rxsunSourcegit clone [email protected].*.200:openbmc/openbmc.gitcd openbmc 准备构建,报缺少python3的错,根据错误提示,总结出需要提前安装以下支撑软件 yum -y install http://mirror.centos.org/centos/7/os/x86_64/Packages/libffi-devel-3.0.13-18.el7.x86_64.rpm yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ zlib* yum install sqlite3 yum install sqlite-devel.x86_64 yum install chrpath.x86_64 yum install texinfo再装python3.7 mkdir ~/rxsunTools cd rxsunTools wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz tar -xzvf Python-3.7.4.tgz cd Python-3.7.4 ./configure make make install ln -s /home/rxsunTools/Python-3.7.4/python /usr/bin/python3命令行执行python3 ,看到版本为python3.7.4 继续构建步骤:在openbmc/build下1.创建目录dowonloads/git2 拷贝裸库2.删除原来的配置文件目录 rm conf/ -rf 只有环境变量改变 就要删除3.设置环境变量 export TEMPLATECONF=meta-haiguang/meta-haiguang1/conf/4.生成配置文件目录 在openbmc下 . openbmc-env 会生成conf目录5.自动进入build目录,执行 bitbake obmc-phosphor-image —不能是root用户 往dowonloads/git2 拷贝裸库 一般会用git clone –bare命令,比较慢, 最好用scp命令,这需要解决口令问题:在120.200上 vim /.ssh/authorized_keys 将刚刚ssh-keygen生成的/.ssh/id_rsa.pub内容拷贝到末尾,即可无口令拷贝 =====================================================================================================]]></content>
<categories>
<category>bmc</category>
</categories>
<tags>
<tag>linux</tag>
<tag>openbmc</tag>
<tag>bmc</tag>
<tag>redhat</tag>
</tags>
</entry>
<entry>
<title><![CDATA[Redhat7.5新机器开箱记]]></title>
<url>%2F2019%2F08%2F21%2FRedhat7-5%E6%96%B0%E6%9C%BA%E5%99%A8%E5%BC%80%E7%AE%B1%E8%AE%B0%2F</url>
<content type="text"><![CDATA[改ip地址:192.168.0.18用cat /etc/sysconfig/network-scripts/ifcfg-em1 查看修改结果在工作机器上 ssh [email protected]@192.168.0.18‘s password:[root@localhost ~]#passwd 改root口令[root@localhost ~]# hostnamectl status –查看机器名 Static hostname: localhost.localdomain Icon name: computer-server Chassis: server Machine ID: ***************** Boot ID: ***************** Operating System: Red Hat Enterprise Linux Server 7.5 (Maipo) CPE OS Name: cpe:/o:redhat:enterprise_linux:7.5:GA:server Kernel: Linux 3.10.0-862.el7.x86_64 Architecture: x86-64 [root@localhost ~]# cat /proc/cpuinfo –看cpu[root@localhost ~]# cat /proc/meminfo –看内存[root@localhost ~]# hostnamectl set-hostname bmcCompileMst —改机器名[root@localhost ~]# cat /etc/hostnamebmccompilemst登出,再进入[root@bmccompilemst ~]# cat /proc/scsi/scsi —查看raid5 不知道什么意思Attached devices:Host: scsi0 Channel: 02 Id: 00 Lun: 00 Vendor: DELL Model: PERC H730P Mini Rev: 4.29 Type: Direct-Access ANSI SCSI revision: 05Host: scsi10 Channel: 00 Id: 00 Lun: 00 Vendor: HL-DT-ST Model: DVD+-RW GTA0N Rev: A3C0 Type: CD-ROM ANSI SCSI revision: 05[kunlun@bmccompilemst openbmc]$ cat /etc/os-release –看os版本 NAME="Red Hat Enterprise Linux Server" VERSION="7.5 (Maipo)" ID="rhel" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="7.5" PRETTY_NAME="Red Hat Enterprise Linux Server 7.5 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.5:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.5 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.5"[kunlun@bmccompilemst openbmc]$useradd -d /home/kunlun -m -s /bin/bash kunlun –增加用户[kunlun@bmccompilemst openbmc]$vim /etc/sudoers 权限不够 给kunlun用户加管理权限 –失败[root@bmccompilemst ~]# ll /etc/sudoers-r–r—–. 1 root root 3938 11月 30 2017 /etc/sudoers[root@bmccompilemst ~]# chmod u+w /etc/sudoers —给sudoers文件加w的权限[root@bmccompilemst ~]# passwd –改口令[root@bmccompilemst ~]# vim /etc/sudoers[root@bmccompilemst ~]# chmod u-w /etc/sudoers 取消sudoers文件w权限在root行下增加kunlun用户:root ALL=(ALL) ALLkunlun ALL=(ALL) ALL 以下处理yum源的问题,因为redhat源是收费的,网上建议用阿里云的[root@bmccompilemst ~]# mkdir /home/yum/ 并进入[kunlun@bmccompilemst yum]$ rpm -qa | grep yum yum-langpacks-0.4.2-7.el7.noarch yum-3.4.3-158.el7.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-utils-1.1.31-45.el7.noarch PackageKit-yum-1.1.5-1.el7.x86_64 yum-rhn-plugin-2.0.1-10.el7.noarch[kunlun@bmccompilemst yum]$ sudo su[sudo] kunlun 的密码:[root@bmccompilemst yum]# rpm -qa | grep yum | xargs rpm -e –nodeps –删除yum从阿里云下载yum需要的软件: wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-50.el7.noarch.rpm wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm[root@bmccompilemst yum]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”[root@bmccompilemst yum]# vim /etc/yum.repos.d/CentOS-Base.repo:%s/$releasever/7/g —将$releasever替换为7 [root@bmccompilemst yum]# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-utils-1.1.31-50.el7.noarch.rpm yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm python-urlgrabber-3.10-9.el7.noarch.rpm –force –nodeps yum 可用了,再执行一下命令yum clear allyum makecacheyum update =====================================================================================================]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>linux</tag>
<tag>redhat</tag>
</tags>
</entry>
<entry>
<title><![CDATA[虚拟机硬盘扩容步骤]]></title>
<url>%2F2019%2F08%2F21%2F%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%A1%AC%E7%9B%98%E6%89%A9%E5%AE%B9%E6%AD%A5%E9%AA%A4%2F</url>
<content type="text"><![CDATA[昨天看到80.82机器上的运行redmine服务器的虚拟机rxsunweb的空间不够,原来创建的时候只有30G,太小.依次执行以下步骤进行扩容. 1.先关闭虚拟机2.为了确保虚拟机的安全,另存一份进行操作.拷贝rxsunweb虚拟机 从C:\Users\Administrator\VirtualBox VMs\rxsunweb到D:\virtualBox_redmine\rxsunweb3.到虚拟机窗口的设置-存储-控制器菜单中添加一个磁盘文件 100G ,文件名为D:\virtualBox_redmine\rxsunweb\redmine_disk_2.vdi,原来的D:\virtualBox_redmine\rxsunweb\rxsunweb-disk2.vmdk 只有30G左右4.启动虚拟机,进去看df –h 5.fdisk -l查看新硬盘/dev/sdb 已经识别到 6.对新硬盘分区fdisk /dev/sdb依次输入: n #新分区 p #选择分区类型 t #更改分区类型 Hex code (type L to list codes): 8e w #保存分区结果7.让系统重新读取分区表:# partprobe /dev/sdb8.创建物理卷(PV) # pvcreate /dev/sdb19.查看物理卷信息: pvdisplay10.将pv加到vg中 vgextend cl /dev/sdb111.将所有剩余空间全部划入LV lvextend -l +100%FREE /dev/mapper/cl-root12.最后一步 关键是最后一步 用 xfs_growfs /dev/mapper/cl-root 然后df –h 看到根目录空间已经变大 以上虚拟机扩容及挂载 参考了https://yq.aliyun.com/articles/486074最后一步参考了https://blog.csdn.net/qq_33932782/article/details/76612965 启动redmine83机器上 cd /usr/local/redmine执行启动redmine 的命令: ruby script/rails server webrick –e developmentsystemctl stop firewalld 关闭防火墙参考了https://blog.csdn.net/Honnyee/article/details/81535464的firewalld命令 后来发现直接在虚拟机里关闭防火墙最简单 从其它机器上访问83机器的3000端口,可看到redmine页面,操作成功. =====================================================================================================]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>linux</tag>
<tag>disk</tag>
<tag>virtulbox</tag>
</tags>
</entry>
<entry>
<title><![CDATA[使用git支撑构建过程之代码同步]]></title>
<url>%2F2019%2F08%2F17%2F%E4%BD%BF%E7%94%A8git%E6%94%AF%E6%92%91%E6%9E%84%E5%BB%BA%E8%BF%87%E7%A8%8B%E4%B9%8B%E4%BB%A3%E7%A0%81%E5%90%8C%E6%AD%A5%2F</url>
<content type="text"><![CDATA[环境说明:中心代码库在192.168.120.200的gitlab上,以刚刚克隆下来的tttt库为例开发机器kunlunsec,用来修改tttt库的代码编译服务器bmcCompileBak,其中的目录/home/kunlun/rxsunSource/gitSource是用来存放源代码库的,目录/home/kunlun/rxsunSource/openbmc/build/downloads/git2是为构建工具准备的裸库存放的位置. 试验目标:1.开发机器kunlunsec上的改动能通过192.168.120.200服务器同步到编译服务器bmcCompileBak上的源代码库里2.编译服务器bmcCompileBak上同步后的源代码库能推送(git push)到编译服务器bmcCompileBak本地的构建目录下/home/kunlun/rxsunSource/openbmc/build/downloads/git2 基本思路:在编译服务器bmcCompileBak的源代码库/home/kunlun/rxsunSource/gitSource/tttt中设置两个remote仓库,一个是中心代码库192.168.120.200上的tttt.git裸库,命名为origin,另一个是/home/kunlun/rxsunSource/openbmc/build/downloads/git2里的tttt.git裸库,命名为local.然后从origin拉取(git pull)代码变更,推送(git push)到local上. 步骤一:在编译服务器bmcCompileBak上克隆源代码库和裸库到各自的目的地克隆下来试验用的源代码库,在home/kunlun/rxsunSource/gitSource下cd /home/kunlun/rxsunSource/gitSourcegit clone [email protected]:qa/tttt.git 到存放所有的裸库的文件夹,克隆裸库下来.cd /home/kunlun/rxsunSource/openbmc/build/downloads/git2/git clone –bare [email protected]:qa/tttt.git这里的库是为构建所用的. 步骤二:在编译服务器bmcCompileBak上为源代码库添加第二个远程库,就是刚刚克隆下来的裸库进入目录 cd /home/kunlun/rxsunSource/gitSource/tttt/git remote add local /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git查看一下,第一种是命令行查看,第二种是查看config文件,看到增加了一个名为”local”的远程库 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git remote local origin kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = [email protected]:qa/tttt.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [remote "local"] url = /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git fetch = +refs/heads/*:refs/remotes/local/*步骤三:在开发机kunlunsec上模拟开发过程中两个分支的代码提交换到开发机kunlunsec上tttt进行操作并提交 kunlun@kunlunsec:~/tmp$ git clone [email protected]:qa/tttt.git 正克隆到 'tttt'... 接收对象中: 100% (20/20), 完成. 检查连接... 完成。 kunlun@kunlunsec:~/tmp$ cd tttt/ kunlun@kunlunsec:~/tmp/tttt$ ll -rw-rw-r-- 1 kunlun kunlun 21 8月 17 18:55 a.txt查看当前分支 kunlun@kunlunsec:~/tmp/tttt$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/test 为master分支添加文件b.txt,并commit,push kunlun@kunlunsec:~/tmp/tttt$ touch b.txt kunlun@kunlunsec:~/tmp/tttt$ echo "test next remote repo">b.txt kunlun@kunlunsec:~/tmp/tttt$ cat b.txt test next remote repo kunlun@kunlunsec:~/tmp/tttt$ git add . kunlun@kunlunsec:~/tmp/tttt$ git commit -m "next remote test" [master 310edf3] next remote test 1 file changed, 1 insertion(+) create mode 100644 b.txt kunlun@kunlunsec:~/tmp/tttt$ git push切换到tttt库的另一个分支test,模拟实际开发中的另一个厂商代码: kunlun@kunlunsec:~/tmp/tttt$ git checkout test 分支 test 设置为跟踪来自 origin 的远程分支 test。 切换到一个新分支 'test' kunlun@kunlunsec:~/tmp/tttt$ git branch -a master * test remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/test kunlun@kunlunsec:~/tmp/tttt$ ll 总用量 16 drwxrwxr-x 4 kunlun kunlun 4096 8月 17 19:03 ./ drwxrwxr-x 3 kunlun kunlun 4096 8月 17 18:55 ../ -rw-rw-r-- 1 kunlun kunlun 0 8月 17 19:03 ddd.txt看到test分支下的文件与master分支的文件是不同的.为test分支添加文件eee.txt,并commit,push kunlun@kunlunsec:~/tmp/tttt$ echo "another file to test branch">eee.txt kunlun@kunlunsec:~/tmp/tttt$ cat eee.txt another file to test branch kunlun@kunlunsec:~/tmp/tttt$ git add . kunlun@kunlunsec:~/tmp/tttt$ git commit -m "another file to test branch" [test d983cbf] another file to test branch 1 file changed, 1 insertion(+) create mode 100644 eee.txt kunlun@kunlunsec:~/tmp/tttt$ git push以上操作是在tttt库的master分支上增加了文件b.txt,在test分支上增加了文件eee.txt,并推送到192.168.120.200中心代码服务器上. 步骤四:在bmcCompileBak编译服务器上依次拉取master分支和test分支的代码回到bmcCompileBak编译服务器上 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git branch -a //查看当前分支 * master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/test kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git pull origin master //与名为origin的远程库,即192.168.120.200中心代码服务器同步master分支的代码 From 192.168.120.200:qa/tttt * branch master -> FETCH_HEAD Updating fce3d3b..310edf3 Fast-forward b.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 b.txt kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ ll //看到新增加的b.txt文件被同步下来 total 24 drwxrwxr-x 4 kunlun kunlun 4096 8月 17 19:24 ./ drwxrwxr-x 8 kunlun kunlun 4096 8月 17 18:32 ../ -rw-rw-r-- 1 kunlun kunlun 21 8月 17 18:29 a.txt -rw-rw-r-- 1 kunlun kunlun 22 8月 17 19:24 b.txt再同步test分支的代码 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git pull origin test //这时git给出一个merge操作,确定 remote: Counting objects: 6, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From 192.168.120.200:qa/tttt * branch test -> FETCH_HEAD 2f18328..d983cbf test -> origin/test Merge made by the 'recursive' strategy. ddd.txt | 0 eee.txt | 1 + 2 files changed, 1 insertion(+) create mode 100644 ddd.txt create mode 100644 eee.txt查看log,发现本地库里包括了在开发机器上两个分支上的提交,并记录了刚刚的合并动作 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git log commit 9d816d31f5244890927ab1c3b5a846a5bcb651ca Merge: 310edf3 d983cbf Author: rxsun <[email protected]> Date: Sat Aug 17 19:24:52 2019 +0800 Merge branch 'test' of 192.168.120.200:qa/tttt commit d983cbf670c31d58cde88da7371f71a6bad7f846 Author: rxsun <“[email protected]> Date: Sat Aug 17 19:21:44 2019 +0800 another file to test branch commit 310edf371ad05051308aa49601d709064403909e Author: rxsun <“[email protected]> Date: Sat Aug 17 18:56:55 2019 +0800 next remote test查看工作区状态,当前工作区是干净的 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git status On branch master Your branch is ahead of 'origin/master' by 3 commits. (use "git push" to publish your local commits) nothing to commit, working directory clean确认当前所在的分支,还是master kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/test查看本地文件,包括了master分支的a.txt,b.txt, 以及test分支的ddd.txt和eee.txt. kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ ll drwxrwxr-x 4 kunlun kunlun 4096 8月 17 19:24 ./ drwxrwxr-x 8 kunlun kunlun 4096 8月 17 18:32 ../ -rw-rw-r-- 1 kunlun kunlun 21 8月 17 18:29 a.txt -rw-rw-r-- 1 kunlun kunlun 22 8月 17 19:24 b.txt -rw-rw-r-- 1 kunlun kunlun 0 8月 17 19:24 ddd.txt -rw-rw-r-- 1 kunlun kunlun 28 8月 17 19:24 eee.txt可见,在master分支上, git pull origin master和 git pull origin test 都执行的话,会将test分支的内容也拉取到master分支里面 ,这明显不符合要求. 回退到拉取代码之前的commit号 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git reset --hard fbf549d38c71d56171a2cb23cfc4a5218953e943 这是本次操作之前的一个commit号查看当前内容 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ ll -rw-rw-r-- 1 kunlun kunlun 16 8月 17 19:58 a.txt就回到了本次拉取操作之前的状态 步骤五:在bmcCompileBak编译服务器上只拉取master分支只同步master分支,查看结果,这个结果是符合预期的 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git pull origin master kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ ll -rw-rw-r-- 1 kunlun kunlun 21 8月 17 20:00 a.txt -rw-rw-r-- 1 kunlun kunlun 22 8月 17 20:00 b.txt步骤六:在bmcCompileBak编译服务器上将master分支推送到local的远程仓库里master分支上执行push,推送的目的地是本地的名为local的远程仓库里master分支上,就是步骤一中克隆下来的裸库/home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git push local master Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 336 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git fce3d3b..310edf3 master -> master进入裸库看一下branch和log,已经同步成功 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ cd /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git kunlun@bmcCompileBak:~/rxsunSource/openbmc/build/downloads/git2/tttt.git$ git branch -a * master test kunlun@bmcCompileBak:~/rxsunSource/openbmc/build/downloads/git2/tttt.git$ git log commit 310edf371ad05051308aa49601d709064403909e Author: rxsun <“[email protected]> Date: Sat Aug 17 18:56:55 2019 +0800 next remote test步骤七:在bmcCompileBak编译服务器上同步origin的远程仓库里test分支变化源代码库里再回到tttt的源代码库里,切换到tset分支. kunlun@bmcCompileBak:cd ~/rxsunSource/gitSource/tttt kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git checkout test Branch test set up to track remote branch test from origin. Switched to a new branch 'test' kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ ll -rw-rw-r-- 1 kunlun kunlun 0 8月 17 20:06 ddd.txt -rw-rw-r-- 1 kunlun kunlun 28 8月 17 20:06 eee.txt发现这种checkout操作会自动拉下远程origin仓库test分支的所有内容. 复习一下,origin和local远程库的地址,origin是中心代码库,在192.168.120.200上,local在bmcCompileBak编译服务器上,是供构建使用的 [remote "origin"] url = [email protected]:qa/tttt.git [remote "local"] url = /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git步骤八:在bmcCompileBak编译服务器上同步test分支的变化到local的远程仓库里test分支上将源代码库里test分支的内容push到本地的名为local的远程仓库里test分支上 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ git push local test Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 355 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git 2f18328..d983cbf test -> test查看当前分支 kunlun@bmcCompileBak:~/rxsunSource/gitSource/tttt$ cd /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git kunlun@bmcCompileBak:~/rxsunSource/openbmc/build/downloads/git2/tttt.git$ git branch -a * master test试图在裸库里切换到test分支,发现不能操作,这种方法没法验证test分支是否被推送上来了. kunlun@bmcCompileBak:~/rxsunSource/openbmc/build/downloads/git2/tttt.git$ git checkout test fatal: This operation must be run in a work tree步骤九:在bmcCompileBak编译服务器上验证test分支的变化被推送到了local远程仓库在bmcCompileBak编译服务器上,到另一个目录再clone一份test分支的内容,从/home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git ,看看结果 kunlun@bmcCompileBak:~/rxsunSource$ mkdir tmp kunlun@bmcCompileBak:~/rxsunSource$ cd tmp kunlun@bmcCompileBak:~/rxsunSource/tmp$ git clone /home/kunlun/rxsunSource/openbmc/build/downloads/git2/tttt.git Cloning into 'tttt'... done. kunlun@bmcCompileBak:~/rxsunSource/tmp$ cd tttt/ kunlun@bmcCompileBak:~/rxsunSource/tmp/tttt$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/test kunlun@bmcCompileBak:~/rxsunSource/tmp/tttt$ git checkout test Branch test set up to track remote branch test from origin. Switched to a new branch 'test' kunlun@bmcCompileBak:~/rxsunSource/tmp/tttt$ ll -rw-rw-r-- 1 kunlun kunlun 0 8月 17 20:14 ddd.txt -rw-rw-r-- 1 kunlun kunlun 28 8月 17 20:14 eee.txt结果是符合预期的,证明test分支到local远程库的推送是成功的. 总结:编译服务器bmcCompileBak上的源代码库可以设置两个远程仓库,一个对应着中心代码库,从这里拉取下来代码,另一个对应着本地的构建代码库,推送代码到这个库.并且,可以实现不同分支的拉取和推送.这种机制是能够为构建服务的. =====================================================================================================]]></content>
<categories>
<category>bmc</category>
</categories>
<tags>
<tag>git</tag>
<tag>openbmc</tag>
<tag>build</tag>
</tags>
</entry>
<entry>
<title><![CDATA[openBmcCompileSecond]]></title>
<url>%2F2019%2F08%2F16%2FopenBmcCompileSecond%2F</url>
<content type="text"><![CDATA[构建openbmc另一个厂商的Release版本一、识别厂商和改动的库需要搞清楚哪个库的修改的commit号在哪里改,开发人员都已经在openbmc.git库里面改好,只有webui需要手工改,位置在:vim meta-haiguang/meta-haiguang2/recipes-phosphor/webui/phosphor-webui_git.bb,其中 meta-haiguang2 是本次将要构建的厂商版本 另外已知有温控git库做了改动, 它的修改 vim meta-phosphor/classes/skeleton-rev.bbclass可以看到,开发人员已经改好. 二、更新改动的库要删掉downloads/git2下面的webui和skeleton库,再git clone –bare 一下还是选择在本地 rxsunSource/git下克隆一个源代码库 加一个remote为 downloads/git2下的库名称 ,push这里,为构建所用. 三、开始构建在build下 export TEMPLATECONF=meta-haiguang/meta-haiguang2/conf/ rm conf/ -rf在openbmc下 . openbmc-env 会生成conf目录 cd conf vim local.conf 看一下 git pull //获取开发人员对bitbake所用的.bb及.bbclass文件的修改git tag -a v0.16.1 -m “Release v0.16 for tongfang” //打tag 变动不大,注释上厂商名称git status //看到刚刚改的webui的bb文件git add ,git commit 在build下,执行bitbake obmc-phosphor-image 四、构建报错:找不到phosphor-hwmon库 ERROR: phosphor-hwmon-1.0+gitAUTOINC+7509bffc35-r1 do_fetch: Fetcher failure: Unable to find revision 7509bffc35ba141844d645533e0628ddd105551a in branch master even from upstream ERROR: phosphor-hwmon-1.0+gitAUTOINC+7509bffc35-r1 do_fetch: Fetcher failure for URL: 'git://github.com/openbmc/phosphor-hwmon'. Unable to fetch URL from any source. ERROR: phosphor-hwmon-1.0+gitAUTOINC+7509bffc35-r1 do_fetch: Function failed: base_do_fetch ERROR: Logfile of failure stored in: /home/kunlun/rxsunSource/openbmc/build/tmp/work/armv6-openbmc-linux-gnueabi/phosphor-hwmon/1.0+gitAUTOINC+7509bffc35-r1/temp/log.do_fetch.26476 ERROR: Task (/home/kunlun/rxsunSource/openbmc/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb:do_fetch) failed with exit code '1'是因为改了这个库,bb文件已经修改,但是在本地的downloads/git2下没有找到里面的commit号,没有同步导致的,编译不过.查看downloads/git2下该库已经被删掉了 ,再git clone –bare 到downloads/git2 里面.在build下,执行bitbake obmc-phosphor-image又报错,是因为名字不该有.git后缀. 重命名为没有.git后缀的目录,回到build下,执行bitbake obmc-phosphor-image, 五、又报错还是找不到库,这次是内核linux库 ERROR: linux-aspeed-4.18.16+gitAUTOINC+72fbc47ed6-r0 do_fetch: Fetcher failure: Unable to find revision 72fbc47ed6c682c9ef362f622336221031dddf8d in branch dev-4.18 even from upstream ERROR: linux-aspeed-4.18.16+gitAUTOINC+72fbc47ed6-r0 do_fetch: Fetcher failure for URL: 'git://github.com/openbmc/linux;protocol=git;branch=dev-4.18'. Unable to fetch URL from any source. ERROR: linux-aspeed-4.18.16+gitAUTOINC+72fbc47ed6-r0 do_fetch: Function failed: base_do_fetch ERROR: Logfile of failure stored in: /home/kunlun/rxsunSource/openbmc/build/tmp/work/haiguang2-openbmc-linux-gnueabi/linux-aspeed/4.18.16+gitAUTOINC+72fbc47ed6-r0/temp/log.do_fetch.11230 ERROR: Task (/home/kunlun/rxsunSource/openbmc/meta-aspeed/recipes-kernel/linux/linux-aspeed_git.bb:do_fetch) failed with exit code '1'linux库有了变动 ,因为改了温控,是内核的,导致编译时间很久.scp 后 重命名为没有.git后缀的目录,回到build下重新 执行bitbake obmc-phosphor-image,成功. 六、构建后测试发现错误开发人员提交修改的库,已经修改bb文件,只需要删掉后重新git clone –bare 并改名去掉.git编译报错 ERROR: /home/kunlun/rxsunSource/openbmc/meta/recipes-core/os-release/os-release.bb: Error executing a python function in <code>: --:--:-- The stack trace of python calls that resulted in this exception/failure was: File: '<code>', lineno: 12, function: <module> 0008:__anon_35__home_kunlun_rxsunSource_openbmc_meta_classes_devshell_bbclass(d) 0009:__anon_105__home_kunlun_rxsunSource_openbmc_meta_classes_sstate_bbclass(d) 0010:__anon_20__home_kunlun_rxsunSource_openbmc_meta_classes_blacklist_bbclass(d) 0011:__anon_50__home_kunlun_rxsunSource_openbmc_meta_classes_allarch_bbclass(d) *** 0012:__anon_28__home_kunlun_rxsunSource_openbmc_meta_phosphor_recipes_core_os_release_os_release_bbappend(d) File: '/home/kunlun/rxsunSource/openbmc/meta-phosphor/recipes-core/os-release/os-release.bbappend', lineno: 23, function: __anon_28__home_kunlun_rxsunSource_openbmc_meta_phosphor_recipes_core_os_release_os_release_bbappend 0019: d.setVar('VERSION_ID', version_id) 0020: versionList = "rc" 0021: versionList = version_id.split('-') 0022: version = versionList[0] + "-" + versionList[1] *** 0023: d.setVar('VERSION', version) 0024: 0025: build_id = run_git(d, 'describe --abbrev=0') 0026: if build_id: 0027: d.setVar('BUILD_ID', build_id) Exception: IndexError: list index out of range ERROR: Failed to parse recipe: /home/kunlun/rxsunSource/openbmc/meta/recipes-core/os-release/os-release.bb解决办法,回退openbmc库到之前某个版本git reset –hard 到 8f0bc988f7924e11899d64b48290a2bdad62891d ,再git pullbitbake又报错git status add commit –可能还是打tag引起的问题,有时间修改一下这个文件再bitbake 六、总结学会读openbmc里面的变更中提到的库名,及时同步更新.最好还是建立一个本地库,否则被删除后只能重新scp ,而本地库可以只git pull变更的内容,然后再push到到底的裸库中.编译某个版本之前要在群里先问一下谁改动了哪个库,编译好后要发给相关开发人员,让各个人分别验证一下添加远程库可以用命令行:git remote add local ~/rxsunSource/openbmc/build/downloads/git2/github.com.openbmc.phosphor-webui.git =====================================================================================================]]></content>
<categories>
<category>bmc</category>
</categories>
<tags>
<tag>openbmc</tag>
<tag>bmc</tag>
<tag>build</tag>
<tag>bitbake</tag>
</tags>
</entry>
<entry>
<title><![CDATA[openBmcCompileProcess]]></title>
<url>%2F2019%2F08%2F16%2FopenBmcCompileProcess%2F</url>
<content type="text"><![CDATA[在ubuntu server16.04上构建openbmc的Release版本一、基本过程服务器环境准备好,用bitbake编译远程和本地的git库,维护各个git库将要被编入的commit号。 二、环境准备工作bmcCompileBak上装ubuntu server16.04,所有服务器选项都勾上,配好网络地址。为了运行bitbake,要先安装build-essential,这需要先apt update和 upgrade。 三、资料准备 新建目录openbmc,在openbmc下 mkdir donwlowds ,在donwlowds下mkdir git2用scp命令将本地gitlab服务器上openbmc组里除了“openbmc.git”以外的git库全部拷贝到git2目录下,这一步相当于git clone –bare,都是拷贝裸库的文件。以后如果某个git库有变化,都要先删除它,再从gitlab服务器上 git clone –bare 一下,或者git pull一次。回到openbmc目录下 git clone openbmc.git ,这次克隆的是源代码,是要修改的。 四、第一次构建在openbmc目录下export TEMPLATECONF=meta-haiguang/meta-haiguang1/conf/在openbmc下,执行. openbmc-env命令,会生成conf目录,可以cd conf进去, vim local.conf 看一下也会生成build目录,cd 到此目录下 执行bitbake obmc-phosphor-image ,注意,不能是root用户 五、编译过程中的问题一ERROR: phosphor-webui-1.0+gitAUTOINC+aacd2a572a-r1 do_fetch: Fetcher failure: Unable to find revision aacd2a572a36abc511da08b9a7b671e1265f7299 in branch master even from upstream是找不到某个分支上的某个commit号,打开我们准备编译的版本中的这个文件,vim meta-haiguang/meta-haiguang1/recipes-phosphor/webui/phosphor-webui_git.bb改分支和commit号为正确的值。 六、编译过程中的问题二ERROR: pflash-v6.1-r0 do_fetch: Fetcher failure: Unable to find revision bb7ae1ade9e06a854771b8ed1e26f7d58b508e84 in branch master even from upstream ERROR: obmc-phosphor-image-1.0-r0 do_generate_static: Error executing a python function in exec_python_func() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:do_generate_static(d) 好像是python环境没有 ubuntu server16.04 默认装2.7和3.5 切换一下就行 alias python=python3 也可以 echo alias python=python3 >> /home/kunlun/.bashrc source /home/kunlun/.bashrc执行bitbake obmc-phosphor-image ,仍然不对,再读错误信息,是找不到文件u-boot.bin Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/kunlun/rxsunSource/openbmc/build/tmp/deploy/images/haiguang1/u-boot.bin'find ./ -name u-boot.bin ./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/packages-split/u-boot-aspeed/boot/u-boot.bin ./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/package/boot/u-boot.bin ./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/build/u-boot.bin ./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/image/boot/u-boot.bincp 第三个到 cp ./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/build/u-boot.bin /home/kunlun/rxsunSource/openbmc/build/tmp/deploy/images/haiguang1/u-boot.bin执行 bitbake obmc-phosphor-image编译不过去,提示需要python2.7,只好又改回来python2.7 七、编译成功build下执行bitbake obmc-phosphor-image,编译成功,结果存放在/openbmc/build/tmp/deploy/images/haiguang1 -rw-rw-r-- 2 kunlun kunlun 33554432 8月 15 10:11 obmc-phosphor-image-haiguang1-20190815021143.static.mtd 烧录器所用 -rw-rw-r-- 2 kunlun kunlun 33566720 8月 15 10:13 obmc-phosphor-image-haiguang1-20190815021143.static.mtd.all.tar 带配置文件的 -rw-rw-r-- 2 kunlun kunlun 27637760 8月 15 10:12 obmc-phosphor-image-haiguang1-20190815021143.static.mtd.tar 不带配置文件的八、改network库的commit号:有一个需求是network包要使用上一次的提交commit号,在vim meta-phosphor/classes/phosphor-networkd-rev.bbclass 中改,这是一个公共的库。build下执行bitbake obmc-phosphor-image,编译成功,ftp到ftp服务器上。 九、测试人员发现没有版本,需要打标签先在openbmc目录下git tag查看一下,已经有v0.15之前的所有tag,再vim ./meta-phosphor/recipes-core/os-release/os-release.bbappend看到版本上上一次生成的v0.15,需要更新。git describe –dirty=-release 也可以查看,已经到了v0.15用git tag -a v0.16 -m “Release V0.16” 生成tag。 十、测试人员发现bios版本是0.0这是一个bug 打过tag后要再提交一次 git status modified: meta-haiguang/meta-haiguang1/recipes-phosphor/webui/phosphor-webui_git.bb modified: meta-phosphor/classes/phosphor-networkd-rev.bbclass git add . ,git commitvim ./tmp/sysroots-components/all/os-release/ 查看结果find ./ -name os-releasebuild下执行bitbake obmc-phosphor-image,编译成功,ftp到ftp服务器上。 十一、后续处理写ReleaseNote.txt,包括本版本解决的所有bug。bug的解决方式可以是代码也可以是手册,手册修改对应的bug是哪一个,应该在发布版本时也加以说明。ReleaseNote.txt,以及测试人员的用户手册和测试报告,都放到ftp服务器上。为了易于分发,要分包压缩20m以下做一个md5 将分包的文件解包为单个文件,用md5sum生成密码,再用“certulti -hashfile 文件名 md5” 验证md5码是否正确,发给用户。 =====================================================================================================]]></content>
<categories>
<category>bmc</category>
</categories>
<tags>
<tag>openbmc</tag>
<tag>bmc</tag>
<tag>build</tag>
<tag>bitbake</tag>
</tags>
</entry>
<entry>
<title><![CDATA[nfs-FileServer]]></title>
<url>%2F2019%2F08%2F15%2Fnfs-FileServer%2F</url>
<content type="text"><![CDATA[nfs文件共享服务器配置过程服务器端200.86 bmcCompileBak因为要用bmcCompileBak服务器上的openbmc目录sudo apt install nfs-kernel-serversudo vim /etc/exports增加一行 /home/kunlun/rxsunSource/openbmc 192.168.200.84 (rw,sync,no_root_squash,no_subtree_check) //200.2是客户端地址 sudo service rpcbind startsudo service nfs-kernel-server start //没有开机自启动sudo /etc/init.d/nfs-kernel-server restart 客户端200.84sudo apt install nfs-commonsudo showmount -e 192.168.200.86 显示Export list for 192.168.200.86:/home/kunlun/rxsunSource/openbmc * 表示成功sudo mount 192.168.200.86:/home/kunlun/rxsunSource/openbmc /home/kunlun/rxsunSource/openbmc //将服务端目录挂载到本地sudo vim /etc/fstab //添加开机自动挂载增加一行 192.168.200.86:/home/kunlun/rxsunSource/openbmc /home/kunlun/rxsunSource/openbmc nfs rw 0 0注意:/home/kunlun/rxsunSource/openbmc必须在客户端是存在的,否则会报错:mount.nfs: mount point /home/kunlun/rxsunSource/openbmc does not exist ls 本地可在本地的/home/kunlun/rxsunSource/openbmc看到服务器上的内容 =====================================================================================================]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>nfs</tag>
</tags>
</entry>
<entry>
<title><![CDATA[Install Centos and Ubuntu OS]]></title>
<url>%2F2019%2F08%2F14%2FInstall-Centos-and-Ubuntu-OS%2F</url>
<content type="text"><![CDATA[安装Centos和Ubuntu系统中遇到的问题一、centos安装的基本操作为了配置一个备用的编译服务器,重装一台机器,准备用centos7,先用ultraIso,打开镜像文件,启动写入到u盘,生成启动u盘。 听闻centos7在联想机器上总死机,为了将来在新服务器上可以装,先验证一下。 ip地址是86,装好后打算装图形界面。检查环境,发现yum 是现成的,依次执行下列命令安装成功。 yum groupinstall “X Window System” //注意有引号 yum grouplist yum install -y wget wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all //清除缓存 yum makecache //生成缓存 yum groupinstall “GNOME Desktop” “Graphical Administration Tools” 命令 startx 进入图形界面 系统启动默认还是命令行页面的,需要进行切换。如果想要使系统启动即为图形化窗口,需要执行下面的命令 ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target centos启动时遇到的问题重启centos7出现这个提示 大概意思就是需要通过许可信息 ,按照下面操作成功 1 输入1-回车 2-回车 c-回车 c-回车,之后即可进入系统 centos拷贝文件时遇到的问题拷贝项目文件过程中,死机,共两次,放弃centos 二、改为装ubuntu选择ubuntu server16.04,一路选择中文最后报错“无法安装busybox-initramfs,向目标系统中安装busybox-initramfs软件包时出现一个错误。”,后来改为在第一个页面选“English”,以后页面都选中文就没有问题了。 配置了建议的所有的服务器,其中邮件服务器名称是机器名bmcCompileBak 用户名kunlun 配置静态Ip auto eno1 iface ens1 inet static address 192.168.200.86 netmask 255.255.255.0 gateway 192.168.200.254 运行软件的编译工作bitbake。。。报错 安装项目所需的软件sudo apt-get install -y git build-essential libsdl1.2-dev texinfo gawk chrpath diffstat也报错 系统升级apt update && apt upgrade 再安装项目所需的软件sudo apt-get install -y git build-essential libsdl1.2-dev texinfo gawk chrpath diffstat ok =====================================================================================================]]></content>
<categories>
<category>os</category>
</categories>
<tags>
<tag>os</tag>
</tags>
</entry>
<entry>
<title><![CDATA[masteBranchRename]]></title>
<url>%2F2019%2F08%2F13%2FmasteBranchRename%2F</url>
<content type="text"><![CDATA[maste分支重命名惊险记一、当前问题做完联想海光后,要将代码应用到同方产品中,产品logo图片和文字不同,要求尽量能共用代码,只将有差异的部分放到单独的分支上。 二、基本思路生成tongfang分支,在这之上不仅改了图片,还改了登录界面的代码,而且将来的登录界面都将与同方的一致。这就意味着可将同方分支作为将来的master分支,而将原来的master分支重命名为联想分支即可。当前的本地和远程都有master分支和tongfang分支。 三、重命名master分支的操作过程 1.本地切换分支到tongfang分支,不能让当前分支是master分支 git checkout tongfang2.本地重命名 git branch -m master lenovo //将原来的master分支重命名为lenovo分支3.在远程gitlab里,将当前的default分支改为tongfang分支4.删除远程分支:git push origin :master5.将重命名过的新分支提交:git push origin lenovo 四、发现问题试图将远程gitlab的当前分支切换到lenovo分支上,目的是将本地和远程的tongfang分支重命名为master,发现新命名的lenovo分支gitlab上看不到,master分支能看到,点击后提示404找不到,只能看到tongfang分支,试图将当前的default分支改为tongfang分支,不成功。 五、解决办法,在远程创建master分支远程gitlab里,在git库的commit->branch页面,new branch创建一个名为master的分支,开始位置是tongfang分支的最后一次提交点,将当前的default分支改为lenovo分支,成功。创建master分支后,一切操作都正常了,看来master分支是必须存在的。 六、本地找回master分支git branch -a可以看到远程的master分支,没有本地的master分支git checkout mastergit branch -a本地分支结构与远程完全一样。 七、后续以后的共性修改都在master分支上,个性的改动在各厂商分支上。共性修改合并到厂商分支的方法:先git checkout 厂商分支再git merge master =====================================================================================================]]></content>
<categories>
<category>git</category>
</categories>
<tags>
<tag>git</tag>
<tag>gitlab</tag>
</tags>
</entry>
<entry>
<title><![CDATA[seleniumUseAttension]]></title>
<url>%2F2019%2F08%2F09%2FseleniumUseAttension%2F</url>
<content type="text"><![CDATA[使用selenium爬数据遇到的问题一、导入需要的库from selenium import webdriver #导入操作web的模块 from selenium.webdriver.support.select import Select #这行是为了操作一个select控件 import time #为了让界面停一会 browser = webdriver.Chrome() #打开chrome browser.maximize_window() #最大化窗口 browser.get('http://×××.com') #访问网页二、解决弹出警告框的障碍time.sleep(3) browser.switch_to.alert.accept() #模拟直接点一下弹出框 三、解决登录问题elem_user = browser.find_element_by_name('username') # 获取用户名的输入控件 ,是通过用chrome的F12查看element获得的,一下控件基本都是这个方法获得 elem_user.clear() elem_user.send_keys('######') # 键入用户名 elem_pass = browser.find_element_by_name('password')# 密码的输入控件 elem_pass.clear() elem_pass.send_keys('#####') elem_login = browser.find_element_by_id('login')# 登录按钮控件 elem_login.click()# 点击登录按钮 time.sleep(2)四、按文字获取控件,使用较多browser.find_element_by_xpath("//*[text()='管理']").click() #按照网页上的顺序单击按钮,等几秒,跳转后再点。。。 time.sleep(3)五、获取select控件的条目list_1 =browser.find_element_by_tag_name('select') # 用到了前面导入的Select模块 Select(list_1).select_by_value("100") # 按值来选条目六、最重要的,如果网页内有iframe控件,想获取它内部的控件browser.switch_to_frame('main') # 先切换到这个frame,“main”是名称 browser.find_element_by_id("add") #再继续获得frame内部的控件,否则总是取不到 ,浪费了大部分时间七、以下是批量写文件file_name ="" file_data = open('file_data_1.txt', 'w') pages=0 while(pages<20000): table = browser.find_element_by_tag_name('table') # 按tag取table表格控件 table_tr_list = table.find_elements_by_tag_name('tr') # 取当前页面的所有行 table_cols = table_tr_list[0].find_elements_by_tag_name('th') #取第一行的所有列 for r,tr in enumerate(table_tr_list, 1): table_td_list = tr.find_elements_by_tag_name('td') for c,td in enumerate(table_td_list): file_data.write(td.text+'\n') pages = pages + 1 print(pages) if pages % 1000 == 0: # 每1000页写个新文件 file_data.close() flie_name = 'file_data_' + str(pages) + '.txt' #动态生成文件名称 file_data = open(flie_name, 'w') browser.find_element_by_id('iwap-gen-3_next').click() #点击下一页 time.sleep(10) file_data.close() #关闭最后一个文件=====================================================================================================]]></content>
<categories>
<category>python</category>
</categories>
<tags>
<tag>python</tag>
<tag>selenium</tag>
</tags>
</entry>
<entry>
<title><![CDATA[cleanDevloopDir]]></title>
<url>%2F2019%2F08%2F08%2FcleanDevloopDir%2F</url>
<content type="text"><![CDATA[删除Linux循环设备/dev/loop用df -h命令查看磁盘空间发现两个loop设备 /dev/loop0 89M 89M 0 100% /snap/core/7270 /dev/loop1 254M 254M 0 100% /snap/electronic-wechat/7其中的electronic-wechat是有一次试图装微信客户端而下载的软件,不好用。 查了一下,dev/loop(或称vnd (vnode disk)、lofi(循环文件接口))是一种伪设备,这种设备使得文件可以如同块设备一般被访问,相当于挂载的镜像文件,也没有什么用途,而snap是一种ubuntu的包安装方式,大概是某次装软件用到的,可以不用。 用losetup -a命令查一下当前的loop设备,与上面的一致 /dev/loop1: [2050]:4325623 (/var/lib/snapd/snaps/electronic-wechat_7.snap) /dev/loop0: [2050]:4325622 (/var/lib/snapd/snaps/core_7270.snap)apt autoremove –purge snapd 卸载了很多软件 不知道会不会影响其它软件的运行 先给机器减轻负担 遇到问题再解决问题吧 用df -h命令查看磁盘空间上面两行不再出现 =====================================================================================================]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>linux</tag>
<tag>disk</tag>
<tag>ubuntu</tag>
</tags>
</entry>
<entry>
<title><![CDATA[fileRunServer]]></title>
<url>%2F2019%2F08%2F02%2FfilerunServer%2F</url>
<content type="text"><![CDATA[移植filerun服务器为了在84机器上调通phpstorm的debug功能插件,在84的原有php5.6环境里下载了一堆模块,debug调通了,但是测试组同事来报,说部门用作内部网盘的filerun软件不能访问了,继续在84机器上找问题有可能会导致debug功能不可用,干脆将它移到201服务器上。 一、确认一下php版本update-alternatives 命令用于处理linux系统中软件版本的切换update-alternatives –display php输出: php - 自动模式 link best version is /usr/bin/php7.3 链接目前指向 /usr/bin/php7.3 link php is /usr/bin/php slave php.1.gz is /usr/share/man/man1/php.1.gz /usr/bin/php5.6 - 优先级 56 次要 php.1.gz:/usr/share/man/man1/php5.6.1.gz /usr/bin/php7.3 - 优先级 73 次要 php.1.gz:/usr/share/man/man1/php7.3.1.gzupdate-alternatives –config php 有 2 个候选项可用于替换 php (提供 /usr/bin/php)。 选择 路径 优先级 状态 ------------------------------------------------------------ * 0 /usr/bin/php7.3 73 自动模式 1 /usr/bin/php5.6 56 手动模式 2 /usr/bin/php7.3 73 手动模式 要维持当前值[*]请按<回车键>,或者键入选择的编号:1切换php版本也可用 a2dismod php5.6 及 a2enmod php7.3,这里不用再改。 二、安装filerun所需的php模块命令行敲php命令,报有些php模块没加载,可是在网页的phpinfo里却看到是已经加载,后来发现在/etc/php/7.3/cli/ 和 /etc/php/7.3/apache/ 下面各有一个php.ini,加载的模块也不一样,所以命令行下php报某个模块没有加载是指cli目录下,会与phpinfo里的不一样。安装curl模块用命令 apt install php7.3-curl,其它的类似只有ionCube比较麻烦,filerun必须要,用来加密它的源代码用的。按照这个链接装好。https://blog.csdn.net/forLightWay/article/details/78888583 三、下载软件并安装配置上官网 https://filerun.com/download下载软件 FileRun_2019_06_01_PHP_71-73.zip, 按照官网的http://blog.filerun.com/how-to-install-filerun-on-ubuntu-16/ 进行安装配置将 /etc/php/7.3/apache2/conf.d/filerun.ini 中display_errors = Off 改成 on数据库先创建一个新的,指定目录到/data1/biosfiles然后 vim system/data/autoconfig.php 将数据库配置到老数据库上成功 !!!filerun2 以后可以删除 四、解决问题1word文件双击报错将/etc/php/7.3/apache2/php.ini 中 ;com.allow_dcom = true 的注释去掉 ,解决了 201上面filerun中word双击报错问题,至少可以双击下载 五、解决问题2访问慢从数据库远程方面找原因,将filerun数据库从84移动到201上 改配置文件 system/data# vim autoconfig.php ,还是慢从新版软件方面找原因,将老的filerun文件装到201的php7.3环境,不能运行查看201 日志 /var/log/apache2/error.log 发现 filerun 的这个老版本FileRun_2017_03_18_PHP7.zip 在201上不能运行 原因是 : The file index.php was encoded by the ionCube Encoder for PHP 5.6 and cannot run under PHP 7.1 or later.\n Please ask the provider of the script to provide a version encoded with the ionCube Encoder for PHP 7.1. in Unknown on line 0 这些文件是被用php5.6版本的加密软件加密的,不能用在php7.3版本上最后吐血发现,要在 filerun/system/data/autoconfig.php 中将数据库地址改成localhost 就很快 —-早该想到的 作为OracleDBA认证专家,哈哈。 六、解决问题3又发现word文件不能下载问题,看来前面的办法无效先改设置 Control Panel > Configuration > Files > Misc options > Enable download accelerator : None试图用libreoffice,无效,office365要购买上filerun的官网讨论区搜索,发现onlyoffice用的挺多找到了一个 ONLYOFFICE,在docker环境运行,免得与外面的php7.3和诸模块不匹配 docker network create --driver bridge onlyoffice docker pull onlyoffice/documentserver docker run --net onlyoffice -i -t -d -p 8080:80 --restart=always --name onlyoffice-document-server onlyoffice/documentserver ufw allow 8080 --放开防火墙端口http://192....201:8080 即可访问onlyofficeControl Panel > Configuration > Files >Plugin->中 关联 到onlyoffice的地址 http://192....201:8080 ,并在Defaults中设置为office文档的设置默认打开方式,ok不仅可以预览下载,还可以在线编辑,非常好用。 七、解决问题4不能下载几百兆的文件这个服务器存了很多测试环境的镜像,要解决这个问题vim /var/log/apache2/error.log 发现 PHP Fatal error: Allowed memory size of使用ps -aux | sort -k4nr | head -10命令查看内存占用前10的进程 没有结果多次在/etc/php/7.3/apache/php.ini下改memory_limit,重启apache2都没有效果,后来vim /etc/php/7.3/apache2/conf.d/filerun.ini 改memory_limit 为4196 就行了可见在php.ini 之外 ,可以为自己的应用设置php内存的可用大小 真牛 ! 八、解决问题5网页上还是只能下载2G以内的文件不知道是不是系统限制,干脆另外建一个ftp服务器,可参考文档 搭建vsftp服务器,将ftp目录设置为filerun存在文件的目录,太大的镜像走ftp吧,速度也会快一些。 九、总结filerun是加密运行的,不能一步步debug遇到问题开阔思维,逐步收小范围,直到锁定目标。]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>linux</tag>
<tag>ubuntu</tag>
<tag>filerun</tag>
<tag>fileshare</tag>
</tags>
</entry>
<entry>
<title><![CDATA[linuxFtpServer]]></title>
<url>%2F2019%2F07%2F31%2FlinuxFtpServer%2F</url>
<content type="text"><![CDATA[搭建vsftp服务器201服务器搭建ftp服务器 环境ubuntu16.04 一、安装并建立用户sudo apt-get update sudo apt-get install vsftpd vsftpd –version //检测是否安装 sudo groupadd ftpusers //创建ftpusers用户组 sudo useradd -m ftpuser//创建一个用户并且自动创建家目录为/home/ftpuser usermod -G ftpusers ftpuser //将这个新用户加入到ftpusers用户组中 sudo passwd ftpuser //更改密码 mkdir /home/ftpuser/dev_new //为用户添加一个具有一定权限的文件夹 chmod 777 -R /home/ftpuser/dev_new //新建一个dev_new目录用于存放文件,并且赋予全部权限,因为vsftp不运行将根目录作为可访问的目录 usermod -s /sbin/nologin username //限制用户登录方式;限制用户username只能通过ftp登陆,而不能直接登陆服务器,或者直接改/etc/passwd文件 二、改配置文件,连接不成功vim /etc/vsftp.conf 改动这几行 write_enable=YES ftpd_banner=Welcome to BIOS FTP service. chroot_local_user=YES //对本地用户是否实施限制 chroot_list_enable=YES //开启限制白名单 chroot_list_file=/etc/vsftpd.chroot_list //白名单路径,若无这个文件需要自己创建 utf8_filesystem=YES 并且vim /etc/vsftpd.chroot_list 写入ftpuser用户 ufw allow 21 service vsftpd restart 访问失败,报口令错误 三、找到原因一绕开linux的pam认证,将/etc/pam.d/vsftpd文件里的required改为optional auth optional pam_listfile.so auth optional pam_shells.so因为/etc/vsftp.conf 中有pam_service_name=vsftpd 这一行 service vsftpd restart filezalli访问失败,list目录失败 四、找到原因二改为被动模式,在vsftp文件中加入 pasv_enable=YES pasv_min_port=30000 pasv_max_port=30010命令行执行 ufw allow 30000:30010/tcp service vsftpd restart filezalli访问失败,仍然是list目录失败 五、找到原因三在命令行用ftp xxx.201访问,输入用户名口令报错 500 OOPS: vsftpd: refusing to run with writable root inside chroot() vim /etc/vsftp.conf文件,加入 allow_writeable_chroot=YES service vsftpd restart filezalli访问成功 六、将原vsftpd配置文件和改动后的文件进行比较diff /etc/vsftpd.conf.well /etc/vsftpd.conf 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626331c31< #write_enable=YES---> write_enable=YES103c103< #ftpd_banner=Welcome to blah FTP service.---> ftpd_banner=Welcome to BIOS FTP service.114c114< #chroot_local_user=YES---> chroot_local_user=YES123c123< #chroot_list_enable=YES---> chroot_list_enable=YES125c125< #chroot_list_file=/etc/vsftpd.chroot_list---> chroot_list_file=/etc/vsftpd.chroot_list155c155,162< #utf8_filesystem=YES---> utf8_filesystem=YES> > pasv_enable=YES> > pasv_min_port=30000> pasv_max_port=30010> > allow_writeable_chroot=YES 七、将原认证模块文件和改动后的文件进行比较diff /etc/pam.d/vsftpd.well /etc/pam.d/vsftpd 12345678910111213141516172c2< authrequiredpam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed---> authoptionalpam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed10c10< authrequiredpam_shells.so---> authoptionalpam_shells.so 八、总结用ftp命令行方式报错信息更清晰!]]></content>
<categories>
<category>linux</category>
</categories>
<tags>
<tag>linux</tag>
<tag>ubuntu</tag>
<tag>ftp</tag>
</tags>
</entry>
</search>