Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: qingquan on January 06, 2023, 05:06:16 AM
-
I want to set up an iscsi server
Who knows, please?
Which module supports Linux-IO Target.
-
Hi qingquan
The iSCSI target fabric is included since Linux 3.1.
The important kernel modules are target_core_mod and iscsi_target_mod, which should be in the kernel ...
Found here:
https://wiki.archlinux.org/title/ISCSI/LIO
That suggests the following kernel config options need to be enabled:
CONFIG_TARGET_CORE
https://cateee.net/lkddb/web-lkddb/TARGET_CORE.html
CONFIG_ISCSI_TARGET
https://cateee.net/lkddb/web-lkddb/ISCSI_TARGET.html
If you look at the kernel config:
http://tinycorelinux.net/12.x/x86_64/release/src/kernel/config-5.10.3-tinycore64
it shows:
# CONFIG_TARGET_CORE is not set
and CONFIG_ISCSI_TARGET does not exist since it requires CONFIG_TARGET_CORE.
That means Linux-IO Target support is not included in your kernel.
-
Hi Rich
Thank you for your reply. I have learned skills from it.
TinyCorePure64-12.0 Not supported Linux-IO Target.
sorry to hear that,I'm not up to the task of recompiling the kernel.
Is there any other way? For example, install a tcz.
-
You will need to re-compile the tinycore kernel - it's not difficult.
-
Thanks to Juanito's encouragement, I downloaded the source code:
http://tinycorelinux.net/12.x/x86_64/release/src/kernel/linux-5.10.3-patched.txz
Next, how to get the source code,or how to set it up?
TARGET_CORE, ISCSI_TARGET,TCM_IBLOCK,TCM_FILEIO,TCM_PSCSI,TCM_USER
Thank you very much!
-
Thanks to Juanito's encouragement, I downloaded the source code:
http://tinycorelinux.net/12.x/x86_64/release/src/kernel/linux-5.10.3-patched.txz
Next, how to get the source code,or how to set it up?
TARGET_CORE, ISCSI_TARGET,TCM_IBLOCK,TCM_FILEIO,TCM_PSCSI,TCM_USER
Thank you very much!
-------------------------------------------------------------------
https://cateee.net/sources/lkddb/lkddb-5.10-rc3.list
module target_core_file "TCM/FILEIO Subsystem Plugin for Linux/VFS" : CONFIG_TCM_FILEIO : drivers/target/Kconfig
module target_core_iblock "TCM/IBLOCK Subsystem Plugin for Linux/BLOCK" : CONFIG_TCM_IBLOCK : drivers/target/Kconfig
module target_core_mod "Generic Target Core Mod (TCM) and ConfigFS Infrastructure" : CONFIG_TARGET_CORE : drivers/target/Kconfig
module target_core_pscsi "TCM/pSCSI Subsystem Plugin for Linux/SCSI" : CONFIG_TCM_PSCSI : drivers/target/Kconfig
module target_core_user "TCM/USER Subsystem Plugin for Linux" : CONFIG_TCM_USER2 : drivers/target/Kconfig
-
You also need to download http://tinycorelinux.net/12.x/x86_64/release/src/kernel/config-5.10.3-tinycore64
Then: tce-load -i compiletc perl5 ncursesw-dev bc glibc_apps elfutils-dev
cd linux-5.10.3
make mrproper
cp ../config-5.10.3-tinycore64 ./.config
make oldconfig
make menuconfig
..choose your new configuration options (set them as modules "m", then save and exit menuconfig
Then: make
Once completed, you will need to copy the new vmlinuz and the new modules.
The new modules can used to create a new extension and the new vmlinuz will replace the existing tinycore vmlinuz64.
-
Hi Juanito
Compiling in a "Linux partition" is a good choice
http://tinycorelinux.net/12.x/x86_64/release/src/kernel/linux-5.10.3-patched.txz
http://tinycorelinux.net/12.x/x86_64/release/src/kernel/config-5.10.3-tinycore64
tce-load -iw compiletc.tcz
tce-load -iw perl5.tcz
tce-load -iw ncursesw-dev.tcz
tce-load -iw bc.tcz
tce-load -iw glibc_apps.tcz
tce-load -iw elfutils-dev.tcz
tar -xvf linux-5.10.3-patched.txz
cd linux-5.10.3
make mrproper
cp ../config-5.10.3-tinycore64 ./.config
make oldconfig
make menuconfig
Choose what I need:TARGET CORE
Device Driver-- <M> Generic Target Core Mod (TCM) and ConfigFS Infrastructure
<M> TCM/IBLOCK Subsystem Plugin for Linux/BLOCK
<M> TCM/FILEIO Subsystem Plugin for Linux/VFS
<M> TCM/pSCSI Subsystem Plugin for Linux/SCSI
<M> TCM/USER Subsystem Plugin for Linux
<M> TCM Virtual SAS target and Linux/SCSI LDD fabric loopback module
<M> TCM FC fabric Plugin
<M> Linux-iSCSI.org iSCSI Target Mode Stack
<M> Chelsio iSCSI target offload driver
<M> FireWire SBP-2 fabric module
[esc][esc]--[Save]
make
......
time: [2:56] CPU:i5-4210Y SSD:intel S3700 200G RAM: 8G
Generate the following file:
Module.symvers 1,197 KB
modules.builtin 15 KB
modules.builtin.modinfo 113 KB
modules.order 90 KB
System.map 4,239 KB
vmlinux 35,200 KB
vmlinux.o 32,173 KB
vmlinux.symvers 605 KB
----------------------------------------------
What should I do next? thank you!
-
Your vmlinuz seems large - it should be +/- 5,500KB.
You need to search the source tree for the additional modules you created (named *.ko) and make them into an extension.
-
I'll try to deal with the module(name*.ko).
My kernel compiled to vmlinux, not vmliunz.
Do you need to compress? "gzip" or "make zImage"
thanks.
-
How big is the file bzImage?
-
Since it takes too long to compile, I didn't use it
"make bzImage" recompiles.
Not sure what file size this will give you.
I compressed vmlinux with winrar and got a file of 5,406 KB
Estimated compression should be at +/-5,400KB
What am I supposed to do now? Recompile it or gzip it?
-
I asked because I have a feeling that we are using bzImage renamed to vmlinuz - @curaga can confirm.
-
vmliunx -->vmliunz, what should I do? thanks.
vmliunx is a file generated with make and should not be compressed
-
You can use bzImage directly or rename it to vmlinuz64 (with a "z") and replace the existing vmlinuz64.
-
I want to compress vmliunx (35.200 KB) to make vmliunz (+/-5.400KB),Just like the official website distribution.
Don't like to rename it because it's too big.
I have searched the documentation and seem to need "objcopy" and "gzip", but don't know the specific command line, please comment.
-
Hi Juanito
I asked because I have a feeling that we are using bzImage renamed to vmlinuz - @curaga can confirm.
I just checked my notes and they show:
make -j 2 bzImage
cp arch/x86/boot/bzImage /path/to/save/vmlinuz
-
I looked at the previous post and found "make -j 2 bzImage". I started recompiling it half an hour ago, so it looks like the problem has been fixed.
Extract the driver file:
With experience:
/5.10.3-tinycore64/kernel/drivers/target/
iscsi(folder) loopback(folder) sbp(folder) tcm_fc(folder)
target_core_file.ko target_core_iblock.ko target_core_mod.ko
target_core_pscsi.ko target_core_user.ko
Extract them, compress them into gz format, copy them to the corresponding path,
edit them /5.10.3-tinycore64/kernel/modules.dep, add the path to the driver file.
Is there a clear way to extract driver files? Thanks!
-
Hi qingquan
I want to compress vmliunx (35.200 KB) to make vmliunz (+/-5.400KB),Just like the official website distribution. ...
Then you will have to run make bzImage because compression is a compile time option.
vmlinuz is basically a self extracting file so not all of it is compressed.
Found here:
https://superuser.com/questions/445507/how-do-i-compress-a-vmlinux-kernel-into-vmlinuz
You can see that not all of the file is compressed because there are readable strings
present in the file.
These show up in the first 200 bytes of the file:
tc@E310:~$ head -c 200 bbox/tempdir/vmlinuz | strings
Use a boot loader.
Remove disk and press any key to reboot...
These show up in the last 2000 bytes of the file:
tc@E310:~$ tail -c 2000 bbox/tempdir/vmlinuz | strings
ng output buffer
Out of memory while allocating input buffer
Out of memory while allocating z_stream
Out of memory while allocating workspace
Kernel is not a valid ELF file
Failed to allocate space for phdrs
32-bit relocation outside of kernel!
Avoiding potentially unsafe overlapping memcpy()!
-- System halted
Failed to get handle for LOADED_IMAGE_PROTOCOL
Failed to allocate lowmem for boot params
Trying to load files to higher address
Failed to allocate memory for 'pci_handle'
Failed to allocate memory for 'rom'
Unsupported properties proto version
Failed to allocate memory for 'properties'
Failed to allocate memory for 'gdt' structure
Failed to allocate memory for 'gdt'
efi_relocate_kernel() failed!
initrd=
Failed to read rom->vendor
Failed to read rom->devid
efi_main() failed!
exit_boot() failed!
nokaslr
quiet
efi=
nochunk
Failed to handle fs_proto
Failed to open volume
Failed to open file:
Failed to get file info size
Failed to get initrd info
EFI stub: ERROR: Failed to alloc mem for file handle list
Failed to alloc mem for file info
EFI stub: ERROR: Failed to alloc highmem for files
EFI stub: ERROR: We've run out of free low memory
EFI stub: ERROR: Failed to read file
EFI stub: ERROR: Failed to allocate usable memory for kernel.
EFI stub: UEFI Secure Boot is enabled.
EFI stub: ERROR: Could not determine UEFI Secure Boot status.
Unable to allocate memory for event log
-
I've recompiled it with "make -j 2 bzImage",
Replace vmlinuz64 in the iso and start successfully.
old vmlinuz64 5,241KB
new vmlinuz64 5,442 KB
Now what I'm not sure about is the method of extracting the driver file!
-
Hi qingquan
Example for packaging a kernel module:
mkdir -p /tmp/pkg/usr/local/lib/modules/4.19.10-tinycore64/kernel/drivers/gpu/drm/nouveau
sudo cp nouveau.ko /tmp/pkg/usr/local/lib/modules/4.19.10-tinycore64/kernel/drivers/gpu/drm/nouveau
sudo chown -R root:root /tmp/pkg/usr
cd /tmp
sudo mksquashfs pkg/ nouveau-4.19.10-tinycore64.tcz
sudo chown tc:staff nouveau-4.19.10-tinycore64.tcz
You would replace 4.19.10-tinycore64 with the version that matches your kernel.
If you are not sure what that is, run uname -r to find out.
Instead of drivers/gpu/drm/nouveau create drivers/target/iscsi, drivers/target/loopback, etc.
Then copy the drivers into the appropriate folders.
When you make the extension it will be something like this:
sudo mksquashfs pkg/ target-5.10.3-tinycore64.tcz
... Extract them, compress them into gz format, ...
The squashfs is already a compressed format. Converting to .gz just makes the file bigger.
... edit them /5.10.3-tinycore64/kernel/modules.dep, add the path to the driver file. ...
No need for that. tce-load handles that for you.
-
Just for completeness sake, I checked and "make" builds both the modules and arch/x86_64/boot/bzImage, but not vmlinuz, so vmlinuz is indeed a renamed bzImage.
-
Hi Juanito Rich
Thanks to juanito and Rich for your encouragement and support,
it was with your help that I started my first kernel compilation journey and finally succeeded after hard work.
Here is a summary to share with those who have not compiled the kernel.
Download address:
http://tinycorelinux.net/12.x/x86_64/release/src/kernel/linux-5.10.3-patched.txz
http://tinycorelinux.net/12.x/x86_64/release/src/kernel/config-5.10.3-tinycore64
tce-load -iw compiletc.tcz
tce-load -iw perl5.tcz
tce-load -iw ncursesw-dev.tcz
tce-load -iw bc.tcz
tce-load -iw elfutils-dev.tcz
tar -xvJf linux-5.10.3-patched.txz #Preferably in a Linux partition
cd linux-5.10.3
sudo make mrproper
sudo cp ../config-5.10.3-tinycore64 ./.config
sudo make oldconfig
sudo make menuconfig
I need the module:TARGET CORE
Device Driver-- <M> Generic Target Core Mod (TCM) and ConfigFS Infrastructure
<M> TCM/IBLOCK Subsystem Plugin for Linux/BLOCK
<M> TCM/FILEIO Subsystem Plugin for Linux/VFS
<M> TCM/pSCSI Subsystem Plugin for Linux/SCSI
<M> TCM/USER Subsystem Plugin for Linux
<M> TCM Virtual SAS target and Linux/SCSI LDD fabric loopback module
<M> TCM FC fabric Plugin
<M> Linux-iSCSI.org iSCSI Target Mode Stack
<M> Chelsio iSCSI target offload driver
<M> FireWire SBP-2 fabric module
[esc][esc]--[Save]
make -j 2 bzImage #Compile kernel
#.............About half an hour..........
sudo cp arch/x86/boot/bzImage ../vmlinuz64
make -j 2 modules #Compile module(Inclusion drive)
#.............About an hour and a half..........
#(ctrl+insert):copy,In the terminal window,May be useful
#(shift+insert):paste,In the terminal window,May be useful
sudo mkdir ../target
sudo cp -a ./drivers/target/* ../target
#Tidy up the files in target and keep *.ko
cd ..
sudo mkdir -p tmp/pkg/usr/local/lib/modules/5.10.3-tinycore64/kernel/drivers/target
sudo cp -a ./target/* tmp/pkg/usr/local/lib/modules/5.10.3-tinycore64/kernel/drivers/target
cd tmp
sudo mksquashfs pkg/ iscsi-target.tcz
sudo chown tc:staff iscsi-target.tcz
Keep well vmlinuz64 and iscsi-target.tcz
Repackage to iso with ezremaster.tcz
depmod -n | grep iscsi
All the necessary modules are here. Great!
-
Hi Juanito Rich
Thanks to juanito and Rich for your encouragement and support,
it was with your help that I started my first kernel compilation journey and finally succeeded after hard work.
Here is a summary to share with those who have not compiled the kernel.
Thank you for letting us know that you succeeded to compile your own kernel, welcome to the Great Linux Community :)
And you show what commands for making it.
To making this little faster you can maybe.
Have seen some another tips to just compile one module that can been see here.
This applies to the old chip soc, but i think this also applies just to another Linux dist's as well.
I think you need some more files from the old kernel compiling not just config.
I think you also need "Module.symvers"
https://yoursunny.com/t/2018/one-kernel-module/
-
Unfortunately the Module.symvers trick no longer works with >5.x
-
Hi Juanito
Thanks for letting me know and also the community, but sadly then it's not working for newer versions of kernel.
-
Oh, thank you patrikg for joining me. I am a beginner. I started with the application and gradually progressed.
I'm going to configure targetcli on tinycore, which seems like a lot of work and a lot of dependencies.
|--python-pyparsing
| |--filesystem
|--python-urwid----glibc --linux-api-headers
| |--tzdata
|
|--python-configshell-fb>=1.1.fb17-|
|
| |--dbus
| |
|--python-dbus --glib2
| |
| |--gobject-introspection-runtime
|
targetcli-fb-2.1.54 --python-gobject
|
|
| |--python-pyudev
| |
|--python-rtslib-fb>=2.1.fb52 --python-six
|
|--systemd --acl
|--audit
|--bash
|--cryptsetup
|--dbus
|--hwdata
|--iptables
|--kbd
|--kmod
|--libacl.so
|--libaudit.so
|--libblkid.so
|--libcap
|--libcap.so
|--libcrypt.so
|--libcrypto.so
|--libcryptsetup.so
|--libelf
|--libgcrypt
|--libidn2
|--libkmod.so
|--libmount.so
|--libp11-kit
|--libp11-kit.so
|--libseccomp
|--libseccomp.so
|--libssl.so
|--libxcrypt
|--lz4
|--openssl
|--pam
|--pcre2
|--systemd-libs
|--util-linux
|--xz
-
Oh, thank you patrikg for joining me. I am a beginner. I started with the application and gradually progressed.
I'm going to configure targetcli on tinycore, which seems like a lot of work and a lot of dependencies.
|--python-pyparsing
| |--filesystem
|--python-urwid----glibc --linux-api-headers
| |--tzdata
|
|--python-configshell-fb>=1.1.fb17-|
|
| |--dbus
| |
|--python-dbus --glib2
| |
| |--gobject-introspection-runtime
|
targetcli-fb-2.1.54 --python-gobject
|
|
| |--python-pyudev
| |
|--python-rtslib-fb>=2.1.fb52 --python-six
|
|--systemd --acl
|--audit
|--bash
|--cryptsetup
|--dbus
|--hwdata
|--iptables
|--kbd
|--kmod
|--libacl.so
|--libaudit.so
|--libblkid.so
|--libcap
|--libcap.so
|--libcrypt.so
|--libcrypto.so
|--libcryptsetup.so
|--libelf
|--libgcrypt
|--libidn2
|--libkmod.so
|--libmount.so
|--libp11-kit
|--libp11-kit.so
|--libseccomp
|--libseccomp.so
|--libssl.so
|--libxcrypt
|--lz4
|--openssl
|--pam
|--pcre2
|--systemd-libs
|--util-linux
|--xz
maybe there is a distribution that already has all this? perhaps?
https://distrowatch.com/search.php
-
maybe there is a distribution that already has all this? perhaps?
https://distrowatch.com/search.php
The website you provided is good, but I can't find "targetcli",
is the distribution you are referring to "targetcli"? Or maybe
I got it wrong. I need "targetcli", or something about it.
thanks!