User Tools

Site Tools


doc:appunti:linux:sa:grml

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:appunti:linux:sa:grml [2023/11/30 10:57] – [Create a new partition into the USB stick] niccolodoc:appunti:linux:sa:grml [2023/12/12 12:45] – [Customize the environment and save the config.tbz] niccolo
Line 15: Line 15:
   - Create the USB boot stick from the **GRML ISO image**.   - Create the USB boot stick from the **GRML ISO image**.
   - Create a **new GRMLCFG partition** into the USB stick.   - Create a **new GRMLCFG partition** into the USB stick.
-  - Customize the GRML environment at your will and create a **config.tbz**; copy the file into the new partition. +  - Customize the GRML environment at your will and create a **config.tbz**. Copy the file into the new partition. 
-  - Create a **scrits/** directory into the partition containing scripts to be run at boot.+  - Create a **scripts/** directory into the partition containing the scripts to be run at boot.
  
 ==== Create the USB stick from the ISO image ==== ==== Create the USB stick from the ISO image ====
Line 50: Line 50:
  
 <code> <code>
-mkfs.ext4 -F -F /dev/sdc3+mkfs.ext4 -F -F -L GRMLCFG /dev/sdc3
 </code> </code>
  
-The double option **-F** is required because the system thinks that the whole device is in use and cannot be formatted.+The double option **-F** is required because the system thinks that the whole device is in use and cannot be formatted. The special label **GRMLCFG** is required because GRML at boot searches for a device with that label and load the configuration from it.
  
 +==== Customize the environment and save the config.tbz ====
 +
 +Now it is time to customize your environment; check the **[[https://grml.org/config/grml-autoconfig.1.html|grml-autoconfig]]** man page about the options to automatically install **Debs**, **Configuration** and **Scripts** into a freshly booted GRML environment.
 +
 +You can for example:
 +
 +  * Generate an SSH RSA key running the **ssh-keygen** utility. The key will be saved into ''$HOME/.ssh/''.
 +  * Customize the shell by editing the **$HOME/.zsrc** file, e.g. by adding alias commands, customizing the **PATH** or other environment variables. etc.
 +  * Run and configure some programs that will save preferences into the **$HOME/**, e.g. the Midnight Commander **mc** will save its files into ''$HOME/.config/mc/''.
 +  * Create an ''$HOME/config/'' directory and place what you want in it. You will find that directory again at the next boot.
 +
 +At the end of the customization, run the GRML command:
 +
 +<code>
 +save-config -all
 +</code>
 +
 +A file named **config.tbz** will be saved into the current directory. The file is a //grml configuration archive//, which may contains several components: hidden files from the ''$HOME'' directory, modified files from the ''/etc/'' directory, etc.
 +
 +Mount the custom partition and copy the file into its root directory:
 +
 +<code>
 +mkdir /mnt/grmlcfg
 +mount /dev/sdc /mnt/grmlcfg
 +cp -p config.tbz /mnt/grmlcfg
 +</code>
 +
 +If you want to modify the **config.tbz** archive without re-creating it via the ''save-config'' command, you can extract the archive and then re-create it:
 +
 +<code bash>
 +mkdir config
 +cd config
 +tar jxvf ../config.tbz
 +# Do whatever you need to the extracted files...
 +mv ../config.tbz ../config.bak.tbz
 +tar jcvf ../config.tbz *
 +</code>
 +
 +==== Add scripts and other files to the USB ====
 +
 +If you want to have some scripts run at bootstrap by GRML, create a **script/** directory into the root of the custom USB partition, and place the scripts into it. During the execution of the script the partition will be mounted under **/mnt/grmlcfg/**.
 +
 +You can place also files into the partition, so e.g. you can install additional deb packages on-the-fly.
 +
 +====== Obsolete ======
 +
 +:!: **WARNING**: The following notes were taken in 2018 and may be out of date.
  
 ===== Boot via PXE ===== ===== Boot via PXE =====
Line 63: Line 110:
  
 Vedere [[install]]. Vedere [[install]].
 +
 ===== Personalizzazione ===== ===== Personalizzazione =====
  
 La partizione VFAT quando il sistema live è avviato, risulta accessibile sotto **''/lib/live/mount/medium/''**. La partizione VFAT quando il sistema live è avviato, risulta accessibile sotto **''/lib/live/mount/medium/''**.
- 
-FIXME (Verificare se funziona davvero) Se nella chiavetta USB contenente GRML si crea un archivio **''config.tbz''**, questo verrà scompattato subito dopo l'avvio a partire dalla directory radice. L'archivio deve essere un **//grml configuration archive//**, abbreviato GCA. 
- 
-FIXME (Verificare se funziona davvero) dopo l'autoconfigurazione viene eventualmente eseguito lo script **''DCSDIR/scrips/grml.sh''**. Vedere il paragrafo [[http://grml.org/config/grml-autoconfig.1.html|Determination of DCS directory]], dovrebbe trattarsi comunque della directory radice della partizione VFAT. 
  
 La via più comoda di avere una GRML personalizzata è passare il parametro **''netconfig=server/archivio.tar.bz2''** al boot prompt. L'archivio viene scompattato subito dopo l'avvio a partire dalla directory radice, ovviamente è necessario che la macchina abbia accesso alla rete. La via più comoda di avere una GRML personalizzata è passare il parametro **''netconfig=server/archivio.tar.bz2''** al boot prompt. L'archivio viene scompattato subito dopo l'avvio a partire dalla directory radice, ovviamente è necessario che la macchina abbia accesso alla rete.
Line 107: Line 151:
 </file> </file>
  
-===== Web References =====+====== Web References ======
  
-  * [[http://grml.org/config/grml-autoconfig.1.html|grml-autoconfig]]+  * [[https://grml.org/online-docs/grml-config.html|grml-config]] 
 +  * [[https://grml.org/config/grml-autoconfig.1.html|grml-autoconfig]]
   * [[http://grml.org/cheatcodes/|CHEATCODES AND HINTS FOR GRML]]   * [[http://grml.org/cheatcodes/|CHEATCODES AND HINTS FOR GRML]]
  
doc/appunti/linux/sa/grml.txt · Last modified: 2024/01/26 18:04 by niccolo