live-build/scripts/build/lb_binary_syslinux

113 lines
2.3 KiB
Plaintext
Raw Normal View History

2007-09-23 08:04:46 +00:00
#!/bin/sh
## live-build(7) - System Build Scripts
2010-09-26 10:38:38 +00:00
## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
##
## 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
. "${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
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
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
2007-09-23 08:04:46 +00:00
Set_defaults
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
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
Check_architecture amd64 i386
Check_crossarchitecture
2007-09-23 08:05:09 +00: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
# Restoring cache
Restore_cache cache/packages_binary
2007-09-23 08:05:13 +00:00
# Installing depends
Install_package
_PREFIX="chroot"
2007-09-23 08:04:52 +00:00
;;
esac
# Assembling image specifics
case "${LB_BINARY_IMAGES}" in
iso*)
_BOOTLOADER="isolinux"
_SUFFIX="binary/isolinux"
2007-09-23 08:04:50 +00:00
;;
net*)
_BOOTLOADER="pxelinux"
_SUFFIX="tftpboot"
2007-09-23 08:05:13 +00:00
;;
2007-09-23 08:04:50 +00:00
usb*)
_BOOTLOADER="syslinux"
_SUFFIX="binary/syslinux"
2007-09-23 08:04:50 +00:00
;;
esac
# Copying files
mkdir -p ${_SUFFIX}
cp -aL ${_PREFIX}/usr/share/syslinux/themes/${LB_SYSLINUX_THEME}/${_BOOTLOADER}-live/* ${_SUFFIX}
2007-09-23 08:04:48 +00:00
# Configuring files
if [ -e ${_SUFFIX}/live.cfg ]
2007-09-23 08:04:50 +00:00
then
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
if [ -e ${_SUFFIX}/install.cfg ]
2007-09-23 08:04:50 +00:00
then
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
case "${LB_BUILD_WITH_CHROOT}" in
true)
# Saving cache
Save_cache cache/packages_binary
# 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