everest-install/scripts/build-2.sh

45 lines
1.3 KiB
Bash
Raw Normal View History

2022-08-02 22:32:50 -04:00
#!/bin/sh
# Everest Linux 1.0.0-busybox - Stage 2 Installation Script
# This program is free software: See the GNU GPL v3.0 for details
2022-08-04 17:21:39 -04:00
printf "[ !!! ] WARNING! DO NOT RUN THIS SCRIPT AS ROOT!\n"
printf "[ i ] Starting in 10 seconds.\n"
sleep 10
2022-08-02 22:32:50 -04:00
printf "[ i ] Starting stage 2 installation...\n"
sleep 0.5
printf "[ i ] Creating bash configuration files...\n"
cat > ~/.bash_profile << "EOF"
exec env -i HOME=${HOME} TERM=${TERM} PS1='\u:\w\$ ' /bin/bash
EOF
cat > ~/.bashrc << "EOF"
set +h
umask 022
EVEREST=/mnt/everest
LC_ALL=POSIX
PATH=${EVEREST}/cross-tools/bin:/bin:/usr/bin
export EVEREST LC_ALL PATH
EOF
printf "[ i ] Sourcing .bash_profile...\n"
source ~/.bash_profile
printf "[ i ] Unsetting CFLAGS...\n"
unset CFLAGS
echo unset CFLAGS >> ~/.bashrc
printf "[ i ] Setting build variables...\n"
export EVEREST_HOST=$(echo ${MACHTYPE} | sed "s/-[^-]*/-cross/")
export EVEREST_TARGET=x86_64-linux-musl
export EVEREST_CPU=k8
printf "[ i ] Setting CPU architecture..\n"
export EVEREST_ARCH="x86"
printf "[ i ] Adding build variables to .bashrc...\n"
echo export EVEREST_HOST=\""${EVEREST_HOST}\"" >> ~/.bashrc
echo export EVEREST_TARGET=\""${EVEREST_TARGET}\"" >> ~/.bashrc
echo export EVEREST_ARCH=\""${EVEREST_ARCH}\"" >> ~/.bashrc
echo export EVEREST_CPU=\""${EVEREST_CPU}\"" >> ~/.bashrc