dev.md: documentation corrected

This commit is contained in:
levasseur
2022-02-11 18:45:33 +01:00
parent 8c975cec0e
commit cc36f50279

View File

@@ -13,12 +13,16 @@
- [3.1.1. ```chroot_bootstrap```](#311-chroot_bootstrap) - [3.1.1. ```chroot_bootstrap```](#311-chroot_bootstrap)
- [3.2. Other functionnalities](#32-other-functionnalities) - [3.2. Other functionnalities](#32-other-functionnalities)
- [4. The diskman.sh file](#4-the-diskmansh-file) - [4. The diskman.sh file](#4-the-diskmansh-file)
- [4.1. Function](#41-function) - [4.1. Global warning](#41-global-warning)
- [4.2. Other functionnalities](#42-other-functionnalities) - [4.2. Function](#42-function)
- [4.2.1. ```blank_disk <bloc_device> [--full]```](#421-blank_disk-bloc_device---full)
- [4.2.2. ```is_blank <bloc_device>```](#422-is_blank--bloc_device)
- [4.3. Other functionnalities](#43-other-functionnalities)
- [5. The command_line.sh file](#5-the-command_linesh-file) - [5. The command_line.sh file](#5-the-command_linesh-file)
- [5.1. Functions](#51-functions) - [5.1. Functions](#51-functions)
- [5.1.1. ```read_commandline```](#511-read_commandline) - [5.1.1. ```read_commandline```](#511-read_commandline)
- [5.1.5. ```process_commandline_and_vars```](#515-process_commandline_and_vars) - [5.1.5. ```process_commandline_and_vars```](#515-process_commandline_and_vars)
- [5.2. Other functionnalities](#52-other-functionnalities)
- [6. The display.sh file](#6-the-displaysh-file) - [6. The display.sh file](#6-the-displaysh-file)
- [6.1. Functions](#61-functions) - [6.1. Functions](#61-functions)
- [6.1.1. ```prnt [-n] [I|W|E|m] <message>```](#611-prnt--n-iwem-message) - [6.1.1. ```prnt [-n] [I|W|E|m] <message>```](#611-prnt--n-iwem-message)
@@ -58,23 +62,24 @@
- [10. The services.sh file](#9-the-servicessh-file) - [10. The services.sh file](#9-the-servicessh-file)
- [10.1. Global dependencies](#101-global-dependencies) - [10.1. Global dependencies](#101-global-dependencies)
- [10.2. Functions](#102-functions) - [10.2. Functions](#102-functions)
- [10.2.1. ```exec_serv <service> <command>```](#1021-exec_serv-service-command) - [10.2.1. ```exec_serv <service> <command>```](#1021-exec_serv-service-command)
- [10.2.2. ```svc_start <service1> [service2 ... serviceN]```](#1022-svc_start-service1-service2--servicen) - [10.2.2. ```svc_start <service1> [service2 [... serviceN]]```](#1022-svc_start-service1-service2--servicen)
- [10.2.3. ```svc_reload <service1> [service2 ... serviceN]```](#1023-svc_reload-service1-service2--servicen) - [10.2.3. ```svc_reload <service1> [service2 [... serviceN]]```](#1023-svc_reload-service1-service2--servicen)
- [10.2.2. ```svc_restart <service1> [service2 ... serviceN]```](#1022-svc_restart-service1-service2--servicen) - [10.2.2. ```svc_restart <service1> [service2 [... serviceN]]```](#1022-svc_restart-service1-service2--servicen)
- [10.2.3. ```svc_stop <service1> [service2 ... serviceN]```](#1023-svc_stop-service1-service2--servicen) - [10.2.3. ```svc_stop <service1> [service2 [... serviceN]]```](#1023-svc_stop-service1-service2--servicen)
- [10.3. Other functionnalities](#103-other-functionnalities)
- [11. The support.sh file](#11-the-supportsh-file) - [11. The support.sh file](#11-the-supportsh-file)
- [11.1. Global behaviour](#111-global-behaviour) - [11.1. Global behaviour](#111-global-behaviour)
- [11.2. Functions](#112-functions) - [11.2. Functions](#112-functions)
- [11.2.1. ```disp_help```](#1121-disp_help) - [11.2.1. ```disp_help```](#1121-disp_help)
- [11.2.2. ```show_version```](#1122-show_version) - [11.2.2. ```show_version```](#1122-show_version)
- [11.3. Other functionnalities](#113-other-functionnalities) - [11.3. Other functionnalities](#113-other-functionnalities)
- [12. The utils.sh file](#12-the-utilssh-file) - [12. The utils.sh file](#12-the-utilssh-file)
- [12.1. Functions](#121-functions) - [12.1. Functions](#121-functions)
- [12.1.1. ```stdtime```](#1211-stdtime) - [12.1.1. ```stdtime```](#1211-stdtime)
- [12.1.2. ```function_exists <function_name>```](#1212-function_exists-function_name) - [12.1.2. ```function_exists <function_name>```](#1212-function_exists-function_name)
- [12.1.3. ```get_mod_name <module_file>```](#1213-get_mod_name-module_file) - [12.1.3. ```get_mod_name <module_file>```](#1213-get_mod_name-module_file)
- [12.1.4. ```set_system_proxy```](#1214-set_system_proxy) - [12.1.4. ```set_system_proxy```](#1214-set_system_proxy)
## 1. Getting started ## 1. Getting started
This is a developer's reference. It's not intended to be a manual, but a This is a developer's reference. It's not intended to be a manual, but a
@@ -103,8 +108,8 @@ without error and no check is done.
Trigger an error, print a back trace and exit the script, unless ```KEEPGOING``` Trigger an error, print a back trace and exit the script, unless ```KEEPGOING```
variable is set to true. In that situation, we just display a warning. variable is set to true. In that situation, we just display a warning.
If the parameter ```--force``` is given, we exit even if the KEEPGOING variable If the parameter ```--force``` is given, we exit even if the ```KEEPGOING```
is set to true. variable is set to true.
#### 2.1.3. ```noerror [--noout] <command>``` #### 2.1.3. ```noerror [--noout] <command>```
Allow the execution of a command bypassing the error management system. The Allow the execution of a command bypassing the error management system. The
@@ -121,8 +126,8 @@ command.
The simple integration of aaa_error.sh file into a script, will change the The simple integration of aaa_error.sh file into a script, will change the
entire script behavior regarding errors. The following Bash signals will be entire script behavior regarding errors. The following Bash signals will be
trapped: trapped:
- **```ERR```**: The ERR signal is triggered every time Bash encounters an - **```ERR```**: The ```ERR``` signal is triggered every time Bash encounters
error or if a command return a non-zero value. The function called on that an error or if a command return a non-zero value. The function called on that
signal will stop execution of the script, displaying an error message with error signal will stop execution of the script, displaying an error message with error
code and a back trace to help identify the error origin. Because of this code and a back trace to help identify the error origin. Because of this
behavior, the function supersedes the internal ```errexit``` Bash configuration behavior, the function supersedes the internal ```errexit``` Bash configuration
@@ -142,7 +147,7 @@ through the use of a *kill* command. The script will exit after cleanup.
#### 3.1.1. ```chroot_bootstrap``` #### 3.1.1. ```chroot_bootstrap```
That function is called if a chroot option have been given. It's in charge of That function is called if a chroot option have been given. It's in charge of
performing the chroot, copying a full working directory structure of init.sh performing the chroot, copying a full working directory structure of init.sh
tree. After that copy a chroot command is runned launching that new copy of tree. After that copy, a chroot command is runned launching that new copy of
init.sh. init.sh.
If the child init.sh end with error, the stage file is gathered in parent If the child init.sh end with error, the stage file is gathered in parent
@@ -163,24 +168,37 @@ your code when using those. By defaults the functions try to be as conservative
as they can, triguering errors on the smallest doubt. as they can, triguering errors on the smallest doubt.
### 4.2. Function ### 4.2. Function
#### 4.2.1. ```blank_disk <bloc_device>``` #### 4.2.1. ```blank_disk <bloc_device> [--full]```
Blank a block device using two different method to be sure it's all clear. First Blank a block device using two different method to be sure it's all clear. First
we use the *wipefs* method specialized in reseting all possible flags on the we use the *wipefs* method specialized in reseting all possible flags on the
drive and it's partitions. It will also blank the partition table. A second pass drive and it's partitions. It will also blank the partition table. A second pass
will fill the first 512 MB with zeroes to also blank MBR and other parts of the will fill the first 512 MB with zeroes to also blank MBR and other parts of the
drive wipefs would have ignored. drive wipefs would have ignored.
If the parameter ```--full``` is provided as second parameter, the entire disk
will be filled with zeroes. Please consider that such operation might take a
very long time (can be several hours).
That function only take parameter which must be a bloc device. That function only take parameter which must be a bloc device.
#### 4.2.2. ```is_blank <bloc_device>``` #### 4.2.2. ```is_blank <bloc_device>```
That function will try to detect if a drive is blank of not. It will return 0 if That function will try to detect if a drive is blank of not. It will return 0 if
the drive is blank, and return 1 otherwise. Please consider that special drive the drive is blank, and return 1 otherwise. If the function return 2, either the
configuration could be detected as blank while it's not. Only one parameter will provided parameter is not a block device or that block device do not exists.
be accepted, a bloc device. The bloc device you provide is suposed to be a whole
drive, not a partition. Please consider that special drive configuration could be detected as blank
while it's not. Only one parameter will be accepted, a bloc device.
The function will give different information depending on the bloc device you
test:
- on a whole disk drive it while return 0 if the drive is blank, meaning no MBR
and no partition table (either GTP or DOS);
- on a partition it will tell if it's formated or not. Beware that an erased
then recreated partion will continue to have old partition data available and
will be shown as non blank.
### 4.3. Other functionnalities ### 4.3. Other functionnalities
That file don't profide any other things that the previously listed functions. That file don't provide any other things that the previously listed functions.
## 5. The command_line.sh file ## 5. The command_line.sh file
### 5.1. Functions ### 5.1. Functions
@@ -222,7 +240,7 @@ character.
That function will also triger an error if the definitive module list is empty. That function will also triger an error if the definitive module list is empty.
### 5.2. Other functionnalities ### 5.2. Other functionnalities
That file don't profide any other things that the previously listed functions. That file don't provide any other things that the previously listed functions.
## 6. The display.sh file ## 6. The display.sh file
### 6.1. Functions ### 6.1. Functions
@@ -407,7 +425,7 @@ function is logicaly massively used during check phase to verify all source
directories are in place. directories are in place.
### 7.3. Other functionnalities ### 7.3. Other functionnalities
That file don't profide any other things that the previously listed functions. That file don't provide any other things that the previously listed functions.
## 8. The loaders.sh file ## 8. The loaders.sh file
### 8.1. Functions ### 8.1. Functions
@@ -436,7 +454,7 @@ If no configuration file can be found the function will trigger an error and
exit the script. exit the script.
### 8.2. Other functionnalities ### 8.2. Other functionnalities
That file don't profide any other things that the previously listed functions. That file don't provide any other things that the previously listed functions.
## 9. The pkgman.sh file ## 9. The pkgman.sh file
### 9.1. Global dependencies ### 9.1. Global dependencies
@@ -571,36 +589,36 @@ than two.
The function returns the exit code of the service command. The function returns the exit code of the service command.
#### 10.2.2. ```svc_start <service1> [service2 ... serviceN]``` #### 10.2.2. ```svc_start <service1> [service2 [... serviceN]]```
Start the services given in parmeters. You can give as many services you want. Start the services given in parmeters. You can give as many services you want.
That function relies on the previously documented exec_serv function. That function relies on the previously documented exec_serv function.
#### 10.2.3. ```svc_reload <service1> [service2 ... serviceN]``` #### 10.2.3. ```svc_reload <service1> [service2 [... serviceN]]```
Reload the configuration of the services given in parmeters. You can give as Reload the configuration of the services given in parmeters. You can give as
many services you want. Be careful using this as some services don't have that many services you want. Be careful using this as some services don't have that
capability. capability.
That function relies on the previously documented exec_serv function. That function relies on the previously documented exec_serv function.
#### 10.2.2. ```svc_restart <service1> [service2 ... serviceN]``` #### 10.2.2. ```svc_restart <service1> [service2 [... serviceN]]```
Restart the services given in parmeters. It consist generally in a stop Restart the services given in parmeters. It consist generally in a stop
immediately followed by a start. You can give as many services you want. immediately followed by a start. You can give as many services you want.
That function relies on the previously documented exec_serv function. That function relies on the previously documented exec_serv function.
#### 10.2.3. ```svc_stop <service1> [service2 ... serviceN]``` #### 10.2.3. ```svc_stop <service1> [service2 [... serviceN]]```
Stop the services given in parmeters. You can give as many services you want. Stop the services given in parmeters. You can give as many services you want.
That function relies on the previously documented exec_serv function. That function relies on the previously documented exec_serv function.
### 10.3. Other functionnalities ### 10.3. Other functionnalities
That file don't profide any other thing that the previously listed functions. That file don't provide any other thing that the previously listed functions.
## 11. The support.sh file ## 11. The support.sh file
### 11.1. Global behaviour ### 11.1. Global behaviour
That file is designed to just display information. It only contains code that That file is designed to just display information. It only contains code that
don't requires any special writes, and do nothing to the system. The idea is to don't requires any special rights, and do nothing to the system. The idea is to
have the minimal sets of dependencies. As it's sometimes using colors to display have the minimal sets of dependencies. As it's sometimes using colors to display
results, it depends only on color code declaration in the ```display.sh``` file. results, it depends only on color code declaration in the ```display.sh``` file.
@@ -618,7 +636,7 @@ If user is not root an additionnal warning will be displayed to warn the fact
the script requires root privileges to work properly. the script requires root privileges to work properly.
### 11.3. Other functionnalities ### 11.3. Other functionnalities
That file don't profide any other thing that the previously listed functions. That file don't provide any other thing that the previously listed functions.
## 12. The utils.sh file ## 12. The utils.sh file
### 12.1. Functions ### 12.1. Functions
@@ -650,7 +668,7 @@ That function takes no parameters and only change ```http_proxy``` and
```https_proxy``` standard POSIX variables. No usefull result will be returned. ```https_proxy``` standard POSIX variables. No usefull result will be returned.
### 12.2. Other functionnalities ### 12.2. Other functionnalities
That file don't profide any other thing that the previously listed functions. That file don't provide any other thing that the previously listed functions.
## 13. The version.sh file ## 13. The version.sh file
### 13.1. Functions ### 13.1. Functions
@@ -696,7 +714,7 @@ The following global variables will be set at the end of the execution:
The ```SYS_CODE``` variable won't be set if your distribution provides no codename. The ```SYS_CODE``` variable won't be set if your distribution provides no codename.
### 13.2. Other functionnalities ### 13.2. Other functionnalities
That file don't profide any other thing that the previously listed functions. That file don't provide any other thing that the previously listed functions.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------