source: live-build/trunk/fuentes/examples/hooks/stripped.chroot @ 900

Last change on this file since 900 was 900, checked in by kbut, 3 years ago

add original source

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/sh
2
3## live-build(7) - System Build Scripts
4## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5##
6## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7## This is free software, and you are welcome to redistribute it
8## under certain conditions; see COPYING for details.
9
10
11set -e
12
13# WARNING: Using this hook will result in a stripped system, means,
14# it may very well be possible that other packages are depending
15# on certain files that get removed here.
16# Therefore, this hooks is merely an inspiration for what could be
17# removed and not a generic nor recommendet solution to get the
18# image filesize down. In any event, using this hook can lead to
19# unforseen bugs and breakages in other packages and you should
20# be prepared to find and fix it for your own images.
21
22# Removing unused packages
23for PACKAGE in apt-utils aptitude man-db manpages info wget dselect
24do
25        if ! apt-get remove --purge --yes "${PACKAGE}"
26        then
27                echo "WARNING: ${PACKAGE} isn't installed"
28        fi
29done
30
31apt-get autoremove --yes || true
32
33# Removing unused files
34find . -name *~ | xargs rm -f
35
36rm -rf /usr/include/*
37#rm -rf /usr/share/groff/*
38rm -rf /usr/share/doc/*
39rm -rf /usr/share/locale/*
40rm -rf /usr/share/man/*
41rm -rf /usr/share/i18n/*
42rm -rf /usr/share/info/*
43rm -rf /usr/share/lintian/*
44rm -rf /usr/share/linda/*
45rm -rf /usr/share/zoneinfo/*
46rm -rf /var/cache/man/*
47
48# Truncating logs
49for FILE in $(find /var/log/ -type f)
50do
51        : > ${FILE}
52done
Note: See TracBrowser for help on using the repository browser.