From c69ac198ed948498c2528e6011f236eab0bcbddd Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 02:28:07 +0100 Subject: [PATCH 01/19] Cleaned up Compile Scripts & Pipeline Commiting to test. --- .gitlab-ci.yml | 77 ++++++++++++-------- Dockerfile | 4 +- compile.sh | 82 ++++----------------- compile_and_run.sh | 7 -- compile_and_run_debug.sh | 7 -- checksum.sh => compile_checksum.sh | 0 compile_debug.sh | 2 - compile_finish.sh | 18 +++++ compile_isogen.sh | 8 ++ compile_link.sh | 17 +++++ compile_sources.sh | 7 ++ compile_stub.sh | 8 ++ compile_sumgen.sh | 8 ++ versioning.sh => compile_vergen.sh | 28 ++++--- install_dev_env.sh | 113 ----------------------------- mount.sh | 53 -------------- run.sh | 38 ---------- run_bochs.sh | 2 - unmount.sh | 11 --- updatevm.sh | 6 -- vb_compile_run.sh | 7 -- vbox.sh | 3 - 22 files changed, 145 insertions(+), 361 deletions(-) delete mode 100755 compile_and_run.sh delete mode 100644 compile_and_run_debug.sh rename checksum.sh => compile_checksum.sh (100%) mode change 100755 => 100644 delete mode 100644 compile_debug.sh create mode 100644 compile_finish.sh create mode 100644 compile_isogen.sh create mode 100644 compile_link.sh create mode 100644 compile_sources.sh create mode 100644 compile_stub.sh create mode 100644 compile_sumgen.sh rename versioning.sh => compile_vergen.sh (81%) mode change 100755 => 100644 delete mode 100755 install_dev_env.sh delete mode 100755 mount.sh delete mode 100755 run.sh delete mode 100755 run_bochs.sh delete mode 100755 unmount.sh delete mode 100755 updatevm.sh delete mode 100755 vb_compile_run.sh delete mode 100755 vbox.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f68577be..6ed2ef25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,39 +1,52 @@ -# This file is a template, and might need editing before it works on your project. -# see https://docs.gitlab.com/ee/ci/yaml/README.html for all available options - -.before_script: - - echo "Before script section" - - echo "For example you might run an update here or install a build dependency" - - echo "Or perhaps you might print out some debugging details" - .after_script: - - echo "After script section" - - echo "For example you might do some cleanup here" - -build: - stage: build - tags: - - asuro - script: ./compile.sh + script: ./compile_finish.sh "$CI_JOB_STATUS" + rules: + - if: '$CI_JOB_STATUS == "failed"' + - when: never artifacts: paths: - - release/Asuro.iso - - iso/boot/asuro.bin - release/*.svg -.test1: - stage: test - script: - - echo "Do a test here" - - echo "For example run a test suite" +stages: + - compile_stub + - vergen + - compile_sources + - link + - isogen + - finish -.test2: - stage: test - script: - - echo "Do another parallel test here" - - echo "For example run a lint test" +compile_stub: + stage: compile_stub + script: ./compile_stub.sh + +vergen: + stage: vergen + script: ./compile_vergen.sh + artifacts: + paths: + - release/*.svg -.deploy1: - stage: deploy - script: - - echo "Do your deploy here" +compile_sources: + stage: compile_sources + script: ./compile_sources.sh + +link: + stage: link + script: ./compile_link.sh + artifacts: + paths: + - bin/kernel.bin + +isogen: + stage: isogen + script: ./compile_isogen.sh + artifacts: + paths: + - ./Asuro.iso + +finish: + stage: finish + script: ./compile_finish.sh "$CI_JOB_STATUS" + artifacts: + paths: + - release/*.svg \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c9c8befb..6b345c26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ FROM ubuntu:latest VOLUME ["/code"] -RUN dpkg --add-architecture i386 && \ - apt-get update +RUN dpkg --add-architecture i386 +RUN apt-get update RUN apt-get install nasm curl make:i386 binutils:i386 xorriso grub-pc-bin dos2unix -y RUN apt-get clean RUN curl https://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.i386-linux.tar/download --output fpc.tar -L && \ diff --git a/compile.sh b/compile.sh index 26bb5686..20a282a2 100755 --- a/compile.sh +++ b/compile.sh @@ -2,18 +2,12 @@ ERRCOUNT=0 echo " " echo "=======================" -echo "== ASURO COMPILATION ==" -echo "=======================" echo " " -echo "Checking out latest VM Source..." +echo "Asuro Compilation" echo " " -./updatevm.sh -echo " " -echo "Compiling ASM Stub..." -echo " " -rm lib/* -nasm -f elf src/stub/stub.asm -o lib/stub.o +#Compile Stub.asm +./compile_stub.sh if [ $? -ne 0 ] then echo "Failed to compile stub!" @@ -22,47 +16,23 @@ else echo "Success." fi -echo " " -echo "=======================" -echo " " - -./versioning.sh - -if [ "$1" = "-d" ] -then - echo "Compiling Debug FPC Sources..." - echo " " - fpc -Aelf -gw -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* src/kernel.pas -else - echo "Compiling FPC Sources..." - echo " " - fpc -Aelf -gw -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* src/kernel.pas -fi +#Generate .pas with versioning headers. +./compile_vergen.sh +#Compile all .pas sources +./compile_sources.sh if [ $? -ne 0 ] then + echo " " echo "Failed to compile FPC Sources!" ERRCOUNT=$((ERRCOUNT+1)) else + echo " " echo "Success." fi -echo " " -echo "=======================" -echo " " -echo "Linking..." -echo " " -objstring=""; -for object in `find lib/ -name "*.o"`; do - if [ "$object" != "lib/stub.o" ] - then - objstring=$objstring$object" "; - fi -done; -objstring=lib/stub.o" "$objstring -echo "Object Files: "$objstring -echo " " -ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin $objstring +#Link into a binary. +./compile_link.sh if [ $? -ne 0 ] then echo "Failed linking!" @@ -71,13 +41,8 @@ else echo "Success." fi -echo " " -echo "=======================" -echo " " -echo "Creating ISO..." -echo " " -cp bin/kernel.bin iso/boot/asuro.bin -grub-mkrescue -o Asuro.iso iso +#Generate an ISO with GRUB as the Bootloader. +./compile_isogen.sh if [ $? -ne 0 ] then echo "Failed to create ISO!" @@ -86,27 +51,12 @@ else echo "Success." fi -echo " " -echo "=======================" -echo " " +#Call generate final artifacts based on failure or success of the above. if [ "$ERRCOUNT" -ne "0" ] then - echo "$ERRCOUNT Errors Occurred, please review." - wget -q https://img.shields.io/badge/build-failed-red.svg -O release/build.svg + ./compile_finish.sh "failed" else - echo "No errors." - wget -q https://img.shields.io/badge/build-succeeded-green.svg -O release/build.svg + ./compile_finish.sh "success" fi -echo " " -echo "=======================" -echo " " -#cp Asuro.iso ~/host/Asuro.iso -cp Asuro.iso release/Asuro.iso - -checksum=$(md5sum release/Asuro.iso | awk '{print $1}') -wget -q https://img.shields.io/badge/checksum-$checksum-important.svg -O release/checksum.svg -cd release -touch * -#svn commit -m "Versioning Auto-Commit" cd .. diff --git a/compile_and_run.sh b/compile_and_run.sh deleted file mode 100755 index 05bc209f..00000000 --- a/compile_and_run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -ERRCOUNT=0 -echo "=======================" -echo "== ASURO ==" -echo "=======================" -./compile.sh -./run.sh diff --git a/compile_and_run_debug.sh b/compile_and_run_debug.sh deleted file mode 100644 index bd6484e9..00000000 --- a/compile_and_run_debug.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -ERRCOUNT=0 -echo "=======================" -echo "== ASURO ==" -echo "=======================" -./compile.sh -d -./run.sh -d diff --git a/checksum.sh b/compile_checksum.sh old mode 100755 new mode 100644 similarity index 100% rename from checksum.sh rename to compile_checksum.sh diff --git a/compile_debug.sh b/compile_debug.sh deleted file mode 100644 index 50efa9bc..00000000 --- a/compile_debug.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -./compile.sh -d diff --git a/compile_finish.sh b/compile_finish.sh new file mode 100644 index 00000000..222a9027 --- /dev/null +++ b/compile_finish.sh @@ -0,0 +1,18 @@ +#/bin/sh +echo " " +echo "=======================" +echo " " +if [ "$1" != "success" ] +then + echo "Errors Occurred, please review." + wget -q https://img.shields.io/badge/build-failed-red.svg -O release/build.svg 2>/dev/null + echo " " + echo "=======================" + exit 1 +else + echo "No errors." + wget -q https://img.shields.io/badge/build-succeeded-green.svg -O release/build.svg 2>/dev/null + echo " " + echo "=======================" + exit 0 +fi \ No newline at end of file diff --git a/compile_isogen.sh b/compile_isogen.sh new file mode 100644 index 00000000..efec801d --- /dev/null +++ b/compile_isogen.sh @@ -0,0 +1,8 @@ +#!/bin/sh +echo " " +echo "=======================" +echo " " +echo "Creating ISO..." +echo " " +cp bin/kernel.bin iso/boot/asuro.bin +grub-mkrescue -o Asuro.iso iso \ No newline at end of file diff --git a/compile_link.sh b/compile_link.sh new file mode 100644 index 00000000..f8611920 --- /dev/null +++ b/compile_link.sh @@ -0,0 +1,17 @@ +#!/bin/sh +echo " " +echo "=======================" +echo " " +echo "Linking..." +echo " " +objstring=""; +for object in `find lib/ -name "*.o"`; do + if [ "$object" != "lib/stub.o" ] + then + objstring=$objstring$object" "; + fi +done; +objstring=lib/stub.o" "$objstring +echo "Object Files: "$objstring +echo " " +ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin $objstring \ No newline at end of file diff --git a/compile_sources.sh b/compile_sources.sh new file mode 100644 index 00000000..aedefff5 --- /dev/null +++ b/compile_sources.sh @@ -0,0 +1,7 @@ +#!/bin/sh +echo " " +echo "=======================" +echo " " +echo "Compiling FPC Sources..." +echo " " +fpc -Aelf -gw -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* src/kernel.pas \ No newline at end of file diff --git a/compile_stub.sh b/compile_stub.sh new file mode 100644 index 00000000..3f834379 --- /dev/null +++ b/compile_stub.sh @@ -0,0 +1,8 @@ +#!/bin/sh +echo " " +echo "=======================" +echo " " +echo "Compiling Stub..." +echo " " +rm lib/* +nasm -f elf src/stub/stub.asm -o lib/stub.o \ No newline at end of file diff --git a/compile_sumgen.sh b/compile_sumgen.sh new file mode 100644 index 00000000..f0f961d1 --- /dev/null +++ b/compile_sumgen.sh @@ -0,0 +1,8 @@ +#/bin/sh +echo " " +echo "=======================" +echo " " +echo "Generating Checksum Badge..." +echo " " +checksum=$(md5sum Asuro.iso | awk '{print $1}') +wget -q https://img.shields.io/badge/checksum-$checksum-important.svg -O release/checksum.svg 2>/dev/null \ No newline at end of file diff --git a/versioning.sh b/compile_vergen.sh old mode 100755 new mode 100644 similarity index 81% rename from versioning.sh rename to compile_vergen.sh index d1380369..a6505cad --- a/versioning.sh +++ b/compile_vergen.sh @@ -1,6 +1,10 @@ #!/bin/bash +echo " " +echo "=======================" +echo " " echo "Generating Versioning Info..." -./checksum.sh +echo " " +./compile_checksum.sh outfile="src/include/asuro.pas" file="version" while IFS=: read -r line;do @@ -44,15 +48,15 @@ echo "implementation" >> $outfile echo " " >> $outfile echo "end." >> $outfile echo "Generating release info..." -wget -q https://img.shields.io/badge/version-$major.$minor.$sub--$revision$release-blue.svg -O release/version.svg -wget -q https://img.shields.io/badge/revision-$revision-blue.svg -O release/revision.svg -wget -q https://img.shields.io/badge/release-$release-blue.svg -O release/release.svg -wget -q https://img.shields.io/badge/lines-$linecount-blueviolet.svg -O release/lines.svg -wget -q https://img.shields.io/badge/files-$sourcecount-blueviolet.svg -O release/files.svg -wget -q https://img.shields.io/badge/drivers-$drivercount-blueviolet.svg -O release/drivers.svg -wget -q https://img.shields.io/badge/FPC_version-$fpcversion-lightgrey.svg -O release/fpcversion.svg -wget -q https://img.shields.io/badge/NASM_version-$nasmversion-lightgrey.svg -O release/nasmversion.svg -wget -q https://img.shields.io/badge/MAKE_version-$makeversion-lightgrey.svg -O release/makeversion.svg -wget -q https://img.shields.io/badge/release_date-$compiledate-lightgrey.svg -O release/date.svg -wget -q https://img.shields.io/badge/fingerprint-$checksum-important.svg -O release/fingerprint.svg +wget -q https://img.shields.io/badge/version-$major.$minor.$sub--$revision$release-blue.svg -O release/version.svg 2>/dev/null +wget -q https://img.shields.io/badge/revision-$revision-blue.svg -O release/revision.svg 2>/dev/null +wget -q https://img.shields.io/badge/release-$release-blue.svg -O release/release.svg 2>/dev/null +wget -q https://img.shields.io/badge/lines-$linecount-blueviolet.svg -O release/lines.svg 2>/dev/null +wget -q https://img.shields.io/badge/files-$sourcecount-blueviolet.svg -O release/files.svg 2>/dev/null +wget -q https://img.shields.io/badge/drivers-$drivercount-blueviolet.svg -O release/drivers.svg 2>/dev/null +wget -q https://img.shields.io/badge/FPC_version-$fpcversion-lightgrey.svg -O release/fpcversion.svg 2>/dev/null +wget -q https://img.shields.io/badge/NASM_version-$nasmversion-lightgrey.svg -O release/nasmversion.svg 2>/dev/null +wget -q https://img.shields.io/badge/MAKE_version-$makeversion-lightgrey.svg -O release/makeversion.svg 2>/dev/null +wget -q https://img.shields.io/badge/release_date-$compiledate-lightgrey.svg -O release/date.svg 2>/dev/null +wget -q https://img.shields.io/badge/fingerprint-$checksum-important.svg -O release/fingerprint.svg 2>/dev/null echo "Done versioning." diff --git a/install_dev_env.sh b/install_dev_env.sh deleted file mode 100755 index 05b1de39..00000000 --- a/install_dev_env.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -ERRCOUNT=0 -echo " " -echo "===================================" -echo "== ASURO DEV ENVIRONMENT INSTALL ==" -echo "===================================" - -echo " " -echo "Installing Build Essentials..." -sudo apt-get install build-essential:i386 -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "Installing NASM..." -sudo apt-get install nasm -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "Installing Bin-Utils..." -sudo apt-get install binutils:i386 -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "Installing FPC Sources..." -sudo apt-get install fpc-src:i386 -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "Installing FPC..." -sudo apt-get install fpc:i386 -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "Installing QEmu..." -sudo apt-get install qemu -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "Installing xorriso..." -sudo apt-get install xorriso -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "Installing GRUB PC Bin..." -sudo apt-get install grub-pc-bin -if [ $? -ne 0 ] -then - echo "Failed to install!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Success." -fi - -echo " " -echo "WARNING: We assume you already have Grub installed." -echo " Asuro depends on grub-mkrescue." - -echo " " -echo "=======================" -echo " " -if [ "$ERRCOUNT" -ne "0" ] -then - echo "$ERRCOUNT Errors Occurred, please review." -else - echo "No errors." -fi -echo " " -echo "=======================" -echo " " - - diff --git a/mount.sh b/mount.sh deleted file mode 100755 index 1f527841..00000000 --- a/mount.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -ERRCOUNT=0 -echo " " -echo "=======================" -echo "== ASURO MOUNT ==" -echo "=======================" -echo " " -echo "Mounting Asuro..." -sudo modprobe nbd -if [ $? -ne 0 ] -then - echo "Failed load nbd!" - ERRCOUNT=$((ERRCOUNT+1)) -fi - -sudo qemu-nbd --connect=/dev/nbd0 IMAGE.img -if [ $? -ne 0 ] -then - echo "Failed to mount Image!" - ERRCOUNT=$((ERRCOUNT+1)) -fi - -sudo partx -a /dev/nbd0 -if [ $? -ne 0 ] -then - echo "Failed to find Partitions!" - ERRCOUNT=$((ERRCOUNT+1)) -fi - -sudo mount /dev/nbd0p1 /mnt/asuro -if [ $? -ne 0 ] -then - echo "Failed to mount Asuro!" - ERRCOUNT=$((ERRCOUNT+1)) -fi - -echo " " -echo "=======================" -echo " " -if [ "$ERRCOUNT" -ne "0" ] -then - ./unmount.sh - echo " " - echo "=======================" - echo " " - echo "$ERRCOUNT Errors Occurred, please review." -else - echo "No errors." -fi - -echo " " -echo "=======================" -echo " " diff --git a/run.sh b/run.sh deleted file mode 100755 index 1ba1e657..00000000 --- a/run.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -ERRCOUNT=0 -echo " " -echo "=======================" -echo "== ASURO OPERATION ==" -echo "=======================" -echo " " -echo "Running Asaro..." -if [ "$1" = "-d" ] -then - qemu-system-i386 -hda IMAGE.img -serial pty -s -S -cdrom Asuro.iso& - sleep 1 - gdb -ex "target remote localhost:1234" -else - qemu-system-i386 -hda IMAGE.img -serial pty -monitor stdio -cdrom Asuro.iso -fi - -if [ $? -ne 0 ] -then - echo "Failed to run Asaro!" - ERRCOUNT=$((ERRCOUNT+1)) -else - echo "Finished Successfully." -fi - -echo " " -echo "=======================" -echo " " -if [ "$ERRCOUNT" -ne "0" ] -then - echo "$ERRCOUNT Errors Occurred, please review." -else - echo "No errors." -fi - -echo " " -echo "=======================" -echo " " diff --git a/run_bochs.sh b/run_bochs.sh deleted file mode 100755 index a16ed817..00000000 --- a/run_bochs.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -bochs diff --git a/unmount.sh b/unmount.sh deleted file mode 100755 index 7881a5f5..00000000 --- a/unmount.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -ERRCOUNT=0 -echo " " -echo "=========================" -echo "== ASURO UNMOUNT ==" -echo "=========================" -echo " " -echo "Unmounting Asuro..." -sudo umount /mnt/asuro -sudo qemu-nbd --disconnect /dev/nbd0 -sudo rmmod nbd diff --git a/updatevm.sh b/updatevm.sh deleted file mode 100755 index 7b3adeb1..00000000 --- a/updatevm.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -DIRECTORY="src/vm" -rm -rf /tmp/MINJ -git clone https://gitlab.spexeah.com/spexeah/MINJ.git /tmp/MINJ -rm -rf $DIRECTORY -cp -rf /tmp/MINJ/src/vm $DIRECTORY \ No newline at end of file diff --git a/vb_compile_run.sh b/vb_compile_run.sh deleted file mode 100755 index adcce76d..00000000 --- a/vb_compile_run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -ERRCOUNT=0 -echo "=======================" -echo "== ASURO ==" -echo "=======================" -./compile.sh -./vbox.sh diff --git a/vbox.sh b/vbox.sh deleted file mode 100755 index 4a68bd56..00000000 --- a/vbox.sh +++ /dev/null @@ -1,3 +0,0 @@ -#name ur machine "asuro" - -VBoxManage startvm "asuro" From aa91842747f30b460e926d9e48ba8cd4cf5d6f9d Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 02:43:08 +0100 Subject: [PATCH 02/19] Fix attempt #1 --- .gitlab-ci.yml | 5 +---- compile_check.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 compile_check.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ed2ef25..71218478 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,5 @@ .after_script: - script: ./compile_finish.sh "$CI_JOB_STATUS" - rules: - - if: '$CI_JOB_STATUS == "failed"' - - when: never + script: ./compile_check.sh "$CI_JOB_STATUS" artifacts: paths: - release/*.svg diff --git a/compile_check.sh b/compile_check.sh new file mode 100644 index 00000000..2bdfd51a --- /dev/null +++ b/compile_check.sh @@ -0,0 +1,12 @@ +#/bin/sh +echo " " +echo "=======================" +echo " " +if [ "$1" = "failed" ] +then + echo "Errors Occurred, please review." + wget -q https://img.shields.io/badge/build-failed-red.svg -O release/build.svg 2>/dev/null + echo " " + echo "=======================" + exit 1 +fi \ No newline at end of file From e4920e59e29ea8c1add91f57a9691075b1630cca Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 02:54:04 +0100 Subject: [PATCH 03/19] Make scripts executable before the pipeline uses them... --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71218478..afe8bd0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,6 @@ +.before_script: + script: chmod +x ./*.sh + .after_script: script: ./compile_check.sh "$CI_JOB_STATUS" artifacts: From 3527cf8ec60ce0383fa56825061fb59f1092ce8e Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 02:56:03 +0100 Subject: [PATCH 04/19] See last commit --- .gitlab-ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afe8bd0c..ea52c6a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,3 @@ -.before_script: - script: chmod +x ./*.sh - .after_script: script: ./compile_check.sh "$CI_JOB_STATUS" artifacts: @@ -8,6 +5,7 @@ - release/*.svg stages: + - chmod - compile_stub - vergen - compile_sources @@ -15,6 +13,10 @@ stages: - isogen - finish +chmod_step: + stage: chmod + script: chmod +x ./*.sh + compile_stub: stage: compile_stub script: ./compile_stub.sh From 2363c02627b0a01cc708db005c6a2dfefa737bae Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 02:59:55 +0100 Subject: [PATCH 05/19] Still trying to fix pipelines. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ea52c6a8..8e5f340a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ stages: chmod_step: stage: chmod - script: chmod +x ./*.sh + script: ls && chmod +x ./*.sh compile_stub: stage: compile_stub From f69d9e1bbcfe9ad0ae6088f0bc35db6e13a69b9f Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 03:01:11 +0100 Subject: [PATCH 06/19] Checking compile_stub exists in second job... --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e5f340a..550165cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ chmod_step: compile_stub: stage: compile_stub - script: ./compile_stub.sh + script: ls && ./compile_stub.sh vergen: stage: vergen From 3dc65d56850def6c4db3aa8d08961122e0e4dcfd Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 03:05:54 +0100 Subject: [PATCH 07/19] Another attempt to get the pipeline to work... --- .gitlab-ci.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 550165cb..7acf6eff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,7 @@ .after_script: - script: ./compile_check.sh "$CI_JOB_STATUS" + script: + - chmod +x ./compile_check.sh + - ./compile_check.sh "$CI_JOB_STATUS" artifacts: paths: - release/*.svg @@ -13,42 +15,50 @@ stages: - isogen - finish -chmod_step: - stage: chmod - script: ls && chmod +x ./*.sh - compile_stub: stage: compile_stub - script: ls && ./compile_stub.sh + script: + - chmod +x ./compile_stub.sh + - ./compile_stub.sh vergen: stage: vergen - script: ./compile_vergen.sh + script: + - chmod +x ./compile_vergen.sh + - ./compile_vergen.sh artifacts: paths: - release/*.svg compile_sources: stage: compile_sources - script: ./compile_sources.sh + script: + - chmod +x ./compile_sources.sh + - ./compile_sources.sh link: stage: link - script: ./compile_link.sh + script: + - chmod +x ./compile_link.sh + - ./compile_link.sh artifacts: paths: - bin/kernel.bin isogen: stage: isogen - script: ./compile_isogen.sh + script: + - chmod +x ./compile_isogen.sh + - ./compile_isogen.sh artifacts: paths: - ./Asuro.iso finish: stage: finish - script: ./compile_finish.sh "$CI_JOB_STATUS" + script: + - chmod +x ./compile_finish.sh + - ./compile_finish.sh "$CI_JOB_STATUS" artifacts: paths: - release/*.svg \ No newline at end of file From b4b5abf36da3974f1c17dc3d83d6b81abd0aa4be Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 03:08:23 +0100 Subject: [PATCH 08/19] Fixed YAML whitespace error --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7acf6eff..66025731 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ .after_script: script: - - chmod +x ./compile_check.sh + - chmod +x ./compile_check.sh - ./compile_check.sh "$CI_JOB_STATUS" artifacts: paths: From 587e6d3320482ca49b99286e79e73c89a4431658 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 15:06:25 +0100 Subject: [PATCH 09/19] More fixes --- .gitlab-ci.yml | 13 ++++++++++++- compile_vergen.sh | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66025731..88420fc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,9 @@ compile_sources: script: - chmod +x ./compile_sources.sh - ./compile_sources.sh + dependencies: + - compile_stub + - vergen link: stage: link @@ -44,6 +47,10 @@ link: artifacts: paths: - bin/kernel.bin + dependencies: + - compile_stub + - vergen + - compile_sources isogen: stage: isogen @@ -53,6 +60,8 @@ isogen: artifacts: paths: - ./Asuro.iso + dependencies: + - link finish: stage: finish @@ -61,4 +70,6 @@ finish: - ./compile_finish.sh "$CI_JOB_STATUS" artifacts: paths: - - release/*.svg \ No newline at end of file + - release/*.svg + dependencies: + - isogen \ No newline at end of file diff --git a/compile_vergen.sh b/compile_vergen.sh index a6505cad..f25df4b9 100644 --- a/compile_vergen.sh +++ b/compile_vergen.sh @@ -4,6 +4,7 @@ echo "=======================" echo " " echo "Generating Versioning Info..." echo " " +chmod +x ./compile_checksum.sh ./compile_checksum.sh outfile="src/include/asuro.pas" file="version" From ab84c516e22b17685946fff47f4b47745ea90703 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 15:15:17 +0100 Subject: [PATCH 10/19] More attempts at getting pipeline to work --- .gitlab-ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88420fc2..d6f73526 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,10 @@ compile_stub: script: - chmod +x ./compile_stub.sh - ./compile_stub.sh - + artifacts: + paths: + - lib/stub.o + vergen: stage: vergen script: @@ -29,12 +32,16 @@ vergen: artifacts: paths: - release/*.svg + - src/include/asuro.pas compile_sources: stage: compile_sources script: - chmod +x ./compile_sources.sh - ./compile_sources.sh + artifacts: + paths: + - lib/*.o dependencies: - compile_stub - vergen @@ -48,8 +55,6 @@ link: paths: - bin/kernel.bin dependencies: - - compile_stub - - vergen - compile_sources isogen: From 05eab9976b2dd2c4a25c4065a93f06e033c8b703 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 15:17:40 +0100 Subject: [PATCH 11/19] More changes for pipeline --- .gitlab-ci.yml | 4 ++-- compile_finish.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6f73526..33f9138e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ .after_script: script: - chmod +x ./compile_check.sh - - ./compile_check.sh "$CI_JOB_STATUS" + - ./compile_check.sh $CI_JOB_STATUS artifacts: paths: - release/*.svg @@ -72,7 +72,7 @@ finish: stage: finish script: - chmod +x ./compile_finish.sh - - ./compile_finish.sh "$CI_JOB_STATUS" + - ./compile_finish.sh $CI_JOB_STATUS artifacts: paths: - release/*.svg diff --git a/compile_finish.sh b/compile_finish.sh index 222a9027..503cc03d 100644 --- a/compile_finish.sh +++ b/compile_finish.sh @@ -2,6 +2,7 @@ echo " " echo "=======================" echo " " +echo $1 if [ "$1" != "success" ] then echo "Errors Occurred, please review." From d83d8f70490cc2447be839dda8d3b5b35a8f9226 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 15:19:59 +0100 Subject: [PATCH 12/19] Change check in "compile_finish" for fail, as pipeline is still running --- .gitlab-ci.yml | 2 +- compile_finish.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33f9138e..1201e97f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,6 +75,6 @@ finish: - ./compile_finish.sh $CI_JOB_STATUS artifacts: paths: - - release/*.svg + - release/build.svg dependencies: - isogen \ No newline at end of file diff --git a/compile_finish.sh b/compile_finish.sh index 503cc03d..b7feb35a 100644 --- a/compile_finish.sh +++ b/compile_finish.sh @@ -3,7 +3,7 @@ echo " " echo "=======================" echo " " echo $1 -if [ "$1" != "success" ] +if [ "$1" == "failed" ] then echo "Errors Occurred, please review." wget -q https://img.shields.io/badge/build-failed-red.svg -O release/build.svg 2>/dev/null From 5431eaabeb153cb379c4a5969be2856589747538 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 22:33:24 +0100 Subject: [PATCH 13/19] Another test --- .gitlab-ci.yml | 9 +-------- compile_check.sh | 12 ------------ compile_finish.sh | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 compile_check.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1201e97f..0dd04123 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,3 @@ -.after_script: - script: - - chmod +x ./compile_check.sh - - ./compile_check.sh $CI_JOB_STATUS - artifacts: - paths: - - release/*.svg - stages: - chmod - compile_stub @@ -70,6 +62,7 @@ isogen: finish: stage: finish + when: always script: - chmod +x ./compile_finish.sh - ./compile_finish.sh $CI_JOB_STATUS diff --git a/compile_check.sh b/compile_check.sh deleted file mode 100644 index 2bdfd51a..00000000 --- a/compile_check.sh +++ /dev/null @@ -1,12 +0,0 @@ -#/bin/sh -echo " " -echo "=======================" -echo " " -if [ "$1" = "failed" ] -then - echo "Errors Occurred, please review." - wget -q https://img.shields.io/badge/build-failed-red.svg -O release/build.svg 2>/dev/null - echo " " - echo "=======================" - exit 1 -fi \ No newline at end of file diff --git a/compile_finish.sh b/compile_finish.sh index b7feb35a..206895fb 100644 --- a/compile_finish.sh +++ b/compile_finish.sh @@ -2,7 +2,6 @@ echo " " echo "=======================" echo " " -echo $1 if [ "$1" == "failed" ] then echo "Errors Occurred, please review." From 3b7ea449b58ccc8929e83efba544f55ad33f4c8a Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 22:34:27 +0100 Subject: [PATCH 14/19] This shouldn't compile. --- src/kernel.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel.pas b/src/kernel.pas index 9b40accc..f0847110 100644 --- a/src/kernel.pas +++ b/src/kernel.pas @@ -214,7 +214,7 @@ begin { Filsystems } fat32.init(); - +fdsafdsafdsafdsafdsadsafafdsfdsadsfa { Device Drivers } tracer.push_trace('kmain.DEVDRV'); console.outputln('KERNEL', 'DEVICE DRIVERS: INIT BEGIN.'); From ac866a3789ed824e8e1eb240090fcbb625494dc7 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 23:02:43 +0100 Subject: [PATCH 15/19] Pipeline Fixed! Thanks Peter --- .gitlab-ci.yml | 15 +-------------- src/kernel.pas | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0dd04123..0373d7d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,6 @@ stages: - compile_sources - link - isogen - - finish compile_stub: stage: compile_stub @@ -58,16 +57,4 @@ isogen: paths: - ./Asuro.iso dependencies: - - link - -finish: - stage: finish - when: always - script: - - chmod +x ./compile_finish.sh - - ./compile_finish.sh $CI_JOB_STATUS - artifacts: - paths: - - release/build.svg - dependencies: - - isogen \ No newline at end of file + - link \ No newline at end of file diff --git a/src/kernel.pas b/src/kernel.pas index f0847110..9b40accc 100644 --- a/src/kernel.pas +++ b/src/kernel.pas @@ -214,7 +214,7 @@ begin { Filsystems } fat32.init(); -fdsafdsafdsafdsafdsadsafafdsfdsadsfa + { Device Drivers } tracer.push_trace('kmain.DEVDRV'); console.outputln('KERNEL', 'DEVICE DRIVERS: INIT BEGIN.'); From 6fbf2b2f7946caa93175be3b26ffe64036703f59 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 23:05:35 +0100 Subject: [PATCH 16/19] Tidied up stage names --- .gitlab-ci.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0373d7d9..bcb97b36 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,12 @@ stages: - - chmod - - compile_stub - - vergen - - compile_sources - - link - - isogen + - Compile Stub + - Generate Version Files + - Compile Sources + - Link + - Generate ISO compile_stub: - stage: compile_stub + stage: Compile Stub script: - chmod +x ./compile_stub.sh - ./compile_stub.sh @@ -16,7 +15,7 @@ compile_stub: - lib/stub.o vergen: - stage: vergen + stage: Generate Version Files script: - chmod +x ./compile_vergen.sh - ./compile_vergen.sh @@ -26,7 +25,7 @@ vergen: - src/include/asuro.pas compile_sources: - stage: compile_sources + stage: Compile Sources script: - chmod +x ./compile_sources.sh - ./compile_sources.sh @@ -38,7 +37,7 @@ compile_sources: - vergen link: - stage: link + stage: Link script: - chmod +x ./compile_link.sh - ./compile_link.sh @@ -49,7 +48,7 @@ link: - compile_sources isogen: - stage: isogen + stage: Generate ISO script: - chmod +x ./compile_isogen.sh - ./compile_isogen.sh From 428981f525ed8a52e0c4b583228c3320e0b7a526 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 23:10:24 +0100 Subject: [PATCH 17/19] Add needs --- .gitlab-ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcb97b36..262cea9a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,12 @@ stages: - - Compile Stub + - Compile Stub & Generate Version Files - Generate Version Files - Compile Sources - Link - Generate ISO compile_stub: - stage: Compile Stub + stage: Compile Stub & Generate Version Files script: - chmod +x ./compile_stub.sh - ./compile_stub.sh @@ -15,7 +15,7 @@ compile_stub: - lib/stub.o vergen: - stage: Generate Version Files + stage: Compile Stub & Generate Version Files script: - chmod +x ./compile_vergen.sh - ./compile_vergen.sh @@ -35,6 +35,9 @@ compile_sources: dependencies: - compile_stub - vergen + needs: + - vergen + - compile_stub link: stage: Link @@ -46,6 +49,8 @@ link: - bin/kernel.bin dependencies: - compile_sources + needs: + - compile_sources isogen: stage: Generate ISO @@ -56,4 +61,6 @@ isogen: paths: - ./Asuro.iso dependencies: + - link + needs: - link \ No newline at end of file From af2013a0a3bde82bc98f2869f9b89162d56d478a Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 23:11:48 +0100 Subject: [PATCH 18/19] Another cleanup! --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 262cea9a..b29bf024 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,12 @@ stages: - - Compile Stub & Generate Version Files + - Genrate Stub and Versions - Generate Version Files - Compile Sources - Link - Generate ISO compile_stub: - stage: Compile Stub & Generate Version Files + stage: Genrate Stub and Versions script: - chmod +x ./compile_stub.sh - ./compile_stub.sh @@ -15,7 +15,7 @@ compile_stub: - lib/stub.o vergen: - stage: Compile Stub & Generate Version Files + stage: Genrate Stub and Versions script: - chmod +x ./compile_vergen.sh - ./compile_vergen.sh From d31f278a769526cf2d4379be6882acdebb465950 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sat, 26 Jun 2021 23:12:29 +0100 Subject: [PATCH 19/19] Managed to missed the 'e' in Generate. --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b29bf024..64a8830c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,12 @@ stages: - - Genrate Stub and Versions + - Generate Stub and Versions - Generate Version Files - Compile Sources - Link - Generate ISO compile_stub: - stage: Genrate Stub and Versions + stage: Generate Stub and Versions script: - chmod +x ./compile_stub.sh - ./compile_stub.sh @@ -15,7 +15,7 @@ compile_stub: - lib/stub.o vergen: - stage: Genrate Stub and Versions + stage: Generate Stub and Versions script: - chmod +x ./compile_vergen.sh - ./compile_vergen.sh