mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 13:16:47 +02:00
move build/command/options to include/option.sh
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
set -u -e
|
||||
|
||||
. "include/err.sh"
|
||||
. "include/option.sh"
|
||||
|
||||
read projectname < projectname
|
||||
opts=""
|
||||
@@ -23,7 +24,7 @@ main()
|
||||
firstoption="${1}"
|
||||
[ "${firstoption}" = "help" ] && usage && exit 0
|
||||
[ "${firstoption}" = "list" ] && \
|
||||
./build command options config/coreboot && exit 0
|
||||
listitems config/coreboot && exit 0
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case ${1} in
|
||||
@@ -46,7 +47,7 @@ main()
|
||||
printf "Building %s ROM images\n" "${projectname}"
|
||||
|
||||
if [ "${firstoption}" = "all" ]; then
|
||||
for target in $(./build command options config/coreboot); do
|
||||
for target in $(listitems config/coreboot); do
|
||||
buildrom "${target}" || err "build/roms (1): error"
|
||||
[ -d "bin/${target}" ] && targets="${target} ${targets}"
|
||||
done
|
||||
@@ -81,7 +82,7 @@ usage()
|
||||
./build boot roms x60 -p grub -d corebootfb -k usqwerty
|
||||
|
||||
possible values for 'target':
|
||||
$(./build command options "config/coreboot")
|
||||
$(listitems "config/coreboot")
|
||||
|
||||
Refer to the ${projectname} documentation for more information.
|
||||
EOF
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
|
||||
|
||||
. "include/err.sh"
|
||||
|
||||
items=1
|
||||
|
||||
main()
|
||||
{
|
||||
[ $# -gt 0 ] || \
|
||||
err "No argument given"
|
||||
listitems "${1}" || err "No items present under: ${1}"
|
||||
}
|
||||
|
||||
listitems()
|
||||
{
|
||||
[ -d "${1}" ] || \
|
||||
err "Directory not does exist: ${1}"
|
||||
for x in "${1}/"*; do
|
||||
# -e used because this is for files *or* directories
|
||||
[ -e "${x}" ] || continue
|
||||
[ "${x##*/}" = "build.list" ] && continue
|
||||
printf "%s\n" "${x##*/}" 2>/dev/null
|
||||
items=0
|
||||
done
|
||||
return ${items}
|
||||
}
|
||||
|
||||
main $@
|
||||
Reference in New Issue
Block a user