aboutsummaryrefslogtreecommitdiff
path: root/verifysetup/cmd
diff options
context:
space:
mode:
authoraxtloss <axtlos@getcryst.al>2024-02-17 22:18:25 +0100
committeraxtloss <axtlos@getcryst.al>2024-02-17 22:18:25 +0100
commit6a3db4c72485aba6187466005473e287f539e3ce (patch)
tree463ce5e3f04f8197cd40565e8ce35c0f98e6d694 /verifysetup/cmd
parent61cc5e9a02a38cd086d382e521509e85fecd6d07 (diff)
downloadfsverify-6a3db4c72485aba6187466005473e287f539e3ce.tar.gz
fsverify-6a3db4c72485aba6187466005473e287f539e3ce.tar.bz2
Clean up code
Diffstat (limited to 'verifysetup/cmd')
-rw-r--r--verifysetup/cmd/setup.go13
1 files changed, 1 insertions, 12 deletions
diff --git a/verifysetup/cmd/setup.go b/verifysetup/cmd/setup.go
index 940c4cd..c2ba790 100644
--- a/verifysetup/cmd/setup.go
+++ b/verifysetup/cmd/setup.go
@@ -62,7 +62,7 @@ func checksumBlock(blockStart int, blockEnd int, bundleSize int, diskBytes []byt
}
func SetupCommand(_ *cobra.Command, args []string) error {
- if len(args) != 3 {
+ if len(args) != 3 && len(args) != 4 {
return fmt.Errorf("Usage: verifysetup setup [partition] [procCount] [fsverify partition output] <minisign directory>")
}
var minisignDir string
@@ -89,10 +89,6 @@ func SetupCommand(_ *cobra.Command, args []string) error {
diskSize := diskInfo.Size()
bundleSize := math.Floor(float64(diskSize / int64(procCount)))
blockCount := math.Ceil(float64(bundleSize / 2000))
- lastBlockSize := int(diskSize) - int(bundleSize)*procCount
- fmt.Println(diskSize)
- fmt.Println(int(bundleSize))
- fmt.Println(lastBlockSize)
diskBytes := make([]byte, diskSize)
_, err = disk.Read(diskBytes)
if err != nil {
@@ -139,8 +135,6 @@ func SetupCommand(_ *cobra.Command, args []string) error {
if err != nil {
return err
}
- fmt.Println(string(signature))
-
sig := minisign.Signature{}
err = sig.UnmarshalText(signature)
if err != nil {
@@ -159,18 +153,13 @@ func SetupCommand(_ *cobra.Command, args []string) error {
return err
}
defer db.Close()
- fmt.Println("Reading from disk")
dbInfo, err := fsverifydb.Stat()
if err != nil {
return err
}
dbSize := dbInfo.Size()
-
verifyPart := make([]byte, 200+dbSize)
header, err := core.CreateHeader(unsignedHash, signedHash, int(diskSize), int(dbSize))
-
- fmt.Printf("%x\n", header)
-
database := make([]byte, dbSize)
_, err = fsverifydb.Read(database)
if err != nil {