减少钢筋生成的升级包的大小

发布于 2024-12-04 17:23:58 字数 405 浏览 2 评论 0原文

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

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

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

感谢您的帮助。

I'm currently learning how to make erlang releases and release upgrades using rebar. Thanks to this tutorial I was already able to successfully generate releases and upgrades, but one issue has emerged during this.

In a project that I'm working on, it is important that release upgrades are as small as possible, because they are downloaded through unreliable and slow connection into an embedded device (e.g. beagleboard)

Unfortunately, tar.gz archives generated by rebar always contain a full release, with all applications. I was wondering if there is a method to make a working release upgrade that would contain only new applications and updated applications to reduce archive size. Maybe it is possible to configure reltool to do that?

Thanks for help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在梵高的星空下 2024-12-11 17:23:58

我已经写了一个关于这个问题的小指南,作为 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 等)。

I've written a small guide on the issue as part of Learn You Some Erlang's releases chapter:

Here's one of the release files presented to make things smaller:

{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}]}
]}.

This strips debug info, makes app files as small as possible, removes test files, excludes as many applications as possible, etc. Note that you will need to at least include SASL and keep the debug_info if you want people to be able to run live code upgrades of your material.

All in all, the ERTS itself takes 18.5MB. That's going to be most of your space if you use the rules above, so you have to check whether or not you can drop some executables (non-SMP Erlang, etc.) from the list.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文