From 9b5e26164fc80ffc35194662b4703fa22a9a724e Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Sun, 5 Feb 2012 17:40:19 -0600 Subject: [PATCH] Do a better job of running check-reqs --- Makefile | 13 +++++-------- README.md | 2 +- util/check-reqs | 12 ++++++++++++ util/install-toolchain.sh | 27 --------------------------- 4 files changed, 18 insertions(+), 36 deletions(-) delete mode 100755 util/install-toolchain.sh diff --git a/Makefile b/Makefile index 38ae49d2..4e3c0e18 100644 --- a/Makefile +++ b/Makefile @@ -39,11 +39,11 @@ ENDRM = util/mk-end-rm EMUARGS = -kernel toaruos-kernel -m 256 -initrd toaruos-initrd -append "vid=qemu hdd" -serial stdio -vga std -hda toaruos-disk.img EMUKVM = -enable-kvm -.PHONY: all check-toolchain system clean clean-once clean-hard clean-soft clean-docs clean-bin clean-aux clean-core update-version install run docs utils +.PHONY: all system clean clean-once clean-hard clean-soft clean-docs clean-bin clean-aux clean-core update-version install run docs utils .SECONDARY: all: .passed system docs utils tags -system: toaruos-initrd toaruos-disk.img toaruos-kernel +system: .passed toaruos-initrd toaruos-disk.img toaruos-kernel install: system @${BEG} "CP" "Installing to /boot..." @@ -63,15 +63,12 @@ utils: ${UTILITIES} @util/check-reqs > /dev/null @touch .passed -check-toolchain: - @util/install-toolchain.sh - ################# # Documentation # ################# docs: docs/core.pdf -docs/core.pdf: docs/*.tex +docs/core.pdf: docs/*.tex @${BEG} "docs" "Generating documentation..." @pdflatex -draftmode -halt-on-error -output-directory docs/ docs/core.tex > /dev/null ${ERRORS} @makeindex -q docs/*.idx ${ERRORS} @@ -81,7 +78,7 @@ docs/core.pdf: docs/*.tex ################ # Kernel # ################ -toaruos-kernel: kernel/start.o kernel/link.ld kernel/main.o ${SUBMODULES} +toaruos-kernel: .passed kernel/start.o kernel/link.ld kernel/main.o ${SUBMODULES} @${BEG} "LD" "$<" @${LD} -T kernel/link.ld -o toaruos-kernel kernel/*.o ${SUBMODULES} ${ERRORS} @${END} "LD" "$<" @@ -102,7 +99,7 @@ kernel/sys/version.o: kernel/*/*.c kernel/*.c ################ # Ram disk # ################ -toaruos-initrd: initrd/boot/kernel +toaruos-initrd: .passed initrd/boot/kernel @${BEG} "initrd" "Generating initial RAM disk" @# Get rid of the old one @-rm -f toaruos-initrd diff --git a/README.md b/README.md index 31d3b7a3..4d72c54e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Clone the git repository and run: # Retreive the precompiled binaries: util/grab-binaries.sh - make # to build the kernel + make system # to build the kernel make run # to run qemu with the proper arguments # Or, if you have KVM... make kvm # to run qemu in KVM mode diff --git a/util/check-reqs b/util/check-reqs index 75b95c36..5f857ea8 100755 --- a/util/check-reqs +++ b/util/check-reqs @@ -18,6 +18,8 @@ function BAIL { exit 1 } +INFO "Checking for required tools (one-time check)..." + if [ -z `which clang` ] ; then WARN "Missing clang" if [ -z `which gcc` ] ; then @@ -35,3 +37,13 @@ if [ -z `which genext2fs` ] ; then BAIL fi +if [ -z `which qemu` ] ; then + if [ -z `which qemu-system-i386` ] ; then + ERROR "Missing qemu" + INFO "You can probably install it from a package of the same name." + fi + ERROR "qemu is installed, but not as 'qemu'" + INFO "You have a version of qemu which does not provide the 'qemu' binary." + INFO "You should run 'ln -s ~/bin/qemu \`which qemu-system-i386\` or similar to correct this." +fi + diff --git a/util/install-toolchain.sh b/util/install-toolchain.sh deleted file mode 100755 index 2ab6ce7d..00000000 --- a/util/install-toolchain.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -TOOLCHAIN=`which i686-pc-toaru-gcc` -if [[ -n "$TOOLCHAIN" ]] ; then - echo "Toolchain is present at $TOOLCHAIN" - exit 0 -fi - -echo -e "\033[1mYou do not appear to have a toolchain available for とあるOS (i686-pc-toaru-gcc was not found in your path).\033[0m" -echo -e "\033[1mI can retreive a pre-built copy of the toolchain for Linux (32-bit, approx. 300MB)\033[0m" -echo -en "\033[1;32mWould you like me to do that?\033[0m (Y/n) " - -read PROMPT - -if [[ "$PROMPT" = "y" ]] ; then - echo "The toolchain will be pulled from Dropbox: http://dl.dropbox.com/u/44305966/toaru-toolchain-0.0.1.tar.gz" - pushd /tmp - wget "http://dl.dropbox.com/u/44305966/toaru-toolchain-0.0.1.tar.gz" - popd - tar -x -C util/ -f "/tmp/toaru-toolchain-0.0.1.tar.gz" - rm "/tmp/toaru-toolchain-0.0.1.tar.gz" - echo "Done!" - echo "You should now add \033[1;33m`pwd`/util/toaru-toolchain/bin\033[0m to your path" -else - echo "I will not retreive the toolchain. Bailing..." - exit 1 -fi