Adding live-helper 1.0~a1-1.

This commit is contained in:
Daniel Baumann 2007-09-23 10:04:46 +02:00
parent 470cf1764b
commit 2b43599e46
240 changed files with 12000 additions and 3317 deletions

18
AUTHORS
View File

@ -1,18 +0,0 @@
Main Authors:
* Daniel Baumann <daniel@debian.org>
* Marco Amadori <marco.amadori@gmail.com>
Patches (alphabetical order):
* Alex Owen <r.a.owen@qmul.ac.uk>
* Bas Wijnen <wijnen@debian.org>
* Cedric Lucantis <omer@no-log.org>
* Frederic Lehobey <Frederic.Lehobey@free.fr>
* Guerkan Senguen <gurkan@linuks.mine.nu>
* Jason D. Clinton <me@jasonclinton.com>
* Kai Hendry <hendry@iki.fi>
* Marcelo D. Re <mdre@rectorado.unl.edu.ar>
* Markus Bauer <bauer-markus@web.de>
* Otavio Salvador <otavio@debian.org>
* Sebastian Raveau <sebastien.raveau@epita.fr>

16
HISTORY
View File

@ -1,16 +0,0 @@
Milestones of Debian Live
-------------------------
2006-02-14: Initial idea
http://blog.daniel-baumann.ch/2006/02/14#20060214_debian-live-initiative
2006-03-16: First CD images available
http://lists.alioth.debian.org/pipermail/debian-live-devel/2006-March/000048.html
2006-06-02: First netboot images available
2007-02-05: Image autobuilder in place
http://lists.alioth.debian.org/pipermail/debian-live-devel/2007-February/000764.html
2007-02-10: First USB images available
http://lists.alioth.debian.org/pipermail/debian-live-devel/2007-February/000790.html

View File

@ -1,58 +1,30 @@
# Makefile
#!/usr/bin/make -f
all: install
install:
@# Install main script
install -D -m 0755 src/main.sh $(DESTDIR)/usr/sbin/make-live
# Installing executables
mkdir -p $(DESTDIR)/usr/bin
cp helpers/lh_* helpers/make-live $(DESTDIR)/usr/bin
@# Install configuration file
install -D -m 0644 src/config $(DESTDIR)/etc/make-live.conf
# Installing shared data
mkdir -p $(DESTDIR)/usr/share/live-helper
cp -r functions hooks includes lists templates $(DESTDIR)/usr/share/live-helper
@# Install package lists
install -d -m 0755 $(DESTDIR)/usr/share/make-live/lists
install -m 0644 src/lists/* $(DESTDIR)/usr/share/make-live/lists
@# Install flavour hooks
install -d -m 0755 $(DESTDIR)/usr/share/make-live/hooks
install -m 0644 src/hooks/* $(DESTDIR)/usr/share/make-live/hooks
@# Install sub scripts
install -d -m 0755 $(DESTDIR)/usr/share/make-live/scripts
install -m 0755 src/scripts/*.sh $(DESTDIR)/usr/share/make-live/scripts
@# Install templates
cp -r templates $(DESTDIR)/usr/share/make-live
@# Install documentation
install -d -m 0755 $(DESTDIR)/usr/share/doc/live-package
install -m 0644 doc/*.txt $(DESTDIR)/usr/share/doc/live-package
@# Install manpages
install -d -m 0755 $(DESTDIR)/usr/share/man/man5
install -m 0644 doc/man/*.5 $(DESTDIR)/usr/share/man/man5
install -d -m 0755 $(DESTDIR)/usr/share/man/man8
install -m 0644 doc/man/*.8 $(DESTDIR)/usr/share/man/man8
$(MAKE) -C helpers install
# Installing documentation
mkdir -p $(DESTDIR)/usr/share/doc/live-helper
cp -r COPYING doc/* $(DESTDIR)/usr/share/doc/live-helper
uninstall:
@# Remove main script
rm -f $(DESTDIR)/usr/sbin/make-live
# Uninstalling executables
rm -f $(DESTDIR)/usr/bin/lh_* $(DESTDIR)/usr/bin/make-live
@# Remove configuration file
rm -f $(DESTDIR)/etc/make-live.conf
# Uninstalling shared data
rm -rf $(DESTDIR)/usr/share/live-helper
@# Remove shared data
rm -rf $(DESTDIR)/usr/share/make-live
# Uninstalling documentation
rm -rf $(DESTDIR)/usr/share/doc/live-helper
@# Remove documentation
rm -rf $(DESTDIR)/usr/share/doc/live-package
clean:
@# Remove manpages
rm -f $(DESTDIR)/usr/share/man/man5/make-live.*
rm -f $(DESTDIR)/usr/share/man/man8/make-live.*
$(MAKE) -C helpers uninstall
reinstall: uninstall install
reinstall: uninstall install

12
README
View File

@ -1,12 +0,0 @@
Debian Live Framework: make-live
================================
make-live is a utility to build Debian Live systems. It takes a Debian mirror as
an input and outputs a live system image (ISO image for CDs and DVDs, tarball
for netboot, or images for USB sticks). make-live is still in the early stage of
development, but has basic functionality and can be run successfully.
More information about Debian Live can be found at:
* <http://debian-live.alioth.debian.org/>
* <http://wiki.debian.org/DebianLive/>

10
TODO
View File

@ -1,10 +0,0 @@
Todo:
* output hiding
* d-i/g-i integration
* documentation
* l10n flags
* --disable-daemons
* general source tarballs

209
debian/changelog vendored
View File

@ -1,208 +1,5 @@
live-package (0.99.26-1) unstable; urgency=low
live-helper (1.0~a1-1) unstable; urgency=low
* New upstream release.
* Initial release, replacing live-package.
-- Daniel Baumann <daniel@debian.org> Fri, 9 Mar 2007 12:27:00 +0100
live-package (0.99.25-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Fri, 9 Mar 2007 01:49:00 +0100
live-package (0.99.24-1) unstable; urgency=low
* New upstream release:
- adds LIVE_INCLUDE_CHROOT to the manual exported variables as reported by
Mathieu Geli <mathieu.geli@gmail.com> (Closes: #412325).
-- Daniel Baumann <daniel@debian.org> Sun, 3 Mar 2007 12:25:00 +0100
live-package (0.99.23-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Wed, 21 Feb 2007 22:08:00 +0100
live-package (0.99.22-1) unstable; urgency=low
* New upstream release:
- updates manpage (Closes: #411008).
-- Daniel Baumann <daniel@debian.org> Fri, 16 Feb 2007 20:38:00 +0100
live-package (0.99.21-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Mon, 12 Feb 2007 15:06:00 +0100
live-package (0.99.20-1) unstable; urgency=low
* New upstream release:
- Fixed manual pruning in minimal flavour as suggested by
Bas Wijnen <wijnen@debian.org> (Closes: #410040).
-- Daniel Baumann <daniel@debian.org> Thu, 1 Feb 2007 17:35:00 +0100
live-package (0.99.19-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Wed, 31 Jan 2007 12:38:00 +0100
live-package (0.99.18-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Thu, 25 Jan 2007 08:29:00 +0100
live-package (0.99.17-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Wed, 24 Jan 2007 22:18:00 +0100
live-package (0.99.16-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Thu, 18 Jan 2007 16:25:00 +0100
live-package (0.99.15-1) unstable; urgency=low
* New upstream release:
- switched default distribution back to unstable, as unstable is usable
again from the kernel point of view (Closes: #400457).
- added file to the minimal package list (Closes: #400485).
-- Daniel Baumann <daniel@debian.org> Tue, 16 Jan 2007 21:24:00 +0100
live-package (0.99.14-3) unstable; urgency=high
* Adding workaround for new xorg packages by including xserver-xorg-input-all
and xserver-xorg-video-all in all X11 package lists. See #405639 for more
information.
* Adding xdebconfigurator to all X11 package lists.
-- Daniel Baumann <daniel@debian.org> Fri, 5 Jan 2007 22:34:00 +0100
live-package (0.99.14-2) unstable; urgency=high
* Adding workaround for initrd backup files (Closes: #404314).
-- Daniel Baumann <daniel@debian.org> Thu, 4 Jan 2007 20:52:00 +0100
live-package (0.99.14-1) unstable; urgency=medium
* New upstream release:
- fixed typo for policy-rc.d hack (Closes: #396813), thanks to
Markus Bauer <bauer-markus@web.de>.
- corrected manpage section (Closes: #396083), thanks to
Sune Vuorela <reportbug@pusling.com>.
- fixes script sourcing to exclude files in .svn (Closes: #396861),
thanks to Markus Bauer <bauer-markus@web.de>.
-- Daniel Baumann <daniel@debian.org> Mon, 6 Nov 2006 00:00:00 +0200
live-package (0.99.13-1) unstable; urgency=medium
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Mon, 30 Oct 2006 00:00:00 +0200
live-package (0.99.12-1) unstable; urgency=medium
* New upstream release.
- Reverted mangling of LIVE_DISTRIBUTION for sources.list generation
(Closes: #394226).
-- Daniel Baumann <daniel@debian.org> Mon, 23 Oct 2006 00:00:00 +0200
live-package (0.99.11-1) unstable; urgency=medium
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Mon, 16 Oct 2006 00:00:00 +0200
live-package (0.99.10-1) unstable; urgency=medium
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Mon, 9 Oct 2006 00:00:00 +0200
live-package (0.99.9-1) unstable; urgency=medium
* New upstream release:
- adds support for custom repositories (Closes: #387068).
- using proxy for chroot creating too (Closes: #390378).
-- Daniel Baumann <daniel@debian.org> Mon, 2 Oct 2006 00:00:00 +0200
live-package (0.99.8-1) unstable; urgency=medium
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Mon, 25 Sep 2006 00:00:00 +0200
live-package (0.99.7-1) unstable; urgency=medium
* New upstream release:
- removes the now outdated handling of testing specific kernels
(Closes: #387562).
- added fix from Bas Wijnen <wijnen@debian.org> for space handling in
arguments (Closes: #388204).
- fixes package list handling similar to the fix suggested by Alex Owen
<r.alex.owen@gmail.com> (Closes: #388060).
-- Daniel Baumann <daniel@debian.org> Mon, 18 Sep 2006 00:00:00 +0200
live-package (0.99.6-1) unstable; urgency=medium
* New upstream release:
- fixing netboot.
-- Daniel Baumann <daniel@debian.org> Mon, 11 Sep 2006 00:00:00 +0200
live-package (0.99.5-1) unstable; urgency=low
* New upstream release.
* Set maintainer to the project list.
-- Daniel Baumann <daniel@debian.org> Mon, 4 Sep 2006 00:00:00 +0200
live-package (0.99.4-1) unstable; urgency=low
* New upstream release:
- Added patch from Alex Owen <r.a.owen@qmul.ac.uk> to update pxelinux.cfg
for NFS root in casper (Closes: #380512).
- Temporarily hacks xorg configuration file to remove BusID and set
default driver to vesa (Closes: #382391).
-- Daniel Baumann <daniel@debian.org> Mon, 28 Aug 2006 00:00:00 +0200
live-package (0.99.3-1) unstable; urgency=low
* New upstream release:
- fixed configuration file handling (Closes: #384598).
* Update long descriptiong (Closes: #382473).
-- Daniel Baumann <daniel@debian.org> Mon, 21 Aug 2006 00:00:00 +0200
live-package (0.99.2-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Mon, 31 Jul 2006 00:00:00 +0200
live-package (0.99.1-1) unstable; urgency=low
* New upstream release.
-- Daniel Baumann <daniel@debian.org> Mon, 24 Jul 2006 00:00:00 +0200
live-package (0.99-1) unstable; urgency=low
* Initial release.
-- Daniel Baumann <daniel@debian.org> Mon, 17 Jul 2006 00:00:00 +0200
-- Daniel Baumann <daniel@debian.org> Mon, 12 Mar 2007 00:00:00 +0100

25
debian/control vendored
View File

@ -1,4 +1,4 @@
Source: live-package
Source: live-helper
Section: misc
Priority: optional
Maintainer: Debian Live <debian-live-devel@lists.alioth.debian.org>
@ -6,16 +6,21 @@ Uploaders: Daniel Baumann <daniel@debian.org>, Marco Amadori <marco.amadori@gmai
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Package: live-package
Package: live-helper
Architecture: all
Depends: cdebootstrap, genext2fs, genisoimage | mkisofs, squashfs-tools
Recommends: aespipe
Depends: cdebootstrap | debootstrap, genext2fs, genisoimage | mkisofs, squashfs-tools
Conflicts: live-package
Replaces: live-package
Suggests: aesloop
Provides: make-live
Description: utility to build Debian Live systems
make-live is a utility to build Debian Live systems. It takes a Debian mirror
as an input and outputs a live system image (ISO image for CDs and DVDs,
tarballs for netboot, or images for USB sticks). make-live is still in the
early stage of development, but has basic functionality and can be run
successfully.
Description: Debian Live helper programs
Live-helper is a collection of programs that can be used to build Debian Live
system images. The philosophy behind live-helper is to provide a collection of
small, simple, and easily understood tools that can be used in your own program
to automate building of a Live system.
.
A typical program that uses live-helper will call several live-helper commands
in sequence. Live-helper commands are all named with a "lh_" prefix. Examples
of such a program that uses live-helper is make-live (included here).
.
Homepage: <http://debian-live.alioth.debian.org/>

6
debian/copyright vendored
View File

@ -1,9 +1,9 @@
This package was debianized by Daniel Baumann <daniel@debian.org> on
Mon, 17 Jul 2006 00:00:00 +0200.
Mon, 12 Mar 2007 00:00:00 +0100.
It was downloaded from <http://debian-live.alioth.debian.org/>.
Upstream: Debian Live Project <debian-live-devel@lists.alioth.debian.org>
Upstream Author: Debian Live <debian-live-devel@lists.alioth.debian.org>
License:
@ -27,7 +27,7 @@ License:
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL file.
License (contrib/syslinux-splash/*, templates/isolinux/splash.rle):
License (contrib/syslinux-splash/*, templates/syslinux/splash.rle):
The derivated splash for Debian Live was done by Daniel Baumann
<daniel@debian.org> from the original of Mark Riedesel. Daniels own

103
debian/cron.daily vendored
View File

@ -1,103 +0,0 @@
#!/bin/sh
# Check for make-live executable
if [ ! -x /usr/sbin/make-live ]
then
exit 0
fi
# Check for make-live default
if [ -r /etc/default/make-live ]
then
. /etc/default/make-live
else
echo "E: /etc/default/make-live missing."
exit 1
fi
# Check for autobuild
if [ "${AUTOBUILD}" = "false" ]
then
exit 0
fi
# Check for build directory
if [ ! -d "${AUTOBUILD_DIRECTORY}" ]
then
mkdir -p "${AUTOBUILD_DIRECTORY}"
else
# FIXME: maybe we should just remove the left overs.
echo "E: ${AUTOBUILD_DIRECTORY} needs cleanup."
exit 1
fi
# Process image autobuilding
cd "${AUTOBUILD_DIRECTORY}"
for AUTOBUILD_DISTRIBUTION in ${AUTOBUILD_DISTRIBUTIONS}
do
for AUTOBUILD_PACKAGE_LIST in ${AUTOBUILD_PACKAGE_LISTS}
do
if [ ! -f "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}_${AUTOBUILD_DATE}-iso-log.txt ]
then
# Generating images
mkdir debian-live
make-live -t iso -d ${AUTOBUILD_DISTRIBUTION} -p ${AUTOBUILD_PACKAGE_LIST} -m ${LIVE_MIRROR} ${AUTOBUILD_OPTIONS} > debian-live/log.txt 2>&1
fi
if [ -f debian-live/binary.iso ] && [ -f debian-live/source.iso ]
then
# Moving logs
mkdir -p "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log
mv debian-live/log.txt "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}_${AUTOBUILD_DATE}-iso-log.txt
mv debian-live/packages.txt "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}_${AUTOBUILD_DATE}-iso-packages.txt
# Moving images
mkdir -p "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/${AUTOBUILD_ARCHITECTURE}
mv debian-live/binary.iso "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/${AUTOBUILD_ARCHITECTURE}/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}.iso
mkdir -p "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/source
mv debian-live/source.iso "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/source/debian-live-${AUTOBUILD_DISTRIBUTION}-source-${AUTOBUILD_PACKAGE_LIST}.iso
fi
# Cleanup
rm -rf debian-live
if [ ! -f "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}_${AUTOBUILD_DATE}-usb-log.txt ]
then
# Generating images
mkdir debian-live
make-live -t usb -d ${AUTOBUILD_DISTRIBUTION} -p ${AUTOBUILD_PACKAGE_LIST} -m ${LIVE_MIRROR} ${AUTOBUILD_OPTIONS} > debian-live/log.txt 2>&1
fi
if [ -f debian-live/binary.img ]
then
# Moving logs
mkdir -p "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log
mv debian-live/log.txt "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}_${AUTOBUILD_DATE}-usb-log.txt
mv debian-live/packages.txt "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/log/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}_${AUTOBUILD_DATE}-usb-packages.txt
# Moving images
mkdir -p "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/${AUTOBUILD_ARCHITECTURE}
mv debian-live/binary.img "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/${AUTOBUILD_ARCHITECTURE}/debian-live-${AUTOBUILD_DISTRIBUTION}-${AUTOBUILD_ARCHITECTURE}-${AUTOBUILD_PACKAGE_LIST}.img
fi
# Cleanup
rm -rf debian-live
done
done
# Cleanup
umount -f "${AUTOBUILD_DIRECTORY}"/debian-live/chroot/proc > /dev/null 2>&1
rm -rf "${AUTOBUILD_DIRECTORY}"
# MD5SUMS
for DIRECTORY in "${AUTOBUILD_SERVER}"/daily-builds/${AUTOBUILD_DATE}/*
do
cd "${DIRECTORY}"
md5sum * > MD5SUMS
done
# Current symlink
rm -f "${AUTOBUILD_SERVER}"/daily-builds/current
ln -s ${AUTOBUILD_DATE} "${AUTOBUILD_SERVER}"/daily-builds/current

17
debian/default vendored
View File

@ -1,17 +0,0 @@
# Defaults for make-live cron.daily
AUTOBUILD="false"
AUTOBUILD_DISTRIBUTIONS="etch sid"
AUTOBUILD_PACKAGE_LISTS="standard kde-desktop gnome-desktop xfce-desktop"
AUTOBUILD_OPTIONS="--with-source"
AUTOBUILD_DIRECTORY="/srv/tmp/make-live"
AUTOBUILD_SERVER="/srv/debian-live"
AUTOBUILD_ARCHITECTURE="`dpkg --print-architecture`"
AUTOBUILD_DATE="`date +%Y%m%d`"
LIVE_MIRROR="http://ftp.debian.org/debian/"
# Source /etc/make-live.conf
# . /etc/make-live.conf

3
debian/docs vendored
View File

@ -1,3 +0,0 @@
AUTHORS
HISTORY
TODO

17
debian/rules vendored
View File

@ -3,8 +3,9 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
upstream: # Needs svn
cd .. && svn co svn://svn.debian.org/debian-live/dists/trunk/live-package || exit 0
upstream:
# Needs: subversion
cd .. && svn co svn://svn.debian.org/debian-live/dists/trunk/live-helper || exit 0
find . -type d -name .svn -exec rm -rf {} \; || exit 0
build:
@ -22,18 +23,22 @@ install: build
dh_installdirs
# Installing package
$(MAKE) install DESTDIR=$(CURDIR)/debian/live-package
install -D debian/default debian/live-package/etc/default/make-live
$(MAKE) install DESTDIR=$(CURDIR)/debian/live-helper
# Removing double files
rm -f debian/live-helper/usr/share/doc/live-helper/COPYING
rm -f debian/live-helper/usr/share/doc/live-helper/ChangeLog
mv debian/live-helper/usr/share/doc/live-helper/ChangeLog.old \
debian/live-helper/usr/share/doc/live-helper/changelog.old
binary-arch: build install
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installchangelogs doc/ChangeLog
dh_installdocs
dh_install
dh_installcron
dh_compress
dh_fixperms
dh_installdeb

4
doc/AUTHORS Normal file
View File

@ -0,0 +1,4 @@
Main Authors:
* Daniel Baumann <daniel@debian.org>
* Marco Amadori <marco.amadori@gmail.com>

30
doc/CREDITS Normal file
View File

@ -0,0 +1,30 @@
Patches (alphabetical order):
* Alex Owen <r.a.owen@qmul.ac.uk>
* Bas Wijnen <wijnen@debian.org>
* Ben Armstrong <synrg@debian.org>
* Cedric Lucantis <omer@no-log.org>
* Frederic Lehobey <Frederic.Lehobey@free.fr>
* Guerkan Senguen <gurkan@linuks.mine.nu>
* Hadar Weiss <whadar@gmail.com>
* Jason D. Clinton <me@jasonclinton.com>
* Kai Hendry <hendry@iki.fi>
* Marcelo D. Re <mdre@rectorado.unl.edu.ar>
* Markus Bauer <bauer-markus@web.de>
* Mathieu Geli <mathieu.geli@gmail.com>
* Otavio Salvador <otavio@debian.org>
* Scott Edwards <debian@foss.daxal.com>
* Sebastian Raveau <sebastien.raveau@epita.fr>
Donations (alphaetical order):
* Gracie <gracie@bithawk.net>
Special thanks (alphabetical order):
* Ben Armstrong <synrg@debian.org> for his IRC support.
* Jason D. Clinton <me@jasonclinton.com> for his work on netboot type.
* Otavio Salvador <otavio@debian.org> for his QA patches.
* Sebastian Raveau <sebastien.raveau@epita.fr> for his work on encryption
support.
* Scott Edwards <debian@foss.daxal.com> for his work on d-i/g-i integration.

4
doc/ChangeLog Normal file
View File

@ -0,0 +1,4 @@
2007-03-12 Daniel Baumann <daniel@debian.org>
* Rewritten live-package.
* Uploaded 1.0~a1-1.

27
doc/NEWS Normal file
View File

@ -0,0 +1,27 @@
News:
* 2006-02-14: Project announcement.
http://blog.daniel-baumann.ch/2006/02/14#20060214_debian-live-initiative
* 2006-02-28: Setup project resources.
http://blog.daniel-baumann.ch/2006/02/28#20060228_debian-live-resources
* 2006-03-16: Added support for ISO image generation.
http://lists.alioth.debian.org/pipermail/debian-live-devel/2006-March/000048.html
* 2006-06-02: Added support for netboot image generation.
http://lists.alioth.debian.org/pipermail/debian-live-devel/2006-May/000185.html
* 2006-07-17: Uploaded live-package to Debian unstable.
http://packages.debian.org/changelogs/pool/main/l/live-package/current/changelog#versionversion0.99-1
* 2007-02-05: Setup image autobuild server.
http://lists.alioth.debian.org/pipermail/debian-live-devel/2007-February/000764.html
* 2007-02-10: Added support for USB image generation.
http://lists.alioth.debian.org/pipermail/debian-live-devel/2007-February/000790.html
* 2007-02-17: Added support for encrypted live filesystem.
http://lists.alioth.debian.org/pipermail/debian-live-devel/2007-February/000836.html
* 2007-03-12: Uploaded live-helper to Debian unstable.

84
doc/README Normal file
View File

@ -0,0 +1,84 @@
* lh_config
* lh_bootstrap
|_ lh_cdebootstrap | lh_debootstrap
* lh_chroot
|_ lh_chroot_proc install
|_ lh_chroot_sysfs install
|_ lh_chroot_debianchroot install
|_ lh_chroot_sysvrc install
|_ lh_chroot_hosts install
|_ lh_chroot_resolv install
|_ lh_chroot_apt install
|_ lh_chroot_sources install
|_ lh_chroot_linuximage install
|
|_ lh_chroot_tasks
|_ lh_chroot_packageslists
|_ lh_chroot_packages
|_ lh_chroot_localpackages
|_ lh_chroot_localpackageslist
|_ lh_chroot_localization
|_ lh_chroot_hacks
|_ lh_chroot_localincludes
|_ lh_chroot_sysvinit
|_ lh_chroot_hooks
|_ lh_chroot_localhooks
|_ lh_chroot_symlinks
|
|_ lh_chroot_linuximage remove
|_ lh_chroot_sources remove
|_ lh_chroot_apt remove
|_ lh_chroot_resolv remove
|_ lh_chroot_hosts remove
|_ lh_chroot_sysvrc remove
|_ lh_chroot_debianchroot remove
|_ lh_chroot_sysfs remove
|_ lh_chroot_proc remove
* lh_binary
|_ lh_binary_rootfs
|_ lh_binary_manifest
|_ lh_binary_encryption
|
|_ lh_chroot_proc install
|_ lh_chroot_sysfs install
|_ lh_chroot_hosts install
|_ lh_chroot_resolv install
|_ lh_chroot_sources install
|
|_ lh_binary_linuximage
|_ lh_binary_memtest86
|_ lh_binary_syslinux
|_ lh_binary_includes
|_ lh_binary_localincludes
|_ lh_binary_md5sum
|
|_ lh_binary_iso
|_ lh_binary_net
|_ lh_binary_usb
|
|_ rm -f .stage/chroot_sources
|_ lh_chroot_resolv remove
|_ lh_chroot_hosts remove
|_ lh_chroot_sysfs remove
|_ lh_chroot_proc remove
* lh_source
|_ lh_chroot_hosts install
|_ lh_chroot_resolv install
|_ lh_chroot_sources install
|
|_ lh_source_download
|
|_ lh_source_generic
|_ lh_source_iso
|_ lh_source_net
|_ lh_source_usb
|
|_ rm -f .stage/chroot_sources
|_ lh_chroot_resolv remove
|_ lh_chroot_hosts remove
* lh_clean

13
doc/TODO Normal file
View File

@ -0,0 +1,13 @@
Fixme:
* check all Require_stagefile calls
* make helpers call required stuff when needed
* integrate lh_chroot_hacks
* cleanup variable names
* do not use full-path anymore
Todo:
* write manpage and documentation
* write lh_binary_di and lh_binary_gi
* write lh_binary_grub

View File

@ -1,9 +0,0 @@
Debian Live Framework: Frequently Asked Questions (FAQ)
=======================================================
Q: What is the root password?
A: There is none. You can switch to root with 'sudo su -' or set a password with
'sudo passwd'.
Q: What is the user password?
A: The user password for casper is 'live'.

View File

@ -1,215 +0,0 @@
.TH MAKE-LIVE 8 "Mon, 4 Sep 2006" "0.99" "Debian Live framework"
.SH NAME
make-live \- utility to build Debian Live systems
.SH SYNOPSIS
.B make-live
.RB [\| \-a \||\| \-\-architecture
.IR ARCHITECTURE \|]
.RB [\| \-b \||\| \-\-bootappend
.IR KERNEL_PARAMETER \||\| \|"KERNEL_PARAMETERS\|" \|]
.RB [\| \-\-config
.IR FILE \|]
.RB [\| \-\-clone
.IR DIRECTORY \|]
.RB [\| \-c \||\| \-\-chroot
.IR DIRECTORY \|]
.RB [\| \-d \||\| \-\-distribution
.IR DISTRIBUTION \|]
.RB [\| \-e \||\| \-\-encryption
.IR ALGORITHM \|]
.RB [\| \-\-filesystem
.IR FILESYSTEM \|]
.RB [\| \-f \||\| \-\-flavour
.IR BOOTSTRAP_FLAVOUR \|]
.RB [\| \-\-hook
.IR COMMAND \||\| \|"COMMANDS\|" \||\|| FILE \|]
.RB [\| \-\-include-chroot
.IR FILE \||\| DIRECTORY \|]
.RB [\| \-\-include-image
.IR FILE \||\| DIRECTORY \|]
.RB [\| \-k \||\| \-\-kernel
.IR KERNEL_FLAVOUR \|]
.RB [ \-\-manifest
.IR PACKAGE \|]
.RB [\| \-m \||\| \-\-mirror
.IR URL \|]
.RB [\| \-\-mirror-security
.IR URL \|]
.RB [\| \-\-packages
.IR PACKAGE \||\| \|"PACKAGES\|" \|]
.RB [\| \-\-preseed
.IR FILE \|]
.RB [\| \-p \||\| \-\-package-list
.IR LIST \||\| FILE \|]
.RB [\| \-\-proxy-ftp
.IR URL \|]
.RB [\| \-\-proxy-http
.IR URL \|]
.RB [\| \-r \||\| \-\-root
.IR DIRECTORY \|]
.RB [\| \-s \||\| \-\-sections
.IR SECTION \||\| \|"SECTIONS\|" \|]
.RB [\| \-\-server-address
.IR HOSTNAME \||\| IP \|]
.RB [\| \-\-server-path
.IR DIRECTORY \|]
.RB [\| \-\-templates
.IR DIRECTORY \|]
.RB [\| \-t \||\| \-\-type
.IR TYPE \|]
.RB [\| \-\-with-generic-indices \|]
.RB [\| \-\-without-generic-indices \|]
.RB [\| \-\-with-source \|]
.RB [\| \-\-without-source \|]
.PP
.B make-live
.RB \-h \||\| \-\-help
.br
.B make-live
.RB \-u \||\| \-\-usage
.br
.B make-live
.RB \-v \||\| \-\-version
.SH DESCRIPTION
make-live is a utility to build Debian Live systems. It takes a Debian mirror as an input and outputs a live system image (ISO image for CDs and DVDs, or tarball for netboot). make-live is still in the early stage of development, but has basic functionality and can be run successfully.
.SH OPTIONS
.TP
.BI "\-a, \-\-architecture " ARCHITECTURE
build an image for another architecture than the autodetected one. This is usefull for e.g. building i386 images on an amd64 machine. Instead of this flag, the environment variable LIVE_ARCHITECTURE can be used (Default: `dpkg-architecture -qDEB_BUILD_ARCH`).
.TP
.BI "\-b, \-\-bootappend " KERNEL_PARAMETER \||\| \|"KERNEL_PARAMETERS\|"
passes kernel parameters to the bootloader, e.g. 'quiet' or 'vga=792' etc. Instead of this flag, the environment variable LIVE_BOOTAPPEND can be used (Default: empty).
.TP
.BI "\-\-config " FILE
uses another configuration file in addition to the default one. Settings in the additional configuration file do overwrite the settings from /etc/make-live.conf. Instead of this flag, the environment variable LIVE_CONFIG can be used (Default: /etc/make-live.conf).
.TP
.BI "\-\-clone " DIRECTORY
Clones the package selection and configuration from a given root directory. It
will output the settings to $LIVE_ROOT/preseed.cloned and $LIVE_ROOT/plist.clone
for easy reuse with \-\-preseed and \-\-package-list. Instead of this flag, the
environment variable LIVE_CLONE can be used.
.TP
.BI "\-c, \-\-chroot " DIRECTORY
specifies the chroot directory. Instead of this flag, the environment variable LIVE_CHROOT (Default: $LIVE_ROOT/chroot").
.TP
.BI "\-d, \-\-distribution " DISTRIBUTION
specifies the distribution to be used. Allowed values are distributions names like unstable and testing, or codenames like sid and etch. Instead of this flag, the environment variable LIVE_DISTRIBUTION can be used (Default: sid).
.TP
.BI "\-e, \-\-encryption " ALGORITHM
specifies the filesystem encryption algorithm. Does not work if -t is set to plain. Instead of this flag, the environment variable LIVE_ENCRYPTION can be used (Default: empty). Valid algorithms are: AES128, AES192 and AES256.
.TP
.BI "\-\-filesystem " FILESYSTEM
Specifies the filesystem for the compressed image. At the moment, ext2, plain and squashfs are supported. Instead of this flag, the environment variable LIVE_FILESYSTEM can be used (Default: squashfs for iso, plain for net).
.TP
.BI "\-f, \-\-flavour " BOOTSTRAP_FLAVOUR
specifies the bootstrap flavour. This can be either standard or minimal. Instead of this flag, the environment variable LIVE_FLAVOUR can be used (Default: standard).
.TP
.BI "\-\-hook " COMMAND \||\| \|"COMMANDS\|" \||\|| FILE
specifies one or more commands to be executed in the chroot. Instead of this flag, the environment variable LIVE_HOOK can be used (Default: empty).
.TP
.BI "\-\-include-chroot " FILE \||\| DIRECTORY
specifies a file or a directory to be included into the chroot. Instead of this flag, the environment variable LIVE_INCLUDE_CHROOT can be used (Default: empty).
.TP
.BI "\-\-include-image " FILE \||\| DIRECTORY
specifies a file or directory which will be copied inside the image. Instead of this flag, the environment variable LIVE_INCLUDE_IMAGE can be used (Default: empty).
.TP
.BI "\-k, \-\-kernel " KERNEL_FLAVOUR
specifies the kernel image flavour. Instead of this flag, the environment variable LIVE_KERNEL can be used (Default: auto-detected).
.TP
.BI "\-\-manifest " PACKAGE
specifies the last package to install before creating the filesystem.manifest-desktop list, mainly used with ubuntu live, PACKAGE should probably be "ubuntu-live" for ubuntu desktop livecd's. Instead of this flag, the environment variable LIVE_MANIFEST can be used (Default: do not create filesystem.manifest-desktop).
.TP
.BI "\-m, \-\-mirror " URL
specifies the debian mirror where make-live will download the packages from. Instead of this flag, the environment variable LIVE_MIRROR can be used (Default: http://ftp.debian.org/debian).
.TP
.BI "\-\-mirror-security" URL
specifies the debian security mirror where make-live will download the packages from. Instead of this flag, the environment variable LIVE_MIRROR_SECURITY can be used (Default: http://security.debian.org/debian).
.TP
.BI "\-\-packages " PACKAGE \||\| \|"PACKAGES\|"
specifies a list of packages to install into the chroot. Instead of this flag, the environment variable LIVE_PACKAGES can be used (Default: empty).
.TP
.BI "\-p, \-\-package-list " FILE
specifies an external package list file, one package for each line. It overrides list option. Instead of this flag, the environment variable LIVE_PACKAGE_LIST can be used (Default: standard).
.TP
.BI "\-\-preseed " FILE
clone the packages selection and configuration from the provided
root directory.
.TP
.BI "\-\-proxy-ftp " URL
specifies the value of ftp_proxy inside the chrooted environment. Instead of this flag, the environment variable LIVE_PROXY_FTP can be used (Default: empty).
.TP
.BI "\-\-proxy-http " URL
specifies the value of http_proxy inside the chrooted environment. Instead of this flag, the environment variable LIVE_PROXY_HTTP can be used (Default: empty).
.TP
.BI "\-r, \-\-root " DIRECTORY
specifies the root directory where the images/tarballs are built. Instead of this flag, the environment variable LIVE_ROOT can be used (Default: `pwd`/debian-live).
.TP
.BI "\-s, \-\-sections " SECTIONS
specifies the debian sections. Instead of this flag, the environment variable LIVE_SECTIONS can be used (Default: main).
.TP
.BI "\-\-server-address " HOSTNAME \||\| IP
specifies the server address you want to use for netboot. Instead of this flag, the environment variable LIVE_SERVER_ADDRESS can be used (Default: 192.168.1.1).
.TP
.BI "\-\-server-path" DIRECTORY
specifies the directory on the server, where you have unpacked the netboot image. Instead of this flag, the environment variable LIVE_SERVER_PATH can be used (Default: /srv/debian-live).
.TP
.BI "\-\-templates " DIRECTORY
specifies a templates directory to use instead of the default one. Instead of this flag, the environment variable LIVE_TEMPLATES can be used (Default: /usr/share/make-live/templates).
.TP
.BI "\-t, \-\-type " TYPE
specifies the image type to generate. TYPE can be one of: iso, net, or usb. Instead of this flag, the environment variable LIVE_TYPE can be used (Default: iso).
.TP
.B \-\-with-generic-indices
enables use of generic Debian package indices. Instead of this flag, the environment variable LIVE_GENERIC_INDICES can be used (Default: yes).
.TP
.B \-\-without-generic-indices
disables use of generic Debian package indices. Instead of this flag, the environment variable LIVE_GENERIC_INDICES can be used (Default: yes).
.TP
.B \-\-with-source
enables generation of source images. Instead of this flag, the environment variable LIVE_SOURCE can be used (Default: no).
.TP
.B \-\-without-source
disables generation of source images. Instead of this flag, the environment variable LIVE_SOURCE can be used (Default: no).
.PP
.TP
.B \-h, \-\-help
display help and exit
.TP
.B \-u, \-\-usage
show usage and exit
.TP
.B \-v, \-\-version
output version information and exit
.SH LISTS
Every list does already include the Debian standard package selection.
.TP
.B gnome | gnome-core | gnome-full
include GNOME.
.TP
.B kde | kde-core | kde-full | kde-extra
include KDE.
.TP
.B x11 | x11-core
include X-Window-System only.
.TP
.B xfce
include Xfce.
.SH BUGS
.B make-live
works fully on amd64 and i386, partially on alpha, hppa, ia64, mips, mipsel, powerpc, s390 and sparc. Other architectures, such as arm and m68k, as well as non-linux ports of Debian, like hurd-i386, are currently not supported.
.SH HOMEPAGE
Debian Live project <http://live.debian.net/>
.SH SEE ALSO
.BR make-live.conf(5)
.SH AUTHOR
make-live was written by Daniel Baumann <daniel@debian.org> and Marco Amadori
<marco.amadori@gmail.com>.

View File

@ -1,94 +0,0 @@
.TH MAKE-LIVE.CONF 5 "Mon, 4 Sep 2006" "0.99" "Debian Live framework"
.SH NAME
make-live.conf \- configuration file for make-live(1)
.SH DESCRIPTION
make-live is a utility to build Debian Live systems. It takes a Debian mirror as an input and outputs a live system image (ISO image for CDs and DVDs, or tarball for netboot). make-live is still in the early stage of development, but has basic functionality and can be run successfully.
.SH ENVIRONMENT
.TP
.B LIVE_ARCHITECTURE
build an image for another architecture than the autodetected one. This is usefull for e.g. building i386 images on an amd64 machine. Instead of this environment variable, the flag \-a, \-\-architecture can be used (Default: `dpkg-architecture -qDEB_BUILD_ARCH`).
.TP
.B LIVE_BOOTAPPEND
specifies additional bootparameters to the kernel (Default: none).
.TP
.B LIVE_CONFIG
uses another configuration file in addition to the default one, if existing, in /etc/make-live.conf. Settings in the additional configuration file do overwrite the settings from /etc/make-live.conf. Instead of this variable, the flag \-c or \-\-config can be used (Default: empty).
.TP
.B LIVE_DISTRIBUTION
specifies the distribution to be used. Allowed values are all Debian distributions (oldstable, stable, testing, unstable), although only unstable (default) is possible for now. Instead of this environment variable, the flag \-d, \-\-distribution can be used (Default: unstable).
.TP
.B LIVE_FLAVOUR
specifies the bootstrap flavour. This can be either standard (default) or minimal. Instead of this environment variable, the flag \-f, \-\-flavour can be used.
.TP
.B LIVE_FILESYSTEM
specifies the filesystem to be used for the root filesystem image
(Default: squashfs).
.TP
.B LIVE_GENERIC_INDICES
specifies if generic Debian indices should be used (Default: enable).
.TP
.B LIVE_FTPPROXY
specifies the value of ftp_proxy inside the chrooted environment. Instead of this environment variable, the flag \-\-ftp-proxy can be used (Default: empty).
.TP
.B LIVE_HOOK
specifies one or more commands to be executed in the chroot. Instead of this environment variable, the flag \-\-hook can be used (Default: empty).
.TP
.B LIVE_INCLUDE_ROOT
specifies a file or a directory to be included into the chroot. Instead of this environment variable. the flag \-\-include-root can be used (Default: empty).
.TP
.B LIVE_KERNEL
specifies the kernel image flavour. Instead of this environment variable, the flag \-k, \-\-kernel can be used.
.TP
.BI LIVE_MANIFEST
specifies the last package to install before creating the filesystem.manifest-desktop list, mainly used with ubuntu live, in those system it should probably be set to "ubuntu-live" for ubuntu desktop livecd's (Default: do not create filesystem.manifest-desktop).
.TP
.B LIVE_MIRROR
specifies the debian mirror where make-live will download the packages from. Instead of this environment variable, the flag \-m, \-\-mirror LIVE_MIRROR can be used (Default: http://ftp.debian.org/debian).
.B LIVE_MIRROR_KEY
specifies the archive signing key. Instead of this environment variable, the flav \-\-mirror-key can be used (Default: http://ftp-master.debian.org/ziyi_key_2006.asc).
.TP
.B LIVE_PACKAGES
specifies a list of packages to install into the chroot. Instead of this environment variable, the flag \-\-packakges can be used (Default: empty).
.TP
.B LIVE_PACKAGE_LIST
specifies a file which contains a list of packages to install.
.TP
.B LIVE_PROXY_FTP
specifies the value of ftp_proxy inside the chrooted environment. Instead of this environment variable, the flag \-\-ftp-proxy can be used (Default: empty).
.TP
.B LIVE_PROXY_HTTP
specifies the value of http_proxy inside the chrooted environment. Instead of this environment variable, the flag \-\-http-proxy can be used (Default: empty).
.TP
.B LIVE_ROOT
specifies the root directory where the images/tarballs are built. Instead of this environment variable, the flag \-r or \-\-root can bse used (Default: `pwd`/debian-live).
.B LIVE_SECTIONS
specifies the debian sections. Instead of this environment variable, the flag \-s, \-\-sections can be used (Default: main).
.B LIVE_SERVER_ADDRESS
specifies the IP address or hostname of the netboot server (Default: none).
.TP
.B LIVE_SERVER_PATH
specifies the directory of the chroot on the netboot server (Default: none).
.TP
.B LIVE_TEMPLATES
specifies a directory to be used for templates instead of the default one.
(Default: "/usr/share/make-live/templates")
.TP
.B LIVE_TYPE
specifies the image type.
.SH BUGS
.B make-live
works fully on amd64 and i386, partially on alpha, hppa, ia64, mips, mipsel, powerpc, s390 and sparc. Other architectures, such as arm and m68k, as well as non-linux ports of Debian, like hurd-i386, are currently not supported.
.SH HOMEPAGE
Debian Live project <http://live.debian.net/>
.SH SEE ALSO
.BR make-live(1)
.SH AUTHOR
make-live was written by Daniel Baumann <daniel@debian.org> and Marco Amadori
<marco.amadori@gmail.com>.

13
functions/chroot.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# chroot.sh - chroot wrapper
set -e
Chroot ()
{
COMMANDS="${1}"
# Executing commands in chroot
chroot "${LIVE_CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" ftp_proxy="${LH_APT_FTPPROXY}" http_proxy="${LH_APT_HTTPPPROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" ${COMMANDS}
}

16
functions/conffile.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# conffile.sh - handle configuration files
set -e
Read_conffile ()
{
CONFFILE="${1}"
# Reading configuration file
if [ -r "${CONFFILE}" ]
then
. "${CONFFILE}"
fi
}

384
functions/defaults.sh Executable file
View File

@ -0,0 +1,384 @@
#!/bin/sh
# defaults.sh - handle default values
set -e
Set_defaults ()
{
## config/common
# Setting package manager
if [ -z "${LH_APT}" ]
then
LH_APT="aptitude"
fi
# Setting apt ftp proxy
if [ -z "${LH_APT_FTPPROXY}" ] && [ -n "${ftp_proxy}" ]
then
LH_APT_FTPPROXY="${ftp_proxy}"
else
if [ -n "${LH_APT_FTPPROXY}" ] && [ "${LH_APT_FTPRPOXY}" != "${ftp_proxy}" ]
then
ftp_proxy="${LH_APT_FTPRPOXY}"
fi
fi
# Setting apt http proxy
if [ -z "${LH_APT_HTTPPROXY}" ] && [ -n "${http_proxy}" ]
then
LH_APT_HTTPPROXY="${http_proxy}"
else
if [ -n "${LH_APT_HTTPPROXY}" ] && [ "${LH_APT_HTTPRPOXY}" != "${http_proxy}" ]
then
http_proxy="${LH_APT_HTTPPROXY}"
fi
fi
# Setting apt indices
if [ -z "${LH_APT_GENERIC}" ]
then
LH_APT_GENERIC="enabled"
fi
# Setting apt pdiffs
if [ -z "${LH_APT_PDIFFS}" ]
then
LH_APT_PDIFFS="enabled"
fi
# Setting apt recommends
if [ -z "${LH_APT_RECOMMENDS}" ]
then
LH_APT_RECOMMENDS="enabled"
fi
# Setting bootstrap program
if [ -z "${LH_BOOTSTRAP}" ]
then
if [ -x "/usr/bin/cdebootstrap" ]
then
LH_BOOTSTRAP="cdebootstrap"
elif [ -x "/usr/sbin/debootstrap" ]
then
LH_BOOTSTRAP="debootstrap"
else
echo "E: Can't process file /usr/bin/cdebootstrap or /usr/sbin/debootstrap (FIXME)"
exit 1
fi
fi
# Setting cache option
if [ -z "${LH_CACHE}" ]
then
LH_CACHE="enabled"
fi
# Setting debconf frontend
if [ -z "${LH_DEBCONF_FRONTEND}" ]
then
LH_DEBCONF_FRONTEND="noninteractive"
fi
if [ -z "${LH_DEBCONF_PRIORITY}" ]
then
LH_DEBCONF_PRIORITY="critical"
fi
# Setting genisoimage
if [ -x /usr/bin/genisoimage ]
then
LH_GENISOIMAGE="genisoimage"
elif [ -x /usr/bin/mkisofs ]
then
LH_GENISOIMAGE="mkisofs"
else
echo "E: cannot find genisoimage nor mkisofs (FIXME)."
exit 1
fi
# Setting root directory
if [ -z "${LIVE_ROOT}" ]
then
LIVE_ROOT="`pwd`/debian-live"
fi
# Setting chroot directory
if [ -z "${LIVE_CHROOT}" ]
then
LIVE_CHROOT="${LIVE_ROOT}/chroot"
fi
## config/bootstrap
# Setting architecture string
if [ -z "${LIVE_ARCHITECTURE}" ]
then
if [ -x "/usr/bin/dpkg" ]
then
LIVE_ARCHITECTURE="`dpkg --print-architecture`"
else
echo "E: Can't process file /usr/bin/dpkg (FIXME)"
fi
fi
# Setting distribution string
if [ -z "${LIVE_DISTRIBUTION}" ]
then
LIVE_DISTRIBUTION="sid"
fi
# Setting distribution configuration string
# LIVE_DISTRIBUTION_CONFIG
# Setting flavour string
if [ -z "${LIVE_FLAVOUR}" ]
then
LIVE_FLAVOUR="standard"
fi
# Setting mirror string
if [ -z "${LIVE_MIRROR}" ]
then
LIVE_MIRROR="http://ftp.debian.org/debian/"
fi
# Setting security mirror string
if [ -z "${LIVE_MIRROR_SECURITY}" ]
then
LIVE_MIRROR_SECURITY="http://security.debian.org/"
fi
# Setting mirror string
if [ -z "${LIVE_MIRROR_GENERIC}" ]
then
LIVE_MIRROR_GENERIC="http://ftp.debian.org/debian/"
fi
# Setting security mirror string
if [ -z "${LIVE_MIRROR_GENERIC_SECURITY}" ]
then
LIVE_MIRROR_GENERIC_SECURITY="http://security.debian.org/"
fi
# Setting sections string
if [ -z "${LIVE_SECTIONS}" ]
then
LIVE_SECTIONS="main"
fi
## config/chroot
# Setting kernel flavour string
if [ -z "${LIVE_KERNEL}" ]
then
case "${LIVE_ARCHITECTURE}" in
alpha)
LIVE_KERNEL="alpha-generic"
;;
amd64)
LIVE_KERNEL="amd64"
;;
arm)
echo "E: You need to specify the linux kernel flavour manually on arm (FIXME)."
exit 1
;;
hppa)
LIVE_KERNEL="parisc"
;;
i386)
LIVE_KERNEL="486"
;;
ia64)
LIVE_KERNEL="itanium"
;;
m68k)
LIVE_KERNEL="E: You need to specify the linux kernel flavour manually on m68k."
exit 1
;;
powerpc)
LIVE_KERNEL="powerpc"
;;
s390)
LIVE_KERNEL="s390"
;;
sparc)
LIVE_KERNEL="sparc32"
;;
*)
echo "E: Architecture notyet supported (FIXME)"
;;
esac
fi
# Set kernel packages
if [ -z "${LIVE_KERNEL_PACKAGES}" ]
then
LIVE_KERNEL_PACKAGES="linux-image-2.6-${LIVE_KERNEL} squashfs-modules-2.6-${LIVE_KERNEL} unionfs-modules-2.6-${LIVE_KERNEL} casper"
if [ -n "${LIVE_ENCRYPTION}" ]
then
LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES} loop-aes-modules-2.6-${LIVE_KERNEL} loop-aes-utils"
fi
fi
# Setting language string
# LIVE_LANGUAGE
# Setting tasks
# LIVE_TASKS
# Setting packages string
# LIVE_PACKAGES
# Setting packages list string
if [ -z "${LIVE_PACKAGES_LIST}" ]
then
if [ "${LIVE_FLAVOUR}" = "mini" ] || [ "${LIVE_FLAVOUR}" = "minimal" ]
then
LIVE_PACKAGES_LIST="minimal"
else
LIVE_PACKAGES_LIST="standard"
fi
fi
# Setting tasks string
for LIST in ${LIVE_PACKAGES_LIST}
do
case "${LIST}" in
gnome-desktop)
LIVE_PACKAGES_LIST="`echo ${LIVE_PACKAGES_LIST} | sed -e 's/gnome-desktop//'` standard-x11"
LIVE_TASKS="${LIVE_TASKS} standard laptop desktop gnome-desktop"
;;
kde-desktop)
LIVE_PACKAGES_LIST="`echo ${LIVE_PACKAGES_LIST} | sed -e 's/kde-desktop//'` standard-x11"
LIVE_TASKS="${LIVE_TASKS} standard laptop desktop kde-desktop"
;;
xfce-desktop)
LIVE_PACKAGES_LIST="`echo ${LIVE_PACKAGES_LIST} | sed -e 's/xfce-desktop//'` standard-x11"
LIVE_TASKS="${LIVE_TASKS} standard laptop desktop xfce-desktop"
;;
esac
done
# Setting security updates option
if [ -z "${LIVE_SECURITY}" ]
then
LIVE_SECURITY="enabled"
fi
# Setting symlink convertion option
if [ -z "${LIVE_SYMLINKS}" ]
then
LIVE_SYMLINKS="disabled"
fi
# Setting sysvinit option
if [ -z "${LIVE_SYSVINIT}" ] && [ "${LIVE_FLAVOUR}" != "mini" ]
then
LIVE_SYSVINIT="enabled"
else
LIVE_SYSVINIT="disabled"
fi
## config/image
# Setting boot parameters
# LIVE_BOOTAPPEND
# Setting encryption
# LIVE_ENCRYPTION
# Setting image type
if [ -z "${LIVE_BINARY_IMAGE}" ]
then
LIVE_BINARY_IMAGE="iso"
fi
# Setting image type
if [ -z "${LIVE_SOURCE_IMAGE}" ]
then
if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
then
LIVE_SOURCE_IMAGE="iso"
elif [ "${LIVE_BINARY_IMAGE}" = "usb" ]
then
LIVE_SOURCE_IMAGE="usb"
elif [ "${LIVE_BINARY_IMAGE}" = "net" ]
then
LIVE_SOURCE_IMAGE="net"
fi
fi
# Setting filesystem
if [ -z "${LIVE_FILESYSTEM}" ] && [ "${LIVE_BINARY_IMAGE}" = "iso" ]
then
LIVE_FILESYSTEM="squashfs"
elif [ -z "${LIVE_FILESYSTEM}" ] && [ "${LIVE_BINARY_IMAGE}" = "usb" ]
then
LIVE_FILESYSTEM="squashfs"
elif [ -z "${LIVE_FILESYSTEM}" ] && [ "${LIVE_BINARY_IMAGE}" = "net" ]
then
LIVE_FILESYSTEM="plain"
else
LIVE_FILESYSTEM="squashfs"
fi
# Setting memtest86 option
if [ -z "${LIVE_MEMTEST86}" ]
then
LIVE_MEMTEST86="enabled"
fi
# Setting iso volume
if [ -z "${LIVE_ISO_VOLUME}" ]
then
LIVE_ISO_VOLUME='Debian Live ${DATE}'
fi
# Setting netboot server address
if [ -z "${LIVE_SERVER_ADDRESS}" ]
then
LIVE_SERVER_ADDRESS="192.168.1.1"
fi
# Setting netboot server path
if [ -z "${LIVE_SERVER_PATH}" ]
then
LIVE_SERVER_PATH="/srv/debian-live"
fi
# Setting source option
if [ -z "${LIVE_SOURCE}" ]
then
LIVE_SOURCE="disabled"
fi
# Setting syslinux
if [ -z "${LIVE_SYSLINUX}" ]
then
LIVE_SYSLINUX="enabled"
fi
# Setting syslinux splash
# LIVE_SYSLINUX_SPLASH
# Setting templates
if [ -z "${LIVE_TEMPLATES}" ]
then
LIVE_TEMPLATES="/usr/share/live-helper/templates"
fi
}

35
functions/lockfile.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
# lockfile.sh - handle lock files
set -e
Check_lockfile ()
{
LOCKFILE="${1}"
# Checking lock file
if [ -f "${LOCKFILE}" ]
then
echo "E: system locked"
exit 1
fi
}
Create_lockfile ()
{
LOCKFILE="${1}"
LOCKDIRECTORY="`dirname ${1}`"
# Creating lock directory
if [ ! -d "${LOCKDIRECTORY}" ]
then
mkdir -p "${LOCKDIRECTORY}"
fi
# Creating lock file
trap "test -f ${LOCKFILE} && \
rm -f ${LOCKFILE}; exit 0" 0 2 15
touch "${LOCKFILE}"
}

46
functions/stagefile.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
# stagefile.sh - handle stage files
set -e
Check_stagefile ()
{
STAGEFILE="${1}"
STAGENAME="`basename ${1}`"
# Checking stage file
if [ -f "${STAGEFILE}" ]
then
echo "W: skipping ${STAGENAME}"
exit 0
fi
}
Create_stagefile ()
{
STAGEFILE="${1}"
STAGEDIRECTORY="`dirname ${1}`"
# Creating stage directory
if [ ! -d "${STAGEDIRECTORY}" ]
then
mkdir -p "${STAGEDIRECTORY}"
fi
# Creating stage file
touch "${STAGEFILE}"
}
Require_stagefile ()
{
STAGEFILE="${1}"
STAGENAME="`basename ${1}`"
# Checking stage file
if [ ! -f "${STAGEFILE}" ]
then
echo "E: ${STAGENAME} missing"
exit 1
fi
}

6
functions/version.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# version.sh - handle version information
DATE="`date +%Y%m%d`"
VERSION="1.0~a1"

View File

@ -1,11 +0,0 @@
# Makefile
all: install
install:
install -d -m 0755 $(DESTDIR)/usr/sbin/
install -m 0755 lh_* $(DESTDIR)/usr/sbin
uninstall:
reinstall: install

46
helpers/lh_binary Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
# lh_image(1) - building the images
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/image
Set_defaults
# Building root filesystem
lh_binary_rootfs
lh_binary_manifest
lh_binary_encryption
# Configuring chroot
lh_chroot_proc install
lh_chroot_sysfs install
lh_chroot_hosts install
lh_chroot_resolv install
lh_chroot_sources install
# Prepare images
lh_binary_linuximage
lh_binary_memtest86
lh_binary_syslinux
lh_binary_includes
lh_binary_localincludes
lh_binary_md5sum
# Building images
lh_binary_iso
lh_binary_net
lh_binary_usb
# Deconfiguring chroot
rm -f .stage/chroot_sources
lh_chroot_resolv remove
lh_chroot_hosts remove
lh_chroot_sysfs remove
lh_chroot_proc remove

73
helpers/lh_binary_encryption Executable file
View File

@ -0,0 +1,73 @@
#!/bin/sh
# lh_binary_encryption(1) - encrypts rootfs
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
Require_stagefile "${LIVE_ROOT}"/.stage/binary_rootfs
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_encryption
if [ -n "${LIVE_ENCRYPTION}" ]
then
if [ ! -x /usr/bin/aespipe ]
then
echo "E: aespipe is missing (FIXME)."
exit 1
fi
case "${LIVE_FILESYSTEM}" in
ext2)
ROOTFS="ext2"
;;
plain)
echo "W: encryption not supported on plain filesystem."
exit 0
;;
squashfs)
ROOTFS="squashfs"
;;
esac
echo "Encrypting ${LIVE_ROOT}/binary/casper/filesystem.${ROOTFS} with ${LIVE_ENCRYPTION}..."
while true
do
cat ${LIVE_ROOT}/binary/casper/filesystem.${ROOTFS} | aespipe -e "${LIVE_ENCRYPTION}" -T > "${LIVE_ROOT}"/binary/casper/filesystem.${ROOTFS} && break
echo -n "Something went wrong... Retry? [YES/no] "
read ANSWER
if [ 'no' = "${ANSWER}" ]
then
unset ANSWER
break
fi
done
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_encryption
fi

42
helpers/lh_binary_includes Executable file
View File

@ -0,0 +1,42 @@
#!/bin/sh
# lh_binary_includes(1) - copy files into binary
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_includes
if ls /usr/share/live-helper/includes/common/* &> /dev/null
then
cp -r /usr/share/live-helper/includes/common/* "${LIVE_ROOT}"/binary
fi
if ls /usr/share/live-helper/includes/"${LIVE_BINARY_IMAGE}"/* &> /dev/null
then
cp -r /usr/share/live-helper/includes/"${LIVE_BINARY_IMAGE}"/* "${LIVE_ROOT}"/binary
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_includes

54
helpers/lh_binary_iso Executable file
View File

@ -0,0 +1,54 @@
#!/bin/sh
# lh_binary_iso(1) - build iso binary image
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_iso
for IMAGE in ${LIVE_BINARY_IMAGE}
do
if [ "${IMAGE}" = "iso" ]
then
# Remove old binary
if [ -f "${LIVE_ROOT}"/binary.iso ]
then
rm -f "${LIVE_ROOT}"/binary.iso
fi
# Create image
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
${LH_GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_ISO_VOLUME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
else
echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
sleep 5
${LH_GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_ISO_VOLUME}" "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_iso
fi
done

59
helpers/lh_binary_linuximage Executable file
View File

@ -0,0 +1,59 @@
#!/bin/sh
# lh_binary_linuximage(1) - install linux-image into binary
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_linuximage
# Removing initrd backup files
rm -f "${LIVE_CHROOT}"/boot/initrd*bak*
# Setting destination directory
case "${LIVE_BINARY_IMAGE}" in
iso)
DESTDIR="${LIVE_ROOT}/binary/isolinux"
;;
net)
DESTDIR="${LIVE_ROOT}/tftpboot"
;;
usb)
DESTDIR="${LIVE_ROOT}/binary"
;;
esac
# Creating directory
if [ ! -d "${DESTDIR}" ]
then
mkdir -p "${DESTDIR}"
fi
# Installing linux-image
cp "${LIVE_CHROOT}"/boot/vmlinuz* "${DESTDIR}"/vmlinuz
cp "${LIVE_CHROOT}"/boot/initrd.img* "${DESTDIR}"/initrd.gz
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_linuximage

39
helpers/lh_binary_localincludes Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
# lh_binary_localincludes(1) - copy files into binary
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_localincludes
if ls "${LIVE_ROOT}"/config/binary_localincludes/* &> /dev/null
then
cd "${LIVE_ROOT}"/config/binary_localincludes
# Copying includes
find . | cpio -dmpu "${LIVE_ROOT}"/binary
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_localincludes
fi

34
helpers/lh_binary_manifest Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
# lh_binary_manifest(1) - create manifest
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_manifest
# Add filesystem.manifest
Chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > "${LIVE_ROOT}"/binary/casper/filesystem.manifest
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_manifest

51
helpers/lh_binary_md5sum Executable file
View File

@ -0,0 +1,51 @@
#!/bin/sh
# lh_binary_md5sum(1) - create md5sum.txt
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_md5sum
# Remove old md5sums
if [ -f "${LIVE_ROOT}"/binary/md5sum.txt ]
then
rm -f "${LIVE_ROOT}"/binary/md5sum.txt
fi
# Calculating md5sums
cd "${LIVE_ROOT}"/binary
find . -type f -print0 | xargs -0 md5sum > "${LIVE_ROOT}"/md5sum.txt
cd "${OLDPWD}"
if [ -d "${LIVE_INCLUDE_IMAGE}" ]
then
cd "${LIVE_INCLUDE_IMAGE}"
find . -type f -print0 | xargs -0 md5sum >> "${LIVE_ROOT}"/md5sum.txt
cd "${OLDPWD}"
fi
mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/binary
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_md5sum

97
helpers/lh_binary_memtest86 Executable file
View File

@ -0,0 +1,97 @@
#!/bin/sh
# lh_binary_memtest86(1) - installs memtest86+
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_memtest86
if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
then
echo "W: skipping binary_memtest86, foreign architecture."
exit 0
fi
if [ "${LIVE_MEMTEST86}" = "enabled" ]
then
if [ ! -f "${LIVE_CHROOT}"/boot/memtest86+.bin ]
then
PACKAGES="${PACKAGES} memtest86+"
fi
if [ -n "${PACKAGES}" ]
then
# Installing symlinks
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes ${PACKAGES}"
;;
aptitude)
Chroot "aptitude install --assume-yes ${PACKAGES}"
;;
esac
fi
case "${LIVE_BINARY_IMAGE}" in
iso)
DESTDIR="${LIVE_ROOT}/binary/isolinux"
;;
net)
DESTDIR="${LIVE_ROOT}/tftpboot"
;;
usb)
DESTDIR="${LIVE_ROOT}/binary"
;;
esac
# Creating directory
if [ ! -d "${DESTDIR}" ]
then
mkdir -p "${DESTDIR}"
fi
# Installing memtest86+
cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${DESTDIR}"/memtest
if [ -n "${PACKAGES}" ]
then
# Removing syslinux
case "${LH_APT}" in
apt)
Chroot "apt-get remove --purge --yes ${PACKAGES}"
;;
aptitude)
Chroot "aptitude purge --assume-yes ${PACKAGES}"
;;
esac
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_memtest86
fi

53
helpers/lh_binary_net Executable file
View File

@ -0,0 +1,53 @@
#!/bin/sh
# lh_binary_net(1) - build netboot binary image
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_net
for IMAGE in ${LIVE_BINARY_IMAGE}
do
if [ "${IMAGE}" = "net" ]
then
# Remove old binary
if [ -f "${LIVE_ROOT}"/binary.tar.gz ]
then
rm -f "${LIVE_ROOT}"/binary.tar.gz
fi
# Creating image file
cd "${LIVE_ROOT}" && \
mv binary "`basename ${LIVE_SERVER_PATH}`" && \
cd .. && \
tar cfz binary.tar.gz "`basename ${LIVE_ROOT}`/`basename ${LIVE_SERVER_PATH}`" "`basename ${LIVE_ROOT}`/tftpboot" && \
mv binary.tar.gz "${LIVE_ROOT}" && \
cd "${OLDPWD}" && \
mv "`basename ${LIVE_SERVER_PATH}`" binary
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_net
fi
done

76
helpers/lh_binary_rootfs Executable file
View File

@ -0,0 +1,76 @@
#!/bin/sh
# lh_binary_rootfs(1) - build rootfs image
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_rootfs
# Creating directory
if [ ! -d "${LIVE_ROOT}"/binary/casper ]
then
mkdir -p "${LIVE_ROOT}"/binary/casper
fi
case "${LIVE_FILESYSTEM}" in
ext2)
if [ -f "${LIVE_ROOT}"/binary/casper/filesystem.ext2 ]
then
rm -f "${LIVE_ROOT}"/binary/casper/filesystem.ext2
fi
DU_DIM="`du -ks ${LIVE_CHROOT} | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.ext2
;;
plain)
if [ -d "${LIVE_ROOT}"/binary/casper/filesystem.dir ]
then
rm -rf "${LIVE_ROOT}"/binary/casper/filesystem.dir
fi
cd "${LIVE_CHROOT}"
find . | cpio -pumd "${LIVE_ROOT}"/binary/casper/filesystem.dir
cd "${OLDPWD}"
;;
squashfs)
if [ -f "${LIVE_ROOT}"/binary/casper/filesystem.squashfs ]
then
rm "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
fi
if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
then
mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs -e "${LIVE_CHROOT}"/boot/vmlinuz* "${LIVE_CHROOT}"/boot/initrd.img* "${LIVE_CHROOT}"/vmlinuz "${LIVE_CHROOT}"/initrd.img "${LIVE_CHROOT}"/boot/config-* "${LIVE_CHROOT}"/boot/System.map-*
else
mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
fi
;;
esac
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_rootfs

152
helpers/lh_binary_syslinux Executable file
View File

@ -0,0 +1,152 @@
#!/bin/sh
# lh_binary_syslinux(1) - installs syslinux
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_syslinux
if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
then
echo "W: skipping binary_syslinux, foreign architecture."
exit 0
fi
if [ "${LIVE_SYSLINUX}" = "enabled" ]
then
if [ ! -f "${LIVE_CHROOT}"/usr/bin/syslinux ]
then
PACKAGES="${PACKAGES} syslinux"
fi
if [ -n "${PACKAGES}" ]
then
# Installing symlinks
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes ${PACKAGES}"
;;
aptitude)
Chroot "aptitude install --assume-yes ${PACKAGES}"
;;
esac
fi
if [ -n "${LIVE_ENCRYPTION}" ]
then
LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}"
fi
case "${LIVE_BINARY_IMAGE}" in
iso)
# Copying syslinux
mkdir -p "${LIVE_ROOT}"/binary/isolinux
cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/isolinux
cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/binary/isolinux
# Copying splash screen
if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
then
cp "${LIVE_SYSLINUX_SPLASH}" "${LIVE_ROOT}/binary/isolinux/splash.rle"
fi
# Configure syslinux templates
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
sed -i -e "s/LIVE_DATE/${DATE}/" "${LIVE_ROOT}"/binary/isolinux/f1.txt
sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/isolinux/f10.txt
# Remove unused files
rm -f "${LIVE_ROOT}"/binary/isolinux/pxelinux.cfg
;;
net)
# Copying syslinux
mkdir -p "${LIVE_ROOT}"/tftpboot
cp "${LIVE_CHROOT}"/usr/lib/syslinux/pxelinux.0 "${LIVE_ROOT}"/tftpboot
# Install syslinux templates
mkdir -p "${LIVE_ROOT}"/tftpboot/pxelinux.cfg
cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/tftpboot/pxelinux.cfg
mv "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/pxelinux.cfg "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
sed -i -e 's#splash.rle#pxelinux.cfg/splash.rle#' "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.txt
# Copying splash screen
if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
then
cp "${LIVE_SYSLINUX_SPLASH}" "${LIVE_ROOT}/tftpboot/pxelinux.cfg/splash.rle"
fi
# Configure syslinux templates
sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
sed -i -e "s/LIVE_DATE/${DATE}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f1.txt
sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f10.txt
# Remove unused files
rm -f "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.cfg
;;
usb)
# Copying syslinux
mkdir -p "${LIVE_ROOT}"/binary
cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/syslinux.bin
cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/binary
mv "${LIVE_ROOT}"/binary/isolinux.cfg "${LIVE_ROOT}"/binary/syslinux.cfg
mv "${LIVE_ROOT}"/binary/isolinux.txt "${LIVE_ROOT}"/binary/syslinux.txt
sed -i -e "s/isolinux.txt/syslinux.txt/" "${LIVE_ROOT}"/binary/syslinux.cfg
# Copying splash screen
if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
then
cp "${LIVE_SYSLINUX_SPLASH}" "${LIVE_ROOT}/binary/splash.rle"
fi
# Configure syslinux templates
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/syslinux.cfg
sed -i -e "s/LIVE_DATE/${DATE}/" "${LIVE_ROOT}"/binary/f1.txt
sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/f10.txt
# Remove unused files
rm -f "${LIVE_ROOT}"/binary/pxelinux.cfg
;;
esac
if [ -n "${PACKAGES}" ]
then
# Removing syslinux
case "${LH_APT}" in
apt)
Chroot "apt-get remove --purge --yes ${PACKAGES}"
;;
aptitude)
Chroot "aptitude purge --assume-yes ${PACKAGES}"
;;
esac
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_syslinux
fi

128
helpers/lh_binary_usb Executable file
View File

@ -0,0 +1,128 @@
#!/bin/sh
# lh_binary_usb(1) - build binary image
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/binary_usb
for IMAGE in ${LIVE_BINARY_IMAGE}
do
if [ "${IMAGE}" = "usb" ]
then
if [ ! -f "${LIVE_CHROOT}"/sbin/mkdosfs ]
then
PACKAGES="${PACKAGES} dosfstools"
fi
if [ ! -f "${LIVE_CHROOT}"/usr/bin/mtools ]
then
PACKAGES="${PACKAGES} mtools"
fi
if [ ! -f "${LIVE_CHROOT}"/sbin/parted ]
then
PACKAGES="${PACKAGES} parted"
fi
if [ ! -f "${LIVE_CHROOT}"/usr/bin/syslinux ]
then
PACKAGES="${PACKAGES} syslinux"
fi
if [ -n "${PACKAGES}" ]
then
# Installing packages
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes ${PACKAGES}"
;;
aptitude)
Chroot "aptitude install --assume-yes ${PACKAGES}"
;;
esac
fi
# Remove old binary
if [ -f "${LIVE_ROOT}"/binary.img ]
then
rm -f "${LIVE_ROOT}"/binary.img
fi
# Everything which comes here needs to be cleaned up,
DU_DIM="`du -ms ${LIVE_ROOT}/binary | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
dd if=/dev/zero of="${LIVE_ROOT}"/binary.img bs=1024k count=${REAL_DIM}
FREELO="`losetup -f`"
if [ ! -b "${LIVE_CHROOT}"/${FREELO} ]
then
MAKEDEV="true"
Chroot "cd /dev && ./MAKEDEV ${FREELO}"
fi
echo "!!! The following error/warning messages can be ignored !!!"
lh_losetup $FREELO "${LIVE_ROOT}"/binary.img 0
Chroot "parted -s ${FREELO} mklabel msdos" || true
Chroot "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%" || true
Chroot "parted -s ${FREELO} set 1 boot on" || true
Chroot "parted -s ${FREELO} set 1 lba off" || true
cat "${LIVE_CHROOT}"/usr/lib/syslinux/mbr.bin > ${FREELO}
losetup -d ${FREELO}
lh_losetup $FREELO "${LIVE_ROOT}"/binary.img 1
Chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}"
mkdir -p "${LIVE_ROOT}"/binary.tmp
mount ${FREELO} "${LIVE_ROOT}"/binary.tmp
cp -r "${LIVE_ROOT}"/binary/* "${LIVE_ROOT}"/binary.tmp
umount "${LIVE_ROOT}"/binary.tmp
rmdir "${LIVE_ROOT}"/binary.tmp
Chroot "syslinux ${FREELO}"
losetup -d ${FREELO}
echo "!!! The above error/warning messages can be ignored !!!"
if [ -n "${MAKEDEV}" ]
then
rm -f "${LIVE_CHROOT}"/${FREELO}
fi
if [ -n "${PACKAGES}" ]
then
# Removing packages
case "${LH_APT}" in
apt)
Chroot "apt-get remove --purge --yes ${PACKAGES}"
;;
aptitude)
Chroot "aptitude purge --assume-yes ${PACKAGES}"
;;
esac
fi
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/binary_usb
done

19
helpers/lh_bootstrap Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# lh_bootstrap(1) - bootstrap a Debian system
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Set_defaults
# Bootstrapping system
lh_bootstrap_"${LH_BOOTSTRAP}"

103
helpers/lh_bootstrap_cdebootstrap Executable file
View File

@ -0,0 +1,103 @@
#!/bin/sh
# lh_bootstrap_cdebootstrap(1) - bootstrap a Debian system with cdebootstrap(1)
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Ensure that a system is built as root
lh_testroot
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Set_defaults
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Creating root directory
if [ ! -d "${LIVE_ROOT}" ]
then
mkdir -p "${LIVE_ROOT}"
fi
# Creating chroot directory
if [ ! -d "${LIVE_CHROOT}" ]
then
mkdir -p "${LIVE_CHROOT}"
fi
# Setting cdebootstrap options
if [ -n "${LIVE_ARCHITECTURE}" ]
then
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --arch=${LIVE_ARCHITECTURE}"
fi
if [ -n "${LIVE_DISTRIBUTION_CONFIG}" ]
then
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --suite-config=${LIVE_DISTRIBUTION_CONFIG}"
fi
if [ "${LIVE_FLAVOUR}" = "mini" ] || [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "minimal-net" ]
then
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=minimal"
else
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=standard"
fi
if [ -x "/usr/bin/cdebootstrap" ]
then
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/bootstrap ]
then
mkdir -p "${LIVE_CHROOT}"/var/cache/bootstrap
cp "${LIVE_ROOT}"/cache/bootstrap/*.deb "${LIVE_CHROOT}"/var/cache/bootstrap
fi
if [ "${LH_CACHE}" = "enabled" ]
then
# Executing cdebootstrap (download-only)
cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
# Removing old cache
if [ -d "${LIVE_ROOT}"/cache/bootstrap ]
then
rm -f "${LIVE_ROOT}"/cache/bootstrap/*.deb
fi
# Saving new cache
if [ ! -d "${LIVE_ROOT}"/cache/bootstrap ]
then
mkdir -p "${LIVE_ROOT}"/cache/bootstrap
fi
cp "${LIVE_CHROOT}"/var/cache/bootstrap/*.deb "${LIVE_ROOT}"/cache/bootstrap
fi
# Executing cdebootstrap (regular run)
cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
else
echo "E: Can't process file /usr/bin/cdebootstrap (FIXME)"
exit 1
fi
# Removing bootstrap cache
if [ -d "${LIVE_CHROOT}/var/cache/bootstrap" ]
then
rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/bootstrap

View File

@ -0,0 +1,93 @@
#!/bin/sh
# lh_bootstrap_debootstrap(1) - bootstrap a Debian system with debootstrap(8)
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Ensure that a system is built as root
lh_testroot
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Set_defaults
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Creating root directory
if [ ! -d "${LIVE_ROOT}" ]
then
mkdir -p "${LIVE_ROOT}"
fi
# Creating chroot directory
if [ ! -d "${LIVE_CHROOT}" ]
then
mkdir -p "${LIVE_CHROOT}"
fi
# Setting debootstrap options
if [ -n "${LIVE_ARCHITECTURE}" ]
then
DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --arch ${LIVE_ARCHITECTURE}"
fi
if [ -n "${LIVE_BOOTSTRAP_CONFIG}" ]
then
LIVE_DEBOOTSTRAP_SCRIPT="/usr/lib/debootstrap/scripts/${LIVE_BOOTSTRAP_CONFIG}"
fi
if [ -x "/usr/sbin/debootstrap" ]
then
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/bootstrap ]
then
mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives
cp "${LIVE_ROOT}"/cache/bootstrap/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
fi
if [ "${LH_CACHE}" = "enabled" ]
then
# Executing debootstrap (download-only)
debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}" "${LIVE_DEBOOTSTRAP_SCRIPT}"
# Removing old cache
if [ -d "${LIVE_ROOT}"/cache/bootstrap ]
then
rm -f "${LIVE_ROOT}"/cache/bootstrap/*.deb
fi
# Saving new cache
if [ ! -d "${LIVE_ROOT}"/cache/bootstrap ]
then
mkdir -p "${LIVE_ROOT}"/cache/bootstrap
fi
cp "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/bootstrap
fi
# Executing debootstrap (regular run)
debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}" "${LIVE_DEBOOTSTRAP_SCRIPT}"
else
echo "E: Can't process file /usr/bin/debootstrap (FIXME)"
exit 1
fi
# Removing bootstrap cache
rm -rf "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/bootstrap

17
helpers/lh_build Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# lh_build(1) - build a Debian system
set -e
# Bootstrapping system
lh_bootstrap
# Customizing chroot
lh_chroot
# Building binary image
lh_binary
# Building source image
lh_source

View File

@ -1,200 +0,0 @@
#!/bin/sh
# lh_buildbinary
if [ ! -f "${LIVE_ROOT}"/.stage/image_binary ]
then
# Configure chroot
lh_patchchroot apply
lh_patchrunlevel apply
# Configure network
lh_patchnetwork apply
mkdir -p "${LIVE_ROOT}"/binary/casper
for MANIFEST in "${LIVE_ROOT}"/filesystem.manifest*
do
if [ -e "${MANIFEST}" ]; then
mv "${MANIFEST}" "${LIVE_ROOT}"/binary/casper/
fi
done
if [ "${LIVE_TYPE}" = "Net" ]
then
# Mount proc
mount proc-live -t proc "${LIVE_CHROOT}"/proc
# Installing smbfs
lh_chroot "aptitude install --assume-yes smbfs"
# Unmount proc
umount "${LIVE_CHROOT}"/proc
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
if [ ! -d "${LIVE_CHROOT}"/etc/initramfs-tools ]
then
mkdir "${LIVE_CHROOT}"/etc/initramfs-tools
fi
# Configuring initramfs for NFS
cat >> "${LIVE_CHROOT}"/etc/initramfs-tools/initramfs.conf << EOF
MODULES=netboot
BOOT=nfs
NFSROOT=auto
EOF
lh_chroot "update-initramfs -tu"
fi
fi
lh_cleanapt
# Switching package indices to default
if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
then
lh_setupapt default
lh_configapt deapply-proxy
lh_configapt deapply-recommends
fi
# Deconfigure network
lh_patchnetwork deapply
# Deconfigure chroot
lh_patchrunlevel deapply
lh_patchchroot deapply
# Generating rootfs image
lh_genrootfs
# Configure chroot
lh_patchchroot apply
lh_patchrunlevel apply
# Configure network
lh_patchnetwork apply
lh_cleanapt
# Switching package indices to custom
lh_setupapt custom
lh_configapt apply-proxy
lh_configapt apply-recommends
case "${LIVE_TYPE}" in
Iso)
TYPE=iso
;;
Usb)
TYPE=usb
;;
Net)
TYPE=net
;;
esac
# Mount proc
mount proc-live -t proc "${LIVE_CHROOT}"/proc
# Install depends
lh_depends install $TYPE
# Installing syslinux
lh_installsyslinux $TYPE
# Installing linux-image
lh_installlinux $TYPE
# Installing memtest
lh_installmemtest86+ $TYPE
# Deconfigure network
lh_patchnetwork deapply
# Deconfigure chroot
lh_patchrunlevel deapply
lh_patchchroot deapply
# Installing templates
if [ "${LIVE_FLAVOUR}" != "minimal" ] || [ "${LIVE_FLAVOUR}" != "mini" ]
then
if [ "${TYPE}" != "usb" ]
then
cp -r "${LIVE_TEMPLATES}"/common/* "${LIVE_ROOT}"/binary
fi
if [ "${TYPE}" = "iso" ] || [ "${TYPE}" = "usb" ]
then
cp -r "${LIVE_TEMPLATES}"/iso/* "${LIVE_ROOT}"/binary
fi
fi
# Calculating md5sums
lh_md5sums
case "${TYPE}" in
iso)
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
# Create image
${GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_DISK_VOLUME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
else
echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
sleep 5
# Create image
${GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_DISK_VOLUME}" "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
fi
;;
net)
cd "${LIVE_ROOT}" && \
mv binary "`basename ${LIVE_SERVER_PATH}`" && \
cd .. && \
tar cfz binary.tar.gz "`basename ${LIVE_ROOT}`/`basename ${LIVE_SERVER_PATH}`" "`basename ${LIVE_ROOT}`/tftpboot" && \
mv binary.tar.gz "${LIVE_ROOT}" && \
cd "${OLDPWD}" && \
mv "`basename ${LIVE_SERVER_PATH}`" binary
;;
usb)
# Everything which comes here needs to be cleaned up,
DU_DIM="`du -ms ${LIVE_ROOT}/binary | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
dd if=/dev/zero of="${LIVE_ROOT}"/binary.img bs=1024k count=${REAL_DIM}
FREELO="`lh_chroot 'losetup -f'`"
echo "!!! The following error/warning messages can be ignored !!!"
lh_losetup $FREELO "${LIVE_ROOT}"/binary.img 0
set +e
lh_chroot "parted -s ${FREELO} mklabel msdos"
lh_chroot "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%"
lh_chroot "parted -s ${FREELO} set 1 boot on"
lh_chroot "parted -s ${FREELO} set 1 lba off"
set -e
cat "${LIVE_CHROOT}"/usr/lib/syslinux/mbr.bin > ${FREELO}
losetup -d ${FREELO}
lh_losetup $FREELO "${LIVE_ROOT}"/binary.img 1
lh_chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}"
mkdir "${LIVE_ROOT}"/binary.tmp
mount ${FREELO} "${LIVE_ROOT}"/binary.tmp
cp -r "${LIVE_ROOT}"/binary/* "${LIVE_ROOT}"/binary.tmp
umount "${LIVE_ROOT}"/binary.tmp
rmdir "${LIVE_ROOT}"/binary.tmp
lh_chroot "syslinux ${FREELO}"
losetup -d ${FREELO}
echo "!!! The above error/warning messages can be ignored !!!"
;;
esac
# Remove depends
lh_depends remove $TYPE
# Unmount proc
umount "${LIVE_CHROOT}"/proc
# Touching stage file
touch "${LIVE_ROOT}"/.stage/image_binary
fi

View File

@ -1,84 +0,0 @@
#!/bin/sh
# lh_buildsource.sh <type>
if [ ! -f "${LIVE_ROOT}"/.stage/image_source ] && [ "${LIVE_SOURCE}" = "yes" ]
then
# Configure chroot
lh_patchnetwork apply
# Download sources
lh_chroot "dpkg --get-selections" | awk '{ print $1 }' > "${LIVE_CHROOT}"/root/dpkg-selection.txt
lh_chroot "xargs --arg-file=/root/dpkg-selection.txt apt-get source --download-only"
rm -f "${LIVE_CHROOT}"/root/dpkg-selection.txt
# Sort sources
for DSC in "${LIVE_CHROOT}"/*.dsc
do
SOURCE="`awk '/Source:/ { print $2; }' ${DSC}`"
if [ "`echo ${SOURCE} | cut -b 1-3`" == "lib" ]
then
LETTER="`echo ${SOURCE} | cut -b 1-4`"
else
LETTER="`echo ${SOURCE} | cut -b 1`"
fi
# Install directory
install -d -m 0755 "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}"
# Move files
mv "${LIVE_CHROOT}"/"${SOURCE}"_* "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}"
done
case "${1}" in
generic)
# Create tarball
tar cf source.tar "$LIVE_ROOT"/source
;;
iso)
# Create image
${GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"source.iso -r -J -l -V "${LIVE_DISK_VOLUME}" "${LIVE_ROOT}"/source
;;
net)
# Create tarball
tar cfz source.tar.gz "${LIVE_ROOT}"/source
;;
usb)
# Create image
DU_DIM="`du -ms ${LIVE_ROOT}/source | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
dd if=/dev/zero of="${LIVE_ROOT}"/source.img bs=1024k count=${REAL_DIM}
FREELO=`losetup -f`
echo "!!! The following error/warning messages can be ignored !!!"
lh_losetup $FREELO "${LIVE_ROOT}"/source.img 0
set +e
lh_chroot "parted -s ${FREELO} mklabel msdos"
lh_chroot "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%"
lh_chroot "parted -s ${FREELO} set 1 lba off"
set -e
losetup -d ${FREELO}
lh_losetup $FREELO "${LIVE_ROOT}"/source.img 1
lh_chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}"
mkdir "${LIVE_ROOT}"/source.tmp
mount ${FREELO} "${LIVE_ROOT}"/source.tmp
cp -r "${LIVE_ROOT}"/source/* "${LIVE_ROOT}"/source.tmp
umount "${LIVE_ROOT}"/source.tmp
rmdir "${LIVE_ROOT}"/source.tmp
losetup -d ${FREELO}
echo "!!! The above error/warning messages can be ignored !!!"
;;
esac
# Deconfigure network
lh_patchnetwork deapply
# Touching stage file
touch "${LIVE_ROOT}"/.stage/image_source
fi

View File

@ -1,33 +0,0 @@
#!/bin/sh
if [ ! -f "${LIVE_ROOT}"/.stage/bootstrap ]
then
# Create chroot directory
if [ ! -d "${LIVE_CHROOT}" ]
then
mkdir -p "${LIVE_CHROOT}"
fi
if [ -n "${LIVE_BOOTSTRAP_CONFIG}" ]; then
SUITE_CONFIG="--suite-config ${LIVE_BOOTSTRAP_CONFIG}"
fi
# Bootstrap system
if [ "${LIVE_FLAVOUR}" = "mini" ]
then
cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour=minimal ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
else
cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour="${LIVE_FLAVOUR}" ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
fi
# Remove package cache
rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap
# Touching stage file
if [ ! -d "${LIVE_ROOT}"/.stage ]
then
mkdir "${LIVE_ROOT}"/.stage
fi
touch "${LIVE_ROOT}"/.stage/bootstrap
fi

View File

@ -1,6 +1,50 @@
#!/bin/sh
# lh_chroot.sh <command>
# lh_chroot(1) - customize the Debian system
# Execute commands chrooted
chroot "${LIVE_CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" ftp_proxy="${LIVE_PROXY_FTP}" http_proxy="${LIVE_PPROXY_HTTP}" DEBIAN_FRONTEND="${LIVE_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LIVE_DEBCONF_PRIORITY}" ${1}
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Configuring chroot
lh_chroot_proc install
lh_chroot_sysfs install
lh_chroot_debianchroot install
lh_chroot_sysvrc install
lh_chroot_hosts install
lh_chroot_resolv install
lh_chroot_apt install
lh_chroot_sources install
lh_chroot_linuximage install
# Customizing chroot
lh_chroot_tasks
lh_chroot_packageslist
lh_chroot_packages
lh_chroot_localpackages
lh_chroot_localpackageslist
lh_chroot_localization
lh_chroot_hacks
lh_chroot_localincludes
lh_chroot_sysvinit
lh_chroot_hooks
lh_chroot_localhooks
lh_chroot_symlinks
# Deconfiguring chroot
lh_chroot_linuximage remove
lh_chroot_sources remove
lh_chroot_apt remove
lh_chroot_resolv remove
lh_chroot_hosts remove
lh_chroot_sysvrc remove
lh_chroot_debianchroot remove
lh_chroot_sysfs remove
lh_chroot_proc remove

141
helpers/lh_chroot_apt Executable file
View File

@ -0,0 +1,141 @@
#!/bin/sh
# lh_chroot_apt(1) - manage /etc/apt/apt.conf
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_apt
if [ "${LH_APT}" = "aptitude" ] && [ ! -d "${LIVE_CHROOT}"/etc/apt/apt.conf.d ]
then
mkdir -p "${LIVE_CHROOT}"/etc/apt/apt.conf.d
fi
# Configuring apt ftp proxy
if [ -n "${LH_APT_FTPPROXY}" ]
then
case "${LH_APT}" in
apt)
echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
;;
aptitude)
echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/ftp-proxy
;;
esac
fi
# Configuring apt http proxy
if [ -n "${LH_APT_HTTPPROXY}" ]
then
case "${LH_APT}" in
apt)
echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
;;
aptitude)
echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/http-proxy
;;
esac
fi
# Configuring apt pdiffs
if [ "${LH_APT_PDIFFS}" = "enabled" ]
then
case "${LH_APT}" in
apt)
echo "Acquire::PDiffs \"true\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
;;
aptitude)
echo "Acquire::PDiffs \"true\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/pdiffs
;;
esac
else
case "${LH_APT}" in
apt)
echo "Acquire::PDiffs \"false\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
;;
aptitude)
echo "Acquire::PDiffs \"false\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/pdiffs
;;
esac
fi
# Configuring apt recommends
if [ "${LH_APT_RECOMMENDS}" = "enabled" ]
then
case "${LH_APT}" in
apt)
echo "Aptitude::Recommends-Important \"true\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
;;
aptitude)
echo "Aptitude::Recommends-Important \"true\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/recommends
;;
esac
else
case "${LH_APT}" in
apt)
echo "Aptitude::Recommends-Important \"false\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
;;
aptitude)
echo "Aptitude::Recommends-Important \"false\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/recommends
;;
esac
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_apt
;;
remove)
# Deconfiguring apt settings
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf
# Deconfiguring aptitude ftp proxy
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/ftp-proxy
# Deconfiguring aptitude http proxy
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/http-proxy
# Deconfiguring aptitude pdiffs
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/pdiffs
# Deconfiguring aptitude recommends
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/recommends
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_apt
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

63
helpers/lh_chroot_debianchroot Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
# lh_chroot_debianchroot(1) - manage /etc/debian_chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_debianchroot
if [ -f "${LIVE_CHROOT}"/etc/debian_chroot ]
then
# Save chroot file
mv "${LIVE_CHROOT}"/etc/debian_chroot "${LIVE_CHROOT}"/etc/debian_chroot.orig
fi
# Create chroot file
echo "live" > "${LIVE_CHROOT}"/etc/debian_chroot
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_debianchroot
;;
remove)
if [ -f "${LIVE_CHROOT}"/etc/debian_chroot.orig ]
then
# Restore chroot file
mv "${LIVE_CHROOT}"/etc/debian_chroot.orig "${LIVE_CHROOT}"/etc/debian_chroot
else
# Remove chroot file
rm -f "${LIVE_CHROOT}"/etc/debian_chroot
fi
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_debianchroot
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

60
helpers/lh_chroot_hacks Executable file
View File

@ -0,0 +1,60 @@
#!/bin/sh
# lh_chroot_hacks(1) - execute hacks in chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_hacks
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${LIVE_BINARY_IMAGE}" in
net)
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes smbfs"
;;
aptitude)
Chroot "aptitude install --assume-yes smbfs"
;;
esac
if [ ! -d "${LIVE_CHROOT}"/etc/initramfs-tools ]
then
mkdir "${LIVE_CHROOT}"/etc/initramfs-tools
fi
# Configuring initramfs for NFS
cat >> "${LIVE_CHROOT}"/etc/initramfs-tools/initramfs.conf << EOF
MODULES=netboot
BOOT=nfs
NFSROOT=auto
EOF
;;
esac
# Update initramfs
Chroot "update-initramfs -tu"
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_hacks

50
helpers/lh_chroot_hooks Executable file
View File

@ -0,0 +1,50 @@
#!/bin/sh
# lh_chroot_hooks(1) - execute hooks in chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_hooks
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Processing hooks
if [ -n "${LIVE_PACKAGES_LIST}" ] && [ -f /usr/share/live-helper/hooks/"${LIVE_PACKAGES_LIST}" ]
then
# Copying hook
cp /usr/share/live-helper/hooks/"${LIVE_PACKAGES_LIST}" "${LIVE_CHROOT}"/root
# Making hook executable
if [ -x "${LIVE_CHROOT}"/root/${LIVE_PACKAGES_LIST} ]
then
chmod +x "${LIVE_CHROOT}"/root/${LIVE_PACKAGES_LIST}
fi
# Executing hook
Chroot "/root/${LIVE_PACKAGES_LIST}"
# Removing hook
rm -f "${LIVE_CHROOT}"/root/"${LIVE_PACKAGE_LIST}"
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_hooks
fi

66
helpers/lh_chroot_hosts Executable file
View File

@ -0,0 +1,66 @@
#!/bin/sh
# lh_chroot_hosts(1) - manage /etc/hosts
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_hosts
if [ -f "${LIVE_CHROOT}"/etc/hosts ]
then
# Save hosts file
cp "${LIVE_CHROOT}"/etc/hosts "${LIVE_CHROOT}"/etc/hosts.orig
fi
if [ -f /etc/hosts ]
then
# Copy hosts file
cp /etc/hosts "${LIVE_CHROOT}"/etc/hosts
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_hosts
;;
remove)
if [ -f "${LIVE_CHROOT}"/etc/hosts.orig ]
then
# Restore hosts file
mv "${LIVE_CHROOT}"/etc/hosts.orig "${LIVE_CHROOT}"/etc/hosts
else
# Remove hosts file
rm -f "${LIVE_CHROOT}"/etc/hosts
fi
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_hosts
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

74
helpers/lh_chroot_linuximage Executable file
View File

@ -0,0 +1,74 @@
#!/bin/sh
# lh_chroot_linuximage(1) - manage /etc/kernel-img.conf
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_linuximage
if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf ]
then
# Saving kernel-img.conf
cp "${LIVE_CHROOT}"/etc/kernel-img.conf "${LIVE_CHROOT}"/etc/kernel-img.conf.old
fi
# Configuring kernel-img.conf
echo "do_initrd = Yes" >> "${LIVE_CHROOT}"/etc/kernel-img.conf
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_linuximage
# Installing linux-image, modules and casper
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes ${LIVE_KERNEL_PACKAGES}"
;;
aptitude)
Chroot "aptitude install --assume-yes ${LIVE_KERNEL_PACKAGES}"
;;
esac
;;
remove)
if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf.old ]
then
# Restoring kernel-img.conf file
mv "${LIVE_CHROOT}"/etc/kernel-img.conf.old "${LIVE_CHROOT}"/etc/kernel-img.conf
else
# Removing kernel-img.conf file
rm -f "${LIVE_CHROOT}"/etc/kernel-img.conf
fi
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_linuximage
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

53
helpers/lh_chroot_localhooks Executable file
View File

@ -0,0 +1,53 @@
#!/bin/sh
# lh_chroot_localhooks(1) - execute hooks in chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localhooks
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Processing localhooks
if ls "${LIVE_ROOT}"/config/chroot_localhooks/* &> /dev/null
then
for HOOK in "${LIVE_ROOT}"/config/chroot_localhooks/*
do
# Copying hook
cp "${HOOK}" "${LIVE_CHROOT}"/root
# Making hook executable
if [ -x "${LIVE_CHROOT}"/root/"${HOOK}" ]
then
chmod +x "${LIVE_CHROOT}"/root/${HOOK}
fi
# Executing hook
Chroot "/root/`basename ${HOOK}`"
# Removing hook
rm -f "${LIVE_CHROOT}"/"`basename ${HOOK}`"
done
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localhooks
fi

39
helpers/lh_chroot_localincludes Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
# lh_chroot_localincludes(1) - copy files into chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localincludes
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
if ls "${LIVE_ROOT}"/config/chroot_localincludes/* &> /dev/null
then
cd "${LIVE_ROOT}"/config/chroot_localincludes
# Copying includes
find . | cpio -dmpu "${LIVE_CHROOT}"
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localincludes
fi

695
helpers/lh_chroot_localization Executable file
View File

@ -0,0 +1,695 @@
#!/bin/sh
# lh_chroot_localization(1) - install localization packages into chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localization
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Setting localizations
if [ -n "${LIVE_LANGUAGE}" ]
then
case "${LIVE_LANGUAGE}" in
af)
# Afrikaans
LOCALIZATIONS="iceweasel kde openoffice"
;;
as-in)
# Assamese
LOCALIZATIONS="openoffice"
;;
ar)
# Arabic
LOCALIZATIONS="iceweasel kde openoffice"
;;
az)
# Azerbaijani
LOCALIZATIONS="kde"
;;
be)
# Belarusian
LOCALIZATIONS="iceape iceweasel openoffice"
# Overrides
OPENOFFICE="be-by"
;;
bg)
# Bulgarian
LOCALIZATIONS="icedove iceweasel kde openoffice"
;;
bn)
# Bengali
LOCALIZATIONS="kde openoffice"
;;
br)
# Breton
LOCALIZATIONS="kde openoffice"
;;
bs)
# Bosnian
LOCALIZATION="kde openoffice"
;;
ca)
# Catalan
LOCALIZATIONS="iceape icedove iceweasel kde koffice openoffice"
;;
cs)
# Czech
LOCALIZATIONS="iceape icedove iceweasel kde koffice openoffice"
;;
cy-gb)
# Welsh
LOCALIZATIONS="iceweasel kde koffice openoffice"
# Overrides
KDE="cy"
KOFFICE="cy"
OPENOFFICE="cy"
;;
da)
# Danish
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
;;
de)
# German
LOCALIZATIONS="iceape icedove iceweasel kde koffice openoffice"
;;
dz-bt)
# Dzongkha
LOCALIZATIONS="iceweasel openoffice"
# Overrides
OPENOFFICE="dz"
;;
el)
# Greek
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
;;
en-gb)
# English (Great Britain)
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
# Overrides
KDE="engb"
KOFFICE="engb"
;;
en-za)
# English (South Africa)
LOCALIZATIONS="openoffice"
;;
eo)
# Esperanto
LOCALIZATIONS="kde openoffice"
;;
es-ar)
# Spanish (Argentina)
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
# Overrides
KDE="es"
KOFFICE="es"
OPENOFFICE="es"
;;
es-es)
# Spanish (Spain)
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
# Overrides
KDE="es"
KOFFICE="es"
OPENOFFICE="es"
;;
et-ee)
# Estonian
LOCALIZATIONS="iceweasel kde koffice openoffice"
# Overrides
KDE="et"
KOFFICE="et"
OPENOFFICE="et"
;;
eu)
# Basque
LOCALIZATIONS="icedove iceweasel kde koffice"
;;
fa-ir)
# Persian
LOCALIZATIONS="iceweasel kde openoffice"
# Overrides
KDE="fa"
OPENOFFICE="fa"
;;
fi)
# Finnish
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
;;
fr)
# French
LOCALIZATIONS="iceape icedove iceweasel kde koffice openoffice"
;;
fur-it)
# Furlan
LOCALIZATIONS="iceweasel"
;;
fy-nl)
# Frisian
LOCALIZATIONS="iceweasel kde"
# Overrides
KDE="fy"
;;
ga-ie)
# Irish (Ireland)
LOCALIZATIONS="icedove iceweasel kde openoffice"
# Overrides
ICEDOVE="ga"
KDE="ga"
OPENOFFICE="ga"
;;
gl)
# Galician
LOCALIZATIONS="kde"
;;
gu-in)
# Gujarati (India)
LOCALIZATIONS="icedove iceweasel openoffice"
# Overrides
ICEDOVE="gu"
;;
he)
# Hebrew
LOCALIZATIONS="iceape icedove iceweasel kde openoffice"
;;
hi)
# Hindi
LOCALIZATIONS="kde openoffice"
;;
hr)
# Croatian
LOCALIZATIONS="kde koffice openoffice"
;;
hu)
# Hungarian
LOCALIZATIONS="icedove iceweasel kde openoffice"
;;
in)
# Indic
LOCALIZATIONS="openoffice"
;;
is)
# Icelandic
LOCALIZATIONS="kde"
;;
it)
# Italian
LOCALIZATIONS="iceape icedove iceweasel kde koffice openoffice"
;;
ja)
# Japanese
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
;;
ka)
# Georgian
LOCALIZATIONS="iceweasel openoffice"
;;
km)
# Khmer
LOCALIZATIONS="kde openoffice"
;;
ko)
# Korean
LOCALIZATIONS="icedove iceweasel kde openoffice"
;;
ku)
# Kurdish
LOCALIZATIONS="iceweasel openoffice"
;;
lo)
# Lao
LOCALIZATIONS="openoffice"
;;
lt)
# Lithuanian
LOCALIZATIONS="icedove iceweasel kde openoffice"
;;
lv)
# Latvian
LOCALIZATIONS="kde koffice openoffice"
;;
mk)
# Macedonian
LOCALIZATIONS="icedove iceweasel kde openoffice"
;;
ml-in)
# Malayalam
LOCALIZATIONS="openoffice"
;;
mn)
# Mongolian
LOCALIZATIONS="iceweasel kde"
;;
ms)
# Malay
LOCALIZATIONS="kde koffice"
;;
nb-no)
# Bokmaal (Norway)
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
# Overrides
ICEDOVE="nb"
KDE="nb"
KOFFICE="nb"
OPENOFFICE="nb"
;;
nds)
# Low Saxon
LOCALIZATIONS="kde"
;;
ne)
# Nepalese
LOCALIZATIONS="openoffice"
;;
nl)
# Dutch
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
;;
nn-no)
# Nynorsk (Norway)
LOCALIZATIONS="iceweasel kde openoffice"
# Overrides
KDE="nn"
OPENOFFICE="nn"
;;
nr)
# Ndebele
LOCALIZATIONS="openoffice"
;;
ns)
# Northernsotho
LOCALIZATIONS="openoffice"
;;
or-in)
# Oriya
LOCALIZATIONS="openoffice"
;;
pa-in)
# Punjabi (India)
LOCALIZATIONS="icedove iceweasel kde openoffice"
# Overrides
ICEDOVE="pa"
KDE="pa"
;;
pl)
# Polish
LOCALIZATIONS="iceape icedove iceweasel kde koffice openoffice"
;;
pt-br)
# Portugese (Brazil)
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
# Overrides
KDE="ptbr"
KOFFICE="ptbr"
;;
pt-pt)
# Portugese (Portugal)
LOCALIZATIONS="iceweasel kde koffice openoffice"
# Overrides
KDE="pt"
KOFFICE="pt"
OPENOFFICE="pt"
;;
ro)
# Romanian
LOCALIZATIONS="iceweasel kde"
;;
roa-es-val)
# Valencian (Spain)
LOCALIZATIONS="iceweasel"
;;
ru)
# Russian
LOCALIZATIONS="iceape icedove iceweasel kde koffice openoffice"
;;
rw)
# Kinarwanda
LOCALIZATIONS="kde openoffice"
;;
se)
# Northern Sami
LOCALIZATIONS="kde"
;;
sk)
# Slovak
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
;;
sl)
# Slovenian
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
;;
sr-cs)
# Serbian
LOCALIZATIONS="kde koffice openoffice"
# Overrides
KDE="sr"
KOFFICE="sr"
;;
sr-latin)
# Latin Serbian
LOCALIZATIONS="kde koffice"
# Overrides
KDE="srlatin"
KOFFICE="srlatin"
;;
ss)
# Swazi
LOCALIZATIONS="kde openoffice"
;;
st)
# Southern_sotho
LOCALIZATIONS="openoffice"
;;
sv-se)
# Swedish
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
# Overrides
ICEDOVE="sv"
KDE="sv"
KOFFICE="sv"
OPENOFFICE="sv"
;;
ta-in)
# Tamil
LOCALIZATIONS="kde openoffice"
# Overrides
KDE="ta"
;;
te-in)
# Telugu
LOCALIZATIONS="openoffice"
;;
tg)
# Tajik
LOCALIZATIONS="kde openoffice"
;;
th)
# Thai
LOCALIZATIONS="openoffice"
;;
tn)
# Tswana
LOCALIZATIONS="openoffice"
;;
tr)
# Turkish
LOCALIZATIONS="icedove iceweasel kde kofffice openoffice"
;;
ts)
# Tsonga
LOCALIZATIONS="openoffice"
;;
uk-ua)
# Ukrainian
LOCALIZATIONS="icedove iceweasel kde kofffice openoffice"
# Overrides
ICEDOVE="uk"
KDE="uk"
KDE="uk"
OPENOFFICE="uk"
;;
uz)
# Uzbek
LOCALIZATIONS="kde"
;;
ve)
# Venda
LOCALIZATIONS="openoffice"
;;
vi)
# Vietnamese
LOCALIZATIONS="openoffice"
;;
xh)
# Xhosa
LOCALIZATIONS="openoffice"
;;
za)
# South African
LOCALIZATIONS="openoffice"
;;
zh-cn)
# Chinese (China)
LOCALIZATIONS="icedove iceweasel kde koffice openoffice"
# Overrides
KDE="zhcn"
KOFFICE="zhcn"
;;
zh-tw)
# Chinese (Taiwan)
LOCALIZATIONS="iceweasel kde koffice openoffice"
# Overrides
KDE="zhtw"
KOFFICE="zhtw"
;;
zu)
# Zulu
LOCALIZATIONS="openoffice"
;;
esac
# Setting languages
if [ -z "${ICEAPE}" ]
then
ICEAPE="${LIVE_LANGUAGE}"
fi
if [ -z "${ICEDOCE}" ]
then
ICEDOVE="${LIVE_LANGUAGE}"
fi
if [ -z "${ICEWEASEL}" ]
then
ICEWEASEL="${LIVE_LANGUAGE}"
fi
if [ -z "${KDE}" ]
then
KDE="${LIVE_LANGUAGE}"
fi
if [ -z "${KOFFICE}" ]
then
KOFFICE="${LIVE_LANGUAGE}"
fi
if [ -z "${OPENOFFICE}" ]
then
OPENOFFICE="${LIVE_LANGUAGE}"
fi
# Setting packages
for LOCALIZATION in ${LOCALIZATIONS}
do
case "${LOCALZATION}" in
iceape)
if [ -f "${LIVE_CHROOT}"/usr/bin/iceape ]
then
PACKAGES="${PACKAGES} iceweasel-l10n-${ICEAPE}"
fi
;;
icedove)
if [ -f "${LIVE_CHROOT}"/usr/bin/icedove ]
then
PACKAGES="${PACKAGES} icedove-locale-${ICEDOVE}"
fi
;;
iceweasel)
if [ -f "${LIVE_CHROOT}"/usr/bin/iceweasel ]
then
PACKAGES="${PACKAGES} iceweasel-l10n-${ICEWEASEL}"
fi
;;
kde)
if [ -f "${LIVE_CHROOT}"/usr/bin/kstart ]
then
PACKAGES="${PACKAGES} kde-i18n-${KDE}"
fi
;;
koffice)
if [ -f "${LIVE_CHROOT}" ]
then
PACKAGES="${PACKAGES} koffice-i18n-${KOFFICE}"
fi
;;
openoffice)
if [ -f "${LIVE_CHROOT}"/usr/bin/ooffice ]
then
PACKAGES="${PACKAGES} openoffice.org-l10n-${OPENOFFICE}"
fi
;;
esac
done
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/chroot_localization ]
then
cp "${LIVE_ROOT}"/cache/chroot_localization/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
fi
# Installing packages
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes ${PACKAGES}"
;;
aptitude)
Chroot "apt-get install --assume-yes ${PACKAGES}"
;;
esac
# Saving new cache
Chroot "apt-get autoclean"
if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null
then
if [ ! -d "${LIVE_ROOT}"/cache/chroot_localization ]
then
mkdir -p "${LIVE_ROOT}"/cache/chroot_localization
fi
mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_localization
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localization
fi

75
helpers/lh_chroot_localpackages Executable file
View File

@ -0,0 +1,75 @@
#!/bin/sh
# lh_chroot_localpackages(1) - install local packages into chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackages
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
if ls "${LIVE_ROOT}"/config/chroot_localpackages/*.deb &> /dev/null
then
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/chroot_localpackages ]
then
cp "${LIVE_ROOT}"/cache/chroot_localpackages/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
fi
# Copying packages
cp "${LIVE_ROOT}"/config/chroot_localpackages/*.deb "${LIVE_CHROOT}"/root
# Installing packages
Chroot "find /root -name *.deb" > "${LIVE_CHROOT}"/root/localpackages
Chroot "xargs --arg-file=/root/localpackages dpkg -i" || true
# Cleaning dependencies
case "${LH_APT}" in
apt)
Chroot "apt-get install -f --yes"
;;
aptitude)
Chroot "aptitude install -f --assume-yes"
;;
esac
# Removing package files
rm -f "${LIVE_CHROOT}"/root/*.deb
rm -f "${LIVE_CHROOT}"/root/localpackages
# Saving new cache
Chroot "apt-get autoclean"
if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null
then
if [ ! -d "${LIVE_ROOT}"/cache/chroot_localpackages ]
then
mkdir -p "${LIVE_ROOT}"/cache/chroot_localpackages
fi
mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_localpackages
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackages
fi

View File

@ -0,0 +1,73 @@
#!/bin/sh
# lh_chroot_localpackageslist(1) - install local packages into chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackageslist
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
if ls "${LIVE_ROOT}"/config/chroot_localpackageslist/* &> /dev/null
then
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/chroot_localpackageslist ]
then
cp "${LIVE_ROOT}"/cache/chroot_localpackageslist/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
fi
for PACKAGESLIST in "${LIVE_ROOT}"/config/chroot_localpackageslist/*
do
# Copying package list
grep -v "^#" "${PACKAGESLIST}" > "${LIVE_CHROOT}"/root/"`basename ${PACKAGESLIST}`"
# Installing package list
case "${LH_APT}" in
apt)
Chroot "xargs --arg-file=/root/`basename ${PACKAGESLIST}` apt-get install --yes"
;;
aptitude)
Chroot "xargs --arg-file=/root/`basename ${PACKAGESLIST}` aptitude install --assume-yes"
;;
esac
# Removing package list
rm -f "${LIVE_CHROOT}"/root/"`basename ${PACKAGESLIST}`"
done
# Saving new cache
Chroot "apt-get autoclean"
if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null
then
if [ ! -d "${LIVE_ROOT}"/cache/chroot_localpackageslist ]
then
mkdir -p "${LIVE_ROOT}"/cache/chroot_localpackageslist
fi
mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_localpackageslist
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackageslist
fi

65
helpers/lh_chroot_packages Executable file
View File

@ -0,0 +1,65 @@
#!/bin/sh
# lh_chroot_packages(1) - install packages into chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_packages
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
if [ -n "${LIVE_PACKAGES}" ]
then
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/chroot ]
then
cp "${LIVE_ROOT}"/cache/chroot_packages/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
fi
# Installing packages
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes ${LIVE_PACKAGES}"
;;
aptitude)
Chroot "aptitude install --assume-yes ${LIVE_PACKAGES}"
;;
esac
# Saving new cache
Chroot "apt-get autoclean"
if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null
then
if [ ! -d "${LIVE_ROOT}"/cache/chroot_packages ]
then
mkdir -p "${LIVE_ROOT}"/cache/chroot_packages
fi
mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_packages
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_packages
fi

76
helpers/lh_chroot_packageslist Executable file
View File

@ -0,0 +1,76 @@
#!/bin/sh
# lh_chroot_packageslist(1) - install packages list into chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_packageslist
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
if [ -n "${LIVE_PACKAGES_LIST}" ]
then
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/chroot_packageslist ]
then
cp "${LIVE_ROOT}"/cache/chroot_packageslist/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
fi
for LIST in ${LIVE_PACKAGES_LIST}
do
if [ -f /usr/share/live-helper/lists/"${LIST}" ]
then
# Copying package list
grep -v "^#" /usr/share/live-helper/lists/"${LIST}" > "${LIVE_CHROOT}"/root/"${LIST}"
# Installing package list
case "${LH_APT}" in
apt)
Chroot "xargs --arg-file=/root/${LIST} apt-get install --yes"
;;
aptitude)
Chroot "xargs --arg-file=/root/${LIST} aptitude install --assume-yes"
;;
esac
# Removing package list
rm -f "${LIVE_CHROOT}"/root/"${LIST}"
fi
done
# Saving new cache
Chroot "apt-get autoclean"
if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null
then
if [ ! -d "${LIVE_ROOT}"/cache/chroot_packageslist ]
then
mkdir -p "${LIVE_ROOT}"/cache/chroot_packageslist
fi
mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_packageslist
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_packageslist
fi

61
helpers/lh_chroot_proc Executable file
View File

@ -0,0 +1,61 @@
#!/bin/sh
# lh_chroot_proc(1) - mount /proc
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_proc
if [ ! -d "${LIVE_CHROOT}"/proc ]
then
# Creating mountpoint
mkdir -p "${LIVE_CHROOT}"/proc
fi
# Mounting /proc
mount proc-live -t proc "${LIVE_CHROOT}"/proc
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_proc
;;
remove)
# Workaround binfmt-support /proc locking
umount "${LIVE_CHROOT}"/proc/sys/fs/binfmt_misc > /dev/null 2>&1 || true
# Unmounting /proc
#fuser -km "${LIVE_CHROOT}"/proc
umount "${LIVE_CHROOT}"/proc > /dev/null 2>&1
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_proc
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

66
helpers/lh_chroot_resolv Executable file
View File

@ -0,0 +1,66 @@
#!/bin/sh
# lh_chroot_resolv(1) - manage /etc/resolv.conf
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_resolv
if [ -f "${LIVE_CHROOT}"/etc/resolv.conf ]
then
# Save resolv file
cp "${LIVE_CHROOT}"/etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf.orig
fi
if [ -f /etc/resolv.conf ]
then
# Copy resolv file
cp /etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_resolv
;;
remove)
if [ -f "${LIVE_CHROOT}"/etc/resolv.conf.orig ]
then
# Restore resolv file
mv "${LIVE_CHROOT}"/etc/resolv.conf.orig "${LIVE_CHROOT}"/etc/resolv.conf
else
# Remove resolv file
rm -f "${LIVE_CHROOT}"/etc/resolv.conf
fi
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_resolv
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

131
helpers/lh_chroot_sources Executable file
View File

@ -0,0 +1,131 @@
#!/bin/sh
# lh_chroot_sources(1) - manage /etc/apt/sources.list
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Read_conffile config/bootstrap #FIXME
Read_conffile config/image
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sources
# Configure custom sources.list
echo "deb ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "enabled" ]
then
echo "deb-src ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
if [ "${LIVE_SECURITY}" = "enabled" ]
then
if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "testing" ]
then
echo "deb ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
fi
fi
# Installing aptitude
if [ "${LH_APT}" = "apt" ]
then
Chroot "apt-get update"
elif [ "${LH_APT}" = "aptitude" ]
then
if [ ! -x "${LH_CHROOT}"/usr/bin/aptitude ]
then
Chroot "apt-get update"
Chroot "apt-get install --yes --force-yes aptitude"
fi
Chroot "aptitude update"
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sources
;;
remove)
# Configure generic indices
if [ "${LH_APT_GENERIC}" = "enabled" ]
then
# Cleaning apt list cache
rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists
mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
echo "deb ${LIVE_MIRROR_GENERIC} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "enabled" ]
then
echo "deb-src ${LIVE_MIRROR_GENERIC} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
if [ "${LIVE_SECURITY}" = "enabled" ]
then
if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "testing" ]
then
echo "deb ${LIVE_MIRROR_GENERIC_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src ${LIVE_MIRROR_GENERIC_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
fi
fi
case "${LH_APT}" in
apt)
Chroot "apt-get update"
;;
aptitude)
Chroot "aptitude update"
;;
esac
fi
# Cleaning apt packages cache
rm -rf "${LIVE_CHROOT}"/var/cache/apt
mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
# Removing old files
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/available-old
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/diversions-old
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/statoverride-old
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/status-old
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_sources
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

70
helpers/lh_chroot_symlinks Executable file
View File

@ -0,0 +1,70 @@
#!/bin/sh
# lh_chroot_symlinks(1) - convert symlinks
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_symlinks
if [ "${LIVE_SYMLINKS}" = "enabled" ]
then
if [ -f "${LIVE_CHROOT}"/usr/bin/symlinks ]
then
SYMLINKS="true"
fi
if [ -n "${SYMLINKS}" ]
then
# Installing symlinks
case "${LH_APT}" in
apt)
Chroot "apt-get install --yes symlinks"
;;
aptitude)
Chroot "aptitude install --assume-yes symlinks"
;;
esac
fi
# Converting symlinks
Chroot "symlinks -c -r -s /"
if [ -n "${SYMLINKS}" ]
then
# Removing symlinks
case "${LH_APT}" in
apt)
Chroot "apt-get remove --purge --yes symlinks"
;;
aptitude)
Chroot "aptitude purge --assume-yes symlinks"
;;
esac
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_symlinks
fi

58
helpers/lh_chroot_sysfs Executable file
View File

@ -0,0 +1,58 @@
#!/bin/sh
# lh_chroot_sysfs(1) - mount /sys
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sysfs
if [ ! -d "${LIVE_CHROOT}"/sys ]
then
# Create mountpoint
mkdir -p "${LIVE_CHROOT}"/sys
fi
# Mounting /sys
mount sys-live -t sysfs "${LIVE_CHROOT}"/sys
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sysfs
;;
remove)
# Unmounting /sys
#fuser -km "${LIVE_CHROOT}"/sys
umount "${LIVE_CHROOT}"/sys > /dev/null 2>&1
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_sysfs
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

50
helpers/lh_chroot_sysvinit Executable file
View File

@ -0,0 +1,50 @@
#!/bin/sh
# lh_chroot_sysvinit(1) - configures sysvinit
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvinit
if [ "${LIVE_SYSVINIT}" = "disabled" ]
then
# Disable all
for FILE in "${LIVE_CHROOT}"/etc/init.d/*
do
Chroot "update-rc.d -f `basename ${FILE}` remove"
done
# Re-enable all required (taken from -f standard chroot)
for PACKAGE in casper console-common cron dpkg ifupdown initscripts kbd klogd libc6 libdevmapper1.02 libselinux1 libsepol1 login makedev module-init-tools netbase openbsd-inetd procps sudo sysklogd udev util-linux
do
if [ -f "${LIVE_CHROOT}"/var/lib/dpkg/info/${PACKAGE}.postinst ]
then
# Re-configure if existing
Chroot "/var/lib/dpkg/info/${PACKAGE}.postinst configure"
fi
done
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvinit
fi

72
helpers/lh_chroot_sysvrc Executable file
View File

@ -0,0 +1,72 @@
#!/bin/sh
# lh_chroot_sysvrc(1) - manage /usr/sbin/policy-rc.d
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
case "${1}" in
install)
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvrc
if [ -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d ]
then
# Save policy-rc.d file
mv "${LIVE_CHROOT}"/usr/sbin/policy-rc.d "${LIVE_CHROOT}"/usr/sbin/policy-rc.d.orig
fi
# Create policy-rc.d file
cat > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d << EOF
#!/bin/sh
echo
echo "Warning: invoke-rc.d policy in action. Skiping daemon starting"
exit 101
EOF
chmod 0755 "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvrc
;;
remove)
if [ -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d.orig ]
then
# Restore policy-rc.d file
mv "${LIVE_CHROOT}"/usr/sbin/policy-rc.d.orig "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
else
# Remove policy-rc.d file
rm -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
fi
# Removing stage file
rm -f "${LIVE_ROOT}"/.stage/chroot_sysvrc
;;
*)
echo "Usage: ${0} {install|remove}"
exit 1
;;
esac

55
helpers/lh_chroot_tasks Executable file
View File

@ -0,0 +1,55 @@
#!/bin/sh
# lh_chroot_tasks(1) - install tasks into chroot
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/chroot
Set_defaults
# Requiring stage file
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
# Checking stage file
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_tasks
# Checking lock file
Check_lockfile "${LIVE_ROOT}"/.lock
# Creating lock file
Create_lockfile "${LIVE_ROOT}"/.lock
if [ -n "${LIVE_TASKS}" ] && [ "${LH_APT}" = "aptitude" ]
then
# Restore old cache
if [ -d "${LIVE_ROOT}"/cache/chroot_tasks ]
then
cp "${LIVE_ROOT}"/cache/chroot_tasks/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
fi
Chroot "aptitude install --assume-yes ${LIVE_TASKS}"
# Saving new cache
Chroot "apt-get autoclean"
if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null
then
if [ ! -d "${LIVE_ROOT}"/cache/chroot_tasks ]
then
mkdir -p "${LIVE_ROOT}"/cache/chroot_tasks
fi
mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_tasks
fi
# Creating stage file
Create_stagefile "${LIVE_ROOT}"/.stage/chroot_tasks
fi

71
helpers/lh_clean Executable file
View File

@ -0,0 +1,71 @@
#!/bin/sh
# lh_clean(1) - clean up system build directories
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Ensure that a system is built as root
lh_testroot
# Reading configuration files
Read_conffile config/common
Set_defaults
case "${1}" in
all)
"${0}" chroot
"${0}" binary
"${0}" stage
"${0}" source
;;
cache)
rm -rf "${LIVE_ROOT}"/cache
;;
chroot)
umount -f "${LIVE_CHROOT}"/sys > /dev/null 2>&1 || true
umount -f "${LIVE_CHROOT}"/proc > /dev/null 2>&1 || true
umount -f "${LIVE_CHROOT}"/lib/init/rw > /dev/null 2>&1 || true
umount -f "${LIVE_CHROOT}"/dev/shm > /dev/null 2>&1 || true
umount -f "${LIVE_CHROOT}"/dev/pts > /dev/null 2>&1 || true
umount -f "${LIVE_CHROOT}"/dev > /dev/null 2>&1 || true
rm -rf "${LIVE_CHROOT}"
;;
binary)
rm -rf "${LIVE_ROOT}"/binary
rm -f "${LIVE_ROOT}"/binary.iso
rm -f "${LIVE_ROOT}"/binary.img
rm -f "${LIVE_ROOT}"/binary.tar.gz
rm -f "${LIVE_ROOT}"/.stage/binary*
;;
stage)
rm -rf "${LIVE_ROOT}"/.stage
rm -f "${LIVE_ROOT}"/.lock
;;
source)
rm -rf "${LIVE_ROOT}"/source
rm -f "${LIVE_ROOT}"/source.iso
rm -f "${LIVE_ROOT}"/source.img
rm -f "${LIVE_ROOT}"/source.tar.gz
rm -f "${LIVE_ROOT}"/.stage/source*
;;
*)
"${0}" all
;;
esac

View File

@ -1,17 +0,0 @@
#!/bin/sh
# lh_cleanapt
# Clean apt packages cache
rm -rf "${LIVE_CHROOT}"/var/cache/apt
mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
# Clean apt list cache
rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists/*
mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial
# Remove old files
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/available-old
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/diversions-old
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/statoverride-old
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/status-old

View File

@ -1,25 +0,0 @@
#!/bin/sh
# lh_clone
# Cloning existing system configuration
if [ -d "${LIVE_CLONE}" ]
then
# Swapping chroot directories
LIVE_CHROOT_TMP="${LIVE_CHROOT}"
LIVE_CHROOT="${LIVE_CLONE}"
# Extract debconf settings
lh_chroot "aptitude install --assume-yes debconf-utils"
lh_chroot "debconf-get-selections" > "${LIVE_ROOT}"/preseed.cloned
# Extract package selection
lh_chroot "dpkg --get-selections" | grep -v deinstall | cut -f1 > "${LIVE_ROOT}"/package-list.cloned
# Restoring chroot directories
LIVE_CHROOT="${LIVE_CHROOT_TMP}"
LIVE_CHROOT_TMP=""
LIVE_PRESEED="${LIVE_ROOT}/preseed.cloned"
LIVE_PACKAGE_LIST_CLONED="${LIVE_ROOT}/package-list.cloned"
fi

View File

@ -1,26 +1,218 @@
#!/bin/sh
# lh_config
# lh_make(1) - create sample configuration for live-helper(7)
case "${1}" in
disable-daemons)
if [ "${LIVE_DAEMONS}" = "no" ]
then
# Disable all
for FILE in "${LIVE_CHROOT}"/etc/init.d/*
do
lh_chroot "update-rc.d -f `basename ${FILE}` remove"
done
set -e
# Re-enable all required (taken from -f standard chroot)
for PACKAGE in casper console-common cron dpkg ifupdown initscripts kbd klogd libc6 libdevmapper1.02 libselinux1 libsepol1 login makedev module-init-tools netbase openbsd-inetd procps sudo sysklogd udev util-linux
do
# Re-configure if existing
if [ -f "${LIVE_CHROOT}"/var/lib/dpkg/info/${PACKAGE}.postinst ]
then
lh_chroot "/var/lib/dpkg/info/${PACKAGE}.postinst configure"
fi
done
fi
;;
esac
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
Set_defaults
# Creating configuration directory
install -d -m 0755 "${LIVE_ROOT}"/config || true
# Creating live-helper configuration
cat > "${LIVE_ROOT}"/config/common << EOF
# config/common: configuration for live-helper(7)
# \$LH_APT: set package manager
# (Default: ${LH_APT})
LH_APT="${LH_APT}"
# \$LH_APT_FTPPROXY: set apt/aptitude ftp proxy
# (Default: autodetected or empty)
LH_APT_FTPPROXY="${LH_APT_FTPPROXY}"
# \$LH_APT_HTTPPROXY: set apt/aptitude http proxy
# (Default: autodetected or empty)
LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}"
# \$LH_APT_GENERIC: set apt/aptitude generic indices
# (Default: ${LH_APT_GENERIC})
LH_APT_GENERIC="${LH_APT_GENERIC}"
# \$LH_APT_PDIFFS: set apt/aptitude pdiff indices
# (Default: ${LH_APT_PDIFFS})
LH_APT_PDIFFS="${LH_APT_PDIFFS}"
# \$LH_APT_RECOMMENDS: enable recommends
# (Default: ${LH_APT_RECOMMENDS})
LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}"
# \$LH_BOOTSTRAP: select the bootstrap program
# (Default: ${LH_BOOTSTRAP})
LH_BOOTSTRAP="${LH_BOOTSTRAP}"
# \$LH_CACHE: enable cache
# (Default: ${LH_CACHE})
LH_CACHE="${LH_CACHE}"
# \$LH_DEBCONF_FRONTEND: set the debconf(1) frontend to use
# (Default: ${LH_DEBCONF_FRONTEND})
LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}"
# \$LH_DEBCONF_PRIORITY: set the debconf(1) priority to use
# (Default: ${LH_DEBCONF_PRIORITY})
LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}"
# \$LH_GENISOIMAGE: set the genisoimage program
# (Default: autodetected)
LH_GENISOIMAGE="${LH_GENISOIMAGE}"
# \$LIVE_ROOT: set the root directory
# (Default: \`pwd\`/debian-live)
LIVE_ROOT="${LIVE_ROOT}"
# \$LIVE_CHROOT: set the chroot directory
# (Default: \${LIVE_ROOT}/chroot)
LIVE_CHROOT="${LIVE_CHROOT}"
EOF
# Creating lh_chroot_* configuration
cat > "${LIVE_ROOT}"/config/chroot << EOF
# config/chroot: configuration for lh_chroot_*
# \$LIVE_KERNEL: set the kernel flavour to use
# (Default: autodetected)
LIVE_KERNEL="${LIVE_KERNEL}"
# \$LIVE_KERNEL: set the kernel packages to use
# (Default: autodetected)
#LIVE_KERNEL_PACKAGES
# \$LIVE_LANGUAGE: set the language to use
# (Default: empty)
LIVE_LANGUAGE="${LIVE_LANGUAGE}"
# \$LIVE_PACKAGES: set the packages to install
# (Default: empty)
LIVE_PACKAGES="${LIVE_PACKAGES}"
# \$LIVE_PACKAGES_LIST: set the package list to install
# (Default: ${LIVE_PACKAGES_LIST})
LIVE_PACKAGES_LIST="${LIVE_PACKAGES_LIST}"
# \$LIVE_TASKS: set the tasks to install
# (Default: empty)
LIVE_TASKS="${LIVE_TASKS}"
# \$LIVE_SECURITY: enable security updates
# (Default: ${LIVE_SECURITY})
LIVE_SECURITY="${LIVE_SECURITY}"
# \$LIVE_SYMLINKS: enable symlink convertion
# (Default: ${LIVE_SYMLINKS})
LIVE_SYMLINKS="${LIVE_SYMLINKS}"
# \$LIVE_SYSVINIT: enable sysvinit
# (Default: ${LIVE_SYSVINIT})
LIVE_SYSVINIT="${LIVE_SYSVINIT}"
EOF
# Creating lh_chroot_* directories
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localhooks || true
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localincludes || true
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localpackages || true
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localpackageslist || true
# Creating lh_bootstrap_* configuration
cat > "${LIVE_ROOT}"/config/bootstrap << EOF
# config/bootstrap: configuration for lh_bootstrap_*
# \$LIVE_ARCHITECTURE: select the chroot architecture
# (Default: autodetected)
LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}"
# \$LIVE_DISTRIBUTION: select the distribution to use
# (Default: ${LIVE_DISTRIBUTION})
LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}"
# \$LIVE_DISTRIBUTION_CONFIG: set distribution config directory
# (Default: empty)
LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}"
# \$LIVE_FLAVOUR: select the flavour to use
# (Default: ${LIVE_FLAVOUR})
LIVE_FLAVOUR="${LIVE_FLAVOUR}"
# \$LIVE_MIRROR: set the mirror to use
# (Default: ${LIVE_MIRROR})
LIVE_MIRROR="${LIVE_MIRROR}"
# \$LIVE_MIRROR_SECURITY: set the security mirror to use
# (Default: ${LIVE_MIRROR_SECURITY})
LIVE_MIRROR_SECURITY="${LIVE_MIRROR_SECURITY}"
# \$LIVE_MIRROR_GENERIC: set the generic mirror to use
# (Default: ${LIVE_MIRROR_GENERIC})
LIVE_MIRROR_GENERIC="${LIVE_MIRROR_GENERIC}"
# \$LIVE_MIRROR_GENERIC_SECURITY: set the generic security mirror to use
# (Default: ${LIVE_MIRROR_GENERIC_SECURITY})
LIVE_MIRROR_GENERIC_SECURITY="${LIVE_MIRROR_GENERIC_SECURITY}"
# \$LIVE_SECTIONS: select the section to use
# (Default: ${LIVE_SECTIONS})
LIVE_SECTIONS="${LIVE_SECTIONS}"
EOF
# Creating lh_image_* configuration
cat > "${LIVE_ROOT}"/config/image << EOF
# config/chroot: configuration for lh_image_*
# \$LIVE_BOOTAPPEND: set boot parameters
# (Default: empty)
LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}"
# \$LIVE_ENCRYPTION: set encrytion
# (Default: empty)
LIVE_ENCRYPTION="${LIVE_ENCRYPTION}"
# \$LIVE_FILESYSTEM: set filesystem
# (Default: ${LIVE_FILESYSTEM})
LIVE_FILESYSTEM="${LIVE_FILESYSTEM}"
# \$LIVE_MEMTEST86: set memtest86+
# (Default: ${LIVE_MEMTEST86})
LIVE_MEMTEST86="${LIVE_MEMTEST86}"
# \$LIVE_ISO_VOLUME: set iso volume
# (Default: ${LIVE_ISO_VOLUME})
LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}"
# \$LIVE_SERVER_ADDRESS: set the netboot server address
# (Default: ${LIVE_SERVER_ADDRESS})
LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}"
# \$LIVE_SERVER_PATH: set the netboot server directory
# (Default: ${LIVE_SERVER_PATH})
LIVE_SERVER_PATH="${LIVE_SERVER_PATH}"
# \$LIVE_SOURCE: set source option
# (Default: ${LH_SOURCE})
LIVE_SOURCE="${LIVE_SOURCE}"
# \$LIVE_SYSLINUX: set syslinux option
# (Default: ${LIVE_SYSLINUX})
LIVE_SYSLINUX="${LIVE_SYSLINUX}"
# \$LIVE_SYSLINUX_SPLASH: set custom syslinux splash
# (Default: empty)
LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}"
# \$LIVE_BINARY_IMAGE: set image type
# (Default: ${LIVE_BINARY_IMAGE})
LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}"
# \$LIVE_SOURCE_IMAGE: set image type
# (Default: ${LIVE_SOURCE_IMAGE})
LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}"
# \$LIVE_TEMPLATES: set templates
# (Default: ${LIVE_TEMPLATES})
LIVE_TEMPLATES="${LIVE_TEMPLATES}"
EOF

View File

@ -1,56 +0,0 @@
#!/bin/sh
# lh_configapt.sh <action>
case "${1}" in
apply-proxy)
# Configure ftp proxy
if [ -n "${LIVE_PROXY_FTP}" ]
then
echo "Acquire::ftp::Proxy \"${LIVE_PROXY_FTP}\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_ftp-proxy.conf
fi
# Configure http proxy
if [ -n "${LIVE_PROXY_HTTP}" ]
then
echo "Acquire::http::Proxy \"${LIVE_PROXY_HTTP}\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_http-proxy.conf
fi
;;
apply-recommends)
# Configure recommends
if [ ! -d "${LIVE_CHROOT}"/etc/apt/apt.conf.d ]
then
mkdir -p "${LIVE_CHROOT}"/etc/apt/apt.conf.d
fi
if [ "${LIVE_RECOMMENDS}" = "yes" ]
then
echo "Aptitude::Recommends-Important \"true\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
else
echo "Aptitude::Recommends-Important \"false\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf
fi
;;
deapply-proxy)
# Deconfigure ftp proxy
if [ -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_ftp-proxy.conf ]
then
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_ftp-proxy.conf
fi
# Deconfigure http proxy
if [ -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_http-proxy.conf ]
then
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_http-proxy.conf
fi
;;
deapply-recommends)
# Deconfigure recommends
if [ -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_recommends.conf ]
then
rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/00make-live_recommends.conf
fi
;;
esac

View File

@ -1,60 +0,0 @@
#!/bin/sh
# lh_patchnetwork.sh <action>
# Packages which are manually installed inside the chroot are installed
# from the network. Therefore, we need to be able to resolv hosts.
case "${1}" in
apply-hosts)
# Save host lookup table
if [ -f "${LIVE_CHROOT}"/etc/hosts ]
then
cp "${LIVE_CHROOT}"/etc/hosts \
"${LIVE_CHROOT}"/etc/hosts.orig
fi
# Copy host lookup table
if [ -f /etc/hosts ]
then
cp /etc/hosts "${LIVE_CHROOT}"/etc/hosts
fi
;;
apply-resolv)
# Save resolver configuration
if [ -f "${LIVE_CHROOT}"/etc/resolv.conf ]
then
cp "${LIVE_CHROOT}"/etc/resolv.conf \
"${LIVE_CHROOT}"/etc/resolv.conf.orig
fi
# Copy resolver configuration
if [ -f /etc/resolv.conf ]
then
cp /etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf
fi
;;
deapply-hosts)
# Restore host lookup table
if [ -f "${LIVE_CHROOT}"/etc/hosts.orig ]
then
mv "${LIVE_CHROOT}"/etc/hosts.orig \
"${LIVE_CHROOT}"/etc/hosts
else
rm -f "${LIVE_CHROOT}"/etc/hosts
fi
;;
deapply-resolv)
# Restore resolver configuration
if [ -f "${LIVE_CHROOT}"/etc/resolv.conf.orig ]
then
mv "${LIVE_CHROOT}"/etc/resolv.conf.orig \
"${LIVE_CHROOT}"/etc/resolv.conf
else
rm -f "${LIVE_CHROOT}"/etc/resolv.conf
fi
;;
esac

View File

@ -1,25 +0,0 @@
#!/bin/sh
if [ ! -f "${LIVE_ROOT}"/.stage/bootstrap ]
then
# Create chroot directory
if [ ! -d "${LIVE_CHROOT}" ]
then
mkdir -p "${LIVE_CHROOT}"
fi
if [ -n "${LIVE_BOOTSTRAP_CONFIG}" ];
then
LIVE_DEBOOTSTRAP_SCRIPT="/usr/lib/debootstrap/scripts/${LIVE_BOOTSTRAP_CONFIG}"
fi
debootstrap --arch="${LIVE_ARCHITECTURE}" --variant=buildd "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}" "${LIVE_DEBOOTSTRAP_SCRIPT}"
# Touching stage file
if [ ! -d "${LIVE_ROOT}"/.stage ]
then
mkdir "${LIVE_ROOT}"/.stage
fi
touch "${LIVE_ROOT}"/.stage/bootstrap
fi

View File

@ -1,86 +0,0 @@
#!/bin/sh
# lh_depends.sh <action> <type>
case "${1}" in
install)
if [ -z "${KEEP_MEMTEST86}" ]
then
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
lh_chroot "aptitude install --assume-yes memtest86+"
fi
fi
if [ -z "${KEEP_SYSLINUX}" ]
then
lh_chroot "aptitude install --assume-yes syslinux"
fi
case "${2}" in
usb)
if [ -z "${KEEP_DOSFSTOOLS}" ]
then
lh_chroot "aptitude install --assume-yes dosfstools"
fi
if [ -z "${KEEP_MTOOLS}" ]
then
lh_chroot "aptitude install --assume-yes mtools"
fi
if [ -z "${KEEP_PARTED}" ]
then
lh_chroot "aptitude install --assume-yes parted"
fi
;;
esac
;;
remove)
if [ -z "${KEEP_MEMTEST86}" ]
then
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
lh_chroot "aptitude purge --assume-yes memtest86+"
fi
fi
if [ -z "${KEEP_SYSLINUX}" ]
then
lh_chroot "aptitude purge --assume-yes syslinux"
fi
case "${2}" in
usb)
if [ -z "${KEEP_DOSFSTOOLS}" ]
then
lh_chroot "aptitude purge --assume-yes dosfstools"
fi
if [ -z "${KEEP_MEMTEST86}" ]
then
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
lh_chroot "aptitude purge --assume-yes memtest86+"
fi
fi
if [ -z "${KEEP_MTOOLS}" ]
then
lh_chroot "aptitude purge --assume-yes mtools"
fi
if [ -z "${KEEP_PARTED}" ]
then
lh_chroot "aptitude purge --assume-yes parted"
fi
if [ -z "${KEEP_SYSLINUX}" ]
then
lh_chroot "aptitude purge --assume-yes syslinux"
fi
;;
esac
;;
esac

View File

@ -1,76 +0,0 @@
#!/bin/sh
# lh_genrootfs.sh <filesystem>
case "${LIVE_FILESYSTEM}" in
ext2)
DU_DIM="`du -ks ${LIVE_CHROOT} | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
if [ -z "${LIVE_ENCRYPTION}" ]
then
genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.ext2
else
echo "Encrypting ${LIVE_ROOT}/binary/casper/filesystem.ext2 with ${LIVE_ENCRYPTION}..."
while true
do
genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${LIVE_CHROOT}" | aespipe -e "${LIVE_ENCRYPTION}" -T > "${LIVE_ROOT}"/binary/casper/filesystem.ext2 && break
echo -n "Something went wrong... Retry? [YES/no] "
read ANSWER
if [ 'no' = "${ANSWER}" ]
then
unset ANSWER
break
fi
done
fi
;;
plain)
if [ -n "${LIVE_ENCRYPTION}" ]
then
echo "Error: encryption is not supported for filesystem type 'plain'"
exit 1
fi
cd "${LIVE_CHROOT}"
find . | cpio -pumd "${LIVE_ROOT}"/binary/casper/filesystem.dir
cd "${OLDPWD}"
;;
squashfs)
if [ -f "${LIVE_ROOT}"/binary/casper/filesystem.squashfs ]
then
rm "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
fi
if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
then
mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs -e "${LIVE_CHROOT}"/boot/vmlinuz* "${LIVE_CHROOT}"/boot/initrd.img* "${LIVE_CHROOT}"/vmlinuz "${LIVE_CHROOT}"/initrd.img "${LIVE_CHROOT}"/boot/config-* "${LIVE_CHROOT}"/boot/System.map-*
else
mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
fi
if [ -n "$LIVE_ENCRYPTION" ]
then
echo "Encrypting ${LIVE_ROOT}/binary/casper/filesystem.squashfs with ${LIVE_ENCRYPTION}..."
while true
do
cat "${LIVE_ROOT}"/binary/casper/filesystem.squashfs | aespipe -e "${LIVE_ENCRYPTION}" -T > "${LIVE_ROOT}"/binary/casper/filesystem.squashfs.encrypted && mv "${LIVE_ROOT}"/binary/casper/filesystem.squashfs.encrypted "${LIVE_ROOT}"/binary/casper/filesystem.squashfs && break
echo -n "Something went wrong... Retry? [YES/no] "
read ANSWER
if [ 'no' = "${ANSWER}" ]
then
unset ANSWER
break
fi
done
fi
;;
esac

View File

@ -1,21 +0,0 @@
#!/bin/sh
# lh_hook
# Process flavour specific hooks
if [ -r "${BASE}"/hooks/"${LIVE_FLAVOUR}" ]
then
grep -v "^#" "${BASE}"/hooks/"${LIVE_FLAVOUR}" > "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}"
LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" lh_chroot "sh /root/${LIVE_FLAVOUR}"
rm -f "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}"
fi
# Execute extra command in the chroot
if [ -r "${LIVE_HOOK}" ]
then
# FIXME
LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" lh_chroot "`cat ${LIVE_HOOK}`"
elif [ -n "${LIVE_HOOK}" ]
then
LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" lh_chroot "${LIVE_HOOK}"
fi

View File

@ -1,11 +0,0 @@
#!/bin/sh
# lh_includechroot
# Copy external directory into the chroot
if [ -d "${LIVE_INCLUDE_CHROOT}" ]
then
cd "${LIVE_INCLUDE_CHROOT}"
find . | cpio -pumd "${LIVE_CHROOT}"
cd "${OLDPWD}"
fi

View File

@ -1,35 +0,0 @@
#!/bin/sh
# lh_installapt
# Install aptitude
lh_chroot "apt-get install --yes --force-yes aptitude"
# FIXME
lh_chroot "apt-key update"
# Install secure apt
if [ "${LIVE_DISTRIBUTION}" = "unstable" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ] || \
[ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ]
then
if [ "${LIVE_FLAVOUR}" != "minimal" ] || [ "${LIVE_FLAVOUR}" != "mini" ]
then
lh_chroot "apt-get install --yes --force-yes ${LIVE_REPOSITORY_KEYRING}"
for NAME in ${LIVE_REPOSITORIES}
do
eval REPOSITORY_KEY="$`echo LIVE_REPOSITORY_KEY_$NAME`"
eval REPOSITORY_KEYRING="$`echo LIVE_REPOSITORY_KEYRING_$NAME`"
if [ -n "${REPOSITORY_KEYRING}" ]
then
lh_chroot "aptitude install ${REPOSITORY_KEYRING}"
elif [ -n "${REPOSITORY_KEY}" ]
then
lh_chroot "wget ${REPOSITORY_KEY}"
lh_chroot "apt-key add `basename ${REPOSITORY_KEY}`"
lh_chroot "rm -f `basename ${REPOSITORY_KEY}`"
fi
done
fi
fi

View File

@ -1,25 +0,0 @@
#!/bin/sh
# lh_installinux <type>
# Removing initrd backup files
rm -f "${LIVE_CHROOT}"/boot/initrd*bak*
# Setting destination directory
case "${1}" in
iso)
DESTDIR="${LIVE_ROOT}/binary/isolinux"
;;
net)
DESTDIR="${LIVE_ROOT}/tftpboot"
;;
usb)
DESTDIR="${LIVE_ROOT}/binary"
;;
esac
# Installing linux image
cp "${LIVE_CHROOT}"/boot/vmlinuz* "${DESTDIR}"/vmlinuz
cp "${LIVE_CHROOT}"/boot/initrd.img* "${DESTDIR}"/initrd.gz

View File

@ -1,24 +0,0 @@
#!/bin/sh
# lh_installmemtest86+.sh <type>
# Setting destination directory
case "${1}" in
iso)
DESTDIR="${LIVE_ROOT}/binary/isolinux"
;;
net)
DESTDIR="${LIVE_ROOT}/tftpboot"
;;
usb)
DESTDIR="${LIVE_ROOT}/binary"
;;
esac
# Installing memtest86+
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${DESTDIR}"/memtest
fi

View File

@ -1,29 +0,0 @@
#!/bin/sh
# lh_installpackagelists
# Install packages list
if [ -n "${LIVE_PACKAGE_LIST}" ]
then
if [ "${LIVE_PACKAGE_LIST}" = "everything" ]
then
#for FILE in "${LIVE_CHROOT}"/var/lib/apt/lists/*_Packages
#do
# awk '/Package: / { print $2 }' "${FILE}" | grep -v ".*-dbg$" >> "${LIVE_CHROOT}"/root/everything
#done
#lh_chroot "xargs --arg-file=/root/everything aptitude install --assume-yes"
#rm -f "${LIVE_CHROOT}"/root/everything
# FIXME
for SECTION in admin base comm devel doc editors electronics embedded games gnome graphics hamradio interpreters kde libs libdevel mail math misc net news oldlibs otherosfs perl python science shells sound tex text utils web x11
do
lh_chroot "aptitude install --assume-yes ~s${SECTION}"
done
else
grep -v "^#" "${LIVE_PACKAGE_LIST}" > "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`"
lh_chroot "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST}` aptitude install --assume-yes"
rm -f "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`"
fi
fi

View File

@ -1,9 +0,0 @@
#!/bin/sh
# lh_installpackages
# Install extra packages
if [ -n "${LIVE_PACKAGES}" ]
then
lh_chroot "aptitude install --assume-yes ${LIVE_PACKAGES}"
fi

View File

@ -1,79 +0,0 @@
#!/bin/sh
# lh_installsyslinux.sh <type>
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
if [ -n "${LIVE_ENCRYPTION}" ]
then
LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}"
fi
case "${1}" in
iso)
# Copy syslinux
mkdir -p "${LIVE_ROOT}"/binary/isolinux
cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/isolinux
cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/binary/isolinux
# Copy splash screen
if [ -n "${LIVE_ISOLINUX_SPLASH}" ]; then
cp "${LIVE_ISOLINUX_SPLASH}" "${LIVE_ROOT}/binary/isolinux/splash.rle"
fi
# Configure syslinux templates
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/binary/isolinux/f1.txt
sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/isolinux/f10.txt
# Remove unused files
rm -f "${LIVE_ROOT}"/binary/isolinux/pxelinux.cfg
;;
net)
# Copy syslinux
mkdir -p "${LIVE_ROOT}"/tftpboot
cp "${LIVE_ROOT}"/chroot/usr/lib/syslinux/pxelinux.0 "${LIVE_ROOT}"/tftpboot
# Install syslinux templates
mkdir -p "${LIVE_ROOT}"/tftpboot/pxelinux.cfg
cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/tftpboot/pxelinux.cfg
mv "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/pxelinux.cfg "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
sed -i -e 's#splash.rle#pxelinux.cfg/splash.rle#' "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.txt
# Copy splash screen
if [ -n "${LIVE_ISOLINUX_SPLASH}" ]; then
cp "${LIVE_ISOLINUX_SPLASH}" "${LIVE_ROOT}/tftpboot/pxelinux.cfg/splash.rle"
fi
# Configure syslinux templates
sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f1.txt
sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f10.txt
# Remove unused files
rm -f "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.cfg
;;
usb)
# Copy syslinux
mkdir -p "${LIVE_ROOT}"/binary
cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/syslinux.bin
cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/binary
mv "${LIVE_ROOT}"/binary/isolinux.cfg "${LIVE_ROOT}"/binary/syslinux.cfg
# Copy splash screen
if [ -n "${LIVE_ISOLINUX_SPLASH}" ]; then
cp "${LIVE_ISOLINUX_SPLASH}" "${LIVE_ROOT}/binary/splash.rle"
fi
# Configure syslinux templates
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/syslinux.cfg
sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/binary/f1.txt
sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/f10.txt
# Remove unused files
rm -f "${LIVE_ROOT}"/binary/isolinux/pxelinux.cfg
;;
esac
fi

View File

@ -1,12 +0,0 @@
#!/bin/sh
# lh_installtasks
# Install aptitude tasks
if [ -n "${LIVE_TASKS}" ]
then
for TASK in ${LIVE_TASKS}
do
lh_chroot "aptitude install --assume-yes ${TASK}"
done
fi

View File

@ -1,10 +0,0 @@
#!/bin/sh
# lh_localdeb
if [ `ls "${LIVE_ROOT}"/localdeb/*.deb` ]
then
cp "${LIVE_ROOT}"/localdeb/*.deb "${LIVE_CHROOT}"/root
lh_chroot "dpkg -i /root/*.deb"
rm -f "${LIVE_CHROOT}"/root/*.deb
fi

View File

@ -2,7 +2,13 @@
# lh_losetup <device> <file> <partition>
DEVICE="${1}"
if [ -z "${1}" ]
then
DEVICE="`losetup -f`"
else
DEVICE="${1}"
fi
FILE="${2}"
PARTITION="${3}"
@ -11,7 +17,7 @@ FDISK_OUT="`fdisk -l -u ${DEVICE} 2>&1`"
losetup -d "${DEVICE}"
LOOPDEVICE="`echo ${DEVICE}p${PARTITION:=1}`"
CYL="`echo ${FDISK_OUT} | sed -ne "s_^${LOOPDEVICE}[ *]*\([0-9]*\).*_\1_p" `"
CYL=`echo "$FDISK_OUT" | sed -ne "s_^$LOOPDEVICE[ *]*\([0-9]*\).*_\1_p"`
#OFFSET="`expr 512 '*' ${CYL}`"
OFFSET="$((CYL*512))"

View File

@ -1,13 +0,0 @@
#!/bin/sh
# lh_manifest
# Add filesystem.manifest
lh_chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > "${LIVE_ROOT}"/filesystem.manifest
if [ -n "${LIVE_MANIFEST}" ]
then
# FIXME; what should that be good for anyway?
lh_chroot "aptitude install --assume-yes ${LIVE_MANIFEST}"
lh_chroot "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest-desktop
fi

View File

@ -1,17 +0,0 @@
#!/bin/sh
# lh_md5sums.sh
# Calculating md5sums
cd "${LIVE_ROOT}"/binary
find . -type f -print0 | xargs -0 md5sum > "${LIVE_ROOT}"/md5sum.txt
cd "${OLDPWD}"
if [ -d "${LIVE_INCLUDE_IMAGE}" ]
then
cd "${LIVE_INCLUDE_IMAGE}"
find . -type f -print0 | xargs -0 md5sum >> "${LIVE_ROOT}"/md5sum.txt
cd "${OLDPWD}"
fi
mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/binary

View File

@ -1,18 +0,0 @@
#!/bin/sh
# lh_patchchroot.sh <action>
# Some maintainer scripts can detect if they are in a chrooted system.
# Therefore, we create the needed file.
case "${1}" in
apply)
# Create chroot file
echo "debian-live" > "${LIVE_CHROOT}"/etc/debian_chroot
;;
deapply)
# Remove chroot file
rm -f "${LIVE_CHROOT}"/etc/debian_chroot
;;
esac

View File

@ -1,32 +0,0 @@
#!/bin/sh
# lh_patchlinux.sh <action>
# The linux-image package asks interactively for initial ramdisk
# creation. Therefore, we preconfigure /etc/kernel-img.conf.
# FIXME: preseeding?
case "${1}" in
apply)
# Save kernel configuration
if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf ]
then
cp "${LIVE_CHROOT}"/etc/kernel-img.conf \
"${LIVE_CHROOT}"/etc/kernel-img.conf.old
fi
# Configure kernel-img.conf
echo "do_initrd = Yes" >> "${LIVE_CHROOT}"/etc/kernel-img.conf
;;
deapply)
# Restore kernel configuration
if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf.old ]
then
mv "${LIVE_CHROOT}"/etc/kernel-img.conf.old \
"${LIVE_CHROOT}"/etc/kernel-img.conf
else
rm -f "${LIVE_CHROOT}"/etc/kernel-img.conf
fi
;;
esac

View File

@ -1,18 +0,0 @@
#!/bin/sh
# lh_patchnetwork.sh <action>
# Packages which are manually installed inside the chroot are installed
# from the network. Therefore, we need to be able to resolv hosts.
case "${1}" in
apply)
lh_confignetwork apply-hosts
lh_confignetwork apply-resolv
;;
deapply)
lh_confignetwork deapply-hosts
lh_confignetwork deapply-resolv
;;
esac

View File

@ -1,27 +0,0 @@
#!/bin/sh
# lh_patchrunlevel.sh <action>
# Disabling all init scripts with a blocking policy as in
# /usr/share/doc/sysv-rc/README.policy-rc.d.gz.
case "${1}" in
apply)
# Create init policy
cat > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d << EOF
#!/bin/sh
echo
echo "Warning: invoke-rc.d policy in action. Skiping daemon starting"
exit 101
EOF
chmod 0755 "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
;;
deapply)
# Removing init policy
rm -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
;;
esac

View File

@ -1,23 +0,0 @@
#!/bin/sh
# lh_preseed
# Restore preseed configuration
if [ -f "${LIVE_PRESEED}" ]
then
lh_chroot "aptitude install --assume-yes debconf-utils"
cp "${LIVE_PRESEED}" "${LIVE_CHROOT}"/root/preseed
lh_chroot "debconf-set-selections /root/preseed"
rm -f "${LIVE_CHROOT}"/root/preseed
else
if [ -n "${LIVE_PRESEED}" ]; then
echo "'${LIVE_PRESEED}' file doesn't exists. Exiting..."
exit 1
fi
fi
# Restore cloned package selection
if [ -f "${LIVE_PACKAGE_LIST_CLONED}" ]
then
lh_chroot "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST_CLONED}` aptitude install --assume-yes"
fi

View File

@ -1,124 +0,0 @@
#!/bin/sh
case "${1}" in
custom)
# Configure custom sources.list
case "${LIVE_DISTRIBUTION}" in
stable|"${CODENAME_STABLE}"|testing|"${CODENAME_TESTING}")
echo "deb ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
echo "deb ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
;;
unstable|"${CODENAME_UNSTABLE}")
echo "deb ${LIVE_MIRROR} unstable ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src ${LIVE_MIRROR} unstable ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
then
echo "deb ${LIVE_MIRROR} experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src ${LIVE_MIRROR} experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
cat > "${LIVE_CHROOT}"/etc/apt/preferences << EOF
Package: *
Pin: release a=experimental
Pin-Priority: 999
EOF
fi
;;
esac
;;
default)
# Configure default sources.list
case "${LIVE_DISTRIBUTION}" in
oldstable|"${CODENAME_OLDSTABLE}"|stable|"${CODENAME_STABLE}"|testing|"${CODENAME_TESTING}")
echo "deb http://ftp.debian.org/debian/ ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src http://ftp.debian.org/debian/ ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
echo "deb http://security.debian.org/ ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src http://security.debian.org/ ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
;;
unstable|"${CODENAME_UNSTABLE}")
echo "deb http://ftp.debian.org/debian/ unstable ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src http://ftp.debian.org/debian/ unstable ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
then
echo "deb http://ftp.debian.org/debian/ experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
if [ "${LIVE_SOURCE}" = "yes" ]
then
echo "deb-src http://ftp.debian.org/debian/ experimental ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
fi
;;
esac
;;
esac
# Add custom repositories
echo "" >> "${LIVE_CHROOT}"/etc/apt/sources.list
echo "# Custom repositories" >> "${LIVE_CHROOT}"/etc/apt/sources.list
for NAME in ${LIVE_REPOSITORIES}
do
eval REPOSITORY="$`echo LIVE_REPOSITORY_$NAME`"
eval REPOSITORY_DISTRIBUTION="$`echo LIVE_REPOSITORY_DISTRIBUTION_$NAME`"
eval REPOSITORY_SECTIONS="$`echo LIVE_REPOSITORY_SECTIONS_$NAME`"
# Configure /etc/apt/sources.list
if [ -n "${REPOSITORY_DISTRIBUTION}" ]
then
echo "deb ${REPOSITORY} ${REPOSITORY_DISTRIBUTION} ${REPOSITORY_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
else
echo "deb ${REPOSITORY} ${LIVE_DISTRIBUTION} ${REPOSITORY_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
fi
done
# Update indices
if [ "${2}" = "initial" ]
then
lh_chroot "apt-get update"
else
lh_chroot "aptitude update"
fi
if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
then
# experimental is sometimes broken,
# therefore this is intentionally kept interactive.
lh_chroot "aptitude upgrade" || return 0
lh_chroot "aptitude dist-upgrade" || return 0
fi

33
helpers/lh_source Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
# lh_source(1) - building the source images
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
# Reading configuration files
Read_conffile config/common
Read_conffile config/image
Set_defaults
# Enabling network in chroot
lh_chroot_hosts install
lh_chroot_resolv install
lh_chroot_sources install
# Preparing images
lh_source_download
# Building images
lh_source_generic
lh_source_iso
lh_source_net
lh_source_usb
# Deconfiguring chroot
rm -f "${LIVE_ROOT}"/.stage/chroot_sources
lh_chroot_resolv remove
lh_chroot_hosts remove

Some files were not shown because too many files have changed in this diff Show More