diff options
Diffstat (limited to 'script')
-rwxr-xr-x | script/build/fw/serprog | 18 | ||||
-rwxr-xr-x | script/build/release/roms | 10 | ||||
-rwxr-xr-x | script/build/release/src | 2 | ||||
-rwxr-xr-x | script/handle/make/config | 1 | ||||
-rwxr-xr-x | script/handle/make/file | 9 | ||||
-rwxr-xr-x | script/update/blobs/download | 2 | ||||
-rwxr-xr-x | script/update/blobs/inject | 17 | ||||
-rwxr-xr-x | script/update/project/trees | 24 |
8 files changed, 27 insertions, 56 deletions
diff --git a/script/build/fw/serprog b/script/build/fw/serprog index cdbf07e1..222d7751 100755 --- a/script/build/fw/serprog +++ b/script/build/fw/serprog @@ -20,22 +20,21 @@ main() if [ "${1}" = "rp2040" ]; then platform="rp2040" boards_dir=${pico_sdk_dir}/src/boards/include/boards - [ -d "${pico_src_dir}/" ] || fetch_repo rpi-pico-serprog + [ -d "${pico_src_dir}/" ] || \ + x_ ./update project repo "rpi-pico-serprog" elif [ "${1}" = "stm32" ]; then platform="stm32" boards_dir=${stm32_src_dir}/boards - [ -d "${stm32_src_dir}/" ] || fetch_repo stm32-vserprog + [ -d "${stm32_src_dir}/" ] || \ + x_ ./update project repo "stm32-vserprog" else err "${usage}" fi x_ mkdir -p "bin/serprog_${platform}" if [ $# -gt 1 ] ; then - if [ "${2}" = "list" ] ; then - print_boards ${boards_dir} - else - build_${platform}_rom "${2}" - fi + [ "${2}" = "list" ] && print_boards ${boards_dir} && return 0 + build_${platform}_rom "${2}" else printf "Building all serprog targets\n" list_boards "${boards_dir}" | while read board; do @@ -44,11 +43,6 @@ main() fi } -fetch_repo() -{ - x_ ./update project repo "${1}" -} - build_rp2040_rom() { board=${1} diff --git a/script/build/release/roms b/script/build/release/roms index 50560f98..3cf5d93e 100755 --- a/script/build/release/roms +++ b/script/build/release/roms @@ -31,10 +31,8 @@ main() init_check() { - [ -f version ] && \ - read version < version - [ -f versiondate ] && \ - read versiondate < versiondate + [ -f version ] && read version < version + [ -f versiondate ] && read versiondate < versiondate [ ! -d "bin/" ] && \ err "init_check: no ROMs built yet (error)" [ -d "release/" ] || \ @@ -106,9 +104,9 @@ make_archive() strip_archive() { romdir=${1} - [ -d "coreboot/${tree}" ] || \ x_ ./update project trees coreboot ${tree} + x_ ./build coreboot utils ${tree} if [ "${microcode_required}" = "n" ]; then @@ -125,12 +123,10 @@ strip_archive() # Hash the rom before removing blobs x_ rm -f "${romdir}/blobhashes" x_ touch "${romdir}/blobhashes" - ( x_ cd "${romdir}" x_ sha512sum *.rom >> blobhashes ) - for romfile in "${romdir}"/*.rom; do [ -f "${romfile}" ] || continue strip_rom_image "${romfile}" diff --git a/script/build/release/src b/script/build/release/src index 71b8e111..6dae201c 100755 --- a/script/build/release/src +++ b/script/build/release/src @@ -109,7 +109,7 @@ purge_files() done x_ ./handle make file -c bios_extract flashrom grub uefitool \ util-fw/stm32-vserprog util-fw/stm32-vserprog/libopencm3 \ - memtest86plus/build* util/* \ + memtest86plus/build* util/* x_ rm -Rf .git* */.git* */*/.git* */*/*/.git* */*/*/*/.git* \ */*/*/*/*/.git* */*/*/*/*/*/.git* */*/*/*/*/*/*/.git* diff --git a/script/handle/make/config b/script/handle/make/config index 31c1b3c2..cd13aca6 100755 --- a/script/handle/make/config +++ b/script/handle/make/config @@ -227,7 +227,6 @@ run_make_command() copy_elf() { [ "${project}" != "coreboot" ] || xx_ modify_coreboot_rom - while read f; do [ ! -f "${codedir}/$f" ] || \ xx_ cp "${codedir}/${f}" "${dest_dir}/" diff --git a/script/handle/make/file b/script/handle/make/file index 445016ea..c0a6afb4 100755 --- a/script/handle/make/file +++ b/script/handle/make/file @@ -46,12 +46,9 @@ run_make_command() { [ -f "${project}/Makefile" ] || [ -f "${project}/makefile" ] || \ [ -f "${project}/GNUmakefile" ] || return 0 - if [ -z "${mode}" ]; then - x_ make -C "${project}" -j$(nproc) - else - x_ make -C "${project}" clean - make -C "${project}" distclean 2>/dev/null || : - fi + [ -z "${mode}" ] && x_ make -C "${project}" -j$(nproc) && return 0 + x_ make -C "${project}" clean + make -C "${project}" distclean 2>/dev/null || : } main $@ diff --git a/script/update/blobs/download b/script/update/blobs/download index f1cab1b8..fef6b2c6 100755 --- a/script/update/blobs/download +++ b/script/update/blobs/download @@ -147,7 +147,7 @@ extract_e6400vga() [ -f "${E6400_VGA_romname}" ] || \ err "extract_e6400vga: can't extract vga rom from bios.bin" ) - x_ cp "${appdir}"/"${E6400_VGA_romname}" "${_dest}" + x_ cp "${appdir}/${E6400_VGA_romname}" "${_dest}" } extract_sch5545ec() diff --git a/script/update/blobs/inject b/script/update/blobs/inject index 99eb9d5b..96ee0002 100755 --- a/script/update/blobs/inject +++ b/script/update/blobs/inject @@ -96,13 +96,10 @@ build_dependencies() inject_blobs() { release_archive="n" - if [ "${release}" = "true" ]; then - printf "patching release file\n" - release_archive="y" - patch_release_roms - else - x_ patch_rom "${rom}" - fi + [ "${release}" != "true" ] && x_ patch_rom "${rom}" && return 0 + printf "patching release file\n" + release_archive="y" + patch_release_roms } patch_release_roms() @@ -240,11 +237,9 @@ inject_blob_hp_kbc1126_ec() if [ "${_ec1_offset}" = "" ] || [ "${_ec1_offset}" = "" ]; then err "inject_blob_hp_kbc1126_ec: ${board}: offset not declared" - fi - if [ "${_ec1_location}" = "" ] || [ "${_ec2_location}" = "" ]; then + elif [ "${_ec1_location}" = "" ] || [ "${_ec2_location}" = "" ]; then err "inject_blob_hp_kbc1126_ec: ${board}: EC path not declared" - fi - if [ ! -f "${_ec1_location}" ] || [ ! -f "${_ec2_location}" ]; then + elif [ ! -f "${_ec1_location}" ] || [ ! -f "${_ec2_location}" ]; then err "inject_blob_hp_kbc1126_ec: ${board}: ecfw not downloaded" fi diff --git a/script/update/project/trees b/script/update/project/trees index 093d5086..b61aab22 100755 --- a/script/update/project/trees +++ b/script/update/project/trees @@ -18,10 +18,9 @@ main() printf "Downloading %s and applying patches\n" ${project} [ -z "${1}" ] && err "project name not specified" - project="${1}" + project="${1}" && shift 1 cfgsdir="config/${project}" [ -d "${cfgsdir}" ] || err "unsupported project name" - shift 1 targets=$(listitems "${cfgsdir}") [ $# -gt 0 ] && targets=$@ @@ -39,21 +38,16 @@ download_for_target() tree="undefined" rev="undefined" - fetch_config "${_target}" + fetch_config + [ -d "${project}/${tree}" ] && printf "download/%s %s (%s): exists\n" \ + "${project}" "${tree}" "${_target}" 1>&2 && return 0 - if [ -d "${project}/${tree}" ]; then - printf "REMARK: download/%s %s (%s): exists. Skipping.\n" \ - "${project}" "${tree}" "${_target}" 1>&2 - else - fetch_from_upstream - prepare_new_tree - fi + fetch_from_upstream + prepare_new_tree } fetch_config() { - _target=${1} - while true; do eval "$(setvars "" rev tree)" _xm="fetch_config ${project}/${_target}" @@ -64,10 +58,7 @@ fetch_config() . "${cfgsdir}/${_target}/target.cfg" || \ err "fetch_config: no \"${cfgsdir}/${_target}/target.cfg\"" - if [ "${_target}" != "${tree}" ]; then - _target="${tree}" - continue - fi + [ "${_target}" != "${tree}" ] && _target="${tree}" && continue [ -z ${tree} ] && err "${_xm}: tree undefined" [ -z ${rev} ] && err "${_xm}: revision undefined" break @@ -78,7 +69,6 @@ check_config_for_target() { [ -f "${cfgsdir}/${1}/target.cfg" ] || \ err "${_xm} check: target.cfg does not exist" - [ -f "${cfgsdir}/${1}/seen" ] && \ err "${_xm} check: infinite loop in tree definitions" |