Skip to content

Commit

Permalink
DOC: some additions
Browse files Browse the repository at this point in the history
  • Loading branch information
alealexpro100 committed Jan 27, 2023
1 parent 9af50e9 commit 0dec5d5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ See presentation of this project [here](https://mirror.alexpro100.ru/scripts_fil

* Download latest `linux_install-*.pxe.tar.gz` file from [releases](https://github.com/alealexpro100/linux_install/releases).
* Unpack it to boot server. Variable `${linux_url}` is a url to directory with needed files.
* To boot it from [IPXE](https://ipxe.org/) there is two necessary kernel options: `modloop=${linux_url}/modloop-lts rootfs_net=${linux_url}/rootfs.img`.
* To boot it from [IPXE](https://ipxe.org/) there is two necessary kernel options: `modloop=${linux_url}/modloop-lts rootfs_net=${linux_url}/rootfs.img BOOTIF=01-${netX/mac}`.
* Follow install instructions.
* That's all. You have installed system. Good luck!

Expand Down
43 changes: 37 additions & 6 deletions docs/distr.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
linux_install (distros)
=======================
linux_install (distr directory)
===============================

You can add you own distro to this directory. It is called 'distro implementation'. There are some notes about making it.

### Structure
## Structure

* `rootfs` - directory with files, that will be placed after in `common_actions_1.sh` (after bootstrap, but before chroot).
* `distr_actions.sh` - executed while running `install_sys.sh`. It is main installation part of specific distro.
* `distr_options.sh` - executed while running `profile_gen.sh`. Asks options of specific distro.

### Notes
* It is necessary to look for an example distribution. See `alpine`, simpliest implementation.
## Notes

* Debian implementation can be used also for ubuntu or other deb-based OS. See `astra` implementation.
* Every distro implementation guarantees that an installed system (using live installer) will be bootable, able to connect to network and usable through SSH (if chosen).
* Use `common_options.sh` file and place rootfs unpacker to `./bin` directory. Every rootfs unpacker have to use only mirror with needed packages, not bootstrap file.
* Use `common_options.sh` file and place rootfs unpacker to `./bin` directory. Every rootfs unpacker have to use only mirror with needed packages, not bootstrap file.

## Distribution notes

### Alpine

This is the simplest implementation of OS install.
It is the most commented distro install implementation, so You should see it if you want to create your own implementation.
In fact live installer is based on this installer too, so it is really guaranteed to be correct.
And, as a result of being simple, there are no graphics or user-oriented options.

### Debian

Powerful installer for debian, which can be easily converted to be used to install other deb-based systems.
Astra install implementation is based on it. Use symbolic links to use files for your own implementation.
Supports various version of debian, starting with `stretch` version.

### Astra

Nothing interesting, beside it demonstrates how author tries to bypass bugs and un-fixable problems of AstraLinux.

### Archlinux

This is implementation for various arch-based distros, not only Archlinux.
It is oriented to be used by user, so it has variety of different options.

### Voidlinux

Looks like alpine install implementation.
It is pretty simple too.
Supports both glibc and musl revisions.
17 changes: 13 additions & 4 deletions lib/common/lib_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function calc_ui_terminal() {

# Generate menu. Reads by lines and return array of it.
# Used for whiptail or dialog in read_params to show menus.
# Example: "$(gen_menu < <(echo -e "glibc\nmusl"))"
function gen_menu() {
local tmp_gen_menu=() i=0
while IFS=$'\n' read -r var; do
Expand All @@ -25,21 +26,25 @@ function gen_menu() {
# Print info
# Use it with read_param.
# Please do not use `msg_print` by yourself in user-mode step.
# Syntax: print_param {note|warn|err|*} [TEXT]
# Example: print_param note "Your carrot is here."
function print_param() {
case $ECHO_MODE in
whiptail|dialog)
calc_ui_terminal
local print_type=$1 text="$2" dialog="$3"
local options=("$ECHO_MODE" "--cancel-button" "$M_CANCEL_BUTTON" "--backtitle" "$M_PROJECT_NAME $LI_VERSION.")
"${options[@]}" --msgbox "$text$dialog" ${ui_terminal[0]} ${ui_terminal[1]}
"${options[@]}" "--msgbox" "$text$dialog" ${ui_terminal[0]} ${ui_terminal[1]}
;;
auto|cli|*)
local print_type=$1 text="$2"
local print_type=$1 text="$2$3"
msg_print "$print_type" "$text"
;;
esac
}

# Function to go back in history. Uses eval, but still pretty safe.
# This function is recursive, so be cautious when editing it.
function history_read_param() {
[[ $1 != "0" ]] || return_err "Operation cancelled by user!"
local params_h=() i_var
Expand All @@ -49,7 +54,7 @@ function history_read_param() {
read_param "${params_h[@]}"
}

#Enter parametres.
# Enter parameters.
# Supported modes:
# * auto (no user input);
# * cli (for plain terminals or automation);
Expand All @@ -58,7 +63,11 @@ function history_read_param() {
# Only whiptail or dialog mode has support for using history.
# Other modes still write history.
# Options:
# NO_HISTORY=1 - Prevents current command to be kept in history. Does not affect variable set.
# * NO_HISTORY=1 - Prevents current command to be kept in history. Does not affect variable set.
# * NO_VAR=1 - Do not set variable in local environment. From function `add_var`.
# Syntax: read_param [TEXT] [DIALOG] {0-99} [VARIABLE] {yes_or_no|no_or_yes|text|text_empty|secret|secret_empty|menu|menu_var} [ADDITIONAL_PARAMS]
# Example 1: read_param "" "${M_VAR_DESCRIPTION[$var]:-$var}" "" "$var" yes_or_no
# Example 2: NO_VAR=1 NO_HISTORY=1 read_param "$M_DEB_REPO_TEXT\n" "$M_LIST_DIALOG" "0" repos menu "$(gen_menu < <(echo -e "$vars_list"))"
function read_param() {
# shellcheck disable=SC2034
local text="$1" dialog="$2" default_var=$3 var=$4 option=$5 tmp='' i_var params=() params_h=()
Expand Down

0 comments on commit 0dec5d5

Please sign in to comment.