I am a bit fed up chasing down the appropriate source for the "zpool" utility, inserting one line (to set "ashift" to 12) and then recompiling it.
This time (for NexentaStor 3.1.0) I decided to patch the binary. Thus, I do not need to care from which source exactly they produced the "zpool" utility.
It goes like this:
--- zpool_nxs310.save.dis 2011-07-30 13:47:58.675595763 +0200
+++ zpool_nxs310.dis 2011-07-30 15:44:50.378893898 +0200
@@ -12667,13 +12667,12 @@
805d901: ff b5 5c fb ff ff pushl -0x4a4(%ebp)
805d907: e8 28 69 ff ff call 8054234 <nvlist_add_uint64@plt>
805d90c: 83 c4 10 add $0x10,%esp
- 805d90f: 85 c0 test %eax,%eax
- 805d911: 74 1a je 805d92d <make_leaf_vdev+0x265>
- 805d913: 83 ec 04 sub $0x4,%esp
- 805d916: 68 d9 01 00 00 push $0x1d9
- 805d91b: 68 00 5f 06 08 push $0x8065f00
- 805d920: 68 10 5f 06 08 push $0x8065f10
- 805d925: e8 8a 66 ff ff call 8053fb4 <__assert@plt>
+ 805d90f: 68 00 00 00 00 push $0x0
+ 805d914: 68 0c 00 00 00 push $0xc
+ 805d919: 68 10 5f 06 08 push $0x8065f10
+ 805d91e: ff b5 5c fb ff ff pushl -0x4a4(%ebp)
+ 805d924: e8 0b 69 ff ff call 8054234 <nvlist_add_uint64@plt>
+ 805d929: 90 nop
805d92a: 83 c4 10 add $0x10,%esp
805d92d: 83 ec 08 sub $0x8,%esp
805d930: 68 f8 5e 06 08 push $0x8065ef8
By overwriting a conditional call to "assert" which is not really needed (if you know what you are doing), one is able to sneak in another call to "nvlist_add_uint64" for the "ashift" value. The "ashift" string comes from 0x8065f10, where previously the string for the "assertion failed" message was located. I am using a hardcoded value of 12 for "ashift" (the "push 0xc").
You can find the binary here.
If you want, you can check its (and my) integrity by doing a "cmp -lc zpool zpool-nxs310".
Thanks