Re: Control Debian image size
Johannes Schauer <[email protected]> Sun, 03 Mar 2019 08:38:01 +0100
| Newsgroups | gmane.linux.debian.devel.embedded |
|---|---|
| Message-ID | <155159868176.20079.10585473809838490134@hoothoot> |
--===============3017737309120974256==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Hi,
Quoting JH (2019-03-03 00:17:06)
> I have been searching build system and distro for my small Linux
> embedded device for many weeks, the device has small resources, about
> 128 MB Flash and 64 MB RAM on imx6, it is a typical embedded system,
> no GUI, no Desktop environment, no multiple user interfaces, the C++
> applications are simply for data transfer and communication using
> TCP/IP, the applications were previously running well on Debian 8
> armhf, so Debian is my first choice, but the Debian image size could
> be a major problem, it could be too large to blow out device resource
> constraints, many people commended me to use OE or Yocto or OpenWrt
> distro which image size seems much smaller than the Debian armhf. Is
> it possible to control / reduce Debian armhf image size by Debian
> build, or isar or some other build bools, to reach the same resource
> requirement level in OE Yocto or OpenWrt?
it is possible to produce a Debian rootfs well below 128 MB in size if you
choose not to install locales, man pages and docs using the --path-exclude =
dpkg
option:
https://raphaelhertzog.com/2010/11/15/save-disk-space-by-excluding-useless-=
files-with-dpkg/
An easy way to create a chroot tarball with this option already set is by u=
sing
mmdebstrap (shameless plug: I'm the author) like so:
mmdebstrap --variant=3Dapt \
--dpkgopt=3D'path-exclude=3D/usr/share/man/*' \
--dpkgopt=3D'path-include=3D/usr/share/man/man[1-9]/*' \
--dpkgopt=3D'path-exclude=3D/usr/share/locale/*' \
--dpkgopt=3D'path-include=3D/usr/share/locale/locale.alias' \
--dpkgopt=3D'path-exclude=3D/usr/share/doc/*' \
--dpkgopt=3D'path-include=3D/usr/share/doc/*/copyright' \
--dpkgopt=3D'path-include=3D/usr/share/doc/*/changelog.Debian.*' \
unstable > debian-unstable.tar
The resulting tarball debian-unstable.tar is 69M in size. You can find a ve=
ry
similar example in the mmdebstrap man page. You can go even smaller if you =
omit
the path-include parts of above command (64M) and even smaller by not
installing apt (49M). You can go even more extreme with the custom variant
which lets you pick exactly the package set you want, ignoring Essential:yes
packages.
Thanks!
cheers, josch
--===============3017737309120974256==
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Description: signature
Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii"
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAlx7hFYACgkQ8sulx4+9
g+G/KA/8D5Z8W+F1nZKVAjqHxE5iPaKdH3XR6PJ55mweTnCG2Mg9iee2TJdoXOFQ
h3/x+vh7FCqK9GN6gFYrn+DyPjtrctsYxzvwdBrN9dqYCIBRfkzGGAWK5auvxHIy
skhgfQcfPRUHIhMcjYM5sR0kQq2KZCrdUoNew4XBV9qkeUmhhNd/lCsv24XhDd2o
b17/eQEaEBJIoER6lOZ1y0ZkygQQfTA82cjKdn5EF392F4Wy9TR+crtE8fYBlXi2
l9XGso4Rv/p5e7LQkmmmZxbem6LY+BHPBZu3gX3t4bKqR7M94EV5FTXg+Hch2MG+
/Rs4TfP0I+/mikf2YxH0MJifgguyGdd0KFeMTOowFrvzisoxhdLOYEeYPxU9H+bu
ML6DQQ1PPqVwgr3kaxhnRoh2hCoGMdpvgJjkHv5XEjgTBB+Jvb52a/d8Xoffn+Kx
9uBKm7lBV5VAccRg7IoiK2oj23N0JuKY35aMpwMGX6sQ4xCGsW4yPJi4/Oy85s1r
5pidIdaPjDsg41op4GeHwcLoO7N15A0HpP7vR/nJYV1bxpBV6BdcJjuqcZ3Ogq+4
EW75RID4xTSZqUXV5cpmp7VwSsrUgXENAbjBUN4cBwZN+Tce71u18fnp7YQXGNBU
AlYK8al2wiRRxt0aWH6FMTkPonzCH6k/milQmSaFe2wpiHr0w9k=
=LVOo
-----END PGP SIGNATURE-----
--===============3017737309120974256==--