osbase/fat32: write file creation time

Add file creation times to directory entries. This was already partially
implemented, and there even was a test. But the test was conditional on
the kernel version, and the version comparison was broken. The test
timestamps were also wrong, as the last component of time.Date is
nanoseconds, not milliseconds.

Change-Id: Ic00d6bb27aced918df018c9ff3148d12ecb07753
Reviewed-on: https://review.monogon.dev/c/monogon/+/3608
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/osbase/fat32/fat32.go b/osbase/fat32/fat32.go
index 65f03e5..c8d4ec9 100644
--- a/osbase/fat32/fat32.go
+++ b/osbase/fat32/fat32.go
@@ -161,9 +161,13 @@
 		selfSize = 0 // Directories don't have an explicit size
 	}
 	date, t, _ := timeToMsDosTime(i.ModTime)
+	cdate, ctime, ctens := timeToMsDosTime(i.CreateTime)
 	if err := binary.Write(w, binary.LittleEndian, &dirEntry{
 		DOSName:           i.dosName,
 		Attributes:        uint8(i.Attrs),
+		CreationTenMilli:  ctens,
+		CreationTime:      ctime,
+		CreationDate:      cdate,
 		FirstClusterHigh:  uint16(i.startCluster >> 16),
 		LastWrittenToTime: t,
 		LastWrittenToDate: date,
@@ -212,6 +216,9 @@
 			// Time is intentionally taken from this directory, not the parent
 			if err := binary.Write(w, binary.LittleEndian, &dirEntry{
 				DOSName:           [11]byte{'.', '.', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
+				CreationDate:      cdate,
+				CreationTime:      ctime,
+				CreationTenMilli:  ctens,
 				LastWrittenToTime: t,
 				LastWrittenToDate: date,
 				Attributes:        uint8(AttrDirectory),