diff options
author | Andreas Loibl <andreas@andreas-loibl.de> | 2012-03-01 14:30:15 +0100 |
---|---|---|
committer | Andreas Loibl <andreas@andreas-loibl.de> | 2012-03-01 14:30:15 +0100 |
commit | f40a33d0da0c3a3e58f27c02b0959b1d43bb25d1 (patch) | |
tree | 82473aecb978eb94b04c10605a2a2e3c3ca0940c /auto/functions | |
parent | 344dc1493807c22fb3bda6a059facf5c328d8b79 (diff) | |
download | kanotix-f40a33d0da0c3a3e58f27c02b0959b1d43bb25d1.zip kanotix-f40a33d0da0c3a3e58f27c02b0959b1d43bb25d1.tar.gz |
included live-build patches into local tree to make it build with unpatched live-build
Diffstat (limited to 'auto/functions')
-rw-r--r-- | auto/functions/compat | 6 | ||||
-rw-r--r-- | auto/functions/livebuild-hacks | 76 |
2 files changed, 79 insertions, 3 deletions
diff --git a/auto/functions/compat b/auto/functions/compat index 061562b..a524c28 100644 --- a/auto/functions/compat +++ b/auto/functions/compat @@ -22,13 +22,13 @@ Compat_arguments () Compat_config () { -[ -e config/chroot ] && cat <<eof >> config/chroot +[ -e config/chroot ] && [ "$LB_ARCHIVES" ] && cat <<eof >> config/chroot # Compat (Live-build 2 -> 3) LB_REPOSITORIES="$LB_ARCHIVES" LB_PACKAGES_LISTS="$LB_PACKAGE_LISTS" eof -[ -e config/bootstrap ] && cat <<eof >> config/bootstrap +[ -e config/bootstrap ] && [ "$LB_ARCHITECTURES" ] && cat <<eof >> config/bootstrap # Compat (Live-build 2 -> 3) LB_ARCHITECTURE="$LB_ARCHITECTURES" @@ -116,7 +116,7 @@ case "$LB_VERSION" in Compat_dir chroot_local-hooks hooks - .chroot ;; lb_binary_hooks) - Compat_dir chroot_binary-hooks hooks - .binary + Compat_dir binary_local-hooks hooks - .binary ;; lb_build|lb_clean) trap Compat_clean EXIT diff --git a/auto/functions/livebuild-hacks b/auto/functions/livebuild-hacks new file mode 100644 index 0000000..7df44df --- /dev/null +++ b/auto/functions/livebuild-hacks @@ -0,0 +1,76 @@ +#!/bin/sh +# Hacks to inject code into various live-build functions + +# ISO sorting +if [ "$(basename "$0")" = "lb_binary_iso" ]; then + echo "HOOK: livebuild-hacks@binary_iso" + In_list () + { + . "${LB_BASE}"/functions/aliases.sh + In_list "$@" + RC=$? + if [ -f config/binary_iso/isoimage.sort ] + then + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -sort isoimage.sort" + + case "${LB_BUILD_WITH_CHROOT}" in + true) + cp config/binary_iso/isoimage.sort chroot + ;; + + false) + cp config/binary_iso/isoimage.sort . + ;; + esac + fi + 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 + echo "HOOK: livebuild-hacks@binary_grub2" + Grub_live_entry () + { + LABEL="${1}" + KERNEL="${2}" + INITRD="${3}" + APPEND="${4}" + + case "${LB_BINARY_IMAGES}" in + iso*|usb*) + if [ "${LABEL}" = "live" ] + then + # Do not number the default kernel / initrd files. + _NUMBER="" + else + # Use order of flavours in LB_LINUX_FLAVOURS for numbering. + _NUMBER="$(echo ${LB_LINUX_FLAVOURS} | awk -v FLAVOUR="${FLAVOUR}" 'BEGIN{RS=" "} {if($1 == FLAVOUR) print NR}')" + fi + + if [ -e binary/${KERNEL} ] + then + mv binary/${KERNEL} "binary/$(dirname ${KERNEL})/vmlinuz${_NUMBER}" | : + KERNEL="$(dirname ${KERNEL})/vmlinuz${_NUMBER}" + fi + + if [ -e binary/${INITRD} ] + then + mv binary/${INITRD} "binary/$(dirname ${INITRD})/initrd${_NUMBER}.img" | : + INITRD="$(dirname ${INITRD})/initrd${_NUMBER}.img" + fi + ;; + esac + + LINUX_LIVE="${LINUX_LIVE}\nmenuentry \"Debian GNU/Linux - ${LABEL}\" {" + LINUX_LIVE="${LINUX_LIVE}\nlinux\t\t/${KERNEL} boot=${INITFS} config LB_BOOTAPPEND_LIVE ${APPEND}" + LINUX_LIVE="${LINUX_LIVE}\ninitrd\t\t/${INITRD}" + LINUX_LIVE="${LINUX_LIVE}\n}" + } +fi + |