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
doc:appunti:linux:sa:grml [2023/11/30 11:56] – [Web References] niccolodoc:appunti:linux:sa:grml [2025/10/03 16:51] (current) – [Add scripts and other files to the USB] 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 38: Line 38:
 The option **%%--wipe never%%** is required because the device contains an **iso9660 signature** that otherwise will be removed by the write command. The option **%%--wipe never%%** is required because the device contains an **iso9660 signature** that otherwise will be removed by the write command.
  
-Using the **n** key to **add a new partition** it is possible to create the ''/dev/sdc3'' partition, which I decided to size at 5 Gb. Select **p** (//print the partition table//) and **w** (//write table to disk and exit//) to finalize the partitioning, using the following schema as a reference:+Using the **n** key to **add a new partition** it is possible to create the ''/dev/sdc3'' partition, which I decided to size at 5 Gb. 
 + 
 +<code> 
 +Command (m for help): n 
 +Partition type 
 +Select (default p): p 
 +Partition number (3,4, default 3): 
 +First sector (1751040-122879999, default 1751040): 
 +Last sector, +/-sectors or +/-size{K,M,G,T,P} (1751040-122879999, default 122879999): +5G 
 +</code> 
 + 
 +Select **p** (//print the partition table//) and **w** (//write table to disk and exit//) to finalize the partitioning, using the following schema as a reference:
  
 <code> <code>
Line 57: Line 68:
 ==== Customize the environment and save the config.tbz ==== ==== Customize the environment and save the config.tbz ====
  
-Now it is time to customize your environment; you can for example:+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/''.   * 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.+  * Customize the shell by editing the **$HOME/.zshrc** 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/''.   * 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.   * Create an ''$HOME/config/'' directory and place what you want in it. You will find that directory again at the next boot.
Line 76: Line 89:
 <code> <code>
 mkdir /mnt/grmlcfg mkdir /mnt/grmlcfg
-mount /dev/sdc /mnt/grmlcfg+mount /dev/sdc3 /mnt/grmlcfg
 cp -p config.tbz /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> </code>
  
Line 85: Line 109:
  
 You can place also files into the partition, so e.g. you can install additional deb packages on-the-fly. You can place also files into the partition, so e.g. you can install additional deb packages on-the-fly.
 +
 +Here it is an example of script named **scripts/grml.sh** placed into the GRMLCFG partition to load the Italian keymap and to configure the keys to get braces:
 +
 +<code>
 +#!/bin/sh
 +echo "=== Execution of \"$0\" ==="
 +loadkeys it
 +loadkeys /root/config/custom-key.map
 +</code>
 +
 +The file **/root/config/custom-key.map** contains:
 +
 +<file>
 +shift altgr keycode 26 = braceleft
 +shift altgr keycode 27 = braceright
 +</file>
  
 ====== Obsolete ====== ====== Obsolete ======
Line 101: Line 141:
  
 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) 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.
doc/appunti/linux/sa/grml.1701341813.txt.gz · Last modified: by niccolo