Skip to content

Commit 050af3a

Browse files
committed
Updated make_toolchain.sh
1 parent 0192438 commit 050af3a

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

.github/workflows/makefile.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ jobs:
1818
- name: Install prereqs
1919
run: |
2020
sudo apt update
21-
sudo apt upgrade
22-
sudo apt install grub-pc-bin nasm mtools qemu-utils xorriso
21+
sudo apt install grub-pc-bin nasm mtools qemu-utils xorriso wget unzip
2322
shell: bash
2423

2524
- name: Create toolchain
26-
run: ./src/scripts/make_toolchain.sh --parallel_build -s ~/sysroot
25+
run: ./src/scripts/make_toolchain.sh --parallel_build -s ~/sysroot download_i686_elf_tools
2726
shell: bash
2827

2928
- name: Compile kernel

src/scripts/make_toolchain.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export BUILD_ALL=true
2525
export USE_DEFAULT=false
2626
export ADD_PATH=false
2727

28+
export DOWNLOAD_I686_ELF_TOOLS=false
29+
2830
function backup_path
2931
{
3032
echo "$PATH" > "$TESTDIR/PATH_${1}"
@@ -68,6 +70,17 @@ function build_i686_elf
6870
fi
6971
}
7072

73+
function download_i686_elf
74+
{
75+
if ls "$TESTDIR/I686_ELF_TOOLS" 1> /dev/null 2>&1; then
76+
echo "I686_elf toolchain is already built. To reinstall, remove $TESTDIR/I686_ELF_TOOLS"
77+
else
78+
wget https://github.com/lordmilko/i686-elf-tools/releases/download/7.1.0/i686-elf-tools-linux.zip -O "$I686_ELF_TOOLCHAIN_ZIP"
79+
touch "$TESTDIR/I686_ELF_TOOLS"
80+
extract_i686_elf
81+
fi
82+
}
83+
7184
function build_autoconf_2_69
7285
{
7386
if ls "$TESTDIR/AUTOCONF_2.69" 1> /dev/null 2>&1; then
@@ -444,6 +457,7 @@ do
444457
newlib) NEWLIB=true; BUILD_ALL=false; shift ;;
445458
ostools) OSTOOLS=true; BUILD_ALL=false; shift ;;
446459
i686_elf_toolchain) I686_ELF_TOOLS=true; BUILD_ALL=false; shift ;;
460+
download_i686_elf_tools) DOWNLOAD_I686_ELF_TOOLS=true; shift ;;
447461
--add_path) ADD_PATH=true; shift ;;
448462
--use_as_default) USE_DEFAULT=true; shift ;;
449463
-h |--help) HELP=true; shift ;;
@@ -510,7 +524,11 @@ function main
510524
mkdir -p "$TESTDIR"
511525

512526
if [[ $I686_ELF_TOOLS == true ]]; then
513-
build_i686_elf
527+
if [[ $DOWNLOAD_I686_ELF_TOOLS == true ]]; then
528+
download_i686_elf
529+
else
530+
build_i686_elf
531+
fi
514532
fi
515533

516534
if [[ $NEWLIB == true ]]; then

0 commit comments

Comments
 (0)