-
Notifications
You must be signed in to change notification settings - Fork 926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added bootstrap file #383
added bootstrap file #383
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
#! /bin/bash | ||
banner() { | ||
echo "|------------------------------------------|" | ||
echo "|----- Welcome to the redox bootstrap -----|" | ||
echo "|------------------------------------------|" | ||
} | ||
|
||
osx() | ||
{ | ||
echo "Detected OSX!" | ||
temp=$(brew --version) | ||
if [ -n "$temp" ]; then | ||
echo "Homebrew detected! Now updating..." | ||
brew update | ||
echo "Now installing git..." | ||
brew install git | ||
echo "Now installing virtualbox..." | ||
brew cask install virtualbox | ||
else | ||
echo "Homebrew does not appear to be installed! Would you like me to install it?" | ||
printf "(Y/n): " | ||
#For now assume yes | ||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | ||
fi | ||
echo "Cloning Redox repo" | ||
git clone -b $1 --recursive https://github.com/redox-os/redox.git | ||
sh redox/setup/osx-homebrew.sh | ||
sh redox/setup/binary.sh | ||
} | ||
|
||
archLinux() | ||
{ | ||
echo "Detected Arch Linux, mah fav" | ||
echo "Updating system..." | ||
sudo pacman -Syu | ||
echo "Installing git..." | ||
sudo pacman -S git | ||
echo "Cloning Redox repo" | ||
if [ "$2" == "qemu" ]; then | ||
echo "Installing QEMU..." | ||
sudo pacman -S qemu | ||
fi | ||
git clone -b $1 --recursive https://github.com/redox-os/redox.git | ||
sh redox/setup/arch.sh | ||
sh redox/setup/binary.sh | ||
} | ||
|
||
ubuntu() | ||
{ | ||
echo "Detected Ubuntu/Debian" | ||
echo "Updating system..." | ||
sudo apt-get upgrade | ||
echo "Installing git..." | ||
sudo apt-get -y install git | ||
if [ "$2" == "qemu" ]; then | ||
echo "Installing QEMU..." | ||
sudo apt-get -y install qemu-system-x86 qemu-kvm | ||
fi | ||
echo "Cloning Redox repo" | ||
git clone -b $1 --recursive https://github.com/redox-os/redox.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You do assume that I do not already have the sources and pull it straight away into the folder which is my current working dir. Perhaps It is already exactly here, perhaps I want it to be somewhere else? When I really do run such installers, I do it always from inside a temporary location, then it is easier to clean up the mess that some of them leave around… There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @NobbZ |
||
sudo apt-get -y install build-essential libc6-dev-i386 nasm curl file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are missing a new status-message here. This is not cloning the repository anymore. Do them right or leave them out. Some of the comments might apply for other OS as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @NobbZ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The interface is pretty much the same, at least the relevant parts… The sole difference in the interface is how upgrades happen. There are
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @NobbZ |
||
sh redox/setup/binary.sh | ||
} | ||
|
||
fedora() | ||
{ | ||
echo "Detected Fedora" | ||
echo "Installing git..." | ||
sudo yum install git-all | ||
if [ "$2" == "qemu" ]; then | ||
echo "Installing QEMU..." | ||
sudo yum install qemu-system-x86 qemu-kvm | ||
else | ||
echo "Installing virtualbox..." | ||
sudo yum install virtualbox | ||
fi | ||
echo "Cloning Redox repo" | ||
git clone -b $1 --recursive https://github.com/redox-os/redox.git | ||
sudo dnf install gcc gcc-c++ glibc-devel.i686 nasm make | ||
sh redox/setup/binary.sh | ||
} | ||
|
||
suse() | ||
{ | ||
echo "Detected a suse" | ||
echo "Installing git..." | ||
zypper install git | ||
if [ "$2" == "qemu" ]; then | ||
echo "Installing QEMU..." | ||
sudo zypper install qemu-x86 qemu-kvm | ||
else | ||
which virtualbox && { "Virtualbox installed!"; break; } | ||
echo "Please install Virtualbox and re-run this script," | ||
echo "or run with -e qemu" | ||
exit | ||
fi | ||
echo "Cloning Redox repo..." | ||
git clone -b $1 --recursive https://github.com/redox-os/redox.git | ||
sudo zypper install gcc gcc-c++ glibc-devel-32bit nasm make | ||
sh redox/setup/binary.sh | ||
} | ||
|
||
usage() | ||
{ | ||
echo "------------------------" | ||
echo "|Redox bootstrap script|" | ||
echo "------------------------" | ||
echo "Usage: ./bootstrap.sh" | ||
echo "OPTIONS:" | ||
echo | ||
echo " -h,--help Show this prompt" | ||
echo " -b [branch] Specify a branch of redox to clone" | ||
echo " -u [branch] Update git repo and update rust" | ||
echo " If blank defaults to master" | ||
echo " -e [emulator] Install specific emulator, virtualbox or qemu" | ||
echo "EXAMPLES:" | ||
echo | ||
echo "./bootstrap.sh -b buddy -e qemu" | ||
exit | ||
} | ||
|
||
update() | ||
{ | ||
git pull origin $1 | ||
sh setup/binary.sh | ||
exit | ||
} | ||
|
||
endMessage() | ||
{ | ||
echo "---------------------------------------" | ||
echo "Well it looks like you are ready to go!" | ||
echo "---------------------------------------" | ||
echo " cd redox" | ||
echo " make all" | ||
echo " make virtualbox or qemu" | ||
echo | ||
echo " Good luck!" | ||
|
||
exit | ||
} | ||
if [ "$1" == "-h" ]; then | ||
usage | ||
fi | ||
|
||
if [ "$1" == "-u" ]; then | ||
if [ -n "$2" ]; then | ||
update $2 | ||
else | ||
update "master" | ||
fi | ||
fi | ||
|
||
branch="master" | ||
emulator="virtualbox" | ||
|
||
while getopts ":b:e:" opt | ||
do | ||
case "$opt" in | ||
b) branch="$OPTARG";; | ||
e) emulator="$OPTARG";; | ||
\?) echo "I don't know what to do with that option..."; exit;; | ||
esac | ||
done | ||
|
||
banner | ||
kernel=$(uname -s) | ||
if [ "$kernel" == "Darwin" ]; then | ||
osx $branch | ||
else | ||
which pacman && { archLinux $branch $emulator; endMessage; } | ||
which apt-get && { ubuntu $branch $emulator; endMessage; } | ||
which yum && { fedora $branch $emulator; endMessage; } | ||
which zypper && { suse $branch $emulator; endMessage; } | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apt-get update
before.upgrade
does not enforce it.install``update
needs manual confirmation of the packages that shall be upgraded.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NobbZ
So would you suggest removing the update part completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since an upgrade of the system is not really necessary to get up and
running redox I think, drop it. Still we need to update package repositorys
via
apt-get update
to avoid problems when installing later. If you don'tdo it, you might run into troubles because package versions shifted since
last update.
DomThePorcupine [email protected] schrieb am Do., 17. Dez. 2015 um
08:01 Uhr:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NobbZ
So drop
apt-get upgrade
in favor ofapt-get update
?