Custom CentOS8/RHEL8 ISO Kernel

[root@AspireM home]# mkdir /home/Custom_CentOS_8_Kernel_6/
[root@AspireM home]# mount -o loop CentOS-Stream-8-x86_64-20230112-dvd1.iso /mnt/iso/
mount: /mnt/iso: WARNING: device write-protected, mounted read-only.

<!–more–>[root@AspireM home]# ls /mnt/iso/
AppStream BaseOS EFI images isolinux LICENSE media.repo TRANS.TBL
[root@AspireM home]# cd /mnt/iso/
[root@AspireM iso]# cp -ri * /home/Custom_CentOS_8_Kernel_6/
[root@AspireM iso]# cp -vf .??* /home/Custom_CentOS_8_Kernel_6/
‘.discinfo’ -&gt; ‘/home/Custom_CentOS_8_Kernel_6/.discinfo’
‘.treeinfo’ -&gt; ‘/home/Custom_CentOS_8_Kernel_6/.treeinfo’
[root@AspireM iso]# cd /home/Custom_CentOS_8_Kernel_6/
[root@AspireM Custom_CentOS_8_Kernel_6]# cp /mnt/iso/BaseOS/repodata/*comps*.xml BaseOS/comps_base.xml
[root@AspireM Custom_CentOS_8_Kernel_6]# cp /mnt/iso/AppStream/repodata/*comps*.xml AppStream/comps_app.xml
[root@AspireM Custom_CentOS_8_Kernel_6]# rm -rf BaseOS/repodata/*
[root@AspireM Custom_CentOS_8_Kernel_6]# rm -rf AppStream/repodata/*
[Remove old kernel rpm and add wanted kernel or other rpm packages into BaseOS/AppStream Package folder before createrepo]
[root@AspireM Custom_CentOS_8_Kernel_6]# rm -rf BaseOS/Packages/bpftool-4.18.0-408.el8.x86_64.rpm kernel-abi-stablelists-4.18.0-408.el8.noarch.rpm perf-4.18.0-408.el8.x86_64.rpm python3-perf-4.18.0-408.el8.x86_64.rpm
[root@AspireM Custom_CentOS_8_Kernel_6]# rm -rf BaseOS/Packages/kmod-kvdo-6.2.6.14-86.el8.x86_64.rpm
[root@AspireM Custom_CentOS_8_Kernel_6]# rm -rf BaseOS/Packages/kmod-kvdo-6.2.6.14-86.el8.x86_64.rpm
[root@AspireM Custom_CentOS_8_Kernel_6]# rm -rf BaseOS/Packages/vdo-*
[root@AspireM Custom_CentOS_8_Kernel_6]# rm -rf BaseOS/Packages/ksc-1.9-2.el8.noarch.rpm
[root@AspireM Custom_CentOS_8_Kernel_6]# createrepo -g comps_app.xml AppStream/
[root@AspireM Custom_CentOS_8_Kernel_6]# createrepo -g comps_base.xml BaseOS/
[root@AspireM Custom_CentOS_8_Kernel_6]# chmod 664 isolinux/isolinux.bin
[root@AspireM Custom_CentOS_8_Kernel_6]# cp /mnt/iso/AppStream/repodata/fd4e75326b80524bcdde4512878dd99a5f7f994762fd48b1aaabe98b4406d631-modules.yaml.gz AppStream/
[root@AspireM Custom_CentOS_8_Kernel_6]# cd AppStream/
[root@AspireM AppStream]# gunzip fd4e75326b80524bcdde4512878dd99a5f7f994762fd48b1aaabe98b4406d631-modules.yaml.gz
[root@AspireM AppStream]# cp fd4e75326b80524bcdde4512878dd99a5f7f994762fd48b1aaabe98b4406d631-modules.yaml modules.yaml
[root@AspireM AppStream]# cd ..
[root@AspireM Custom_CentOS_8_Kernel_6]# modifyrepo_c –mdtype=modules AppStream/modules.yaml AppStream/repodata/
[root@AspireM Custom_CentOS_8_Kernel_6]# mkisofs -o /tmp/new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat –no-emul-boot –boot-load-size 4 –boot-info-table -joliet-long -r -T -J -V “CentOS-Stream-8-x86_64-dvd” .

Test packages dependencies after modification
[root@AspireM Custom_CentOS_8_Kernel_6]# mkdir /tmp/testdb
[root@AspireM Custom_CentOS_8_Kernel_6]# rpm –initdb –dbpath /tmp/testdb
[root@AspireM Custom_CentOS_8_Kernel_6]# rpm –test –dbpath /tmp/testdb -Uvh BaseOS/Packages/*.rpm AppStream/Packages/*.rpm

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *