How To Make CustomRescueCD

Let's examine the structure of the ISO:

 * ./boot/grub/font.pf2
 * ./boot/grub/grub.cfg <-- Grub Configuration File for EFI BOOT
 * ./boot/grub/x86_64-efi
 * ./boot/grub/x86_64-efi/all_video.mod
 * ./boot/grub/x86_64-efi/efi_gop.mod
 * ./boot/grub/x86_64-efi/efi_uga.mod
 * ./boot/grub/x86_64-efi/gfxterm.mod
 * ./boot/grub/x86_64-efi/video.mod
 * ./boot/grub/x86_64-efi/videoinfo.mod
 * ./boot/grub/x86_64-efi/videotest.mod
 * ./boot/memtest86plus/memtest
 * ./boot/memtest86plus/memtest.bin <-- Memtest kernel for bios boot
 * ./boot/syslinux/chain.c32
 * ./boot/syslinux/syslinux.cfg <--- Main Syslinux Configuration File
 * ./boot/syslinux/customresccd.cfg
 * ./boot/syslinux/customresccd_head.cfg
 * ./boot/syslinux/customresccd_pxe.cfg
 * ./boot/syslinux/customresccd_sys.cfg
 * ./boot/syslinux/customresccd_tail.cfg
 * ./boot/syslinux/hdt/modalias.gz
 * ./boot/syslinux/hdt/pciids.gz
 * ./boot/syslinux/isohdpfx.bin <--- Syslinux MBR for Bios Boot
 * ./boot/syslinux/isolinux.bin <--- Syslinux Image
 * ./boot/syslinux/boot.cat <--- Syslinux Boot Catalogue
 * ./boot/syslinux/ldlinux.c32
 * ./boot/syslinux/ldlinux.sys
 * ./boot/syslinux/libcom32.c32
 * ./boot/syslinux/libutil.c32
 * ./boot/syslinux/memdisk
 * ./boot/syslinux/poweroff.c32
 * ./boot/syslinux/pxelinux.0
 * ./boot/syslinux/reboot.c32
 * ./boot/syslinux/vesamenu.c32
 * ./boot/syslinux/whichsys.c32
 * ./boot/x86_64/customrescue64 <-- CustomRescueCd KERNEL
 * ./customresccd/x86_64/customrescuecd.sfs <--- SquashFS
 * ./customresccd/x86_64/customrescuecd.sha512 < Sha512 of Squashfs
 * ./EFI/boot/bootx64.efi < Grub Efi Executable for usb stick boot
 * ./EFI/customiso/grub.img <--- Grub Partition in append to iso for efi boot that contain .efi executable

First create 2 directories

 * 1) customrescuecd-squash <--- Download a Gentoo Stage 3, explode into it and build your own system.Remember to emerge syslinux and grub! Insert GRUB_PLATFORMS="efi-64" into make.conf of your stage4
 * 2) customrescuecd64 < which contain the structure of the ISO

The customrescuecd64 directory must contain these subdirectories:

 * boot/syslinux
 * boot/syslinux/hdt
 * boot/grub/x86_64-efi
 * boot/memtest86plus
 * boot/x86_64
 * EFI/boot
 * EFI/customiso
 * customresccd/x86_64

when you have completed your stage4 do the following
create a txt file with these line:


 * proc/*
 * sys/*
 * dev/*
 * run/*
 * boot/*
 * root/*
 * var/cache/edb/*
 * var/db/pkg/*
 * var/db/repos/gentoo/*
 * var/db/repos/local/*
 * var/db/repos/palemoon/*
 * var/tmp/portage/*
 * var/cache/distfiles/*
 * var/cache/binpkgs/*
 * var/log/*
 * var/tmp/*
 * usr/include/*
 * usr/src/*
 * etc/kernels/*
 * etc/portage/*

and save it as exclude.txt and then do

mksquashfs ./customresccd-squash-64/ ./customrescuecd64/customresccd/x86_64/customrescuecd.sfs -wildcards -ef exclude.txt -b 1024K -comp xz -progress -processors 4 -Xdict-size 100% cd ./customrescuecd64/customresccd/x86_64 sha512sum customrescuecd.sfs > customrescuecd.sha512