[root@rhel-8 rules.d]# cd /tmp/custom_initrd/
[root@rhel-8 custom_initrd]#
Execute the below command to rebuild initrd image with xz as compression format
[root@rhel-8 custom_initrd]# find . 2>/dev/null | cpio -c -o | xz -9 --format=xz > /tmp/new.img
378439 blocks
Check the compression type of your new initrd file
[root@rhel-8 custom_initrd]# ls -l /tmp/new.img
-rw-r–r--. 1 root root 53615972 Sep 13 20:24 /tmp/new.img
[root@rhel-8 custom_initrd]# file /tmp/new.img
/tmp/new.img: XZ compressed data