Creare una ISO Rocky Linux personalizzata
Introduction¶
Potrebbe essere necessario creare una ISO personalizzata per varie ragioni. Si potrebbe voler cambiare il processo di boot, aggiungere pacchetti specifici o aggiornare un file di configurazione.
Questa guida spiega come costruire la propria ISO di Rocky Linux dall'inizio alla fine.
Prerequisites¶
- Una macchina 64-bit con Rocky Linux 9
- Un'immagine ISO DVD di Rocky Linux 9
- Un file
kickstartda applicare alla ISO - Leggere la documentazione Lorax Quickstart e mkksiso per familiarizzare con la creazione di
Anacondaboot.iso.
Package installation and setup¶
- Install the
loraxpackage:
sudo dnf install -y lorax
Building the ISO with a kickstart file¶
- Eseguire il comando
mkksisoper aggiungere un filekickstarte quindi creare una nuova ISO:
mkksiso --ks <0> <1> <2>
- Di seguito è riportato un esempio di file
kickstart, ovveroexample-ks.cfg, il quale imposta un ambienteServer With GUIRocky Linux 9.5:
lang en_GB
keyboard --xlayouts='us'
timezone Asia/Tokyo --utc
reboot
cdrom
bootloader --append="rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M"
zerombr
clearpart --all --initlabel
autopart
network --bootproto=dhcp
firstboot --disable
selinux --enforcing
firewall --enabled
%packages
@^server-product-environment
%end
Adding a repository with its packages to an ISO image¶
- Make sure the repository you want to add has the
repodatadirectory inside of it. Se così non è, è possibile crearla utilizzando il comandocreaterepo_c, è possibile installarlo con `sudo dnf install -y createrepo_c - Add the repository to your
kickstartfile, using the following syntax:
repo --name=extra-repo --baseurl=file:///run/install/repo/<0>/
- Add your repository using the
--addflag with themkksisotool:
mkksiso --add <0> --ks <1> <2> <3>
- Si possono vedere dettagli aggiuntivi di questo processo utilizzando il repository
baseosnell'esempio a seguire. - Il repository
base ossarà scaricato localmente assieme a tutti i suoi pacchetti:
dnf reposync -p ~ --download-metadata --repo=baseos
- Successivamente aggiungere il repository al file
kickstart:
repo --name=extra-repo --baseurl=file:///run/install/repo/baseos/
- Il file
kickstartha l'aspetto seguente:
lang en_GB
keyboard --xlayouts='us'
timezone Asia/Tokyo --utc
reboot
cdrom
bootloader --append="rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M"
zerombr
clearpart --all --initlabel
autopart
network --bootproto=dhcp
firstboot --disable
selinux --enforcing
firewall --enabled
%packages
@^server-product-environment
repo --name=extra-repo --baseurl=file:///run/install/repo/baseos/
%end
- Then point the
mkksisocommand directly to the repository directory and build the ISO:
mkksiso --add ~/baseos --ks example-ks.cfg ~/Rocky-9.5-x86_64-dvd.iso ~/Rocky-9.5-x86_64-dvd-new.iso
Conclusion¶
Qui condivido alcune opzioni per modificare e creare la vostra ISO Rocky Linux. Per ulteriori modi, tra cui la modifica degli argomenti della riga di comando del kernel, l'autore consiglia vivamente di consultare la documentazione di mkksiso in modo più dettagliato.
Author: Howard Van Der Wal
Contributors: Steven Spencer, Ganna Zhyrnova