Skip to content

Commit

Permalink
Add attestation script
Browse files Browse the repository at this point in the history
It is a bit specific for lundman but it will help
as a start
  • Loading branch information
lundman committed Oct 22, 2024
1 parent 5f4f271 commit 0700b8d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
44 changes: 44 additions & 0 deletions contrib/windows/attestation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
#
# Submit installer to Microsoft to be signed with EV certificate.
#
# 1: Compile project with codesign
# 2: Run this script with no arguments
# it will read the openzfs.ddf file and create disk1/openzfs.cab
# 3: Go to URL and add "New Hardware Submission" upload openzfs.cab
# 4: Wait for the signature, and "Download signed files"
# Can be hard to find, click small "More" on the upload line.
# 5: Run script again with downloaded filename as argument.
# MS signed binaries are copied into out/ directory, do not compile again
# 6: Run Inno Setup and produce installer.
#
# 20231212 lundman
#
# This script should probably be made less "lundman only".

# No args?
CERT=05855aef9ca26ecca0473d2563bd0497b47e6f4d

WDK_BASE_PATH="/c/Program Files (x86)/Windows Kits/10/bin"
LATEST_VERSION=$(ls "$WDK_BASE_PATH" | grep "..\..\......\.." | tail -n 1)
SIGNTOOL="$WDK_BASE_PATH/$LATEST_VERSION/x64/signtool.exe"

if [ $# -eq 0 ]; then

makecab -f contrib/windows/openzfs.ddf

"$SIGNTOOL" sign -v -as -fd sha256 -td sha256 -sha1 $CERT -tr http://ts.ssl.com disk1/OpenZFS.cab

echo "Now go to https://partner.microsoft.com/en-us/dashboard/hardware/driver/New#?productId=14183878782569539"
echo "Sign it, and download new package, run:"
echo " $0 Signed_XXXX.zip "

exit 0
fi


rm -rf drivers
unzip $1
cp drivers/OpenZFS/* out/build/x64-Debug/module/os/windows/driver/

echo "Now run Inno Setup to produce installer"
24 changes: 24 additions & 0 deletions contrib/windows/openzfs.ddf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;*** OpenZFS.ddf example
;
.OPTION EXPLICIT ; Generate errors
.Set CabinetFileCountThreshold=0
.Set FolderFileCountThreshold=0
.Set FolderSizeThreshold=0
.Set MaxCabinetSize=0
.Set MaxDiskFileCount=0
.Set MaxDiskSize=0
.Set CompressionType=MSZIP
.Set Cabinet=on
.Set Compress=on
;Specify file name for new cab file
.Set CabinetNameTemplate=OpenZFS.cab
; Specify the subdirectory for the files.
; Your cab file should not have files at the root level,
; and each driver package must be in a separate subfolder.
.Set DestinationDir=OpenZFS
;Specify files to be included in cab file
C:\src\openzfs\out\build\x64-Debug\module\os\windows\driver\OpenZFS.Inf
C:\src\openzfs\out\build\x64-Debug\module\os\windows\driver\OpenZFS.sys
C:\src\openzfs\out\build\x64-Debug\module\os\windows\driver\OpenZFS.pdb
C:\src\openzfs\out\build\x64-Debug\module\os\windows\driver\OpenZFS.cat
C:\src\openzfs\out\build\x64-Debug\module\os\windows\driver\OpenZFS.man

0 comments on commit 0700b8d

Please sign in to comment.