everest-install/scripts/build.sh

154 lines
4.1 KiB
Bash
Raw Normal View History

2022-08-02 16:04:08 -04:00
#!/bin/sh
# Everest Linux 1.0.0-busybox - Stage 1 Installation Script
# This program is free software: See the GNU GPL v3.0 for details
printf "=== WELCOME TO EVEREST LINUX! ===\n"
printf "This program will do the following:\n"
sleep 0.2
printf " - Create the necessary directory layout (as defined by the Filesystem Hierarchy Standard)\n"
sleep 0.2
printf " - Load the build settings defined in the 'build-settings' file\n"
sleep 0.2
printf " - Bootstrap the Glacier package manager\n"
sleep 0.2
printf " - Compile Everest Linux v1.0.0-busybox\n"
sleep 0.2
2022-08-02 16:31:25 -04:00
printf "The following settings will be used. If these do not work, alter this script.\n"
sleep 0.2
printf "/mnt/everest - build directory\n"
sleep 0.2
printf "everest - build user\n"
sleep 0.2
printf "/bin/bash - shell for user\n"
sleep 0.2
2022-08-02 16:04:08 -04:00
printf "This script will perform actions that are >>> NOT REVERSIBLE! <<<\n"
sleep 0.2
read -p "Are you sure you want to continue? (y/n) " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
printf "[!!!] The script will execute in 10"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "9"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "8"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "7"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "6"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "5"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "4"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "3"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "2"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "1"
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "."
sleep 0.25
printf "0\n"
printf "[ i ] Loading build-settings file...\n"
./build-settings
printf "[ i ] Creating build directory...\n"
2022-08-02 16:31:25 -04:00
mkdir /mnt/everest # CHANGE THIS IF YOU DO NOT WANT YOUR BUILD DIRECTORY TO BE /mnt/everest
export EVEREST=/mnt/everest
2022-08-02 16:04:08 -04:00
printf "[ i ] Ensuring EVEREST variable is correctly set up... (output should be the path to the build directory)\n"
echo $EVEREST
printf "[ i ] Changing permissions...\n"
2022-08-02 16:31:25 -04:00
chmod 777 /mnt/everest
2022-08-02 16:04:08 -04:00
printf "[ i ] Creating sources directory...\n"
2022-08-02 16:31:25 -04:00
mkdir -pv $EVEREST/sources
2022-08-02 16:04:08 -04:00
printf "[ i ] Downloading packages...\n"
2022-08-02 16:31:25 -04:00
mkdir -pv tempfiles
2022-08-02 16:04:08 -04:00
cd tempfiles
2022-08-02 16:31:25 -04:00
wget --quiet --show-progress http://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.bz2
wget --quiet --show-progress http://busybox.net/downloads/busybox-1.24.2.tar.bz2
wget --quiet --show-progress https://github.com/cross-lfs/bootscripts-embedded/archive/master.tar.gz
wget --quiet --show-progress http://gcc.gnu.org/pub/gcc/releases/gcc-6.2.0/gcc-6.2.0.tar.bz2
wget --quiet --show-progress http://ftp.gnu.org/gnu/gmp/gmp-6.1.1.tar.bz2
wget --quiet --show-progress http://sethwklein.net/iana-etc-2.30.tar.bz2
wget --quiet --show-progress http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.22.tar.xz
wget --quiet --show-progress http://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
wget --quiet --show-progress http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.bz2
wget --quiet --show-progress http://www.musl-libc.org/releases/musl-1.1.16.tar.gz
2022-08-02 16:04:08 -04:00
printf "[ i ] Downloading patches...\n"
2022-08-02 16:31:25 -04:00
wget --quiet --show-progress http://patches.clfs.org/embedded-dev/iana-etc-2.30-update-2.patch
2022-08-02 16:04:08 -04:00
printf "[ i ] Double checking EVEREST variable is correct...\n"
echo $EVEREST
printf "[ i ] Creating user for build...\n"
groupadd everest
2022-08-02 16:31:25 -04:00
useradd -s /bin/bash -g everest -m -k /dev/null everest
2022-08-02 16:04:08 -04:00
printf "[ ? ] Enter a password for the new user:\n"
passwd everest
printf "[ i ] Giving ownership of build directory to the new user...\n"
chown -Rv everest $EVEREST
2022-08-02 16:31:25 -04:00
printf "[ i ] The stage 1 installation has now finished.\n"
#printf "su - everest"
printf "[ i ] Please execute the stage 2 installation.\n"
2022-09-01 07:59:31 -04:00
cd ../..
mv everest-install ${EVEREST}/tmp
2022-08-02 16:04:08 -04:00
su - everest
2022-08-02 16:31:25 -04:00
#printf "test"
2022-08-02 16:04:08 -04:00
fi