Cleaned up Compile Scripts & Pipeline
Commiting to test.
This commit is contained in:
parent
78955c41ab
commit
c69ac198ed
@ -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:
|
.after_script:
|
||||||
- echo "After script section"
|
script: ./compile_finish.sh "$CI_JOB_STATUS"
|
||||||
- echo "For example you might do some cleanup here"
|
rules:
|
||||||
|
- if: '$CI_JOB_STATUS == "failed"'
|
||||||
build:
|
- when: never
|
||||||
stage: build
|
|
||||||
tags:
|
|
||||||
- asuro
|
|
||||||
script: ./compile.sh
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- release/Asuro.iso
|
|
||||||
- iso/boot/asuro.bin
|
|
||||||
- release/*.svg
|
- release/*.svg
|
||||||
|
|
||||||
.test1:
|
stages:
|
||||||
stage: test
|
- compile_stub
|
||||||
script:
|
- vergen
|
||||||
- echo "Do a test here"
|
- compile_sources
|
||||||
- echo "For example run a test suite"
|
- link
|
||||||
|
- isogen
|
||||||
|
- finish
|
||||||
|
|
||||||
.test2:
|
compile_stub:
|
||||||
stage: test
|
stage: compile_stub
|
||||||
script:
|
script: ./compile_stub.sh
|
||||||
- echo "Do another parallel test here"
|
|
||||||
- echo "For example run a lint test"
|
|
||||||
|
|
||||||
.deploy1:
|
vergen:
|
||||||
stage: deploy
|
stage: vergen
|
||||||
script:
|
script: ./compile_vergen.sh
|
||||||
- echo "Do your deploy here"
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- release/*.svg
|
||||||
|
|
||||||
|
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
|
@ -2,8 +2,8 @@ FROM ubuntu:latest
|
|||||||
|
|
||||||
VOLUME ["/code"]
|
VOLUME ["/code"]
|
||||||
|
|
||||||
RUN dpkg --add-architecture i386 && \
|
RUN dpkg --add-architecture i386
|
||||||
apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install nasm curl make:i386 binutils:i386 xorriso grub-pc-bin dos2unix -y
|
RUN apt-get install nasm curl make:i386 binutils:i386 xorriso grub-pc-bin dos2unix -y
|
||||||
RUN apt-get clean
|
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 && \
|
RUN curl https://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.i386-linux.tar/download --output fpc.tar -L && \
|
||||||
|
82
compile.sh
82
compile.sh
@ -2,18 +2,12 @@
|
|||||||
ERRCOUNT=0
|
ERRCOUNT=0
|
||||||
echo " "
|
echo " "
|
||||||
echo "======================="
|
echo "======================="
|
||||||
echo "== ASURO COMPILATION =="
|
|
||||||
echo "======================="
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "Checking out latest VM Source..."
|
echo "Asuro Compilation"
|
||||||
echo " "
|
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 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
echo "Failed to compile stub!"
|
echo "Failed to compile stub!"
|
||||||
@ -22,47 +16,23 @@ else
|
|||||||
echo "Success."
|
echo "Success."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " "
|
#Generate .pas with versioning headers.
|
||||||
echo "======================="
|
./compile_vergen.sh
|
||||||
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
|
|
||||||
|
|
||||||
|
#Compile all .pas sources
|
||||||
|
./compile_sources.sh
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
|
echo " "
|
||||||
echo "Failed to compile FPC Sources!"
|
echo "Failed to compile FPC Sources!"
|
||||||
ERRCOUNT=$((ERRCOUNT+1))
|
ERRCOUNT=$((ERRCOUNT+1))
|
||||||
else
|
else
|
||||||
|
echo " "
|
||||||
echo "Success."
|
echo "Success."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " "
|
#Link into a binary.
|
||||||
echo "======================="
|
./compile_link.sh
|
||||||
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
|
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
echo "Failed linking!"
|
echo "Failed linking!"
|
||||||
@ -71,13 +41,8 @@ else
|
|||||||
echo "Success."
|
echo "Success."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " "
|
#Generate an ISO with GRUB as the Bootloader.
|
||||||
echo "======================="
|
./compile_isogen.sh
|
||||||
echo " "
|
|
||||||
echo "Creating ISO..."
|
|
||||||
echo " "
|
|
||||||
cp bin/kernel.bin iso/boot/asuro.bin
|
|
||||||
grub-mkrescue -o Asuro.iso iso
|
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
echo "Failed to create ISO!"
|
echo "Failed to create ISO!"
|
||||||
@ -86,27 +51,12 @@ else
|
|||||||
echo "Success."
|
echo "Success."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " "
|
#Call generate final artifacts based on failure or success of the above.
|
||||||
echo "======================="
|
|
||||||
echo " "
|
|
||||||
if [ "$ERRCOUNT" -ne "0" ]
|
if [ "$ERRCOUNT" -ne "0" ]
|
||||||
then
|
then
|
||||||
echo "$ERRCOUNT Errors Occurred, please review."
|
./compile_finish.sh "failed"
|
||||||
wget -q https://img.shields.io/badge/build-failed-red.svg -O release/build.svg
|
|
||||||
else
|
else
|
||||||
echo "No errors."
|
./compile_finish.sh "success"
|
||||||
wget -q https://img.shields.io/badge/build-succeeded-green.svg -O release/build.svg
|
|
||||||
fi
|
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 ..
|
cd ..
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
ERRCOUNT=0
|
|
||||||
echo "======================="
|
|
||||||
echo "== ASURO =="
|
|
||||||
echo "======================="
|
|
||||||
./compile.sh
|
|
||||||
./run.sh
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
ERRCOUNT=0
|
|
||||||
echo "======================="
|
|
||||||
echo "== ASURO =="
|
|
||||||
echo "======================="
|
|
||||||
./compile.sh -d
|
|
||||||
./run.sh -d
|
|
0
checksum.sh → compile_checksum.sh
Executable file → Normal file
0
checksum.sh → compile_checksum.sh
Executable file → Normal file
@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
./compile.sh -d
|
|
18
compile_finish.sh
Normal file
18
compile_finish.sh
Normal file
@ -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
|
8
compile_isogen.sh
Normal file
8
compile_isogen.sh
Normal file
@ -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
|
17
compile_link.sh
Normal file
17
compile_link.sh
Normal file
@ -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
|
7
compile_sources.sh
Normal file
7
compile_sources.sh
Normal file
@ -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
|
8
compile_stub.sh
Normal file
8
compile_stub.sh
Normal file
@ -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
|
8
compile_sumgen.sh
Normal file
8
compile_sumgen.sh
Normal file
@ -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
|
28
versioning.sh → compile_vergen.sh
Executable file → Normal file
28
versioning.sh → compile_vergen.sh
Executable file → Normal file
@ -1,6 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
echo " "
|
||||||
|
echo "======================="
|
||||||
|
echo " "
|
||||||
echo "Generating Versioning Info..."
|
echo "Generating Versioning Info..."
|
||||||
./checksum.sh
|
echo " "
|
||||||
|
./compile_checksum.sh
|
||||||
outfile="src/include/asuro.pas"
|
outfile="src/include/asuro.pas"
|
||||||
file="version"
|
file="version"
|
||||||
while IFS=: read -r line;do
|
while IFS=: read -r line;do
|
||||||
@ -44,15 +48,15 @@ echo "implementation" >> $outfile
|
|||||||
echo " " >> $outfile
|
echo " " >> $outfile
|
||||||
echo "end." >> $outfile
|
echo "end." >> $outfile
|
||||||
echo "Generating release info..."
|
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/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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
wget -q https://img.shields.io/badge/fingerprint-$checksum-important.svg -O release/fingerprint.svg 2>/dev/null
|
||||||
echo "Done versioning."
|
echo "Done versioning."
|
@ -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 " "
|
|
||||||
|
|
||||||
|
|
53
mount.sh
53
mount.sh
@ -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 " "
|
|
38
run.sh
38
run.sh
@ -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 " "
|
|
@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
bochs
|
|
11
unmount.sh
11
unmount.sh
@ -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
|
|
@ -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
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
ERRCOUNT=0
|
|
||||||
echo "======================="
|
|
||||||
echo "== ASURO =="
|
|
||||||
echo "======================="
|
|
||||||
./compile.sh
|
|
||||||
./vbox.sh
|
|
Loading…
x
Reference in New Issue
Block a user