Skip to content

Commit

Permalink
Add archinstall to software section
Browse files Browse the repository at this point in the history
  • Loading branch information
stevleibelt committed Jun 22, 2024
1 parent 938efd3 commit ecff079
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ At the end, you only need to dd the iso to your favorit usb drive, use [venotoy]

This iso comes with some batteries included.

* Git
* Vim
* [archinstall](https://github.com/archlinux/archinstall) in `/root/software/archinstall` including a `start_archinstall.sh`
* [arch-linux-configuration](https://github.com/stevleibelt/arch-linux-configuration) in `/root/software/arch-linux-configuration`
* This repository has a [recover](https://github.com/stevleibelt/arch-linux-configuration/tree/master/scripts/zfs/recover) section to ease up fixing broken installations
* [downgrade](https://github.com/pbrisbin/downgrade) to the image in the path `/root/software/downgrade`
Expand All @@ -29,6 +28,8 @@ This iso comes with some batteries included.
* This repository has a [unix](https://github.com/stevleibelt/General_Howtos/tree/master/operation_system/unix) knowledge section inside
* This repository has a [zfs](https://github.com/stevleibelt/General_Howtos/tree/master/filesystem/zfs) knowledge section inside
* And much more knowledge
* Git
* Vim

## Howto

Expand Down
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ function add_files ()
cp "${PATH_TO_THIS_SCRIPT}/source/replace_zfsbootmenu.sh" "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/zfsbootmenu/"
exit_if_last_exit_code_is_not_zero ${?} "Copy of >>${PATH_TO_THIS_SCRIPT}/source/replace_zfsbootmenu.sh<< to >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/zfsbootmenu/<< failed."

_echo_if_be_verbose " Adding repository >>archinstall<< "
git clone https://github.com/archlinux/archinstall "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall<< failed."
cp "${PATH_TO_THIS_SCRIPT}/source/start_archinstall.sh" "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall/"
exit_if_last_exit_code_is_not_zero ${?} "Copy of >>${PATH_TO_THIS_SCRIPT}/source/start_archinstall.sh<< to >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall/<< failed."

_echo_if_be_verbose " Adding repository >>general_howtos<< "
git clone https://github.com/stevleibelt/general_howtos "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos<< failed."
Expand Down
56 changes: 56 additions & 0 deletions source/start_archinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
#####
# Tries to find existing zfsbootmenu.EFI file and replace this with another one
# Creates a backup of the existing file
####
# @since: 2023-11-10
# @author: stev leibelt <[email protected]>
####

function _echo_if_be_verbose ()
{
if [[ ${BE_VERBOSE} -eq 1 ]];
then
echo "${@}"
fi
}

function _exit_if_last_exit_code_is_not_zero ()
{
local ERROR_MESSAGE
local LAST_COMMAND
local LAST_EXIT_CODE

ERROR_MESSAGE="${2:-'Something went wrong'}"
LAST_COMMAND="${@:2}"
LAST_EXIT_CODE="${1:-1}"

if [[ ${LAST_EXIT_CODE} -ne 0 ]];
then
echo ":: Error"
echo " Last exit code >>${LAST_EXIT_CODE}<<"
echo " Last command >>${LAST_COMMAND}<<"
echo " >>${ERROR_MESSAGE}<<."

exit "${LAST_EXIT_CODE}"
fi
}

function _main ()
{
local BASEPATH_OF_THIS_SCRIPT

BASEPATH_OF_THIS_SCRIPT=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)

if [[ ${UID} != 0 ]];
then
echo ":: Script needs to be executed as root"

exit 10
fi

# ref: https://github.com/archlinux/archinstall?tab=readme-ov-file#running-the-guided-installer-using-git
python -m archinstall
}

_main "${@}"

0 comments on commit ecff079

Please sign in to comment.