Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Directory | Files | Note
### Generate installer ISO

```shell
export DISK_DEVS=sda,sdb # System has /dev/sda and /dev/sdb
export DISK_DEVS=sda,sdb # Disks usable by the installer; ones not present on the machine are skipped
export MAIN_DISK=sda # Install OS to /dev/sda
export PARTSIZE_DOCKER=8192 # 8G
export PARTSIZE_LOG=2048 # 2G
Expand Down
25 changes: 22 additions & 3 deletions ks.tpl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ cmdline
reboot
# Run the Setup Agent on first boot
firstboot --disable
ignoredisk --only-use=@@DISK_DEVS@@
# ignoredisk/clearpart with the disks existing on this machine, generated in %pre
%include /tmp/ks.diskdevs.cfg
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='jp'
# System language
Expand All @@ -25,8 +26,6 @@ group --name=docker

%include /tmp/ks.media.cfg

# Partition clearing information
clearpart --all --initlabel --drives=@@DISK_DEVS@@
# Create partitions
part /boot/efi --fstype="efi" --ondisk=@@MAIN_DISK@@ --size=200 --fsoptions="umask=0077,shortname=winnt"
part / --fstype="ext4" --ondisk=@@MAIN_DISK@@ --size=2048 --mkfsoptions="-U 64eb4db5-3385-46a5-a3d5-c48197a53555"
Expand Down Expand Up @@ -59,6 +58,26 @@ else
echo "url --url http://172.16.250.1/iso" > /tmp/ks.media.cfg
fi

# Pick only the disks that exist on this machine
diskdevs=
for dev in $(echo @@DISK_DEVS@@ | tr "," " ")
do
if [ -b "/dev/${dev}" ]
then
diskdevs="${diskdevs:+${diskdevs},}${dev}"
else
echo "disk ${dev} not found, skipped"
fi
done
if [ -z "${diskdevs}" ]
then
echo "no disks in DISK_DEVS (@@DISK_DEVS@@) found"
fi
cat > /tmp/ks.diskdevs.cfg <<EOF
ignoredisk --only-use=${diskdevs}
clearpart --all --initlabel --drives=${diskdevs}
EOF

@@KS.PRE.CFG@@
%end

Expand Down