Skip to content
Snippets Groups Projects
Verified Commit f7a8eae6 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Support passing a path to a file to run, parse exit status differently

parent 2ad8e56f
No related branches found
No related tags found
No related merge requests found
...@@ -90,8 +90,6 @@ function redoxfs_mount { ...@@ -90,8 +90,6 @@ function redoxfs_mount {
done done
} }
name="$(basename "$1")"
if [ ! -f build/bootloader.bin ] if [ ! -f build/bootloader.bin ]
then then
echo "building bootloader" >&2 echo "building bootloader" >&2
...@@ -139,13 +137,25 @@ mkdir -p "build/${uuid}" ...@@ -139,13 +137,25 @@ mkdir -p "build/${uuid}"
redoxfs_mount "build/${uuid}.bin" "build/${uuid}" redoxfs_mount "build/${uuid}.bin" "build/${uuid}"
cp "target/${TARGET}/release/redoxerd" "build/${uuid}/bin/redoxerd" cp "target/${TARGET}/release/redoxerd" "build/${uuid}/bin/redoxerd"
if [[ "$1" == */* ]]
then
name="$(basename "$1")"
cp "$1" "build/${uuid}/bin/${name}"
echo "${name}" >> "build/${uuid}/etc/redoxerd"
shift
fi
for arg in "$@" for arg in "$@"
do do
echo "${arg}" >> "build/${uuid}/etc/redoxerd" echo "${arg}" >> "build/${uuid}/etc/redoxerd"
done done
redoxfs_unmount "build/${uuid}" redoxfs_unmount "build/${uuid}"
set +e
qemu-system-x86_64 \ qemu-system-x86_64 \
-enable-kvm \ -enable-kvm \
-cpu host \ -cpu host \
...@@ -161,7 +171,10 @@ qemu-system-x86_64 \ ...@@ -161,7 +171,10 @@ qemu-system-x86_64 \
-nographic \ -nographic \
-vga none \ -vga none \
-drive file="build/${uuid}.bin",format=raw -drive file="build/${uuid}.bin",format=raw
status="$(("$?" / 2))"
echo echo
echo "## redoxer $@ ##" echo "## redoxer (${status}) ##"
cat "build/${uuid}.log" cat "build/${uuid}.log"
exit "${status}"
...@@ -147,8 +147,7 @@ pub fn main() { ...@@ -147,8 +147,7 @@ pub fn main() {
Err(err) => { Err(err) => {
eprintln!("redoxerd: {}", err); eprintln!("redoxerd: {}", err);
// Exit with error using qemu device // Exit with error using qemu device
let status = 0x21; Pio::<u8>::new(0x501).write(1);
Pio::<u8>::new(0x501).write(status >> 1);
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment