summaryrefslogtreecommitdiff
path: root/auto/functions
diff options
context:
space:
mode:
Diffstat (limited to 'auto/functions')
-rw-r--r--auto/functions/compat42
-rw-r--r--auto/functions/debpool-hook6
-rw-r--r--auto/functions/livebuild-hacks36
3 files changed, 64 insertions, 20 deletions
diff --git a/auto/functions/compat b/auto/functions/compat
index 250402d..9bb8438 100644
--- a/auto/functions/compat
+++ b/auto/functions/compat
@@ -1,5 +1,8 @@
#!/bin/bash
export LB_VERSION=$VERSION
+export LB_BASE="${LB_BASE:-/usr/share/live/build}"
+
+current_script="$(basename "$0"|sed 's/^lb_//')"
Compat_arguments ()
{
@@ -10,11 +13,11 @@ Compat_arguments ()
case "$arg" in
-r|--repositories) arg="--archives";;
--architecture) arg="--architectures";;
- --packages-lists) arg="--package-lists";;
--syslinux-theme) ;;
# ignore other unsupported arguments
--syslinux-*|--bootstrap-config|-e|--encryption|-l|--language) shift; continue;;
--binary-indices|--packages|--symlinks|--sysvinit|--tasks|--virtual-root-size) shift; continue;;
+ --packages-lists|--package-list|-p) Compat_packagelists $1; shift; continue;;
esac
echo -n "$arg$IFS"
done
@@ -41,6 +44,7 @@ Compat_dir ()
dir3="$2"
ext2="$3"
ext3="$4"
+ [ ! -e "config/$dir2" ] && return 0
if [ -z "$ext2$ext3" ]; then
rm -r "config/$dir3"
ln -s "$(basename "$dir2")" "config/$dir3"
@@ -61,6 +65,19 @@ Compat_dir ()
touch config/$dir3.compat
}
+Compat_packagelists()
+{
+ mkdir -p config/package-lists
+ (
+ echo '# AUTOGENERATED from "lb config -p" option - DO NOT CHANGE'
+ IFS=" "
+ for packagelist in $1
+ do
+ echo "#include <$packagelist>"
+ done
+ ) > config/package-lists/compat.list.chroot
+}
+
Compat_clean()
{
for i in config/*.compat
@@ -75,8 +92,13 @@ Compat_clean()
case "$LB_VERSION" in
3*)
- case "$(basename "$0")" in
- lb_config)
+ case "$current_script" in
+ config)
+ if [ -z "$LB_COMPAT_CONFIG_AUTO" ]; then
+ export LB_COMPAT_CONFIG_AUTO=1
+ auto/config "$@"
+ exit $?
+ fi
OIFS="$IFS"; IFS="$(printf \\a)"
set -- $(Compat_arguments "$@")
IFS="$OIFS"
@@ -88,10 +110,10 @@ case "$LB_VERSION" in
LB_ARCHITECTURE="$LB_ARCHITECTURES"
trap Compat_config EXIT
;;
- lb_chroot_apt)
+ chroot_apt)
Compat_dir chroot_local-packages packages.chroot
;;
- lb_chroot_archives)
+ chroot_archives)
mkdir -p config/archives
touch config/archives.compat
. config/bootstrap
@@ -109,19 +131,19 @@ case "$LB_VERSION" in
done
done
;;
- lb_chroot_preseed)
+ chroot_preseed)
Compat_dir chroot_local-preseed preseed .cfg .preseed
;;
- lb_chroot_includes)
+ chroot_includes)
Compat_dir chroot_local-includes includes.chroot
;;
- lb_chroot_hooks)
+ chroot_hooks)
Compat_dir chroot_local-hooks hooks - .chroot
;;
- lb_binary_hooks)
+ binary_hooks)
Compat_dir binary_local-hooks hooks - .binary
;;
- lb_build|lb_clean)
+ build|clean)
trap Compat_clean EXIT
;;
esac
diff --git a/auto/functions/debpool-hook b/auto/functions/debpool-hook
index c86a065..e56df34 100644
--- a/auto/functions/debpool-hook
+++ b/auto/functions/debpool-hook
@@ -1,6 +1,8 @@
#!/bin/bash
-if [ "$(basename "$0")" = "lb_chroot_local-hooks" ]; then
+current_script="$(basename "$0"|sed 's/^lb_//')"
+
+if [ "$current_script" = "chroot_local-hooks" ]; then
echo "HOOK: debpool@chroot_local-hooks"
if [ -e config/chroot_debpool ]; then
mkdir -p chroot/live
@@ -8,7 +10,7 @@ if [ "$(basename "$0")" = "lb_chroot_local-hooks" ]; then
fi
fi
-if [ "$(basename "$0")" = "lb_binary_rootfs" ]; then
+if [ "$current_script" = "binary_rootfs" ]; then
echo "HOOK: debpool@binary-rootfs"
for dir in chroot/chroot/live chroot/live
do
diff --git a/auto/functions/livebuild-hacks b/auto/functions/livebuild-hacks
index 6dd0cdc..3fc2fac 100644
--- a/auto/functions/livebuild-hacks
+++ b/auto/functions/livebuild-hacks
@@ -1,17 +1,16 @@
#!/bin/sh
# Hacks to inject code into various live-build functions
+current_script="$(basename "$0"|sed 's/^lb_//')"
+
# ISO sorting
-if [ "$(basename "$0")" = "lb_binary_iso" ]; then
+if [ "$current_script" = "binary_iso" ]; then
echo "HOOK: livebuild-hacks@binary_iso"
- In_list ()
+ Genisoimage_options_hack ()
{
- . "${LB_BASE}"/functions/aliases.sh
- In_list "$@"
- RC=$?
if [ -f config/binary_iso/isoimage.sort ]
then
- GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -sort isoimage.sort"
+ echo " -sort isoimage.sort"
case "${LB_BUILD_WITH_CHROOT}" in
true)
@@ -23,17 +22,38 @@ if [ "$(basename "$0")" = "lb_binary_iso" ]; then
;;
esac
fi
+ Genisoimage_options_hack () { true; } # only once -> overload
+ }
+ In_list ()
+ {
+ . "${LB_BASE}"/functions/aliases.sh
+ In_list "$@"
+ RC=$?
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS}$(Genisoimage_options_hack)"
case "$LB_BOOTLOADER" in
grub2|burg)
LB_BINARY_IMAGES=iso
;;
esac
- return $rc
+ return $RC
+ }
+ Install_package ()
+ {
+ . "${LB_BASE}"/functions/packages.sh
+ Install_package "$@"
+ RC=$?
+ LB_ISO_APPLICATION="${LB_ISO_APPLICATION}\"$(Genisoimage_options_hack)\""
+ case "$LB_BOOTLOADER" in
+ grub2|burg)
+ LB_BINARY_IMAGES=iso
+ ;;
+ esac
+ return $RC
}
fi
# Grub2: Do not number the default kernel / initrd files.
-if [ "$(basename "$0")" = "lb_binary_grub2" ]; then
+if [ "$current_script" = "binary_grub2" ]; then
echo "HOOK: livebuild-hacks@binary_grub2"
Overload_Grub_live_entry ()
{