Moving grub and grub2 templates into shared bootloader config directory.

This commit is contained in:
Daniel Baumann 2015-04-29 07:52:56 +02:00
parent 7f6b1d71f8
commit 7e633e77f2
10 changed files with 32 additions and 47 deletions

View File

@ -40,7 +40,7 @@ build:
install:
# Installing shared data
mkdir -p $(DESTDIR)/usr/share/live/build
cp -r data functions templates VERSION $(DESTDIR)/usr/share/live/build
cp -r data functions VERSION $(DESTDIR)/usr/share/live/build
cp -r share/* $(DESTDIR)/usr/share/live/build
# Installing executables

View File

@ -341,14 +341,6 @@ Set_defaults ()
;;
esac
# Setting templates
if [ -n "${LIVE_BUILD}" ]
then
LB_TEMPLATES="${LB_TEMPLATES:-${LIVE_BUILD}/templates}"
else
LB_TEMPLATES="${LB_TEMPLATES:-/usr/share/live/build/templates}"
fi
# Setting live build options
_BREAKPOINTS="${_BREAKPOINTS:-false}"
_COLOR="${_COLOR:-false}"

View File

@ -1,25 +0,0 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program 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.
Check_templates ()
{
PACKAGE="${1}"
if [ -d "config/templates/${PACKAGE}" ]
then
TEMPLATES="config/templates/${PACKAGE}"
elif [ -d "${LB_TEMPLATES}/${PACKAGE}" ]
then
TEMPLATES="${LB_TEMPLATES}/${PACKAGE}"
else
Echo_error "%s templates not accessible in %s nor config/templates" "${PACKAGE}" "${LB_TEMPLATES}"
exit 1
fi
}

View File

@ -117,6 +117,20 @@ Grub_install_entry ()
done
}
if [ -e "config/bootloaders/grub" ]
then
# Internal local copy
_SOURCE="config/bootloaders/grub"
else
# Internal system copy
if [ -n "${LIVE_BUILD}" ]
then
_SOURCE="${LIVE_BUILD}/share/bootloaders/grub"
else
_SOURCE="/usr/share/live/build/bootloaders/grub"
fi
fi
case "${LB_INITRAMFS}" in
casper)
INITFS="casper"
@ -238,7 +252,7 @@ fi
# Copying templates
mkdir -p binary/boot/grub
cp -r "${TEMPLATES}"/* binary/boot/grub
cp -r "${_SOURCE}"/* binary/boot/grub
case ${LIVE_IMAGE_TYPE} in
iso*)

View File

@ -91,6 +91,20 @@ Grub_install_entry ()
LINUX_INSTALL="${LINUX_INSTALL}\n}"
}
if [ -e "config/bootloaders/grub2" ]
then
# Internal local copy
_SOURCE="config/bootloaders/grub2"
else
# Internal system copy
if [ -n "${LIVE_BUILD}" ]
then
_SOURCE="${LIVE_BUILD}/share/bootloaders/grub2"
else
_SOURCE="/usr/share/live/build/bootloaders/grub2"
fi
fi
case "${LB_INITRAMFS}" in
casper)
INITFS="casper"
@ -211,7 +225,7 @@ fi
# Copying templates
mkdir -p binary/boot/grub/i386-pc
cp -r "${TEMPLATES}"/* binary/boot/grub
cp -r "${_SOURCE}"/* binary/boot/grub
case ${LIVE_IMAGE_TYPE} in
iso*)

View File

@ -113,7 +113,6 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--swap-file-path PATH]\n\
\t [--swap-file-size MB]\n\
\t [--tasksel apt|aptitude|tasksel]\n\
\t [--templates PATH]\n\
\t [--updates true|false]\n\
\t [--backports true|false]\n\
\t [--verbose]\n\
@ -130,7 +129,7 @@ Local_arguments ()
apt-pipeline:,apt-recommends:,apt-secure:,apt-source-archives:,bootstrap:,cache:,cache-indices:,cache-packages:,
cache-stages:,debconf-frontend:,debconf-priority:,dump,
initramfs:,initramfs-compression:,initsystem:,fdisk:,losetup:,mode:,system:,tasksel:,
templates:,architectures:,clean,
architectures:,clean,
distribution:,parent-distribution:,parent-debian-installer-distribution:,parent-mirror-bootstrap:,parent-mirror-chroot:,parent-mirror-chroot-security:,parent-mirror-binary:,
parent-mirror-binary-security:,parent-mirror-debian-installer:,
mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:,
@ -329,11 +328,6 @@ Local_arguments ()
shift 2
;;
--templates)
LB_TEMPLATES="${2}"
shift 2
;;
# config/bootstrap
-a|--architectures)
LB_ARCHITECTURES="${2}"
@ -966,10 +960,6 @@ LB_SYSTEM="${LB_SYSTEM}"
# (Default: ${LB_TASKSEL})
LB_TASKSEL="${LB_TASKSEL}"
# \$LB_TEMPLATES: set templates
# (Default: ${LB_TEMPLATES})
LB_TEMPLATES="${LB_TEMPLATES}"
# live-build options
# \$_BREAKPOINTS: enable breakpoints