summaryrefslogtreecommitdiff
path: root/buildlive
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2021-03-31 13:19:32 +0800
committerIru Cai <mytbk920423@gmail.com>2021-03-31 13:19:32 +0800
commit1e643b9aa7851b22994f28925e4775173198e5a0 (patch)
tree362b9d1535276149f81d8e99519af3bfa501df50 /buildlive
parent6622de751b60f0474d1a69be9b5592e82c1ba556 (diff)
parenta5092b29f5e60e6ee9a4bd537747d53bfd6c491c (diff)
downloadliveusb-builder-1e643b9aa7851b22994f28925e4775173198e5a0.tar.xz
Merge branch 'metaiso'
Diffstat (limited to 'buildlive')
-rwxr-xr-xbuildlive51
1 files changed, 44 insertions, 7 deletions
diff --git a/buildlive b/buildlive
index ad607cb..120c14d 100755
--- a/buildlive
+++ b/buildlive
@@ -31,7 +31,7 @@ fatalerror() {
usage() {
>&2 cat << EOF
-$0 [--root <path>] [options] [distro 1] [distro 2] ...
+$0 [--root <path>] [options] [--distro=<metadist> <isofile>] [distro] ...
use $0 -L to list available distros
options:
--root <path>
@@ -103,6 +103,20 @@ do
--clean)
CLEAN_USB=1
;;
+ --distro=*)
+ metadist="${1/--distro=}"
+ if [ ! -f "distro/$metadist/meta" ]
+ then
+ fatalerror "distro/$metadist/meta not found"
+ fi
+ shift
+ isofn="$1"
+ if [ ! -f "$isofn" ]
+ then
+ fatalerror "File $isofn not found"
+ fi
+ DISTROLIST=(${DISTROLIST[@]} "/meta@$metadist@$isofn")
+ ;;
*=*|-*)
usage
exit 1
@@ -174,6 +188,17 @@ fi
for i in ${DISTROLIST[@]}
do
+ if [[ "$i" == /meta@* ]]
+ then
+ # FIXME: we assume the meta file path and the iso file name
+ # does not have '@' character
+ ISOFILE="$(echo "$i" | cut -d@ -f3)"
+ ISOLIST=("${ISOLIST[@]}" "$ISOFILE")
+ # TODO: we just use the file name as the ISO name
+ # can we do it better?
+ ISONAMELIST=("${ISONAMELIST[@]}" "$(basename "$ISOFILE")")
+ continue
+ fi
process_isoinfo "$i"
ISOLIST=("${ISOLIST[@]}" "$ISOFILE")
ISONAMELIST=("${ISONAMELIST[@]}" "$ISONAME")
@@ -199,16 +224,28 @@ do
DISTRO="${DISTROLIST[$i-1]}"
ISO_FILEPATH="$ISOPATH/$ISOFILE"
- set_distro "$DISTRO"
- export DISTRONAME KEYWORD # for grub and syslinux generation
-
- process_distro "$DISTRO"
+ if [[ "$DISTRO" == /meta@* ]]
+ then
+ metadir="$(echo "$DISTRO" | cut -d@ -f2)"
+ _meta=meta_
+ ISO_FILEPATH="$ISOFILE"
+ DISTRO="$metadir"
+ set_distro "$metadir"
+ KEYWORD="$ISONAME"
+ source "distro/$metadir/meta"
+ else
+ _meta=
+ ISO_FILEPATH="$ISOPATH/$ISOFILE"
+ set_distro "$DISTRO"
+ export DISTRONAME KEYWORD # for grub and syslinux generation
+ process_distro "$DISTRO"
+ fi
if [ "$GRUBCFG_ONLY" == 0 ]; then
install_live
fi
- gen_grubcfg "$DISTRO" >> "$GRUBCFG"
- gen_syslinux "$DISTRO" >> "$SYSLINUXCFG"
+ ${_meta}gen_grubcfg "$DISTRO" >> "$GRUBCFG"
+ ${_meta}gen_syslinux "$DISTRO" >> "$SYSLINUXCFG"
done
if [ "$GRUBCFG_ONLY" == 1 ]; then