Merge lp:~rbalint/livecd-rootfs/minimize-doc into lp:~vorlon/livecd-rootfs/minimizing

Proposed by Balint Reczey on 2017-03-29
Status: Merged
Merged at revision: 1470
Proposed branch: lp:~rbalint/livecd-rootfs/minimize-doc
Merge into: lp:~vorlon/livecd-rootfs/minimizing
Diff against target: 44 lines (+22/-1)
2 files modified
live-build/auto/build (+21/-0)
live-build/ubuntu-cpc/hooks/032-disk-image.binary (+1/-1)
To merge this branch: bzr merge lp:~rbalint/livecd-rootfs/minimize-doc
Reviewer Review Type Date Requested Status
Steve Langasek 2017-03-29 Needs Information on 2017-04-03
Review via email: mp+321330@code.launchpad.net

Description of the Change

Use dpkg filter config file for not installing man files & docs.
For testing only, not for merging yet. :-)

To post a comment you must log in.
Balint Reczey (rbalint) wrote :

The final rootfs still has broken symlinks and empty directories in /usr/share/doc due to dpkg not honoring the filters for them, but otherwise the patch works now.

The symlinks and dirs don't take too much space, but they can be removed by moving the find ... part to the end of lb build script.

Steve Langasek (vorlon) wrote :

Comments inline. Thanks!

review: Needs Information
1468. By Steve Langasek on 2017-04-01

if we're using SUBPROJECT=minimize, and tzdata is not installed, remove
files that have been left behind. This is a workaround for a bug that should
be fixed in tzdata.

Steve Langasek (vorlon) wrote :

also, I've pushed a new revision to the target branch which conflicts (sorry) - should be a trivial merge to fix up, which I'll let you handle in the interest of a clean merge.

1469. By Balint Reczey on 2017-04-04

Source config/binary instead of /build/config/binary which may not exist

1470. By Balint Reczey on 2017-04-04

Drop man pages and most of the documentation from minimized images

/usr/share/doc/*/copyright and changelog.Debian.gz files are still kept

Balint Reczey (rbalint) :
Balint Reczey (rbalint) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'live-build/auto/build'
2--- live-build/auto/build 2017-04-01 04:11:40 +0000
3+++ live-build/auto/build 2017-04-04 14:03:34 +0000
4@@ -37,6 +37,27 @@
5 rm -f chroot/etc/localtime chroot/etc/timezone
6 fi
7
8+ if [ "$SUBPROJECT" = minimize ]; then
9+ # set up dpkg filters to skip installing docs on minimized system
10+ mkdir -p chroot/etc/dpkg/dpkg.cfg.d
11+ cat > chroot/etc/dpkg/dpkg.cfg.d/excludes <<EOF
12+# Drop all man pages
13+path-exclude=/usr/share/man/*
14+
15+# Drop all documentation ...
16+path-exclude=/usr/share/doc/*
17+
18+# ... except copyright files ...
19+path-include=/usr/share/doc/*/copyright
20+
21+# ... and Debian changelogs
22+path-include=/usr/share/doc/*/changelog.Debian.*
23+EOF
24+
25+ # Remove docs installed by bootstrap
26+ Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs apt-get install --reinstall
27+ fi
28+
29 Chroot chroot "dpkg-divert --quiet --add \
30 --divert /usr/sbin/update-initramfs.REAL --rename \
31 /usr/sbin/update-initramfs"
32
33=== modified file 'live-build/ubuntu-cpc/hooks/032-disk-image.binary'
34--- live-build/ubuntu-cpc/hooks/032-disk-image.binary 2017-03-04 02:19:54 +0000
35+++ live-build/ubuntu-cpc/hooks/032-disk-image.binary 2017-04-04 14:03:34 +0000
36@@ -2,7 +2,7 @@
37
38 . /build/config/functions
39
40-. /build/config/binary
41+. config/binary
42
43 BOOTPART_START=
44 BOOTPART_END=

Subscribers

People subscribed via source and target branches

to all changes: