0746048a00
This also removed the need for `@intCase()` Also move the making directories and copying to a script to the build is simpler. Install qemu earler Added chmod +x Fixed copy elf Added missing switch for qemu binary Spelling Make makeiso.sh executable No longer chmod makeiso.sh Use the cache root to set the output directory
31 lines
707 B
Bash
Executable file
31 lines
707 B
Bash
Executable file
#!/bin/bash
|
|
|
|
BOOT_DIR=$1
|
|
MODULES_DIR=$2
|
|
ISO_DIR=$3
|
|
PLUTO_ELF=$4
|
|
OUTPUT_FILE=$5
|
|
|
|
MAP_FILE=$MODULES_DIR/'kernel.map'
|
|
|
|
exit_missing() {
|
|
printf "$_ must be installed\n";
|
|
exit 1;
|
|
}
|
|
|
|
# Check dependencies
|
|
which xorriso > /dev/null || exit_missing
|
|
which grub-mkrescue > /dev/null || exit_missing
|
|
which readelf > /dev/null || exit_missing
|
|
|
|
mkdir -p $BOOT_DIR
|
|
mkdir -p $MODULES_DIR
|
|
|
|
cp -r grub $BOOT_DIR
|
|
cp $PLUTO_ELF $BOOT_DIR/"pluto.elf"
|
|
|
|
# Read the symbols from the binary, remove all the unnecessary columns with awk and emit to a map file
|
|
readelf -s $PLUTO_ELF | grep -F "FUNC" | awk '{$1=$3=$4=$5=$6=$7=""; print $0}' | sort -k 1 > $MAP_FILE
|
|
echo "" >> $MAP_FILE
|
|
|
|
grub-mkrescue -o $OUTPUT_FILE $ISO_DIR
|