# Asking advices for customizing a RockyLinux based ISO with specific version of kernel

**URL:** <https://forums.rockylinux.org/t/asking-advices-for-customizing-a-rockylinux-based-iso-with-specific-version-of-kernel/5371>\
**Category:** Rocky Linux Help & Support\
**Created:** [February 15, 2022, 7:03am UTC](https://forums.rockylinux.org/t/asking-advices-for-customizing-a-rockylinux-based-iso-with-specific-version-of-kernel/5371 "2022-02-15T07:03:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diabloneo](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/diabloneo/32/1637_2.png) [@diabloneo](https://forums.rockylinux.org/u/diabloneo)\
**Post date:** [February 15, 2022, 7:03am UTC](https://forums.rockylinux.org/t/asking-advices-for-customizing-a-rockylinux-based-iso-with-specific-version-of-kernel/5371/1 "2022-02-15T07:03:01Z")

</div>

Hi,

I’m trying to make a RockyLinux based ISO which will install specific version of kernel, say 5.4 LTS, automatically. I have figured out a way to to this, see next section. But I still have questions:

1. Is it a good idea to replace the kernel related rpms in _BaseOS_, so the installation will install specific version of kernel by default?
2. Are there any other methods to to this?

## My way to do this

1. Download kernel 5.4 from [elrepo.org](http://elrepo.org), and put them in a directory _./localrepo_.
2. Make a repo with **createrepo** against _./localrepo_ directory.

Following is the resulting repo:

```auto
tmp/rocky8/
❯ tree localrepo
localrepo
├── Packages
│ ├── kernel-lt-5.4.179-1.el8.elrepo.x86_64.rpm
│ ├── kernel-lt-core-5.4.179-1.el8.elrepo.x86_64.rpm
│ └── kernel-lt-modules-5.4.179-1.el8.elrepo.x86_64.rpm
└── repodata
    ├── 5078e86eea6133a97495be8f38ac37fb057509fb3cb2c15d602c0acce22388f0-other.xml.gz
    ├── 52a88a26b19f84b7691d8beeb1d94fbfe983769d69ab9a86f4bec0d4f852dba0-primary.sqlite.bz2
    ├── c8082299e8d8093dbdbc7d31ce79ecd7b7aecd2ed5908f35795b8f2c6d42e632-filelists.sqlite.bz2
    ├── ceb4660fa015d54844913e066e130633f36e82386d5ba4e679d89856bb5a7954-other.sqlite.bz2
    ├── dc209f17d2b7d751f25b937e47d5ed5b576949780652ea756ccf1d27a9123d99-filelists.xml.gz
    ├── f0ae38968a117cf251220a4aa97a4e4ace55c221deb966ce639a8683e41732fe-primary.xml.gz
    └── repomd.xml

2 directories, 10 files

```

1. Extract Rocky Linux 8.5 ISO to _./iso_
2. Copy the localrepo I just created to _./iso/localrepo/_
3. Add a kickstart file in _./isolinux/custom.ks_:

```auto
#version=RHEL8
graphical
cdrom

repo --name="local" --baseurl=file:///run/install/sources/mount-0000-cdrom/localrepo

%packages
@^custom-environment
@standard
kexec-tools
kernel-lt
%end

keyboard --xlayouts='us'
lang en_US.UTF-8

network --hostname=localhost.localdomain

firstboot --enable

ignoredisk --only-use=sda
bootloader --append="crashkernel=auto" --location=mbr --boot-drive=sda
clearpart --all
part / --fstype="xfs" --ondisk=sda --size=39935
part /boot --fstype="xfs" --ondisk=sda --size=1024

timezone America/New_York --isUtc

rootpw --plaintext rocky

```

The **kernel-lt** package is kernel 5.4 LTS version.

1. Add an entry to _isolinux.cfg_:

```auto
label custom_linux
  menu label ^Install Customize Rocky Linux 8
  kernel vmlinuz
  append inst.ks=hd:LABEL=Rocky-8-5-x86_64-dvd:/isolinux/custom.ks initrd=initrd.img inst.stage2=hd:LABEL=Rocky-8-5-x86_64-dvd quiet

```

1. Create ISO using _genisoimage_ and _implantisomd5_

The **custom\_linux** entry in isolinux will install **kernel** (from BaseOS) and **kernel-lt** (from localrepo) both. After installation, the grub has three entries:

 ![NYDhA8uZG5](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/f/f8d28ca092448efd0284ecf353b51ffefac35a15.png)

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:55am UTC](https://forums.rockylinux.org/t/asking-advices-for-customizing-a-rockylinux-based-iso-with-specific-version-of-kernel/5371/2 "2023-08-25T03:55:09Z")

</div>


