Add git commits to writer log files.
[dcpomatic.git] / src / tools / dcpomatic_disk_writer.cc
index 3fabe3e28f8a90bb0b216351d490e8ace4650416..66f34794347e3fd6885e2ae012cca2278b76944c 100644 (file)
@@ -18,6 +18,7 @@
 
 */
 
+#include "lib/version.h"
 #include "lib/disk_writer_messages.h"
 #include "lib/compose.hpp"
 #include "lib/exceptions.h"
@@ -243,12 +244,12 @@ void
 write (boost::filesystem::path dcp_path, string device)
 try
 {
-//     ext4_dmask_set (DEBUG_ALL);
+       ext4_dmask_set (DEBUG_ALL);
 
        /* We rely on static initialization for these */
        static struct ext4_fs fs;
        static struct ext4_mkfs_info info;
-       info.block_size = 1024;
+       info.block_size = 4096;
        info.inode_size = 128;
        info.journal = false;
 
@@ -277,7 +278,6 @@ try
 
        /* XXX: not sure if disk_id matters */
        int r = ext4_mbr_write (bd, &parts, 0);
-
        if (r) {
                throw CopyError ("Failed to write MBR", r);
        }
@@ -439,7 +439,7 @@ try
                /* Do some basic sanity checks; this is a bit belt-and-braces but it can't hurt... */
 
 #ifdef DCPOMATIC_OSX
-               if (!starts_with(*device, "/dev/rdisk")) {
+               if (!starts_with(*device, "/dev/disk")) {
                        LOG_DISK ("Will not write to %1", *device);
                        nanomsg->send(DISK_WRITER_ERROR "\nRefusing to write to this drive\n1\n", LONG_TIMEOUT);
                        return true;
@@ -511,7 +511,7 @@ main ()
         * redirect this to a file in /var/log
         */
        dcpomatic_log.reset(new StdoutLog(LogEntry::TYPE_DISK));
-       LOG_DISK_NC("dcpomatic_disk_writer started");
+       LOG_DISK("dcpomatic_disk_writer %1 started", dcpomatic_git_commit);
 #else
        /* XXX: this is a hack, but I expect we'll need logs and I'm not sure if there's
         * a better place to put them.