2

我目前正在学习如何使用 rebar 制作 erlang 版本和版本升级。感谢本教程,我已经能够成功生成版本和升级,但在此期间出现了一个问题。

在我正在进行的项目中,版本升级尽可能小很重要,因为它们是通过不可靠且缓慢的连接下载到嵌入式设备(例如 beagleboard)

不幸的是,rebar 生成的 tar.gz 档案总是包含一个完整的版本,包含所有的应用程序。我想知道是否有一种方法可以进行工作版本升级,只包含新应用程序和更新的应用程序以减少存档大小。也许可以配置 reltool 来做到这一点?

感谢帮助。

4

1 回答 1

0

作为Learn You Some Erlang 的发布章节的一部分,我写了一个关于这个问题的小指南:

这是为使事情变得更小而提供的发布文件之一:

{sys, [
 {lib_dirs, ["/home/ferd/code/learn-you-some-erlang/release/"]},
 {erts, [{mod_cond, derived},
         {app_file, strip}]},
 {rel, "erlcount", "1.0.0", [kernel, stdlib, ppool, erlcount]},
 {boot_rel, "erlcount"},
 {relocatable, true},
 {profile, embedded}, 
 {app_file, strip},
 {debug_info, strip},
 {incl_cond, exclude},
 {excl_app_filters, ["_tests.beam$"]},
 {app, stdlib, [{mod_cond, derived}, {incl_cond, include}]},
 {app, kernel, [{incl_cond, include}]},
 {app, ppool, [{vsn, "1.0.0"}, {incl_cond, include}]},
 {app, erlcount, [{vsn, "1.0.0"}, {incl_cond, include}]}
]}.

这会剥离调试信息,使应用程序文件尽可能小,删除测试文件,排除尽可能多的应用程序等。请注意,如果您希望人们能够实时运行,您至少需要包含 SASL 并保留 debug_info材料的代码升级。

总而言之,ERTS 本身需要 18.5MB。如果您使用上述规则,这将是您的大部分空间,因此您必须检查是否可以从列表中删除一些可执行文件(非 SMP Erlang 等)。

于 2011-09-15T16:16:52.627 回答