Bug 203294 - [new port] net/isboot-kmod: kernel module to allow booting from an iSCSI root volume
Summary: [new port] net/isboot-kmod: kernel module to allow booting from an iSCSI root...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-23 19:49 UTC by John Nielsen
Modified: 2015-09-24 14:44 UTC (History)
3 users (show)

See Also:


Attachments
shar file of the new port (2.80 KB, text/plain)
2015-09-23 19:49 UTC, John Nielsen
no flags Details
Patch to isboot-kmod port (499 bytes, patch)
2015-09-23 20:38 UTC, Yonas Yanfa
no flags Details | Diff
revised version of the port (shar) (2.66 KB, text/plain)
2015-09-23 22:10 UTC, John Nielsen
no flags Details
2nd revised version (shar) (2.49 KB, text/plain)
2015-09-24 03:45 UTC, John Nielsen
no flags Details
next-try (4.39 KB, text/plain)
2015-09-24 05:47 UTC, Kurt Jaeger
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Nielsen 2015-09-23 19:49:50 UTC
Created attachment 161313 [details]
shar file of the new port

This is a port to simplify installation of isboot.ko, a kernel module which allows booting FreeBSD from an iSCSI root volume.
Comment 1 Yonas Yanfa 2015-09-23 20:38:53 UTC
Created attachment 161315 [details]
Patch to isboot-kmod port

Hi John, thanks for creating this port. I found a small typo, patch attached.

We should mention this port in the FreeBSD Handbook to further increase exposure.
Comment 2 Yonas Yanfa 2015-09-23 20:41:57 UTC
Also, pkg-message.in mentions the README being located in %%DOCSDIR%%/README (or /usr/local/share/doc/isboot-kmod/README) but I didn't find it there.
Comment 3 Hiroki Sato freebsd_committer freebsd_triage 2015-09-23 20:45:49 UTC
(In reply to John Nielsen from comment #0)

Please do not set OPTIONS_DEFAULT+=VIMAGE based on the result of kern.features.vimage.  It can break the package when a package building machine is different from the consumers.
Comment 4 Kurt Jaeger freebsd_committer freebsd_triage 2015-09-23 21:11:30 UTC
Test-builds: works on 10.2a+i, fails on current-amd64 and 9.3amd. See

http://people.freebsd.org/~pi/logs/net__isboot-kmod-cur-1443039437.txt

9.3 does not provide a valid error log via poudriere, but prints


[00:00:04] ====>> Warning: (net/isboot-kmod): "Makefile", line 23: Malformed conditional ("${VIMAGE_SUPPORT}" == "1")
[00:00:04] ====>> Warning: (net/isboot-kmod): "Makefile", line 25: if-less endif
[00:00:04] ====>> Warning: (net/isboot-kmod): make: fatal errors encountered -- cannot continue
"Makefile", line 23: Malformed conditional ("${VIMAGE_SUPPORT}" == "1")
"Makefile", line 25: if-less endif
make: fatal errors encountered -- cannot continue
Comment 5 John Nielsen 2015-09-23 22:10:00 UTC
Created attachment 161318 [details]
revised version of the port (shar)

Here is a revised .shar addressing most comments so far:
 - Fixed pkg-message typo
 - No longer checking sysctl kern.features.vimage, so the default is always without VIMAGE
 - As a side effect of the above the Makefile should now play nicely with make in FreeBSD 9, please test
Comment 6 John Nielsen 2015-09-23 22:12:23 UTC
@yonas, did you de-select the "DOCS" port option or do you have NOPORTDOCS or similar defined in /etc/make.conf? Either of those would (correctly) prevent the README from being installed.

If not, please let me know what version of FreeBSD you are on and how you are trying to build the port so I can attempt to reproduce the issue.
Comment 7 Yonas Yanfa 2015-09-23 22:49:32 UTC
(In reply to John Nielsen from comment #6)

@yonas, did you de-select the "DOCS" port option or do you have NOPORTDOCS or similar defined in /etc/make.conf? Either of those would (correctly) prevent the README from being installed.

If not, please let me know what version of FreeBSD you are on and how you are trying to build the port so I can attempt to reproduce the issue.

I have the DOCS port option enabled, and I don't have a /etc/make.conf file. I'm using FreeBSD 10.2.

In the Makefile, the line:

${INSTALL_MAN} ${PORTDOCS:S|^|${WRKSRC}/../|} ${STAGEDIR}${DOCSDIR}

should it make use of the DOCS_PORTDOCS variable?
Comment 8 John Nielsen 2015-09-23 23:19:36 UTC
(In reply to Yonas Yanfa from comment #7)

No, the contents of DOCS_PORTDOCS are appended to PORTDOCS if the DOCS option is selected. What do you get for each of the following when run from the isboot-kmod port directory?

make -V PORT_OPTIONS
make -V PORTDOCS
make && find `make -V STAGEDIR` -type f
Comment 9 Hiroki Sato freebsd_committer freebsd_triage 2015-09-23 23:44:38 UTC
(In reply to John Nielsen from comment #8)

- You can simply use PORTDOCS, not DOCS_PORTDOCS.  PORTDOCS is no-op
  when DOCS is not defined.

- Please use post-install-DOCS-on target instead of .if defined(PORTDOCS)
  like the following.  That is a preferred way.

post-install-DOCS-on:
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    cd ${WRKDIR} && ${INSTALL_MAN} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
 
  WRKDIR is defined as ../${WRKSRC} in this case.

- IGNORE is not necessary because 8.x is no longer supported.
Comment 10 Yonas Yanfa 2015-09-23 23:49:36 UTC
(In reply to John Nielsen from comment #8)

Here's the output:

[root@fbsd3 isboot-kmod]# make -V PORT_OPTIONS
  DOCS EXAMPLES IPV6 NLS
[root@fbsd3 isboot-kmod]# make -V PORTDOCS

[root@fbsd3 isboot-kmod]# make && find `make -V STAGEDIR` -type f
/usr/ports/net/isboot-kmod/work/stage/boot/modules/isboot.ko
Comment 11 Kurt Jaeger freebsd_committer freebsd_triage 2015-09-24 03:34:41 UTC
(In reply to John Nielsen from comment #5)
Yes, builds on 9.3amd64.
Comment 12 John Nielsen 2015-09-24 03:45:19 UTC
Created attachment 161319 [details]
2nd revised version (shar)

Thanks hrs for your feedback. This version incorporates your suggestions and results in a much simpler Makefile.

@yonas, let me know if you end up with a README after installing from this version.

Kurt, thanks for build testing on 9.3.
Comment 13 Kurt Jaeger freebsd_committer freebsd_triage 2015-09-24 05:47:32 UTC
Created attachment 161320 [details]
next-try

This version builds on all versions (11a, 10.2a+i, 9.3a)
Comment 14 Yonas Yanfa 2015-09-24 08:42:33 UTC
(In reply to Kurt Jaeger from comment #13)

Nice work, I can find the readme using attachment 161320 [details].
Comment 15 commit-hook freebsd_committer freebsd_triage 2015-09-24 10:29:04 UTC
A commit references this bug:

Author: pi
Date: Thu Sep 24 10:29:00 UTC 2015
New revision: 397686
URL: https://svnweb.freebsd.org/changeset/ports/397686

Log:
  New port: net/isboot-kmod

  This installs Daisuke Aoyama's isboot kernel module, which allows
  booting FreeBSD directly from an iSCSI root disk. If your BIOS
  supports iSCSI you may configure your target settings in the BIOS
  and boot directly. If not, you may PXE boot using software that
  contains iSCSI support such as iPXE. The module reads the iSCSI
  Boot Firmware Table (IBFT) to configure the network and re-attach
  the volume once the kernel begins execution.

  WWW: http://shell.peach.ne.jp/aoyama/archives/2115 (Japanese)

  PR:		203294
  Submitted by:	John Nielsen <john@jnielsen.net>

Changes:
  head/net/Makefile
  head/net/isboot-kmod/
  head/net/isboot-kmod/Makefile
  head/net/isboot-kmod/distinfo
  head/net/isboot-kmod/files/
  head/net/isboot-kmod/files/patch-iscsi.c
  head/net/isboot-kmod/files/pkg-message.in
  head/net/isboot-kmod/pkg-descr
Comment 16 Kurt Jaeger freebsd_committer freebsd_triage 2015-09-24 10:32:35 UTC
Committed, thanks!
Comment 17 Yonas Yanfa 2015-09-24 10:48:35 UTC
You guys are awesome :P
Comment 18 John Nielsen 2015-09-24 14:44:33 UTC
(In reply to Kurt Jaeger from comment #16)

Thanks for the -HEAD patch and for committing! And thanks again all for the feedback and testing.