2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2011-01-11 12:49:49 -01:00
|
|
|
## Copyright (C) 2006-2011 Daniel Baumann <daniel@debian.org>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
|
|
|
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
2010-09-07 13:11:20 +00:00
|
|
|
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2009-01-15 01:37:42 -01:00
|
|
|
DESCRIPTION="$(Echo 'installs syslinux into binary')"
|
2007-09-23 08:04:48 +00:00
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:04:46 +00:00
|
|
|
Set_defaults
|
|
|
|
|
2010-09-07 13:11:20 +00:00
|
|
|
if [ "${LB_BOOTLOADER}" != "syslinux" ]
|
2007-09-23 08:04:50 +00:00
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
Echo_message "Begin installing syslinux..."
|
2007-09-23 08:04:49 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Requiring stage file
|
2008-10-14 19:32:50 +00:00
|
|
|
Require_stagefile .stage/config .stage/bootstrap
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:04:50 +00:00
|
|
|
# Checking stage file
|
|
|
|
Check_stagefile .stage/binary_syslinux
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Checking lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Check_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Creating lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Create_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:13 +00:00
|
|
|
# Check architecture
|
2010-12-05 12:27:08 -01:00
|
|
|
Check_architectures amd64 i386
|
|
|
|
Check_crossarchitectures
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
case "${LB_BUILD_WITH_CHROOT}" in
|
|
|
|
true)
|
|
|
|
# Checking depends
|
|
|
|
Check_package chroot/usr/bin/syslinux syslinux
|
|
|
|
Check_package chroot/usr/share/syslinux/themes/${LB_SYSLINUX_THEME} syslinux-themes-${LB_SYSLINUX_THEME}
|
2007-09-19 00:43:18 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
# Restoring cache
|
|
|
|
Restore_cache cache/packages_binary
|
2007-09-23 08:05:13 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
# Installing depends
|
|
|
|
Install_package
|
2010-09-15 11:19:04 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
_PREFIX="chroot"
|
2007-09-23 08:04:52 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
# Assembling image specifics
|
2010-09-07 13:11:20 +00:00
|
|
|
case "${LB_BINARY_IMAGES}" in
|
2010-02-18 15:34:29 -01:00
|
|
|
iso*)
|
2010-11-02 09:19:42 -01:00
|
|
|
_BOOTLOADER="isolinux"
|
|
|
|
_SUFFIX="binary/isolinux"
|
2007-09-23 08:04:50 +00:00
|
|
|
;;
|
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
net*)
|
|
|
|
_BOOTLOADER="pxelinux"
|
|
|
|
_SUFFIX="tftpboot"
|
2007-09-23 08:05:13 +00:00
|
|
|
;;
|
2007-09-23 08:04:50 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
usb*)
|
|
|
|
_BOOTLOADER="syslinux"
|
|
|
|
_SUFFIX="binary/syslinux"
|
2007-09-23 08:04:50 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
# Copying files
|
|
|
|
mkdir -p ${_SUFFIX}
|
2010-11-21 16:18:10 -01:00
|
|
|
cp -aL ${_PREFIX}/usr/share/syslinux/themes/${LB_SYSLINUX_THEME}/${_BOOTLOADER}-live/* ${_SUFFIX}
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
# Configuring files
|
|
|
|
if [ -e ${_SUFFIX}/live.cfg ]
|
2007-09-23 08:04:50 +00:00
|
|
|
then
|
2010-11-02 09:19:42 -01:00
|
|
|
sed -i -e "s|@LB_BOOTAPPEND_LIVE@|${LB_BOOTAPPEND_LIVE}|g" \
|
|
|
|
${_SUFFIX}/live.cfg
|
2007-09-23 08:04:50 +00:00
|
|
|
fi
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
if [ -e ${_SUFFIX}/install.cfg ]
|
2007-09-23 08:04:50 +00:00
|
|
|
then
|
2010-11-02 09:19:42 -01:00
|
|
|
sed -i -e "s|@LB_BOOTAPPEND_INSTALL@|${LB_BOOTAPPEND_INSTALL}|g" \
|
|
|
|
${_SUFFIX}/install.cfg
|
2007-09-23 08:04:50 +00:00
|
|
|
fi
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
case "${LB_BUILD_WITH_CHROOT}" in
|
|
|
|
true)
|
|
|
|
# Saving cache
|
|
|
|
Save_cache cache/packages_binary
|
2009-11-01 12:06:46 -01:00
|
|
|
|
2010-11-02 09:19:42 -01:00
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
2007-09-23 08:04:50 +00:00
|
|
|
;;
|
|
|
|
esac
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2007-09-23 08:04:50 +00:00
|
|
|
# Creating stage file
|
|
|
|
Create_stagefile .stage/binary_syslinux
|