11#! /bin/bash
2- ELEV=" ${ELEV:- " $ELEV " } "
3-
2+ ELEV=" ${ELEV:- sudo} "
43# Strict
54set -e # uo pipefail
65
76# DO NOT RUN AS ROOT // Will prompt when needed
87[ " $( id -u) " -eq 0 ] && echo " Error: Root not required." && exit 1
98
9+ THREADS=" ${THREADS:- $(nproc)} "
1010# Build stage 1 ISO with slight modifs
1111# Requires 'archiso'
12- # Requires 'pacman-contrib' if this is enabled
13- CACHING=" ${CACHING:- 1} "
14-
1512SILENT_MODE=" ${SILENT_MODE:- 0} "
16- CLEANUP=" ${CLEANUP:- 1} "
1713PRECLEAN=" ${PRECLEAN:- 0} "
18- THREADS =" ${THREADS :- $(nproc) } "
14+ CLEANUP =" ${CLEANUP :- 1 } "
1915LOG_FILE=" ${LOG_FILE:- 1} "
16+ # Requires 'pacman-contrib' if this is enabled
17+ CACHING=" ${CACHING:- 0} "
2018
2119SCRIPT_DIR=" $( cd " $( dirname " $0 " ) " && pwd) "
2220
@@ -81,7 +79,10 @@ echo "Copy releng profile..."
8179cp -r /usr/share/archiso/configs/releng/* " $PROFILE_DIR " || error_exit " Failed to copy releng profile"
8280
8381echo " Mod ISO name..."
84- sed -i ' s/^iso_name=.*/iso_name="ArchMod"/' " $PROFILE_DIR /profiledef.sh"
82+ sed -i ' s/^iso_name=.*/iso_name="EVOQUUS"/' " $PROFILE_DIR /profiledef.sh"
83+
84+ echo " Adding archinstoo to file_permissions..."
85+ sed -i ' /^file_permissions=(/a\ ["/usr/local/bin/archinstoo"]="0:0:755"' " $PROFILE_DIR /profiledef.sh"
8586
8687echo " Modifying COW overlay size..."
8788
@@ -102,16 +103,32 @@ cat >> "$PROFILE_DIR/airootfs/etc/motd" << EOF
102103
103104 Archinstoo Mods Projects
104105 Media Gen: ${BUILD_DATE}
106+
107+ Connect to the internet.
108+ Then 'archinstoo' for TUI installer.
105109
106110EOF
107111
108- # add git clone command to zsh history
109- # allows for arrow up fatser testing
112+ # add git clone command to zsh history
113+ # allows for arrow up faster testing
110114echo " Adding to zsh history..."
111115cat > " $PROFILE_DIR /airootfs/root/.zsh_history" << 'HISTEOF '
112- : 1728000000:0;pacman-key --init && git clone https://github.com/h8d13/archinstoo && cd archinstoo/archinstoo && python -m archinstall --debug
116+ : 1728000000:0;pacman-key --init && git clone https://github.com/h8d13/archinstoo && cd archinstoo/archinstoo && python -m archinstall --debug --advanced
113117HISTEOF
114118
119+ # add 'archinstoo' command to PATH
120+ echo " Adding archinstoo command..."
121+ mkdir -p " $PROFILE_DIR /airootfs/usr/local/bin"
122+ cat > " $PROFILE_DIR /airootfs/usr/local/bin/archinstoo" << 'CMDEOF '
123+ #!/bin/bash
124+ set -e
125+ pacman-key --init
126+ git clone https://github.com/h8d13/archinstoo /root/archinstoo
127+ cd /root/archinstoo/archinstoo
128+ exec python -m archinstall --debug "$@"
129+ CMDEOF
130+ chmod +x " $PROFILE_DIR /airootfs/usr/local/bin/archinstoo"
131+
115132echo " Styling pacman.conf (Color + ILoveCandy)..."
116133# Ensure pacman.conf exists in airootfs/etc
117134mkdir -p " $PROFILE_DIR /airootfs/etc"
@@ -154,6 +171,4 @@ echo "Restoring permissions..."
154171" $ELEV " chown -R " $USER " :" $USER " " $OUTPUT_DIR "
155172echo " "
156173
157- cleanup
158- exit 0
159- # done
174+ cleanup && exit 0
0 commit comments