From 7af9953463c65fe2f02704e6bce815d830e58d7d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 14 Nov 2022 00:51:12 +0000 Subject: pragmatic system distribution guideline compliance osboot is now part of libreboot, and will soon shut down. libreboot now conforms to osboot policy. --- resources/scripts/download/coreboot | 60 +++++++------------------------------ 1 file changed, 10 insertions(+), 50 deletions(-) (limited to 'resources/scripts/download/coreboot') diff --git a/resources/scripts/download/coreboot b/resources/scripts/download/coreboot index 80fff097..c50b0d77 100755 --- a/resources/scripts/download/coreboot +++ b/resources/scripts/download/coreboot @@ -62,19 +62,6 @@ elif [ $# -eq 1 ] && [ "$1" == "--list-boards" ] ; then exit 0 fi -# set this when you want to modify each coreboot tree -# for example, you want to test custom patches -# NODELETE= ./download coreboot -deletegit="true" -deleteblobs="true" -if [ "x${NODELETE+set}" = 'xset' ]; then - [ "x${NODELETE:-all}" = "xgit" ] && deletegit="false" - [ "x${NODELETE:-all}" = "xall" ] && deleteblobs="false" && deletegit="false" -fi - -# Error handling is extreme in this script. -# This script handles the internet, and Git. Both are inherently unreliable. - [[ -f build_error ]] && rm -f build_error rm -f resources/coreboot/*/seen @@ -152,25 +139,25 @@ downloadfor() { if [ ! -d coreboot ]; then printf "Download coreboot from upstream:\n" - git clone --depth=1 https://review.coreboot.org/coreboot || rm -Rf coreboot + git clone https://review.coreboot.org/coreboot || rm -Rf coreboot if [ ! -d coreboot ]; then printf "WARNING: Upstream failed. Trying backup github repository:\n" - git clone --depth=1 https://github.com/coreboot/coreboot.git || rm -Rf coreboot + git clone https://github.com/coreboot/coreboot.git || rm -Rf coreboot fi if [ ! -d coreboot ]; then printf "ERROR: download/coreboot: Problem with git-clone. Network issue?\n" cd ../; return 1 fi - fi - - ( cd coreboot/; git fetch --depth=1 origin "${cbrevision}" || touch ../build_error ) - if [ -f ../build_error ]; then - printf "ERROR: download/coreboot: Problem with git-fetch. Network issue?\n" - cd ../; return 1 + else + ( cd coreboot/; git pull || touch ../build_error ) + if [ -f ../build_error ]; then + printf "ERROR: download/coreboot: Problem with git-pull. Network issue?\n" + cd ../; return 1 + fi fi cp -R coreboot "${cbtree}" || touch ../build_error - if [ -f ../build_error ]; then + if [ -d ../build_error ]; then printf "ERROR: download/coreboot: Unable to copy directory. Check file system permissions or free space.\n" rm -Rf "${cbtree}/" cd ../; return 1 @@ -184,7 +171,7 @@ downloadfor() { cd ../../; return 1 fi - git submodule update --init --depth=1 || touch ../../build_error + git submodule update --init --checkout || touch ../../build_error if [ -f ../../build_error ]; then printf "ERROR: download/coreboot: Unable to update submodules for tree '%s'\n" "${cbtree}" cd ../../; return 1 @@ -243,31 +230,4 @@ rm -f resources/coreboot/*/seen rm -f "build_error" printf "\n\n" -if [ "${deleteblobs}" = "true" ]; then - if [ "${deletegit}" = "true" ]; then - rm -Rf coreboot/coreboot/ - rm -Rf coreboot/.git* coreboot/*/.git* coreboot/*/3rdparty/*/.git* - rm -Rf coreboot/*/util/nvidia/cbootimage/.git* - fi - for cbdir in coreboot/*; do - if [ ! -d "${cbdir}" ]; then continue; fi - cbtree="${cbdir##coreboot/}" - cbtree="${cbtree%/}" - if [ ! -d "coreboot/${cbtree}" ]; then continue; fi - bloblist="resources/coreboot/${cbtree}/blobs.list" - if [ -f "${bloblist}" ]; then - for blobfile in $(cat "${bloblist}"); do - printf "Deleting blob: 'coreboot/%s/%s'\n" "${cbtree}" "${blobfile}" - rm -f "coreboot/${cbtree}/${blobfile}" - done - fi - rmlist="resources/coreboot/${cbtree}/rm.list" - if [ -f "${rmlist}" ]; then - for rmentry in $(cat "${rmlist}"); do - printf "Deleting directory to save space: 'coreboot/%s/%s'\n" "${cbtree}" "${rmentry}" - rm -Rf "coreboot/${cbtree}/${rmentry}" - done - fi - done -fi exit 0 -- cgit v1.2.1