#version=RHEL8
# 텍스트 기반 설치
graphical
# General options
cdrom # Use CDROM installation media
services --disabled=kdump # Kdump 비활성화
firstboot --enable # Run the Setup Agent on first boot
keyboard --xlayouts='kr' # Keyboard layouts
lang ko_KR.UTF-8 # System language
timezone Asia/Seoul --isUtc # 시간대 설정
repo --name="Minimal" --baseurl=file:///run/install/repo/Minimal # 설치 소스 (ISO 내부의 BaseOS 사용)
# %packages options
%packages
@^minimal-environment # 최소 설치 환경
@standard # 표준
@development # 개발용 툴
@graphical-admin-tools # 그래픽 기반 관리 툴
@headless-management # 헤드리스 관리
@legacy-unix # 레거시 UNIX 호환성
@security-tools # 보안 툴
%end
# Account options
rootpw --iscrypted $6$abcdefgh$YFl4Uo9e/DI3OZxAaGBlXlBhHiLfaFYXZed6rVp9VwFprfdVO8pJqUCB.B6F.IcuV09bDrwtD1E99BpShToNj1 # Root 계정 비밀번호 설정 (>암호화 비밀번호 생성)
user --name=admin --password=$6$abcdefgh$YFl4Uo9e/DI3OZxAaGBlXlBhHiLfaFYXZed6rVp9VwFprfdVO8pJqUCB.B6F.IcuV09bDrwtD1E99BpShToNj1 --iscrypted --groups=wheel # 사용자 생성
# %post: OS 설치가 끝난 후, 추가로 설정을 해주는 부분
%post --log=/var/log/kickstart-post.log
LOG_FILE=/var/log/kickstart-post.log
# /localrepo 디렉터리 생성
mkdir -p /localrepo/BaseOS /localrepo/rpms /data
# ISO에서 BaseOS 디렉터리를 /localrepo로 복사
cp -r /run/install/repo/BaseOS /localrepo/ &>> $LOG_FILE
if [ $? -ne 0 ]; then
echo "Error copying BaseOS to /localrepo." >> $LOG_FILE
exit 1
fi
isolinux.cfg 파일에도 해당 내용을 참고한 상태입니다
label linux
menu label ^Install Rocky Linux 8.10
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=Rocky-8-10-x86_64-dvd quiet inst.ks=hd:LABEL=Rocky-8-10-x86_64-dvd:/ks.cfg
menu default
label check
menu label Test this ^media & install Rocky Linux 8.10
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=Rocky-8-10-x86_64-dvd rd.live.check quiet inst.ks=hd:LABEL=Rocky-8-10-x86_64-dvd:/ks.cfg
Oh Thanks you so much !!!
my two command
genisoimage -o Rocky-8.10-minimal.iso
-b isolinux/isolinux.bin
-c isolinux/boot.cat
-no-emul-boot -boot-load-size 4 -boot-info-table
-R -J -v -T
-V “Rocky-8-10-x86_64-dvd”
/custom
and
mkisofs -o Rocky-8.10-minimal.iso
-b isolinux/isolinux.bin
-c isolinux/boot.cat
-no-emul-boot -boot-load-size 4 -boot-info-table
-R -J -v -T
-V “Rocky-8-10-x86_64-dvd”
/custom
my ks.cfg
#version=RHEL8
# 텍스트 기반 설치
graphical
# General options
cdrom # Use CDROM installation media
services --disabled=kdump # Kdump 비활성화
firstboot --enable # Run the Setup Agent on first boot
keyboard --xlayouts='kr' # Keyboard layouts
lang ko_KR.UTF-8 # System language
timezone Asia/Seoul --isUtc # 시간대 설정
repo --name="Minimal" --baseurl=file:///run/install/repo/Minimal # 설치 소스 (ISO 내부의 BaseOS 사용)
# %packages options
%packages
@^minimal-environment # 최소 설치 환경
@standard # 표준
@development # 개발용 툴
@graphical-admin-tools # 그래픽 기반 관리 툴
@headless-management # 헤드리스 관리
@legacy-unix # 레거시 UNIX 호환성
@security-tools # 보안 툴
%end
# Account options
rootpw --iscrypted $6$abcdefgh$YFl4Uo9e/DI3OZxAaGBlXlBhHiLfaFYXZed6rVp9VwFprfdVO8pJqUCB.B6F.IcuV09bDrwtD1E99BpShToNj1 # Root 계정 비밀번호 설정 (>암호화 비밀번호 생성)
user --name=admin --password=$6$abcdefgh$YFl4Uo9e/DI3OZxAaGBlXlBhHiLfaFYXZed6rVp9VwFprfdVO8pJqUCB.B6F.IcuV09bDrwtD1E99BpShToNj1 --iscrypted --groups=wheel # 사용자 생성
# %post: OS 설치가 끝난 후, 추가로 설정을 해주는 부분
%post --log=/var/log/kickstart-post.log
LOG_FILE=/var/log/kickstart-post.log
# /localrepo 디렉터리 생성
mkdir -p /localrepo/BaseOS /localrepo/rpms /data
# ISO에서 BaseOS 디렉터리를 /localrepo로 복사
cp -r /run/install/repo/BaseOS /localrepo/ &>> $LOG_FILE
if [ $? -ne 0 ]; then
echo "Error copying BaseOS to /localrepo." >> $LOG_FILE
exit 1
fi
`type or paste code here`
and
custom/isolinux.cfg
label linux
menu label ^Install Rocky Linux 8.10
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=Rocky-8-10-x86_64-dvd quiet inst.ks=hd:LABEL=Rocky-8-10-x86_64-dvd:/ks.cfg
menu default
label check
menu label Test this ^media & install Rocky Linux 8.10
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=Rocky-8-10-x86_64-dvd rd.live.check quiet inst.ks=hd:LABEL=Rocky-8-10-x86_64-dvd:/ks.cfg
You’re very welcome. I’ll try my best to continue helping here if I can.
Thank you for providing the full kickstart and the commands you were using!
If I’m understanding correctly, you’re trying to use the minimal ISO and install quite a bit of groups/packages that aren’t there. The minimal ISO won’t have most of those, so it will be incomplete.
Here’s a few ideas or options you may consider:
You can use the DVD iso which will have everything and remove repo from your kickstart
You can use the boot iso which will be smaller and modify your kickstart to…
a. remove or comment cdrom and add url
b. remove or comment the repo line
c. change the %post to replace the cp with dnf reposync
Example…
#cdrom # Use CDROM installation media
url --url="http://dl.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os"
#repo --name="Minimal" --baseurl=file:///run/install/repo/Minimal # 설치 소스 (ISO 내부의 BaseOS 사용)
. . .
%post --log=/var/log/kickstart-post.log
LOG_FILE=/var/log/kickstart-post.log
# /localrepo 디렉터리 생성
mkdir -p /localrepo/rpms /data
dnf reposync --disablerepo=* --enablerepo=baseos --download-metadata -p /localrepo &>> $LOG_FILE
if [ $? -ne 0 ]; then
echo "Error copying BaseOS to /localrepo." >> $LOG_FILE
exit 1
fi
I believe genisoimage and mkisofs may work for you, but I would highly suggest using mkksiso to add your custom kickstart as it will take care of those things for you. It is much easier to use.
Thank you! Please understand that I use a translator for communication.
First of all, I created a custom iso file with a minimal iso file, and I’m going to download the packages that I had when I booted to the rocky8.10 minimal.iso file.
And in the case of repo, it should be installed in a closed network environment.
What should I do now?
It automatically mounts to /run/install/repo when you put the cdrom command.
And how can I add kickstart customization with the mkksiso command?
Rocky 8.10 Minimaliso is confirmed as /run/install/Minimal when you check that it is mounted, but there is actually no Packages file in the directory, only repodata file.
So do I have to do /run/installMinimal when I boot up customiso as well?
Also, would it be possible for you to get the logs from the failed install? Or at least some additional screenshots of the errors you’re getting? Logs should be in /tmp if you have a way of transferring them to your computer.
I ask this because looking back at your kickstart, you’re wanting groups like @development, which won’t be on the minimal ISO, and I want to know if that’s the actual problem you have or if there’s something else causing issues.
Rocky 8.10 Minimal.iso If you look at it after booting, the mount location looks like the picture above.
I’m trying to install the packages in the minimal.iso file, and I didn’t touch the files for the packages in custom.iso.
If so, do I have to modify the ks file as above?
I’ve declared the repo url location in the ks.cfg file, but why does it keep being mounted as /run/install/repo? And I can’t read it even though there’s a repo file in the file
That’s because you are using mkisofs still. The command I’m referring to is called mkksiso.
The mount locations are not controlled by the kickstart file. /run/install/root and /run/install/sources are controlled by anaconda, the installer.
The problem you seem to be facing is that /run/install is not populated with the ISO while running %post, so your cp command isn’t working. You should try %post --nochroot instead. See below for what I tried.
I did a minimal install, modified the kickstart. I changed %post to %post --nochroot. This is because /mnt/sysimage does not have /run/install mounted with the ISO. I also used rsync instead of the cp command, which I find to be cleaner (and faster).
#version=RHEL8
# Use graphical install
graphical
repo --name="Minimal" --baseurl=file:///run/install/sources/mount-0000-cdrom/Minimal
%packages
@^minimal-environment
@development
@graphical-admin-tools
@headless-management
@legacy-unix
@security-tools
@standard
kexec-tools
%end
# Keyboard layouts
keyboard --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=enp0s3 --ipv6=auto --activate
network --hostname=localhost.localdomain
# Use CDROM installation media
cdrom
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
autopart
# Partition clearing information
clearpart --all --initlabel
# System timezone
timezone America/Phoenix --isUtc
# Root password
rootpw --iscrypted ...
user --groups=wheel --name=admin --password=... --iscrypted --gecos="admin"
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
%post --nochroot --log=/mnt/sysimage/var/log/kickstart-post.log
LOG_FILE=/mnt/sysimage/var/log/kickstart-post.log
# create localrepo
mkdir -p /mnt/sysimage/localrepo/{BaseOS,rpms} /mnt/sysimage/data
# copy baseos from the iso
rsync -vrlptDSHog /run/install/repo/BaseOS /mnt/sysimage/localrepo/ &>> $LOG_FILE
if [ $? -ne 0 ]; then
echo "Error copying BaseOS to /localrepo." >> $LOG_FILE
exit 1
fi
%end
I used mkksiso to make the custom ISO.
[label@sani tmp]$ sudo mkksiso --ks /tmp/ks.cfg /var/tmp/Rocky-8.10-x86_64-minimal.iso /var/tmp/custom.iso
[sudo] password for label:
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 1828 nodes read in 1 seconds
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev '/var/tmp/Rocky-8.10-x86_64-minimal.iso'
Drive access : shared:readonly
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record : El Torito , MBR isohybrid cyl-align-off GPT
Media summary: 1 session, 1315287 data blocks, 2569m data, 63.7g free
Volume id : 'Rocky-8-10-x86_64-dvd'
xorriso : UPDATE : 1 files restored ( 3069b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/isolinux/isolinux.cfg'='/tmp/mkksiso-kg0fw15n/isolinux/isolinux.cfg'
xorriso : UPDATE : 1 files restored ( 1347b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/EFI/BOOT/BOOT.conf'='/tmp/mkksiso-kg0fw15n/EFI/BOOT/BOOT.conf'
xorriso : UPDATE : 1 files restored ( 1347b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/EFI/BOOT/grub.cfg'='/tmp/mkksiso-kg0fw15n/EFI/BOOT/grub.cfg'
xorriso : UPDATE : 1 files restored ( 46b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/.discinfo'='/tmp/mkksiso-kg0fw15n/.discinfo'
INFO:iso arch = x86_64
INFO:Volume Id = Rocky-8-10-x86_64-dvd
WARNING:No s390 config files found
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 1828 nodes read in 1 seconds
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev '/var/tmp/Rocky-8.10-x86_64-minimal.iso'
Drive access : shared:readonly
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record : El Torito , MBR isohybrid cyl-align-off GPT
Media summary: 1 session, 1315287 data blocks, 2569m data, 63.7g free
Volume id : 'Rocky-8-10-x86_64-dvd'
xorriso : UPDATE : 13 files restored (9235.1k) in 1 seconds = 6.8xD
Extracted from ISO image: file '/EFI'='/tmp/mkksiso-sa19b0c3/EFI'
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 1828 nodes read in 1 seconds
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev '/var/tmp/Rocky-8.10-x86_64-minimal.iso'
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record : El Torito , MBR isohybrid cyl-align-off GPT
Media summary: 1 session, 1315287 data blocks, 2569m data, 63.7g free
Volume id : 'Rocky-8-10-x86_64-dvd'
Drive current: -outdev '/var/tmp/custom.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 63.7g free
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
xorriso : NOTE : Replayed 21 boot related commands
Updating '/tmp/mkksiso-kg0fw15n/isolinux/isolinux.cfg' to '/isolinux/isolinux.cfg'
xorriso : UPDATE : Added/overwrote '/isolinux/isolinux.cfg' (3257)
Differences detected and updated. (runtime 0.0 s)
Updating '/tmp/mkksiso-kg0fw15n/EFI/BOOT/BOOT.conf' to '/EFI/BOOT/BOOT.conf'
xorriso : UPDATE : Added/overwrote '/EFI/BOOT/BOOT.conf' (1535)
Differences detected and updated. (runtime 0.0 s)
Updating '/tmp/mkksiso-kg0fw15n/EFI/BOOT/grub.cfg' to '/EFI/BOOT/grub.cfg'
xorriso : UPDATE : Added/overwrote '/EFI/BOOT/grub.cfg' (1535)
Differences detected and updated. (runtime 0.0 s)
Updating '/tmp/mkksiso-kg0fw15n/.discinfo' to '/.discinfo'
xorriso : UPDATE : Adjusted attributes of '/.discinfo'
Differences detected and updated. (runtime 0.0 s)
xorriso : UPDATE : 1 files added in 1 seconds
Added to ISO image: file '/ks.cfg'='/tmp/ks.cfg'
xorriso : NOTE : Copying to System Area: 32768 bytes from file '--interval:imported_iso:0s-15s:zero_mbrpt,zero_gpt:/var/tmp/Rocky-8.10-x86_64-minimal.iso'
xorriso : UPDATE : Writing: 40960s 3.1% fifo 100% buf 50%
xorriso : UPDATE : Writing: 172032s 13.0% fifo 100% buf 50% 645.4xD
xorriso : UPDATE : Writing: 606208s 45.9% fifo 100% buf 50% 641.4xD
xorriso : UPDATE : Writing: 1015808s 77.0% fifo 100% buf 50% 605.0xD
ISO image produced: 1319799 sectors
Written to medium : 1319968 sectors at LBA 32
Writing to '/var/tmp/custom.iso' completed successfully.
After, I ran it on VirtualBox. Installation completes.
OMG Crazy so amazing very very very Thanks you
I’m on a business trip, so I can’t check it right away. I’m sorry. I’ll check it as soon as I have time and give you an answer. Thank you so much
How are you? Teacher
Does the bootloader have to be mbr in kickstart?
I want to install it in a gpt environment, how do I do it?
Is there any problem with the /boot/efi file even if I use the bootloader as mbr??
The direction I want is
When I added the kickstart file with the mkgsiso command to the original rocky 8.10 minimaliso file and then tested it, I didn’t get a repo problem, but I used the mkksiso command after transferring it to the custom file with the cp command, but a repo error occurs
For example, my kickstart has these options set and EFI works after the installation completes and systems will always boot for me. Ensure you have fsoptions set for your efi partition like I have them below. You will also need to make sure that you have secure boot on or you have UEFI enabled (do not use classic BIOS booting).
If you make changes to an ISO by hand, you will have issues like this. The ISO’s are in what’s called “isohybrid” so making changes must be done with caution.
You can try to use mkksiso again to replace the kickstart, but I recommend that you run it on an unchanged ISO.