diff --git a/.clang-format b/.clang-format
index 3b9352e..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -6,12 +6,14 @@
 AlignConsecutiveAssignments: false
 AlignConsecutiveDeclarations: false
 AlignEscapedNewlines: Right
-AlignOperands:   true
-AlignTrailingComments: true
+AlignOperands:  Align
+AlignTrailingComments:
+  Kind: Always
+  OverEmptyLines: 1
 AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
 AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
+AllowShortFunctionsOnASingleLine: Empty
 AllowShortIfStatementsOnASingleLine: false
 AllowShortLoopsOnASingleLine: false
 AlwaysBreakAfterReturnType: None
@@ -36,12 +38,13 @@
   SplitEmptyFunction:   false
   SplitEmptyRecord:     false
   SplitEmptyNamespace:  false
+BreakAfterAttributes: Never
 BreakBeforeBinaryOperators: None
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: true
 BreakConstructorInitializers: AfterColon
 BreakInheritanceList: AfterColon
-BreakStringLiterals: true
+BreakStringLiterals: false
 ColumnLimit:     80
 CommentPragmas:  '^ IWYU pragma:'
 CompactNamespaces: false
@@ -49,6 +52,7 @@
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
+DeriveLineEnding: false
 DerivePointerAlignment: false
 PointerAlignment: Left
 DisableFormat:   false
@@ -74,9 +78,13 @@
   - Regex:           '.*'
     Priority:        6
 IndentCaseLabels: true
+IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+InsertNewlineAtEOF: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
@@ -84,13 +92,19 @@
 ObjCBlockIndentWidth: 2
 ObjCSpaceAfterProperty: false
 ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 25
 PenaltyBreakBeforeFirstCallParameter: 19
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+QualifierAlignment: Left
+ReferenceAlignment: Left
 ReflowComments:  true
+RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
 SortIncludes:    true
 SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
@@ -113,4 +127,3 @@
 UseTab:          Never
 ...
 
-
diff --git a/include/erase.hpp b/include/erase.hpp
index 8acd3d8..e591043 100644
--- a/include/erase.hpp
+++ b/include/erase.hpp
@@ -12,8 +12,7 @@
     /** @brief creates an erase object
      *  @param inDevPath the linux path for the block device
      */
-    Erase(std::string_view inDevPath) : devPath(inDevPath)
-    {}
+    Erase(std::string_view inDevPath) : devPath(inDevPath) {}
 
   protected:
     /* The linux path for the block device */
diff --git a/include/pattern.hpp b/include/pattern.hpp
index e8c61ee..7e9b126 100644
--- a/include/pattern.hpp
+++ b/include/pattern.hpp
@@ -21,8 +21,7 @@
      *
      *  @param[in] inDevPath - the linux device path for the block device.
      */
-    Pattern(std::string_view inDevPath) : Erase(inDevPath)
-    {}
+    Pattern(std::string_view inDevPath) : Erase(inDevPath) {}
 
     /** @brief writes an uncompressible random pattern to the drive, using
      * default parameters. It also throws errors accordingly.
diff --git a/include/verifyDriveGeometry.hpp b/include/verifyDriveGeometry.hpp
index ee8b3b7..5d17957 100644
--- a/include/verifyDriveGeometry.hpp
+++ b/include/verifyDriveGeometry.hpp
@@ -15,8 +15,7 @@
      *
      *  @param[in] inDevPath - the linux device path for the block device.
      */
-    VerifyDriveGeometry(std::string_view inDevPath) : Erase(inDevPath)
-    {}
+    VerifyDriveGeometry(std::string_view inDevPath) : Erase(inDevPath) {}
 
     /** @brief Test if input is in between the max and min expected sizes,
      * and throws errors accordingly.
diff --git a/include/zero.hpp b/include/zero.hpp
index bfa240d..25bc04e 100644
--- a/include/zero.hpp
+++ b/include/zero.hpp
@@ -20,8 +20,7 @@
      *
      *  @param[in] inDevPath - the linux device path for the block device.
      */
-    Zero(std::string_view inDevPath) : Erase(inDevPath)
-    {}
+    Zero(std::string_view inDevPath) : Erase(inDevPath) {}
     /** @brief writes zero to the drive
      * and throws errors accordingly.
      *  @param[in] driveSize - the size of the block device in bytes
diff --git a/src/erase/pattern.cpp b/src/erase/pattern.cpp
index 7d7990b..7855fc9 100644
--- a/src/erase/pattern.cpp
+++ b/src/erase/pattern.cpp
@@ -76,7 +76,6 @@
 
 void Pattern::verifyPattern(const uint64_t driveSize, Fd& fd)
 {
-
     uint64_t currentIndex = 0;
     // random number generator seeded with a constant value will
     // generate a predictable sequence of values NOLINTNEXTLINE
diff --git a/src/erase/sanitize.cpp b/src/erase/sanitize.cpp
index ac1770d..dbf92f5 100644
--- a/src/erase/sanitize.cpp
+++ b/src/erase/sanitize.cpp
@@ -73,7 +73,6 @@
 
 void Sanitize::emmcErase(uint64_t driveSize)
 {
-
     uint64_t sectorSize = 0x200; // default value see eMMC spec 6.6.34.
                                  // NOTE: 0x200 is only valid for eMMC greater
                                  // then 2 GB
@@ -105,7 +104,6 @@
 
 void Sanitize::emmcSanitize()
 {
-
     struct mmc_ioc_cmd idata = {};
     idata.write_flag = 1;
     idata.opcode = mmcSwitch;
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index 341440a..3a6a8bb 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -48,8 +48,8 @@
     /* Get the filename of the device (without "/dev/"). */
     std::string deviceName = std::filesystem::path(devPath).filename().string();
     /* DBus object path */
-    std::string objectPath =
-        "/xyz/openbmc_project/inventory/storage/" + deviceName;
+    std::string objectPath = "/xyz/openbmc_project/inventory/storage/" +
+                             deviceName;
 
     /* Add Volume interface. */
     volumeInterface = objectServer.add_interface(
@@ -59,13 +59,15 @@
                              Volume::FilesystemType type) {
             this->formatLuks(password, type);
         });
-    volumeInterface->register_method(
-        "Erase",
-        [this](Volume::EraseMethod eraseType) { this->erase(eraseType); });
+    volumeInterface->register_method("Erase",
+                                     [this](Volume::EraseMethod eraseType) {
+        this->erase(eraseType);
+    });
     volumeInterface->register_method("Lock", [this]() { this->lock(); });
-    volumeInterface->register_method(
-        "Unlock",
-        [this](std::vector<uint8_t>& password) { this->unlock(password); });
+    volumeInterface->register_method("Unlock",
+                                     [this](std::vector<uint8_t>& password) {
+        this->unlock(password);
+    });
     volumeInterface->register_method(
         "ChangePassword", [this](const std::vector<uint8_t>& oldPassword,
                                  const std::vector<uint8_t>& newPassword) {
@@ -74,8 +76,8 @@
     volumeInterface->register_property_r(
         "Locked", lockedProperty, sdbusplus::vtable::property_::emits_change,
         [this](bool& value) {
-            value = this->isLocked();
-            return value;
+        value = this->isLocked();
+        return value;
         });
 
     /* Add Drive interface. */
@@ -89,16 +91,16 @@
     driveInterface->register_property_r(
         "Locked", lockedProperty, sdbusplus::vtable::property_::emits_change,
         [this](bool& value) {
-            value = this->isLocked();
-            return value;
+        value = this->isLocked();
+        return value;
         });
 
     driveInterface->register_property_r(
         "EncryptionStatus", encryptionStatus,
         sdbusplus::vtable::property_::emits_change,
         [this](Drive::DriveEncryptionState& value) {
-            value = this->findEncryptionStatus();
-            return value;
+        value = this->findEncryptionStatus();
+        return value;
         });
 
     embeddedLocationInterface = objectServer.add_interface(
@@ -335,7 +337,6 @@
 
 CryptHandle EStoraged::loadLuksHeader()
 {
-
     CryptHandle cryptHandle(devPath);
 
     int retval = cryptIface->cryptLoad(cryptHandle.get(), CRYPT_LUKS2, nullptr);
diff --git a/src/getConfig.cpp b/src/getConfig.cpp
index 1046416..79579b1 100644
--- a/src/getConfig.cpp
+++ b/src/getConfig.cpp
@@ -34,15 +34,15 @@
         [self, path, owner](
             const boost::system::error_code ec,
             boost::container::flat_map<std::string, BasicVariantType>& data) {
-            if (ec)
-            {
-                lg2::error("Error getting properties for {PATH}", "PATH", path,
-                           "REDFISH_MESSAGE_ID",
-                           std::string("OpenBMC.0.1.GetStorageInfoFail"));
-                return;
-            }
+        if (ec)
+        {
+            lg2::error("Error getting properties for {PATH}", "PATH", path,
+                       "REDFISH_MESSAGE_ID",
+                       std::string("OpenBMC.0.1.GetStorageInfoFail"));
+            return;
+        }
 
-            self->respData[path] = std::move(data);
+        self->respData[path] = std::move(data);
         },
         owner, path, "org.freedesktop.DBus.Properties", "GetAll",
         emmcConfigInterface);
@@ -53,28 +53,28 @@
     std::shared_ptr<GetStorageConfiguration> self = shared_from_this();
     dbusConnection->async_method_call(
         [self](const boost::system::error_code ec, const GetSubTreeType& ret) {
-            if (ec)
+        if (ec)
+        {
+            lg2::error("Error calling mapper");
+            return;
+        }
+        for (const auto& [objPath, objDict] : ret)
+        {
+            if (objDict.empty())
             {
-                lg2::error("Error calling mapper");
                 return;
             }
-            for (const auto& [objPath, objDict] : ret)
+            const std::string& objOwner = objDict.begin()->first;
+            /* Look for the config interface exposed by this object. */
+            for (const std::string& interface : objDict.begin()->second)
             {
-                if (objDict.empty())
+                if (interface.compare(emmcConfigInterface) == 0)
                 {
-                    return;
-                }
-                const std::string& objOwner = objDict.begin()->first;
-                /* Look for the config interface exposed by this object. */
-                for (const std::string& interface : objDict.begin()->second)
-                {
-                    if (interface.compare(emmcConfigInterface) == 0)
-                    {
-                        /* Get the properties exposed by this interface. */
-                        self->getStorageInfo(objPath, objOwner);
-                    }
+                    /* Get the properties exposed by this interface. */
+                    self->getStorageInfo(objPath, objOwner);
                 }
             }
+        }
         },
         mapper::busName, mapper::path, mapper::interface, mapper::subtree, "/",
         0, std::vector<const char*>(1, emmcConfigInterface));
diff --git a/src/main.cpp b/src/main.cpp
index 578d505..db3173a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,72 +40,67 @@
         dbusConnection,
         [&objectServer, &storageObjects](
             const estoraged::ManagedStorageType& storageConfigurations) {
-            size_t numConfigObj = storageConfigurations.size();
-            if (numConfigObj > 1)
+        size_t numConfigObj = storageConfigurations.size();
+        if (numConfigObj > 1)
+        {
+            lg2::error("eStoraged can only manage 1 eMMC device; found {NUM}",
+                       "NUM", numConfigObj, "REDFISH_MESSAGE_ID",
+                       std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
+            return;
+        }
+
+        for (const std::pair<sdbusplus::message::object_path,
+                             estoraged::StorageData>& storage :
+             storageConfigurations)
+        {
+            const std::string& path = storage.first.str;
+
+            if (storageObjects.find(path) != storageObjects.end())
             {
-                lg2::error(
-                    "eStoraged can only manage 1 eMMC device; found {NUM}",
-                    "NUM", numConfigObj, "REDFISH_MESSAGE_ID",
-                    std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
-                return;
+                /*
+                 * We've already created this object, or at least
+                 * attempted to.
+                 */
+                continue;
             }
 
-            for (const std::pair<sdbusplus::message::object_path,
-                                 estoraged::StorageData>& storage :
-                 storageConfigurations)
+            /* Get the properties from the config object. */
+            const estoraged::StorageData& data = storage.second;
+
+            /* Look for the device file. */
+            const std::filesystem::path blockDevDir{"/sys/block"};
+            std::filesystem::path deviceFile, sysfsDir;
+            std::string luksName;
+            bool found = estoraged::util::findDevice(
+                data, blockDevDir, deviceFile, sysfsDir, luksName);
+            if (!found)
             {
-                const std::string& path = storage.first.str;
-
-                if (storageObjects.find(path) != storageObjects.end())
-                {
-                    /*
-                     * We've already created this object, or at least
-                     * attempted to.
-                     */
-                    continue;
-                }
-
-                /* Get the properties from the config object. */
-                const estoraged::StorageData& data = storage.second;
-
-                /* Look for the device file. */
-                const std::filesystem::path blockDevDir{"/sys/block"};
-                std::filesystem::path deviceFile, sysfsDir;
-                std::string luksName;
-                bool found = estoraged::util::findDevice(
-                    data, blockDevDir, deviceFile, sysfsDir, luksName);
-                if (!found)
-                {
-                    lg2::error(
-                        "Device not found for path {PATH}", "PATH", path,
-                        "REDFISH_MESSAGE_ID",
-                        std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
-                    /*
-                     * Set a NULL pointer as a placeholder, so that we don't
-                     * try and fail again later.
-                     */
-                    storageObjects[path] = nullptr;
-                    continue;
-                }
-
-                uint64_t size =
-                    estoraged::util::findSizeOfBlockDevice(deviceFile);
-
-                uint8_t lifeleft =
-                    estoraged::util::findPredictedMediaLifeLeftPercent(
-                        sysfsDir);
-                std::string partNumber =
-                    estoraged::util::getPartNumber(sysfsDir);
-                std::string serialNumber =
-                    estoraged::util::getSerialNumber(sysfsDir);
-                /* Create the storage object. */
-                storageObjects[path] = std::make_unique<estoraged::EStoraged>(
-                    objectServer, path, deviceFile, luksName, size, lifeleft,
-                    partNumber, serialNumber);
-                lg2::info("Created eStoraged object for path {PATH}", "PATH",
-                          path, "REDFISH_MESSAGE_ID",
-                          std::string("OpenBMC.0.1.CreateStorageObjects"));
+                lg2::error("Device not found for path {PATH}", "PATH", path,
+                           "REDFISH_MESSAGE_ID",
+                           std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
+                /*
+                 * Set a NULL pointer as a placeholder, so that we don't
+                 * try and fail again later.
+                 */
+                storageObjects[path] = nullptr;
+                continue;
             }
+
+            uint64_t size = estoraged::util::findSizeOfBlockDevice(deviceFile);
+
+            uint8_t lifeleft =
+                estoraged::util::findPredictedMediaLifeLeftPercent(sysfsDir);
+            std::string partNumber = estoraged::util::getPartNumber(sysfsDir);
+            std::string serialNumber =
+                estoraged::util::getSerialNumber(sysfsDir);
+            /* Create the storage object. */
+            storageObjects[path] = std::make_unique<estoraged::EStoraged>(
+                objectServer, path, deviceFile, luksName, size, lifeleft,
+                partNumber, serialNumber);
+            lg2::info("Created eStoraged object for path {PATH}", "PATH", path,
+                      "REDFISH_MESSAGE_ID",
+                      std::string("OpenBMC.0.1.CreateStorageObjects"));
+        }
         });
     getter->getConfiguration();
 }
@@ -134,34 +129,33 @@
         boost::asio::deadline_timer filterTimer(io);
         std::function<void(sdbusplus::message_t&)> eventHandler =
             [&](sdbusplus::message_t& message) {
-                if (message.is_method_error())
+            if (message.is_method_error())
+            {
+                lg2::error("eventHandler callback method error");
+                return;
+            }
+            /*
+             * This implicitly cancels the timer, if it's already pending.
+             * If there's a burst of events within a short period, we want
+             * to handle them all at once. So, we will wait this long for no
+             * more events to occur, before processing them.
+             */
+            filterTimer.expires_from_now(boost::posix_time::seconds(1));
+
+            filterTimer.async_wait([&](const boost::system::error_code& ec) {
+                if (ec == boost::asio::error::operation_aborted)
                 {
-                    lg2::error("eventHandler callback method error");
+                    /* we were canceled */
                     return;
                 }
-                /*
-                 * This implicitly cancels the timer, if it's already pending.
-                 * If there's a burst of events within a short period, we want
-                 * to handle them all at once. So, we will wait this long for no
-                 * more events to occur, before processing them.
-                 */
-                filterTimer.expires_from_now(boost::posix_time::seconds(1));
-
-                filterTimer.async_wait(
-                    [&](const boost::system::error_code& ec) {
-                        if (ec == boost::asio::error::operation_aborted)
-                        {
-                            /* we were canceled */
-                            return;
-                        }
-                        if (ec)
-                        {
-                            lg2::error("timer error");
-                            return;
-                        }
-                        createStorageObjects(server, storageObjects, conn);
-                    });
-            };
+                if (ec)
+                {
+                    lg2::error("timer error");
+                    return;
+                }
+                createStorageObjects(server, storageObjects, conn);
+            });
+        };
 
         auto match = std::make_unique<sdbusplus::bus::match_t>(
             static_cast<sdbusplus::bus_t&>(*conn),
diff --git a/src/test/erase/crypto_test.cpp b/src/test/erase/crypto_test.cpp
index 9eefa9d..dd3954e 100644
--- a/src/test/erase/crypto_test.cpp
+++ b/src/test/erase/crypto_test.cpp
@@ -63,8 +63,8 @@
 
     EXPECT_CALL(*mockCryptIface, cryptKeyslotDestroy(_, 0)).Times(1);
 
-    CryptErase myCryptErase =
-        CryptErase(testFileName.c_str(), std::move(mockCryptIface));
+    CryptErase myCryptErase = CryptErase(testFileName.c_str(),
+                                         std::move(mockCryptIface));
     EXPECT_NO_THROW(myCryptErase.doErase());
 }
 
@@ -79,8 +79,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeySlotMax(StrEq(CRYPT_LUKS2)))
         .WillOnce(Return(-1));
 
-    CryptErase myCryptErase =
-        CryptErase(testFileName.c_str(), std::move(mockCryptIface));
+    CryptErase myCryptErase = CryptErase(testFileName.c_str(),
+                                         std::move(mockCryptIface));
     EXPECT_THROW(myCryptErase.doErase(), ResourceNotFound);
 }
 
@@ -95,8 +95,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeySlotMax(StrEq(CRYPT_LUKS2)))
         .WillOnce(Return(0));
 
-    CryptErase myCryptErase =
-        CryptErase(testFileName.c_str(), std::move(mockCryptIface));
+    CryptErase myCryptErase = CryptErase(testFileName.c_str(),
+                                         std::move(mockCryptIface));
     EXPECT_THROW(myCryptErase.doErase(), ResourceNotFound);
 }
 
@@ -114,8 +114,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeySlotStatus(_, _))
         .WillRepeatedly(Return(CRYPT_SLOT_INVALID));
 
-    CryptErase myCryptErase =
-        CryptErase(testFileName.c_str(), std::move(mockCryptIface));
+    CryptErase myCryptErase = CryptErase(testFileName.c_str(),
+                                         std::move(mockCryptIface));
     EXPECT_NO_THROW(myCryptErase.doErase());
 }
 
@@ -136,8 +136,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeyslotDestroy(_, 0))
         .WillOnce(Return(-1));
 
-    CryptErase myCryptErase =
-        CryptErase(testFileName.c_str(), std::move(mockCryptIface));
+    CryptErase myCryptErase = CryptErase(testFileName.c_str(),
+                                         std::move(mockCryptIface));
     EXPECT_THROW(myCryptErase.doErase(), InternalFailure);
 }
 
diff --git a/src/test/erase/pattern_test.cpp b/src/test/erase/pattern_test.cpp
index 0693163..e8ea6ce 100644
--- a/src/test/erase/pattern_test.cpp
+++ b/src/test/erase/pattern_test.cpp
@@ -166,8 +166,8 @@
     size_t shortSize = 128;
     Pattern tryPattern(testFileName);
     auto shortData = std::vector<std::byte>(shortSize, std::byte{0});
-    auto restOfData =
-        std::vector<std::byte>(size - shortSize * 3, std::byte{0});
+    auto restOfData = std::vector<std::byte>(size - shortSize * 3,
+                                             std::byte{0});
     std::span shortDataSpan{shortData};
     std::span restOfDataSpan{restOfData};
     // open the file and write none to it
diff --git a/src/test/erase/zero_test.cpp b/src/test/erase/zero_test.cpp
index 8570154..f57cd62 100644
--- a/src/test/erase/zero_test.cpp
+++ b/src/test/erase/zero_test.cpp
@@ -126,8 +126,8 @@
     size_t shortSize = 128;
     Zero pass(testFileName);
     auto shortData = std::vector<std::byte>(shortSize, std::byte{0});
-    auto restOfData =
-        std::vector<std::byte>(size - shortSize * 3, std::byte{0});
+    auto restOfData = std::vector<std::byte>(size - shortSize * 3,
+                                             std::byte{0});
     std::span shortDataSpan{shortData};
     std::span restOfDataSpan{restOfData};
     stdplus::fd::FdMock mock;
@@ -159,8 +159,8 @@
     size_t shortSize = 128;
     Zero tryZero(testFileName);
     auto shortData = std::vector<std::byte>(shortSize, std::byte{0});
-    auto restOfData =
-        std::vector<std::byte>(size - shortSize * 3, std::byte{0});
+    auto restOfData = std::vector<std::byte>(size - shortSize * 3,
+                                             std::byte{0});
     std::span shortDataSpan{shortData};
     std::span restOfDataSpan{restOfData};
     // open the file and write none zero to it
diff --git a/src/test/util_test.cpp b/src/test/util_test.cpp
index 5f16068..b85fca0 100644
--- a/src/test/util_test.cpp
+++ b/src/test/util_test.cpp
@@ -31,7 +31,6 @@
 
 TEST(utilTest, estimatesSame)
 {
-
     std::string prefixName = ".";
     std::string testFileName = prefixName + "/life_time";
     std::ofstream testFile;
@@ -46,7 +45,6 @@
 
 TEST(utilTest, estimatesNotAvailable)
 {
-
     std::string prefixName = ".";
     std::string testFileName = prefixName + "/life_time";
     std::ofstream testFile;
diff --git a/src/util.cpp b/src/util.cpp
index b971646..8aad066 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -174,7 +174,7 @@
     }
 
     /* Look for the eMMC in the specified searchDir directory. */
-    for (auto const& dirEntry : std::filesystem::directory_iterator{searchDir})
+    for (const auto& dirEntry : std::filesystem::directory_iterator{searchDir})
     {
         /*
          * We will look at the 'type' file to determine if this is an MMC
