diff --git a/.github/workflows/buildMe.yml b/.github/workflows/buildMe.yml index 1ea0194..e2ab0fc 100644 --- a/.github/workflows/buildMe.yml +++ b/.github/workflows/buildMe.yml @@ -77,6 +77,7 @@ jobs: run: | sudo git clone https://github.com/OpenHD/OpenHD-ImageBuilder sudo mv OpenHD-ImageBuilder/images . + sudo mv OpenHD-ImageBuilder/stages/01-Baseimage stages/ - name: configure run: sudo bash build.sh ${{ matrix.TARGET }} ${{ matrix.TESTING }} - name: debug diff --git a/stages/01-Baseimage/00-run.sh b/stages/01-Baseimage/00-run.sh deleted file mode 100644 index 5e6317e..0000000 --- a/stages/01-Baseimage/00-run.sh +++ /dev/null @@ -1,55 +0,0 @@ -# Download Base Image, extract, check checksum -pushd ${STAGE_WORK_DIR} - -log "Check any previous images" - -SHA=$(sha256sum ${BASE_IMAGE}) -echo "SHA: ${SHA}" - - -if [[ "${SHA}" != "${BASE_IMAGE_SHA256} ${BASE_IMAGE}" ]]; then - rm *.zip - rm *.img - rm *.xz - rm *.7z - -if [[ "${BASE_IMAGE}" != "true" ]]; then - log "Download base Image" - if wget -q --show-progress --progress=bar:force:noscroll $BASE_IMAGE_URL/$BASE_IMAGE; then - log "Base image download successful" - else - log "Base image download using wget failed, trying with curl" - if curl $BASE_IMAGE_URL/$BASE_IMAGE -o $BASE_IMAGE -s; then - log "Base image download successful" - else - log "Base image download using curl failed" - exit 1 - fi - fi -fi - -fi - - -log "Unarchive base image" - -if [[ ${BASE_IMAGE: -4} == ".zip" ]]; then - unzip ${BASE_IMAGE} - rm -Rf *.zip -elif [ ${BASE_IMAGE: -7} == ".img.xz" ]; then - xz -k -d ${BASE_IMAGE} -elif [ ${BASE_IMAGE: -4} == ".bz2" ]; then - bunzip2 -k -d ${BASE_IMAGE} -elif [ ${BASE_IMAGE: -3} == ".gz" ]; then - gunzip -k ${BASE_IMAGE} -elif [ ${BASE_IMAGE: -3} == ".7z" ]; then - 7z e ${BASE_IMAGE} - -fi - -mv *.[iI][mM][gG] IMAGE.img - -# return -popd - - diff --git a/stages/01-Baseimage/01-run.sh b/stages/01-Baseimage/01-run.sh deleted file mode 100644 index c0647fa..0000000 --- a/stages/01-Baseimage/01-run.sh +++ /dev/null @@ -1,84 +0,0 @@ -# Extend Image Size -if [ ! -e ../../emmc ]; then - if [[ "${OS}" == radxa-debian-rock5a ]] || [[ "${OS}" == radxa-debian-rock5b ]];then - WANTEDSIZE="6800000000" - elif [[ "${OS}" == ubuntu ]]; then - echo "__________________________AGX__________________________-" - WANTEDSIZE="18500000256" - else - WANTEDSIZE="5632000000" - fi -else -WANTEDSIZE="9500000256" -echo "_______________________________________________________________________" -echo "this is the emmc-model" -echo "_______________________________________________________________________" - -fi - -pushd ${STAGE_WORK_DIR} - - #Makes the images flashable with raspberry pi imager - log "We now define the size to be ~15GB (the maximum size we have in our github builder, this doesn't affect the output image because we're resizeing it in the end before uploading the image)" - FILESIZE=$(stat -c%s "IMAGE.img") - DIFFERENCE=$(expr $WANTEDSIZE - $FILESIZE) - DIFFERENCE=$(expr $DIFFERENCE - 1) - echo "partitions in image:" - sudo gdisk -l IMAGE.img - echo "IMAGE will be extended with" - echo $DIFFERENCE - echo "bytes" - ls -l - -if [[ "${OS}" != ubuntu-x86 ]] && [[ "${OS}" != debian-X20 ]]; then - - log "Create empty image" #this will be attached to the base image to increase the size of it - dd if=/dev/zero of=temp.img bs=1 count=1 seek=$DIFFERENCE - ls -l - - - log "Enlarge the downloaded image" - cat temp.img >> IMAGE.img - - if [[ "${OS}" == ubuntu ]] || [[ radxa-debian-rock5a ]] || [[ "${OS}" == radxa-debian-rock5b ]] || [[ "${OS}" == radxa-debian-rock-cm3 ]] || [[ "${OS}" == radxa-debian-rock-cm3-core3566 ]]; then - echo "resize with parted" - echo -e "x\ne\nd\nn\n\n\n\n\nw\ny\n" | sudo gdisk IMAGE.img - sudo parted -s IMAGE.img resizepart ${ROOT_PART} 100% - sudo gdisk -l IMAGE.img - partprobe - else - - log "fdisk magic to enlarge the main partition" - #calculating image offsets - #debug showing all offsets: - echo "Partition information for /dev/sda:" - sudo parted -m IMAGE.img unit s print | awk -F: '$1 ~ /^[0-9]+$/ {print "Partition " $1 ": " $2 " - " $3 " (offset: " $2 "s)"}' - - PARTED_OUT=$(parted -s IMAGE.img unit s print) - ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e "^ ${ROOT_PART}"| xargs echo -n \ - | cut -d" " -f 2 | tr -d s) - - echo "ROOT PART: ${ROOT_PART}" - echo "ROOT OFFSET: $ROOT_OFFSET" - echo "IF EDITING THIS SCRIPT THE SPACES MATER FOR FDISK COMMANDS" - #Now we delete the root Partition , write a new partition and write the calculated size to have a larger root-partition) - #DO NOT TOUCH OR REFORMAT .. this is quite annoying - - fdisk IMAGE.img <