First of all iSCSI specific options have to be enabled in kernel:
Device Drivers >
SCSI device support >
SCSI low-level drivers
<M> iSCSI Initiator over TCP/IP [ISCSI_TCP]
<M> iSCSI Boot Sysfs Interface [ISCSI_BOOT_SYSFS]
File systems >
Pseudo filesystems
<M> Userspace-driven configuration filesystem [CONFIGFS_FS]
Device Drivers
<M> Generic Target Core Mod (TCM) and ConfigFS Infrastructure ---> [TARGET_CORE]
<M> TCM/IBLOCK Subsystem Plugin for Linux/BLOCK [TCM_IBLOCK]
<M> TCM/FILEIO Subsystem Plugin for Linux/VFS [TCM_FILEIO]
<M> TCM/pSCSI Subsystem Plugin for Linux/SCSI [TCM_PSCSI]
<M> TCM/USER Subsystem Plugin for Linux [TCM_USER2]
<M> TCM Virtual SAS target and Linux/SCSI LDD fabric loopback module [LOOPBACK_TARGET]
<M> SCSI Target Mode Stack [ISCSI_TARGET]
<M> Chelsio iSCSI target offload driver [ISCSI_TARGET_CXGB4]
<M> TCM Virtual Remote target [REMOTE_TARGET]
Linux kernel source tree is stored in "/usr/src/linux-*" directory.
To edit kerel options run
make menuconfig
To build kernel run
chimp kernel_build
To install kernel run
chimp kernel_install
After kernel installation system should be rebooted.
Enable and start iscsid service
systemctl enable iscsid
systemctl start iscsid
Install targetcli-ng package
create link to file
cd backstores/fileio
create dos /sources/iscsi/freedos.img
create portal
cd /iscsi
create iqn.2025-08.com.umvirt.nas:freedos
create LUN
cd /iscsi/iqn.2025-08.com.umvirt.nas:freedos/tpg1/luns
create /backstores/fileio/dos
create acl
cd ../acls
create iqn.2025-08.com.umvirt.pxe
disable authentication
cd /iscsi/iqn.2025-08.com.umvirt.nas:freedos/tpg1/acls/iqn.2025-08.com.umvirt.pxe
set attribute authentication=0
save
cd /
saveconfig
exit
exit
create text file "freedos" in /srv/tftp directory:
#!ipxe
set initiator-iqn iqn.2025-08.com.umvirt.pxe
sanhook --drive 0x80 iscsi:192.168.180.254:6:3260:0:iqn.2025-08.com.umvirt.nas:freedos
sanboot --drive 0x80
replace "boot-file-name" value to "freedos"
"boot-file-name": "freedos"
restart Kea dhcp4 server
systemctl restart kea-dhcp4-server
Run compute unit. On PXE boot attempt FreeDOS shold be loaded.