3
## live-build(7) - System Build Scripts
4
## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
6
## live-build 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.
13
# Including common functions
14
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
16
# Setting static variables
17
DESCRIPTION="$(Echo 'manage /var/lib/dpkg')"
19
USAGE="${PROGRAM} {install|remove} [--force]"
23
# Reading configuration files
24
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
27
# Requiring stage file
28
Require_stagefile .stage/config .stage/bootstrap
32
Echo_message "Configuring tmpfs for /var/lib/dpkg"
35
Check_stagefile .stage/chroot_dpkg_tmpfs
43
mv chroot/var/lib/dpkg chroot/var/lib/dpkg.tmp
44
mkdir chroot/var/lib/dpkg
45
mount -t tmpfs tmpfs chroot/var/lib/dpkg
46
mv chroot/var/lib/dpkg.tmp/* chroot/var/lib/dpkg
47
rm -rf chroot/var/lib/dpkg.tmp
50
Create_stagefile .stage/chroot_dpkg_tmpfs
54
Echo_message "Deconfiguring tmpfs for /var/lib/dpkg"
62
mkdir -p chroot/var/lib/dpkg.tmp
63
mv chroot/var/lib/dpkg/* chroot/var/lib/dpkg.tmp
64
umount chroot/var/lib/dpkg
65
rm -rf chroot/var/lib/dpkg
66
mv chroot/var/lib/dpkg.tmp chroot/var/lib/dpkg
69
rm -f .stage/chroot_dpkg_tmpfs