Step8-Log-制品细节
# 一、制品生成日志回顾
在源码编译与安装阶段完成后,Bigtop 会调用 Debhelper 工具链 执行一系列步骤,将 Redis 打包成 .deb
文件。以下是关键日志片段:
02:29:19.517 [QUIET] [system.out] dh_makeshlibs
02:29:19.571 [QUIET] [system.out] dh_makeshlibs: warning: Compatibility levels before 10 are deprecated (level 9 in use)
02:29:19.703 [QUIET] [system.out] dh_installdeb
02:29:19.738 [QUIET] [system.out] install -d debian/redis-3-2-0/DEBIAN
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.postinst debian/redis-3-2-0/DEBIAN/postinst
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.preinst debian/redis-3-2-0/DEBIAN/preinst
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.prerm debian/redis-3-2-0/DEBIAN/prerm
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.postrm debian/redis-3-2-0/DEBIAN/postrm
02:29:19.743 [QUIET] [system.out] dh_gencontrol
02:29:19.771 [QUIET] [system.out] dpkg-gencontrol -predis-3-2-0 ...
02:29:20.255 [QUIET] [system.out] dh_builddeb
02:29:20.392 [QUIET] [system.out] dpkg-deb: building package 'redis-3-2-0' in '../redis-3-2-0_7.4.0-1_amd64.deb'.
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# 二、关键步骤解析
在构建日志中,Debhelper 依次调用多个 dh_*
工具,执行打包核心逻辑:
- dh_makeshlibs 清理与生成共享库信息,发出兼容性警告。
- dh_installdeb
拷贝钩子脚本(
postinst
、preinst
、prerm
、postrm
)至DEBIAN/
目录,并替换#TOKEN#
元数据。 - dh_gencontrol
调用
dpkg-gencontrol
生成最终control
文件,写入依赖信息。 - dh_md5sums
为包内所有文件生成
md5sums
校验文件。 - dh_builddeb
最终执行
dpkg-deb --build
生成.deb
制品。
日志细节如下:
02:29:19.516 [QUIET] [system.out] make[1]: Leaving directory '/opt/modules/bigtop/output/redis/redis-3-2-0-7.4.0'
02:29:19.517 [QUIET] [system.out] dh_makeshlibs
02:29:19.571 [QUIET] [system.out] dh_makeshlibs: warning: Compatibility levels before 10 are deprecated (level 9 in use)
02:29:19.571 [QUIET] [system.out] rm -f debian/redis-3-2-0/DEBIAN/shlibs
02:29:19.703 [QUIET] [system.out] dh_installdeb
02:29:19.738 [QUIET] [system.out] dh_installdeb: warning: Compatibility levels before 10 are deprecated (level 9 in use)
02:29:19.738 [QUIET] [system.out] install -d debian/redis-3-2-0/DEBIAN
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.postinst debian/redis-3-2-0/DEBIAN/postinst
02:29:19.738 [QUIET] [system.out] [META] Replace #TOKEN#s in "debian/redis-3-2-0/DEBIAN/postinst"
02:29:19.738 [QUIET] [system.out] chmod 0755 -- debian/redis-3-2-0/DEBIAN/postinst
02:29:19.738 [QUIET] [system.out] chown 0:0 -- debian/redis-3-2-0/DEBIAN/postinst
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.preinst debian/redis-3-2-0/DEBIAN/preinst
02:29:19.738 [QUIET] [system.out] [META] Replace #TOKEN#s in "debian/redis-3-2-0/DEBIAN/preinst"
02:29:19.738 [QUIET] [system.out] chmod 0755 -- debian/redis-3-2-0/DEBIAN/preinst
02:29:19.738 [QUIET] [system.out] chown 0:0 -- debian/redis-3-2-0/DEBIAN/preinst
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.prerm debian/redis-3-2-0/DEBIAN/prerm
02:29:19.738 [QUIET] [system.out] [META] Replace #TOKEN#s in "debian/redis-3-2-0/DEBIAN/prerm"
02:29:19.738 [QUIET] [system.out] chmod 0755 -- debian/redis-3-2-0/DEBIAN/prerm
02:29:19.738 [QUIET] [system.out] chown 0:0 -- debian/redis-3-2-0/DEBIAN/prerm
02:29:19.738 [QUIET] [system.out] cp -f debian/redis-3-2-0.postrm debian/redis-3-2-0/DEBIAN/postrm
02:29:19.738 [QUIET] [system.out] [META] Replace #TOKEN#s in "debian/redis-3-2-0/DEBIAN/postrm"
02:29:19.738 [QUIET] [system.out] chmod 0755 -- debian/redis-3-2-0/DEBIAN/postrm
02:29:19.738 [QUIET] [system.out] chown 0:0 -- debian/redis-3-2-0/DEBIAN/postrm
02:29:19.738 [QUIET] [system.out] find debian/redis-3-2-0/etc -type f -printf '/etc/%P
02:29:19.738 [QUIET] [system.out] ' | LC_ALL=C sort >> debian/redis-3-2-0/DEBIAN/conffiles
02:29:19.741 [QUIET] [system.out] rm -f debian/redis-3-2-0/DEBIAN/conffiles
02:29:19.743 [QUIET] [system.out] dh_gencontrol
02:29:19.771 [QUIET] [system.out] echo misc:Depends= >> debian/redis-3-2-0.substvars
02:29:19.771 [QUIET] [system.out] echo misc:Pre-Depends= >> debian/redis-3-2-0.substvars
02:29:19.771 [QUIET] [system.out] dpkg-gencontrol -predis-3-2-0 -ldebian/changelog -Tdebian/redis-3-2-0.substvars -Pdebian/redis-3-2-0
02:29:19.850 [QUIET] [system.out] dpkg-gencontrol: warning: Depends field of package redis-3-2-0: substitution variable ${shlibs:Depends} used, but
is not defined
02:29:19.862 [QUIET] [system.out] dpkg-gencontrol: warning: package redis-3-2-0: substitution variable ${perl:Depends} unused, but is defined
02:29:19.864 [QUIET] [system.out] chmod 0644 -- debian/redis-3-2-0/DEBIAN/control
02:29:19.864 [QUIET] [system.out] chown 0:0 -- debian/redis-3-2-0/DEBIAN/control
02:29:19.866 [QUIET] [system.out] dh_md5sums
02:29:19.901 [QUIET] [system.out] cd debian/redis-3-2-0 >/dev/null && xargs -r0 md5sum | perl -pe 'if (s@^\\@@) { s/\\\\/\\/g; }' > DEBIAN/md5
sums
02:29:20.252 [QUIET] [system.out] chmod 0644 -- debian/redis-3-2-0/DEBIAN/md5sums
02:29:20.252 [QUIET] [system.out] chown 0:0 -- debian/redis-3-2-0/DEBIAN/md5sums
02:29:20.255 [QUIET] [system.out] dh_builddeb
02:29:20.284 [QUIET] [system.out] dpkg-deb --build debian/redis-3-2-0 ..
02:29:20.392 [QUIET] [system.out] dpkg-deb: building package 'redis-3-2-0' in '../redis-3-2-0_7.4.0-1_amd64.deb'.
### 中间省略不重要的步骤
### 中间省略不重要的步骤
s-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/deps/jemalloc/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/deps/linenoise/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/src/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/src/modules/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/tests/cluster/tmp/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/tests/sentinel/tmp/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/tests/tmp/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/utils/create-cluster/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: package-contains-vcs-control-file usr/bigtop/3.2.0/usr/lib/redis/utils/hyperloglog/.gitignore
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: recursive-privilege-change "chown -R" [postinst:47]
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: recursive-privilege-change "chown -R" [postinst:48]
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: recursive-privilege-change "chown -R" [postinst:49]
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: windows-devel-file-in-package usr/bigtop/3.2.0/usr/lib/redis/deps/jemalloc/msvc/jemalloc_vc2015.sl
n
02:31:40.376 [QUIET] [system.out] W: redis-3-2-0: windows-devel-file-in-package usr/bigtop/3.2.0/usr/lib/redis/deps/jemalloc/msvc/jemalloc_vc2017.sl
n
02:31:41.060 [QUIET] [system.out] Finished running lintian.
02:31:41.062 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: SUCCEEDED
02:31:41.062 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'debuild'' finished with exit value 0 (state: SUCCEEDED)
02:31:41.086 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'rm''. Working directory: /opt/modules/bigtop/output/r
edis Command: rm -rf redis-3-2-0-7.4.0
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
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
# 三、lintian 检查与警告
构建完成后,lintian
工具会自动扫描包质量,给出警告:
W: redis-3-2-0: package-contains-vcs-control-file usr/.../.gitignore
W: redis-3-2-0: recursive-privilege-change "chown -R" [postinst:47]
W: redis-3-2-0: windows-devel-file-in-package usr/.../jemalloc/msvc/jemalloc_vc2017.sln
1
2
3
2
3
注意
这些问题通常来源于源码目录未清理(残留 .gitignore
)、Windows 构建文件误入包内,或脚本中存在不推荐的 chown -R
操作。
虽然不影响基本运行,但若面向企业交付,建议修复后再发布。
# 四、产物路径与命名规则
最终制品输出在上级目录:
../redis-3-2-0_7.4.0-1_amd64.deb
1
命名规则遵循:
<包名>_<版本号>-<release>_<架构>.deb
1
示例:redis-3-2-0_7.4.0-1_amd64.deb
- 01
- [/metrics/aggregated] — 聚合数据范围 检查点09-19
- 02
- [/metrics] — 反向分析接口参数 请求抓包09-17
- 03
- [/metrics] — 普通指标写入方法 POST09-17