containers / initoverlayfs

GNU General Public License v2.0
35 stars 9 forks source link

Add manual scsi probe of a Lun #84

Closed alessandrocarminati closed 2 months ago

alessandrocarminati commented 2 months ago

This commit introduces manual probing of a specified SCSI LUN. The LUN can be specified either via the kernel command line scsi.addr=<host>:<channel>:<target>:<lun> or by adding a line to the initoverlayfs.config file scsi.addr <host>:<channel>:<target>:<lun>. In case both are present, the configuration takes precedence. Any operation depends on the presence of the scsi_mod.scan=manual kernel argument. If it is not present in the kernel command line, no action will occur. The directory scsi_probe contains the main functions needed to complete the task and some related tests. To run the tests, simply run make in the scsi_probe subdirectory.

ericcurtin commented 2 months ago

I can't wait to give this a run!

I'm probably taking a few day off from Wednesday (I'll be out around 7 days), so I dunno if I will get the opportunity to look at this in detail.

But it's pretty ifdef'd out, so I don't mind merging this if it helps things progress.

alessandrocarminati commented 2 months ago

Take your time; I took mine, so I can't complain if things go long. In any case, to be more confident about the code quality, I bothered to add tests to my functions. I hope it helps to maintain the quality of this contribution and not degrade the rest.

alessandrocarminati commented 2 months ago

I updated my PR because of a typo I discovered. It doesn't change much in practice, but it bothered me. In scsi_probe/tests/parse_kernel_cmdline.c, the Italian version of Donald Duck, paperino, was misspelled. Now, it's fixed! :-P

ericcurtin commented 2 months ago

Merging before I go on PTO, I didn't give the most thorough review, but it's all ifdef'd out anyway, better to merge to not block progress...

dougsland commented 2 months ago

agreed, sorry i couldn't review before. If we find anything later in the road we improve it.

ericcurtin commented 2 months ago

It will be interesting to try the boot direct to erofs idea you had @alessandrocarminati via "root=" karg and then pivot_rooting to the real rootfs using "systemd.root=" karg @rrendec is working on.

Of course this is only suitable for embedded because of the dependency on the storage drivers being directly into the kernel, but it's one of the cases we care about.