source: live-build/trunk/fuentes/scripts/build/lb_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: 2.5 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# Including common functions
14( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
15
16# Automatically populating config tree
17if [ -x auto/config ] && [ ! -e .build/config ]
18then
19        Echo_message "Automatically populating config tree."
20        lb config
21fi
22
23# Setting static variables
24DESCRIPTION="$(Echo 'customize the Debian system')"
25HELP=""
26USAGE="${PROGRAM} [--force]"
27
28Arguments "${@}"
29
30# Reading configuration files
31Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
32Set_defaults
33
34# Setup cleanup function
35Setup_cleanup
36
37# Configuring chroot
38lb chroot_cache restore ${*}
39lb chroot_devpts install ${*}
40lb chroot_proc install ${*}
41lb chroot_selinuxfs install ${*}
42lb chroot_sysfs install ${*}
43lb chroot_debianchroot install ${*}
44lb chroot_dpkg install ${*}
45lb chroot_tmpfs install ${*}
46lb chroot_sysv-rc install ${*}
47lb chroot_upstart install ${*}
48lb chroot_hosts install ${*}
49lb chroot_resolv install ${*}
50lb chroot_hostname install ${*}
51lb chroot_apt install ${*}
52lb chroot_archives chroot install ${*}
53
54# Customizing chroot
55lb chroot_linux-image ${*}
56lb chroot_preseed ${*}
57lb chroot_early_hooks ${*}
58
59for _PASS in install live
60do
61        lb chroot_package-lists ${_PASS} ${*}
62        lb chroot_install-packages ${_PASS} ${*}
63
64        if [ "${_PASS}" = install ]
65        then
66                Chroot chroot "dpkg -l linux-headers-3* linux-headers-4*" 2>/dev/null \
67                        | awk '/^i/ {print $2}' > chroot.headers
68                for i in $(cat chroot.headers); do
69                        Chroot chroot "apt-mark auto $i"
70                done
71                Chroot chroot "apt-get --purge -y autoremove"
72                Chroot chroot "dpkg-query -W" > chroot.packages.install
73        fi
74done
75
76lb chroot_live-packages ${*}
77lb chroot_includes ${*}
78lb chroot_hooks ${*}
79lb chroot_hacks ${*}
80lb chroot_interactive ${*}
81
82Chroot chroot "dpkg-query -W" > chroot.packages.live
83
84# Deconfiguring chroot
85lb chroot_archives chroot remove ${*}
86lb chroot_apt remove ${*}
87lb chroot_hostname remove ${*}
88lb chroot_resolv remove ${*}
89lb chroot_hosts remove ${*}
90lb chroot_sysv-rc remove ${*}
91lb chroot_upstart remove ${*}
92lb chroot_tmpfs remove ${*}
93lb chroot_dpkg remove ${*}
94lb chroot_debianchroot remove ${*}
95lb chroot_sysfs remove ${*}
96lb chroot_selinuxfs remove ${*}
97lb chroot_proc remove ${*}
98lb chroot_devpts remove ${*}
99lb chroot_cache save ${*}
Note: See TracBrowser for help on using the repository browser.