Add wget to list of dependencies. Add prep_host function. Add source code downloading...
authorJason Self <j@jxself.org>
Sat, 19 Aug 2017 23:31:23 +0000 (16:31 -0700)
committerJason Self <j@jxself.org>
Sat, 19 Aug 2017 23:31:23 +0000 (16:31 -0700)
keyring.gpg [new file with mode: 0644]
stage0.sh
urls [new file with mode: 0644]

diff --git a/keyring.gpg b/keyring.gpg
new file mode 100644 (file)
index 0000000..a3d300b
Binary files /dev/null and b/keyring.gpg differ
index 31a695a0830941a3d675017766e749fb76dd4c07..e50426be990f31df74a03696d9e8a13b1c7d38a4 100755 (executable)
--- a/stage0.sh
+++ b/stage0.sh
@@ -26,9 +26,13 @@ check_if_root () {
     fi
 }
 
+get_source_code () {
+    wget -P /$distro/usr/src/release -i urls
+}
+
 install_dependencies () {
     # TODO: Implement support for other package managers
-    packages=( binutils bison g++ gawk gcc lzip m4 make patch texinfo xz-utils )
+    packages=( binutils bison g++ gawk gcc lzip m4 make patch texinfo wget xz-utils )
     for i in "${packages[@]}"
     do
         if ! dpkg -s "$i" &> /dev/null ; then
@@ -48,6 +52,35 @@ make_bin_sh_point_to_bash () {
     fi
 }
 
+prep_host () {
+    if [ ! -d /$distro/toolchain ]; then
+        mkdir -p /$distro/toolchain
+    fi
+    ln -sf /$distro/toolchain /
+    groupadd $distro
+    useradd -s /bin/bash -g $distro -m -k /dev/null $distro
+    chown $distro /$distro/toolchain
+    if [ ! -d /$distro/usr/src/release ]; then
+        mkdir -p /$distro/usr/src/release;
+        chmod a+wt /$distro/usr/src/release
+    fi
+    chown $distro /$distro/usr/src/release
+cat > /home/$distro/.bash_profile << "EOF"
+exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
+EOF
+cat > /home/$distro/.bashrc << "EOF"
+set +h
+umask 022
+distro=selfix
+LC_ALL=POSIX
+SELFIX_TGT=$(uname -m)-selfix-linux-gnu
+PATH=/toolchain/bin:/bin:/usr/bin
+export distro LC_ALL SELFIX_TGT PATH
+EOF
+}
+
 check_if_root
 install_dependencies
-make_bin_sh_point_to_bash
\ No newline at end of file
+make_bin_sh_point_to_bash
+prep_host
+get_source_code
\ No newline at end of file
diff --git a/urls b/urls
new file mode 100644 (file)
index 0000000..47e2b71
--- /dev/null
+++ b/urls
@@ -0,0 +1,2 @@
+ftp://ftp.astron.com/pub/file/file-5.31.tar.gz
+ftp://ftp.astron.com/pub/file/file-5.31.tar.gz.asc
\ No newline at end of file