You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2018/12/12 01:55:00 UTC

[mynewt-core] branch master updated: Use syscfg settings for sysinit stage numbers

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new f5769ec  Use syscfg settings for sysinit stage numbers
f5769ec is described below

commit f5769ec3e2caf365e5a1036a300fe943a6feb67c
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Oct 25 11:32:25 2018 -0700

    Use syscfg settings for sysinit stage numbers
    
    This allows the app or target to rearrange package initialization order
    via syscfg overrides.
    
    Note: This requires an updated version of newt
    (https://github.com/apache/mynewt-newt/pull/230).  Older versions of
    newt fail to parse the updated `pkg.yml` files.
---
 boot/boot_serial/pkg.yml                           |  4 ++--
 boot/boot_serial/syscfg.yml                        | 11 ++++++++++
 boot/split/pkg.yml                                 |  2 +-
 {test/testutil => boot/split}/syscfg.yml           | 10 +++++----
 crypto/tinycrypt/pkg.yml                           |  2 +-
 crypto/tinycrypt/syscfg.yml                        |  5 +++++
 fs/fatfs/pkg.yml                                   |  2 +-
 {test/testutil => fs/fatfs}/syscfg.yml             | 10 +++++----
 fs/nffs/pkg.yml                                    |  2 +-
 fs/nffs/syscfg.yml                                 |  4 ++++
 hw/battery/pkg.yml                                 |  2 +-
 hw/battery/syscfg.yml                              |  5 +++++
 hw/bsp/nordic_pca20020/pkg.yml                     |  2 +-
 hw/bsp/nordic_pca20020/syscfg.yml                  |  5 +++++
 hw/bsp/ruuvitag_rev_b/pkg.yml                      |  4 ++--
 hw/bsp/ruuvitag_rev_b/syscfg.yml                   | 11 ++++++++++
 hw/charge-control/pkg.yml                          |  3 +--
 hw/charge-control/syscfg.yml                       |  5 +++++
 hw/drivers/bq27z561/pkg.yml                        |  2 +-
 hw/drivers/bq27z561/syscfg.yml                     |  4 ++++
 hw/drivers/lwip/stm32_eth/pkg.yml                  |  2 +-
 .../drivers/lwip/stm32_eth}/syscfg.yml             |  8 ++++---
 hw/sensor/creator/pkg.yml                          |  2 +-
 hw/sensor/creator/syscfg.yml                       |  4 ++++
 hw/sensor/pkg.yml                                  |  2 +-
 hw/sensor/syscfg.yml                               |  4 ++++
 kernel/os/pkg.yml                                  |  2 +-
 kernel/os/syscfg.yml                               |  4 ++++
 mgmt/imgmgr/pkg.yml                                |  2 +-
 mgmt/imgmgr/syscfg.yml                             |  4 ++++
 mgmt/newtmgr/pkg.yml                               |  2 +-
 {test/testutil => mgmt/newtmgr}/syscfg.yml         | 10 +++++----
 mgmt/newtmgr/transport/ble/pkg.yml                 |  2 +-
 .../newtmgr/transport/ble}/syscfg.yml              | 10 +++++----
 mgmt/newtmgr/transport/nmgr_shell/pkg.yml          |  2 +-
 .../newtmgr/transport/nmgr_shell}/syscfg.yml       | 10 +++++----
 mgmt/newtmgr/transport/nmgr_uart/pkg.yml           |  2 +-
 mgmt/newtmgr/transport/nmgr_uart/syscfg.yml        | 16 ++++++++------
 mgmt/oicmgr/pkg.yml                                |  2 +-
 mgmt/oicmgr/syscfg.yml                             | 21 +++++++++++-------
 net/ip/native_sockets/pkg.yml                      |  2 +-
 net/ip/native_sockets/syscfg.yml                   |  4 ++++
 net/ip/pkg.yml                                     |  2 +-
 net/ip/syscfg.yml                                  |  4 ++++
 net/lora/node/pkg.yml                              |  2 +-
 net/lora/node/syscfg.yml                           |  5 +++++
 net/oic/pkg.yml                                    | 12 +++++------
 net/oic/syscfg.yml                                 | 25 ++++++++++++++++++++++
 sys/config/pkg.yml                                 |  4 ++--
 sys/config/syscfg.yml                              | 10 +++++++++
 sys/console/full/pkg.yml                           |  2 +-
 sys/console/full/syscfg.yml                        |  5 +++++
 sys/console/minimal/pkg.yml                        |  2 +-
 sys/console/minimal/syscfg.yml                     |  7 +++++-
 sys/flash_map/pkg.yml                              |  2 +-
 sys/flash_map/syscfg.yml                           |  5 +++++
 sys/id/pkg.yml                                     |  2 +-
 sys/id/syscfg.yml                                  |  5 +++++
 sys/log/full/pkg.yml                               |  4 ++--
 sys/log/full/syscfg.yml                            |  9 ++++++++
 sys/log/modlog/pkg.yml                             |  2 +-
 sys/log/modlog/syscfg.yml                          |  4 ++++
 sys/metrics/pkg.yml                                |  2 +-
 sys/metrics/syscfg.yml                             |  4 ++++
 sys/mfg/pkg.yml                                    |  2 +-
 {test/testutil => sys/mfg}/syscfg.yml              |  8 ++++---
 sys/reboot/pkg.yml                                 |  2 +-
 sys/reboot/syscfg.yml                              |  5 +++++
 sys/shell/pkg.yml                                  |  2 +-
 sys/shell/syscfg.yml                               |  5 +++++
 sys/stats/full/pkg.yml                             |  2 +-
 sys/stats/full/syscfg.yml                          |  4 ++++
 sys/sysview/pkg.yml                                |  2 +-
 sys/sysview/syscfg.yml                             |  4 ++++
 test/crash_test/pkg.yml                            |  2 +-
 test/crash_test/syscfg.yml                         |  4 ++++
 test/flash_test/pkg.yml                            |  3 +--
 test/{testutil => flash_test}/syscfg.yml           | 10 +++++----
 test/i2c_scan/pkg.yml                              |  2 +-
 test/{testutil => i2c_scan}/syscfg.yml             | 10 +++++----
 test/runtest/pkg.yml                               |  2 +-
 test/runtest/syscfg.yml                            |  4 ++++
 test/testutil/pkg.yml                              |  2 +-
 test/testutil/syscfg.yml                           |  4 ++++
 time/timesched/pkg.yml                             |  2 +-
 {test/testutil => time/timesched}/syscfg.yml       | 10 +++++----
 86 files changed, 315 insertions(+), 107 deletions(-)

diff --git a/boot/boot_serial/pkg.yml b/boot/boot_serial/pkg.yml
index 8211eb4..fe552ff 100644
--- a/boot/boot_serial/pkg.yml
+++ b/boot/boot_serial/pkg.yml
@@ -42,5 +42,5 @@ pkg.cflags.SELFTEST:
     - -DBOOT_SERIAL_DETECT_PIN_CFG=0
 
 pkg.init:
-    boot_serial_os_dev_init: 0
-    boot_serial_pkg_init: 200
+    boot_serial_os_dev_init: 'MYNEWT_VAL(BOOT_SERIAL_SYSINIT_STAGE_OS_DEV)'
+    boot_serial_pkg_init: 'MYNEWT_VAL(BOOT_SERIAL_SYSINIT_STAGE_MAIN)'
diff --git a/boot/boot_serial/syscfg.yml b/boot/boot_serial/syscfg.yml
index e6c8e5f..47a005b 100644
--- a/boot/boot_serial/syscfg.yml
+++ b/boot/boot_serial/syscfg.yml
@@ -90,3 +90,14 @@ syscfg.defs:
             - '(BOOT_SERIAL_DETECT_PIN != -1) ||
                (BOOT_SERIAL_DETECT_TIMEOUT != 0) ||
 	       (BOOT_SERIAL_NVREG_INDEX != -1)'
+
+    BOOT_SERIAL_SYSINIT_STAGE_OS_DEV:
+        description: >
+            Sysinit stage for OS device initialization.  `os_init()` does not
+            get called for the boot loader, so this is needed as an
+            alternative.
+        value: 0
+
+    BOOT_SERIAL_SYSINIT_STAGE_MAIN:
+        description: Main sysinit stage for serial boot loader functionality.
+        value: 200
diff --git a/boot/split/pkg.yml b/boot/split/pkg.yml
index b42bc6f..ddd779a 100644
--- a/boot/split/pkg.yml
+++ b/boot/split/pkg.yml
@@ -31,4 +31,4 @@ pkg.req_apis:
     - bootloader
 
 pkg.init:
-    split_app_init: 500
+    split_app_init: 'MYNEWT_VAL(SPLIT_APP_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/boot/split/syscfg.yml
similarity index 85%
copy from test/testutil/syscfg.yml
copy to boot/split/syscfg.yml
index 073520b..c4cb77a 100644
--- a/test/testutil/syscfg.yml
+++ b/boot/split/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    SPLIT_APP_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for split image functionality.
+        value: 500
diff --git a/crypto/tinycrypt/pkg.yml b/crypto/tinycrypt/pkg.yml
index c336ca5..d5e7e40 100644
--- a/crypto/tinycrypt/pkg.yml
+++ b/crypto/tinycrypt/pkg.yml
@@ -30,4 +30,4 @@ pkg.deps.TINYCRYPT_UECC_RNG_USE_TRNG:
     - "@apache-mynewt-core/hw/drivers/trng"
 
 pkg.init.TINYCRYPT_UECC_RNG_USE_TRNG:
-    mynewt_tinycrypt_pkg_init: 200
+    mynewt_tinycrypt_pkg_init: 'MYNEWT_VAL(TINYCRYPT_SYSINIT_STAGE)'
diff --git a/crypto/tinycrypt/syscfg.yml b/crypto/tinycrypt/syscfg.yml
index f9b970a..eb8f983 100644
--- a/crypto/tinycrypt/syscfg.yml
+++ b/crypto/tinycrypt/syscfg.yml
@@ -27,3 +27,8 @@ syscfg.defs:
         description: >
             Name of OS device to use as TRNG source.
         value: '"trng"'
+
+    TINYCRYPT_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for tinycrypt.
+        value: 200
diff --git a/fs/fatfs/pkg.yml b/fs/fatfs/pkg.yml
index e1d6307..7bfd9d8 100644
--- a/fs/fatfs/pkg.yml
+++ b/fs/fatfs/pkg.yml
@@ -37,4 +37,4 @@ pkg.req_apis:
     - stats
 
 pkg.init:
-    fatfs_pkg_init: 200
+    fatfs_pkg_init: 'MYNEWT_VAL(FATFS_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/fs/fatfs/syscfg.yml
similarity index 86%
copy from test/testutil/syscfg.yml
copy to fs/fatfs/syscfg.yml
index 073520b..dd2df06 100644
--- a/test/testutil/syscfg.yml
+++ b/fs/fatfs/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    FATFS_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for FATFS functionality.
+        value: 200
diff --git a/fs/nffs/pkg.yml b/fs/nffs/pkg.yml
index dcab5a2..c93bb54 100644
--- a/fs/nffs/pkg.yml
+++ b/fs/nffs/pkg.yml
@@ -39,4 +39,4 @@ pkg.req_apis:
     - stats
 
 pkg.init:
-    nffs_pkg_init: 200
+    nffs_pkg_init: 'MYNEWT_VAL(NFFS_SYSINIT_STAGE)'
diff --git a/fs/nffs/syscfg.yml b/fs/nffs/syscfg.yml
index 9256c4e..ea32789 100644
--- a/fs/nffs/syscfg.yml
+++ b/fs/nffs/syscfg.yml
@@ -33,3 +33,7 @@ syscfg.defs:
             Number of areas to allocate in the NFFS disk.  A smaller number is
             used if the flash hardware cannot support this value.
         value: 8
+    NFFS_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for NFFS functionality.
+        value: 200
diff --git a/hw/battery/pkg.yml b/hw/battery/pkg.yml
index 1bb14bd..f6eafa5 100644
--- a/hw/battery/pkg.yml
+++ b/hw/battery/pkg.yml
@@ -28,4 +28,4 @@ pkg.req_apis:
     - console
 
 pkg.init:
-    battery_pkg_init: 501
+    battery_pkg_init: 'MYNEWT_VAL(BATTERY_SYSINIT_STAGE)'
diff --git a/hw/battery/syscfg.yml b/hw/battery/syscfg.yml
index 973ebc8..21479fc 100644
--- a/hw/battery/syscfg.yml
+++ b/hw/battery/syscfg.yml
@@ -31,3 +31,8 @@ syscfg.defs:
             Maximum number of supported battery properties. Number should
             be a minimum multiple of 32 that is grater of supported properties.
         value: 32
+
+    BATTERY_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for battery functionality.
+        value: 501
diff --git a/hw/bsp/nordic_pca20020/pkg.yml b/hw/bsp/nordic_pca20020/pkg.yml
index 35dd9a1..37fc8b8 100644
--- a/hw/bsp/nordic_pca20020/pkg.yml
+++ b/hw/bsp/nordic_pca20020/pkg.yml
@@ -44,4 +44,4 @@ pkg.deps.LIS2DH12_ONB:
     - "@apache-mynewt-core/hw/drivers/sensors/lis2dh12"
 
 pkg.init:
-    config_lis2dh12_sensor: 400
+    config_lis2dh12_sensor: 'MYNEWT_VAL(NORDIC_PCA20020_SYSINIT_STAGE)'
diff --git a/hw/bsp/nordic_pca20020/syscfg.yml b/hw/bsp/nordic_pca20020/syscfg.yml
index ac7ab2f..ca5cb31 100644
--- a/hw/bsp/nordic_pca20020/syscfg.yml
+++ b/hw/bsp/nordic_pca20020/syscfg.yml
@@ -39,6 +39,11 @@ syscfg.defs:
         description: 'NRF52 Thingy onboard lis2dh12 sensor'
         value:  0
 
+    NORDIC_PCA20020_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the PCA20020 BSP.
+        value: 400
+
 syscfg.vals:
     # Enable nRF52832 MCU
     MCU_NRF52832: 1
diff --git a/hw/bsp/ruuvitag_rev_b/pkg.yml b/hw/bsp/ruuvitag_rev_b/pkg.yml
index 1eb5c4b..66fc4f5 100644
--- a/hw/bsp/ruuvitag_rev_b/pkg.yml
+++ b/hw/bsp/ruuvitag_rev_b/pkg.yml
@@ -50,5 +50,5 @@ pkg.deps.LIS2DH12_ONB:
     - "@apache-mynewt-core/hw/drivers/sensors/lis2dh12"
 
 pkg.init:
-    config_bme280_sensor: 400
-    config_lis2dh12_sensor: 400
+    config_bme280_sensor: 'MYNEWT_VAL(RUUVITAG_REV_B_SYSINIT_STAGE_BME280)'
+    config_lis2dh12_sensor: 'MYNEWT_VAL(RUUVITAG_REV_B_SYSINIT_STAGE_LIS2DH12)'
diff --git a/hw/bsp/ruuvitag_rev_b/syscfg.yml b/hw/bsp/ruuvitag_rev_b/syscfg.yml
index 61ff5bb..f03577d 100644
--- a/hw/bsp/ruuvitag_rev_b/syscfg.yml
+++ b/hw/bsp/ruuvitag_rev_b/syscfg.yml
@@ -50,6 +50,17 @@ syscfg.defs:
         description: 'Enable RuuviTag onboard LIS2DH12 sensor (rev. B3 and newer)'
         value:  0
 
+    RUUVITAG_REV_B_SYSINIT_STAGE_BME280:
+        description: >
+            Sysinit stage for the Ruuvitag, Rev. B; initializes the BME280
+            sensor.
+        value: 400
+    RUUVITAG_REV_B_SYSINIT_STAGE_LIS2DH12:
+        description: >
+            Sysinit stage for the Ruuvitag, Rev. B; initializes the LIS2DH12
+            sensor.
+        value: 400
+
 syscfg.vals:
     # Enable nRF52832 MCU
     MCU_NRF52832: 1
diff --git a/hw/charge-control/pkg.yml b/hw/charge-control/pkg.yml
index 6b28caa..68b68b6 100644
--- a/hw/charge-control/pkg.yml
+++ b/hw/charge-control/pkg.yml
@@ -32,5 +32,4 @@ pkg.req_apis:
     - console
 
 pkg.init:
-    charge_control_pkg_init: 501
-
+    charge_control_pkg_init: 'MYNEWT_VAL(CHARGE_CONTROL_SYSINIT_STAGE)'
diff --git a/hw/charge-control/syscfg.yml b/hw/charge-control/syscfg.yml
index a711ca8..572fcbd 100644
--- a/hw/charge-control/syscfg.yml
+++ b/hw/charge-control/syscfg.yml
@@ -25,3 +25,8 @@ syscfg.defs:
         description: >
             Specify the eventq to be used by the charge control manager
         value:
+
+    CHARGE_CONTROL_SYSINIT_STAGE:
+        description:
+            Sysinit stage for charge control functionality.
+        value: 501
diff --git a/hw/drivers/bq27z561/pkg.yml b/hw/drivers/bq27z561/pkg.yml
index 2861084..8f8e010 100644
--- a/hw/drivers/bq27z561/pkg.yml
+++ b/hw/drivers/bq27z561/pkg.yml
@@ -38,4 +38,4 @@ pkg.deps.BQ27Z561_CLI:
     - "@apache-mynewt-core/util/parse"
 
 pkg.init:
-    bq27z561_pkg_init: 500
+    bq27z561_pkg_init: 'MYNEWT_VAL(BQ27Z561_SYSINIT_STAGE)'
diff --git a/hw/drivers/bq27z561/syscfg.yml b/hw/drivers/bq27z561/syscfg.yml
index 840fabd..8e1d6fd 100644
--- a/hw/drivers/bq27z561/syscfg.yml
+++ b/hw/drivers/bq27z561/syscfg.yml
@@ -45,3 +45,7 @@ syscfg.defs:
         description: >
             Number of OS ticks to wait for each I2C transaction to complete.            
         value: 6
+    BQ27Z561_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the BQ27Z561 driver.
+        value: 500
diff --git a/hw/drivers/lwip/stm32_eth/pkg.yml b/hw/drivers/lwip/stm32_eth/pkg.yml
index 4b26020..6819c45 100644
--- a/hw/drivers/lwip/stm32_eth/pkg.yml
+++ b/hw/drivers/lwip/stm32_eth/pkg.yml
@@ -38,4 +38,4 @@ pkg.deps.MCU_STM32F7:
 pkg.req_apis: 
 
 pkg.init:
-    stm32_eth_open: 240
+    stm32_eth_open: 'MYNEWT_VAL(STM32_ETH_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/hw/drivers/lwip/stm32_eth/syscfg.yml
similarity index 86%
copy from test/testutil/syscfg.yml
copy to hw/drivers/lwip/stm32_eth/syscfg.yml
index 073520b..04e40a7 100644
--- a/test/testutil/syscfg.yml
+++ b/hw/drivers/lwip/stm32_eth/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    STM32_ETH_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the stm32 eth driver.
+        value: 240
diff --git a/hw/sensor/creator/pkg.yml b/hw/sensor/creator/pkg.yml
index e1ab7b4..7b49089 100644
--- a/hw/sensor/creator/pkg.yml
+++ b/hw/sensor/creator/pkg.yml
@@ -59,4 +59,4 @@ pkg.deps.LPS33HW_OFB:
 pkg.deps.LPS33THW_OFB:
     - "@apache-mynewt-core/hw/drivers/sensors/lps33thw"
 pkg.init:
-    sensor_dev_create: 500
+    sensor_dev_create: 'MYNEWT_VAL(SENSOR_CREATOR_SYSINIT_STAGE)'
diff --git a/hw/sensor/creator/syscfg.yml b/hw/sensor/creator/syscfg.yml
index 63c8f7c..5404dc0 100644
--- a/hw/sensor/creator/syscfg.yml
+++ b/hw/sensor/creator/syscfg.yml
@@ -75,3 +75,7 @@ syscfg.defs:
         description: 'BME680 is present'
         value: 0
 
+    SENSOR_CREATOR_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the sensor creator package.
+        value: 500
diff --git a/hw/sensor/pkg.yml b/hw/sensor/pkg.yml
index 7c61a7c..c8c6a46 100644
--- a/hw/sensor/pkg.yml
+++ b/hw/sensor/pkg.yml
@@ -37,4 +37,4 @@ pkg.req_apis:
     - console
     
 pkg.init:
-    sensor_pkg_init: 501
+    sensor_pkg_init: 'MYNEWT_VAL(SENSOR_SYSINIT_STAGE)'
diff --git a/hw/sensor/syscfg.yml b/hw/sensor/syscfg.yml
index a02c12c..abc78f7 100644
--- a/hw/sensor/syscfg.yml
+++ b/hw/sensor/syscfg.yml
@@ -58,3 +58,7 @@ syscfg.defs:
                        notification events so that multiple events can be put
                        on the eventq for processing'
          value: 5
+    SENSOR_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the sensors framework.
+        value: 501
diff --git a/kernel/os/pkg.yml b/kernel/os/pkg.yml
index dd0ea64..c0d853f 100644
--- a/kernel/os/pkg.yml
+++ b/kernel/os/pkg.yml
@@ -48,4 +48,4 @@ pkg.deps.OS_CRASH_LOG:
     - "@apache-mynewt-core/sys/reboot"
 
 pkg.init:
-    os_pkg_init: 0
+    os_pkg_init: 'MYNEWT_VAL(OS_SYSINIT_STAGE)'
diff --git a/kernel/os/syscfg.yml b/kernel/os/syscfg.yml
index 7097fcd..7a38d24 100644
--- a/kernel/os/syscfg.yml
+++ b/kernel/os/syscfg.yml
@@ -143,6 +143,10 @@ syscfg.defs:
             Include filename and line number in crash messages.  Aids in
             debugging, but increases text size.
         value: 0
+    OS_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the Mynewt kernel.
+        value: 0
 
 syscfg.vals.OS_DEBUG_MODE:
     OS_CRASH_STACKTRACE: 1
diff --git a/mgmt/imgmgr/pkg.yml b/mgmt/imgmgr/pkg.yml
index bf35d74..e498121 100644
--- a/mgmt/imgmgr/pkg.yml
+++ b/mgmt/imgmgr/pkg.yml
@@ -46,4 +46,4 @@ pkg.deps.IMGMGR_SHELL:
     - "@apache-mynewt-core/sys/shell"
 
 pkg.init:
-    imgmgr_module_init: 500
+    imgmgr_module_init: 'MYNEWT_VAL(IMGMGR_SYSINIT_STAGE)'
diff --git a/mgmt/imgmgr/syscfg.yml b/mgmt/imgmgr/syscfg.yml
index f28447f..b23b8e5 100644
--- a/mgmt/imgmgr/syscfg.yml
+++ b/mgmt/imgmgr/syscfg.yml
@@ -34,3 +34,7 @@ syscfg.defs:
         description: >
             Send verbose error message in responses.
         value: 0
+    IMGMGR_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for image management functionality.
+        value: 500
diff --git a/mgmt/newtmgr/pkg.yml b/mgmt/newtmgr/pkg.yml
index 2f58ffc..dabbcdc 100644
--- a/mgmt/newtmgr/pkg.yml
+++ b/mgmt/newtmgr/pkg.yml
@@ -37,4 +37,4 @@ pkg.apis:
     - newtmgr
 
 pkg.init:
-    nmgr_pkg_init: 500
+    nmgr_pkg_init: 'MYNEWT_VAL(NEWTMGR_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/mgmt/newtmgr/syscfg.yml
similarity index 86%
copy from test/testutil/syscfg.yml
copy to mgmt/newtmgr/syscfg.yml
index 073520b..a02dacd 100644
--- a/test/testutil/syscfg.yml
+++ b/mgmt/newtmgr/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    NEWTMGR_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for newtmgr functionality.
+        value: 500
diff --git a/mgmt/newtmgr/transport/ble/pkg.yml b/mgmt/newtmgr/transport/ble/pkg.yml
index fae5ded..d008a2f 100644
--- a/mgmt/newtmgr/transport/ble/pkg.yml
+++ b/mgmt/newtmgr/transport/ble/pkg.yml
@@ -32,4 +32,4 @@ pkg.deps:
     - "@apache-mynewt-nimble/nimble/host"
 
 pkg.init:
-    newtmgr_ble_pkg_init: 501
+    newtmgr_ble_pkg_init: 'MYNEWT_VAL(NEWTMGR_BLE_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/mgmt/newtmgr/transport/ble/syscfg.yml
similarity index 85%
copy from test/testutil/syscfg.yml
copy to mgmt/newtmgr/transport/ble/syscfg.yml
index 073520b..bd41fd2 100644
--- a/test/testutil/syscfg.yml
+++ b/mgmt/newtmgr/transport/ble/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    NEWTMGR_BLE_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the BLE newtmgr transport.
+        value: 501
diff --git a/mgmt/newtmgr/transport/nmgr_shell/pkg.yml b/mgmt/newtmgr/transport/nmgr_shell/pkg.yml
index 09aa68a..e73eaf8 100644
--- a/mgmt/newtmgr/transport/nmgr_shell/pkg.yml
+++ b/mgmt/newtmgr/transport/nmgr_shell/pkg.yml
@@ -31,4 +31,4 @@ pkg.deps:
     - "@apache-mynewt-core/mgmt/newtmgr"
 
 pkg.init:
-    nmgr_shell_pkg_init: 501
+    nmgr_shell_pkg_init: 'MYNEWT_VAL(NMGR_SHELL_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/mgmt/newtmgr/transport/nmgr_shell/syscfg.yml
similarity index 85%
copy from test/testutil/syscfg.yml
copy to mgmt/newtmgr/transport/nmgr_shell/syscfg.yml
index 073520b..143a7af 100644
--- a/test/testutil/syscfg.yml
+++ b/mgmt/newtmgr/transport/nmgr_shell/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    NMGR_SHELL_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the shell newtmgr transport.
+        value: 501
diff --git a/mgmt/newtmgr/transport/nmgr_uart/pkg.yml b/mgmt/newtmgr/transport/nmgr_uart/pkg.yml
index 6883980..d6f254c 100644
--- a/mgmt/newtmgr/transport/nmgr_uart/pkg.yml
+++ b/mgmt/newtmgr/transport/nmgr_uart/pkg.yml
@@ -32,4 +32,4 @@ pkg.deps:
     - "@apache-mynewt-core/util/crc"
 
 pkg.init:
-    nmgr_uart_pkg_init: 501
+    nmgr_uart_pkg_init: 'MYNEWT_VAL(NMGR_UART_SYSINIT_STAGE)'
diff --git a/mgmt/newtmgr/transport/nmgr_uart/syscfg.yml b/mgmt/newtmgr/transport/nmgr_uart/syscfg.yml
index 2d9d15e..0e1b243 100644
--- a/mgmt/newtmgr/transport/nmgr_uart/syscfg.yml
+++ b/mgmt/newtmgr/transport/nmgr_uart/syscfg.yml
@@ -18,11 +18,15 @@
 #
 
 syscfg.defs:
-  NMGR_UART:
-    description: 'UART port number to use for newtmgr'
-    value: '"uart0"'
+    NMGR_UART:
+        description: 'UART port number to use for newtmgr'
+        value: '"uart0"'
 
-  NMGR_UART_SPEED:
-    description: 'Baudrate for newtmgr UART'
-    value: 115200
+    NMGR_UART_SPEED:
+        description: 'Baudrate for newtmgr UART'
+        value: 115200
 
+    NMGR_UART_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the UART newtmgr transport.
+        value: 501
diff --git a/mgmt/oicmgr/pkg.yml b/mgmt/oicmgr/pkg.yml
index df9ee5d..58140bd 100644
--- a/mgmt/oicmgr/pkg.yml
+++ b/mgmt/oicmgr/pkg.yml
@@ -33,4 +33,4 @@ pkg.apis:
     - newtmgr
 
 pkg.init:
-    oicmgr_init: 500
+    oicmgr_init: 'MYNEWT_VAL(OICMGR_SYSINIT_STAGE)'
diff --git a/mgmt/oicmgr/syscfg.yml b/mgmt/oicmgr/syscfg.yml
index 23e0f12..a6daa0e 100644
--- a/mgmt/oicmgr/syscfg.yml
+++ b/mgmt/oicmgr/syscfg.yml
@@ -17,11 +17,16 @@
 # under the License.
 #
 syscfg.defs:
-   OICMGR_TRANS_SECURITY:
-      description: >
-          Configure transport security for oicmgr resource.
-          Can be OC_TRANS_ENC | OC_TRANS_AUTH, OC_TRANS_ENC or OC_TRANS_AUTH.
-          0 means no security checing.
-      value: 0
-      restrictions:
-         - OC_TRANS_SECURITY
+    OICMGR_TRANS_SECURITY:
+        description: >
+            Configure transport security for oicmgr resource.
+            Can be OC_TRANS_ENC | OC_TRANS_AUTH, OC_TRANS_ENC or OC_TRANS_AUTH.
+            0 means no security checing.
+        value: 0
+        restrictions:
+            - OC_TRANS_SECURITY
+
+    OICMGR_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for OIC manager functionality.
+        value: 500
diff --git a/net/ip/native_sockets/pkg.yml b/net/ip/native_sockets/pkg.yml
index e0591c6..d404d98 100644
--- a/net/ip/native_sockets/pkg.yml
+++ b/net/ip/native_sockets/pkg.yml
@@ -30,4 +30,4 @@ pkg.deps:
     - "@apache-mynewt-core/net/ip/mn_socket"
 
 pkg.init:
-    native_sock_init: 200
+    native_sock_init: 'MYNEWT_VAL(NATIVE_SOCKETS_SYSINIT_STAGE)'
diff --git a/net/ip/native_sockets/syscfg.yml b/net/ip/native_sockets/syscfg.yml
index 53f2b60..aceb333 100644
--- a/net/ip/native_sockets/syscfg.yml
+++ b/net/ip/native_sockets/syscfg.yml
@@ -35,3 +35,7 @@ syscfg.defs:
         description: 'The priority of the native sockets task.'
         type: task_priority
         value: 2
+    NATIVE_SOCKETS_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the native sockets implementation.
+        value: 200
diff --git a/net/ip/pkg.yml b/net/ip/pkg.yml
index d1c06f5..998e0dd 100644
--- a/net/ip/pkg.yml
+++ b/net/ip/pkg.yml
@@ -36,4 +36,4 @@ pkg.deps.LWIP_CLI:
     - "@apache-mynewt-core/sys/shell"
 
 pkg.init:
-    ip_init: 200
+    ip_init: 'MYNEWT_VAL(IP_SYSINIT_STAGE)'
diff --git a/net/ip/syscfg.yml b/net/ip/syscfg.yml
index 5a2a948..c76bb69 100644
--- a/net/ip/syscfg.yml
+++ b/net/ip/syscfg.yml
@@ -22,3 +22,7 @@ syscfg.defs:
         value: 1
         restrictions:
           - SHELL_TASK
+    IP_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the IP stack.
+        value: 200
diff --git a/net/lora/node/pkg.yml b/net/lora/node/pkg.yml
index a5c44dc..a165f17 100644
--- a/net/lora/node/pkg.yml
+++ b/net/lora/node/pkg.yml
@@ -42,4 +42,4 @@ pkg.req_apis:
     - lora_node_driver
 
 pkg.init:
-    lora_node_init: 200
+    lora_node_init: 'MYNEWT_VAL(LORA_NODE_SYSINIT_STAGE)'
diff --git a/net/lora/node/syscfg.yml b/net/lora/node/syscfg.yml
index 0dd4173..28305b9 100644
--- a/net/lora/node/syscfg.yml
+++ b/net/lora/node/syscfg.yml
@@ -92,3 +92,8 @@ syscfg.defs:
                 Sets public or private lora network. A value of 1 means
                 the network is public; private otherwise
         value: 0
+
+    LORA_NODE_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for the LoRa endpoint.
+        value: 200
diff --git a/net/oic/pkg.yml b/net/oic/pkg.yml
index f9aafaf..8c32c66 100644
--- a/net/oic/pkg.yml
+++ b/net/oic/pkg.yml
@@ -54,9 +54,9 @@ pkg.cflags:
     - "-I@apache-mynewt-core/net/oic/include/oic"
 
 pkg.init:
-    oc_init: 300
-    oc_register_ip6: 301
-    oc_register_ip4: 301
-    oc_register_serial: 301
-    oc_register_gatt: 301
-    oc_register_lora: 301
+    oc_init: 'MYNEWT_VAL(OC_SYSINIT_STAGE_MAIN)'
+    oc_register_ip6: 'MYNEWT_VAL(OC_SYSINIT_STAGE_IP6)'
+    oc_register_ip4: 'MYNEWT_VAL(OC_SYSINIT_STAGE_IP4)'
+    oc_register_serial: 'MYNEWT_VAL(OC_SYSINIT_STAGE_SERIAL)'
+    oc_register_gatt: 'MYNEWT_VAL(OC_SYSINIT_STAGE_GATT)'
+    oc_register_lora: 'MYNEWT_VAL(OC_SYSINIT_STAGE_LORA)'
diff --git a/net/oic/syscfg.yml b/net/oic/syscfg.yml
index a2fb6dd..a87ab43 100644
--- a/net/oic/syscfg.yml
+++ b/net/oic/syscfg.yml
@@ -102,3 +102,28 @@ syscfg.defs:
     OC_COAP_RESPONSE_TIMEOUT:
         description: 'How many seconds before client request times out'
         value: 4
+
+    OC_SYSINIT_STAGE_MAIN:
+        description: >
+            Main sysinit stage for OIC functionality.
+        value: 300
+    OC_SYSINIT_STAGE_IP6:
+        description: >
+            Sysinit stage for the IPv6 OIC transport.
+        value: 301
+    OC_SYSINIT_STAGE_IP4:
+        description: >
+            Sysinit stage for the IPv4 OIC transport.
+        value: 301
+    OC_SYSINIT_STAGE_SERIAL:
+        description: >
+            Sysinit stage for the serial OIC transport.
+        value: 301
+    OC_SYSINIT_STAGE_GATT:
+        description: >
+            Sysinit stage for the GATT (BLE) OIC transport.
+        value: 301
+    OC_SYSINIT_STAGE_LORA:
+        description: >
+            Sysinit stage for the LoRa OIC transport.
+        value: 301
diff --git a/sys/config/pkg.yml b/sys/config/pkg.yml
index 32fa85f..93fe279 100644
--- a/sys/config/pkg.yml
+++ b/sys/config/pkg.yml
@@ -36,5 +36,5 @@ pkg.deps.CONFIG_NFFS:
     - "@apache-mynewt-core/fs/nffs"
 
 pkg.init:
-    config_pkg_init: 50
-    config_pkg_init_stage2: 220
+    config_pkg_init: 'MYNEWT_VAL(CONFIG_SYSINIT_STAGE_1)'
+    config_pkg_init_stage2: 'MYNEWT_VAL(CONFIG_SYSINIT_STAGE_2)'
diff --git a/sys/config/syscfg.yml b/sys/config/syscfg.yml
index d5b7bbd..9a8d58d 100644
--- a/sys/config/syscfg.yml
+++ b/sys/config/syscfg.yml
@@ -49,6 +49,16 @@ syscfg.defs:
         description: 'Automatically configure a single config region at bootup'
         value: 1
 
+    CONFIG_SYSINIT_STAGE_1:
+        description: >
+            Primary sysinit stage for the config package.
+        value: 50
+    CONFIG_SYSINIT_STAGE_2:
+        description: >
+            Secondary sysinit stage for the config package; populates the
+            underlying storage medium for config if it is has not been done.
+        value: 220
+
 syscfg.defs.CONFIG_FCB:
     CONFIG_FCB_FLASH_AREA:
         description: 'BSP flash area for config'
diff --git a/sys/console/full/pkg.yml b/sys/console/full/pkg.yml
index 654c36a..361cbbe 100644
--- a/sys/console/full/pkg.yml
+++ b/sys/console/full/pkg.yml
@@ -33,4 +33,4 @@ pkg.deps.CONSOLE_RTT:
 pkg.apis: console
 
 pkg.init:
-    console_pkg_init: 20
+    console_pkg_init: 'MYNEWT_VAL(CONSOLE_SYSINIT_STAGE)'
diff --git a/sys/console/full/syscfg.yml b/sys/console/full/syscfg.yml
index ec7e03c..33b72db 100644
--- a/sys/console/full/syscfg.yml
+++ b/sys/console/full/syscfg.yml
@@ -92,3 +92,8 @@ syscfg.defs:
             value may affect RTT console responsiveness, using small value may
             affect device performance due to more frequent polling.
         value: 250
+
+    CONSOLE_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for console functionality.
+        value: 20
diff --git a/sys/console/minimal/pkg.yml b/sys/console/minimal/pkg.yml
index b64bcae..6712db9 100644
--- a/sys/console/minimal/pkg.yml
+++ b/sys/console/minimal/pkg.yml
@@ -33,4 +33,4 @@ pkg.deps.CONSOLE_RTT:
 pkg.apis: console
 
 pkg.init:
-    console_pkg_init: 20
+    console_pkg_init: 'MYNEWT_VAL(CONSOLE_SYSINIT_STAGE)'
diff --git a/sys/console/minimal/syscfg.yml b/sys/console/minimal/syscfg.yml
index 61324b6..f816ef9 100644
--- a/sys/console/minimal/syscfg.yml
+++ b/sys/console/minimal/syscfg.yml
@@ -48,4 +48,9 @@ syscfg.defs:
 
     CONSOLE_UART_DEV:
         description: 'Console UART device.'
-        value: '"uart0"'
\ No newline at end of file
+        value: '"uart0"'
+
+    CONSOLE_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for console functionality.
+        value: 20
diff --git a/sys/flash_map/pkg.yml b/sys/flash_map/pkg.yml
index b30c8e5..686f2c7 100644
--- a/sys/flash_map/pkg.yml
+++ b/sys/flash_map/pkg.yml
@@ -30,4 +30,4 @@ pkg.deps:
     - "@apache-mynewt-core/sys/mfg"
 
 pkg.init:
-    flash_map_init: 2
+    flash_map_init: 'MYNEWT_VAL(FLASH_MAP_SYSINIT_STAGE)'
diff --git a/sys/flash_map/syscfg.yml b/sys/flash_map/syscfg.yml
index 2dfc91a..da988da 100644
--- a/sys/flash_map/syscfg.yml
+++ b/sys/flash_map/syscfg.yml
@@ -19,3 +19,8 @@ syscfg.defs:
     FLASH_MAP_MAX_AREAS:
         description: 'Maximum number of expected flash areas'
         value: 10
+
+    FLASH_MAP_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for flash map functionality.
+        value: 2
diff --git a/sys/id/pkg.yml b/sys/id/pkg.yml
index 409c248..ac6ccef 100644
--- a/sys/id/pkg.yml
+++ b/sys/id/pkg.yml
@@ -34,4 +34,4 @@ pkg.deps:
     - "@apache-mynewt-core/encoding/base64"
 
 pkg.init:
-    id_init: 500
+    id_init: 'MYNEWT_VAL(ID_SYSINIT_STAGE)'
diff --git a/sys/id/syscfg.yml b/sys/id/syscfg.yml
index 8e5f29b..107b804 100644
--- a/sys/id/syscfg.yml
+++ b/sys/id/syscfg.yml
@@ -52,3 +52,8 @@ syscfg.defs:
         restrictions:
             # Older versions of newt don't export the target name.
             - 'TARGET_NAME'
+
+    ID_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for ID functionality.
+        value: 500
diff --git a/sys/log/full/pkg.yml b/sys/log/full/pkg.yml
index 8e0a315..c4c9544 100644
--- a/sys/log/full/pkg.yml
+++ b/sys/log/full/pkg.yml
@@ -48,7 +48,7 @@ pkg.apis:
     - log
 
 pkg.init:
-    log_init: 100
+    log_init: 'MYNEWT_VAL(LOG_SYSINIT_STAGE_MAIN)'
 
 pkg.init.LOG_FCB_SLOT1:
-    log_init_slot1: 101
+    log_init_slot1: 'MYNEWT_VAL(LOG_SYSINIT_STAGE_SLOT1)'
diff --git a/sys/log/full/syscfg.yml b/sys/log/full/syscfg.yml
index a5aa3e2..9e530fd 100644
--- a/sys/log/full/syscfg.yml
+++ b/sys/log/full/syscfg.yml
@@ -91,3 +91,12 @@ syscfg.defs:
             bytes used by entries above watermark.
         value: 0
         restrictions: LOG_STORAGE_INFO
+
+    LOG_SYSINIT_STAGE_MAIN:
+        description: >
+            Primary sysinit stage for logging functionality.
+        value: 100
+    LOG_SYSINIT_STAGE_SLOT1:
+        description: >
+            Sysinit stage for logging to the second image slot.
+        value: 101
diff --git a/sys/log/modlog/pkg.yml b/sys/log/modlog/pkg.yml
index e173007..8419e91 100644
--- a/sys/log/modlog/pkg.yml
+++ b/sys/log/modlog/pkg.yml
@@ -32,4 +32,4 @@ pkg.req_apis:
     - log
 
 pkg.init:
-    modlog_init: 100
+    modlog_init: 'MYNEWT_VAL(MODLOG_SYSINIT_STAGE)'
diff --git a/sys/log/modlog/syscfg.yml b/sys/log/modlog/syscfg.yml
index 9f86554..b39e73b 100644
--- a/sys/log/modlog/syscfg.yml
+++ b/sys/log/modlog/syscfg.yml
@@ -41,3 +41,7 @@ syscfg.defs:
             modlog.  This setting will be enabled by default in a future
             release.
         value: 0
+    MODLOG_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for modular logging functionality.
+        value: 100
diff --git a/sys/metrics/pkg.yml b/sys/metrics/pkg.yml
index 759c107..d2fc70f 100644
--- a/sys/metrics/pkg.yml
+++ b/sys/metrics/pkg.yml
@@ -34,4 +34,4 @@ pkg.deps.METRICS_CLI:
     - sys/shell
 
 pkg.init:
-      metrics_pkg_init: 500
+      metrics_pkg_init: 'MYNEWT_VAL(METRICS_SYSINIT_STAGE)'
diff --git a/sys/metrics/syscfg.yml b/sys/metrics/syscfg.yml
index 28e3353..f1dde8a 100644
--- a/sys/metrics/syscfg.yml
+++ b/sys/metrics/syscfg.yml
@@ -27,3 +27,7 @@ syscfg.defs:
     METRICS_CLI:
         description: Enable shell interface
         value: 0
+    METRICS_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for metrics functionality.
+        value: 500
diff --git a/sys/mfg/pkg.yml b/sys/mfg/pkg.yml
index 28804ea..42fb19f 100644
--- a/sys/mfg/pkg.yml
+++ b/sys/mfg/pkg.yml
@@ -30,4 +30,4 @@ pkg.deps:
 
 # sys/flash_map must get initialized before sys/mfg.
 pkg.init:
-    mfg_init: 100
+    mfg_init: 'MYNEWT_VAL(MFG_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/sys/mfg/syscfg.yml
similarity index 86%
copy from test/testutil/syscfg.yml
copy to sys/mfg/syscfg.yml
index 073520b..10f84f5 100644
--- a/test/testutil/syscfg.yml
+++ b/sys/mfg/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    MFG_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for manufacturing support.
+        value: 100
diff --git a/sys/reboot/pkg.yml b/sys/reboot/pkg.yml
index 305fa23..3b70a01 100644
--- a/sys/reboot/pkg.yml
+++ b/sys/reboot/pkg.yml
@@ -36,4 +36,4 @@ pkg.deps.REBOOT_LOG_FCB:
     - "@apache-mynewt-core/fs/fcb"
 
 pkg.init:
-    log_reboot_pkg_init: 200
+    log_reboot_pkg_init: 'MYNEWT_VAL(REBOOT_SYSINIT_STAGE)'
diff --git a/sys/reboot/syscfg.yml b/sys/reboot/syscfg.yml
index fb58ead..105b084 100644
--- a/sys/reboot/syscfg.yml
+++ b/sys/reboot/syscfg.yml
@@ -44,3 +44,8 @@ syscfg.defs:
             The maximum size, in bytes, of a reboot log entry.  A buffer of
             this size is allocated on the stack each time an entry is written.
         value: 256
+
+    REBOOT_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for reboot functionality.
+        value: 200
diff --git a/sys/shell/pkg.yml b/sys/shell/pkg.yml
index 896119f..cf1c103 100644
--- a/sys/shell/pkg.yml
+++ b/sys/shell/pkg.yml
@@ -35,4 +35,4 @@ pkg.req_apis:
     - console
 
 pkg.init:
-    shell_init: 500
+    shell_init: 'MYNEWT_VAL(SHELL_SYSINIT_STAGE)'
diff --git a/sys/shell/syscfg.yml b/sys/shell/syscfg.yml
index 895d45c..ecc8b67 100644
--- a/sys/shell/syscfg.yml
+++ b/sys/shell/syscfg.yml
@@ -63,6 +63,11 @@ syscfg.defs:
         description: 'Include shell prompt module'
         value: 0
 
+    SHELL_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for shell functionality.
+        value: 500
+
 ## duplicated from boot/boot_serial
     BOOT_SERIAL_NVREG_MAGIC:
         description: >
diff --git a/sys/stats/full/pkg.yml b/sys/stats/full/pkg.yml
index df75884..e1dcb45 100644
--- a/sys/stats/full/pkg.yml
+++ b/sys/stats/full/pkg.yml
@@ -34,7 +34,7 @@ pkg.deps.STATS_NEWTMGR:
     - "@apache-mynewt-core/mgmt/mgmt"
 
 pkg.init:
-    stats_module_init: 10
+    stats_module_init: 'MYNEWT_VAL(STATS_SYSINIT_STAGE)'
 
 pkg.init.STATS_PERSIST:
     stats_conf_init: 'MYNEWT_VAL(STATS_SYSINIT_STAGE_CONF)'
diff --git a/sys/stats/full/syscfg.yml b/sys/stats/full/syscfg.yml
index 97c2556..146b6f9 100644
--- a/sys/stats/full/syscfg.yml
+++ b/sys/stats/full/syscfg.yml
@@ -61,3 +61,7 @@ syscfg.defs:
             Sysdown stage for persistent stat config.  During system shutdown,
             pending stat writes get flushed to disk.
         value: 500
+    STATS_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for statistics functionality.
+        value: 10
diff --git a/sys/sysview/pkg.yml b/sys/sysview/pkg.yml
index 39efbfd..3e7f569 100644
--- a/sys/sysview/pkg.yml
+++ b/sys/sysview/pkg.yml
@@ -26,4 +26,4 @@ pkg.build_profile: speed
 pkg.deps:
     - "@apache-mynewt-core/sys/sysview/vendor"
 pkg.init:
-    sysview_init: 100
+    sysview_init: 'MYNEWT_VAL(SYSVIEW_SYSINIT_STAGE)'
diff --git a/sys/sysview/syscfg.yml b/sys/sysview/syscfg.yml
index c194e52..405dff3 100644
--- a/sys/sysview/syscfg.yml
+++ b/sys/sysview/syscfg.yml
@@ -42,3 +42,7 @@ syscfg.defs:
             It is recommended to use large SysView buffer to get as much data
             for analysis as possible.
         value: 0
+    SYSVIEW_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for sysview functionality.
+        value: 100
diff --git a/test/crash_test/pkg.yml b/test/crash_test/pkg.yml
index 67f93df..212f8b0 100644
--- a/test/crash_test/pkg.yml
+++ b/test/crash_test/pkg.yml
@@ -33,4 +33,4 @@ pkg.deps.CRASH_TEST_NEWTMGR:
     - "@apache-mynewt-core/encoding/json"
 
 pkg.init:
-    crash_test_init: 500
+    crash_test_init: 'MYNEWT_VAL(CRASH_TEST_SYSINIT_STAGE)'
diff --git a/test/crash_test/syscfg.yml b/test/crash_test/syscfg.yml
index d29c915..849b41e 100644
--- a/test/crash_test/syscfg.yml
+++ b/test/crash_test/syscfg.yml
@@ -24,3 +24,7 @@ syscfg.defs:
     CRASH_TEST_NEWTMGR:
         description: 'Newtmgr commands for crashing'
         value: 1
+    CRASH_TEST_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for crash test functionality.
+        value: 500
diff --git a/test/flash_test/pkg.yml b/test/flash_test/pkg.yml
index 21bfe52..f760065 100644
--- a/test/flash_test/pkg.yml
+++ b/test/flash_test/pkg.yml
@@ -30,5 +30,4 @@ pkg.req_apis:
     - console
 
 pkg.init:
-    flash_test_init: 500
-
+    flash_test_init: 'MYNEWT_VAL(FLASH_TEST_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/test/flash_test/syscfg.yml
similarity index 85%
copy from test/testutil/syscfg.yml
copy to test/flash_test/syscfg.yml
index 073520b..5cf5343 100644
--- a/test/testutil/syscfg.yml
+++ b/test/flash_test/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    FLASH_TEST_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for flash test functionality.
+        value: 500
diff --git a/test/i2c_scan/pkg.yml b/test/i2c_scan/pkg.yml
index 1e43ef9..e6a419d 100644
--- a/test/i2c_scan/pkg.yml
+++ b/test/i2c_scan/pkg.yml
@@ -32,4 +32,4 @@ pkg.req_apis:
     - console
 
 pkg.init:
-    i2c_scan_init: 500
+    i2c_scan_init: 'MYNEWT_VAL(I2C_SCAN_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/test/i2c_scan/syscfg.yml
similarity index 85%
copy from test/testutil/syscfg.yml
copy to test/i2c_scan/syscfg.yml
index 073520b..66067ee 100644
--- a/test/testutil/syscfg.yml
+++ b/test/i2c_scan/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    I2C_SCAN_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for I2C scan test functionality.
+        value: 500
diff --git a/test/runtest/pkg.yml b/test/runtest/pkg.yml
index f51d3b3..672b97b 100644
--- a/test/runtest/pkg.yml
+++ b/test/runtest/pkg.yml
@@ -37,4 +37,4 @@ pkg.req_apis.RUNTEST_CLI:
     - console
 
 pkg.init:
-    runtest_init: 500
+    runtest_init: 'MYNEWT_VAL(RUNTEST_SYSINIT_STAGE)'
diff --git a/test/runtest/syscfg.yml b/test/runtest/syscfg.yml
index 895db78..6670d92 100644
--- a/test/runtest/syscfg.yml
+++ b/test/runtest/syscfg.yml
@@ -56,3 +56,7 @@ syscfg.defs:
             test token is specified by the runtest client and is included in
             test result log entries.
         value: 32
+    RUNTEST_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for runtest functionality.
+        value: 500
diff --git a/test/testutil/pkg.yml b/test/testutil/pkg.yml
index 776dd31..bcc09b2 100644
--- a/test/testutil/pkg.yml
+++ b/test/testutil/pkg.yml
@@ -31,4 +31,4 @@ pkg.deps:
     - "@apache-mynewt-core/sys/sysinit"
 
 pkg.init:
-    tu_init: 1
+    tu_init: 'MYNEWT_VAL(TESTUTIL_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/test/testutil/syscfg.yml
index 073520b..db7d007 100644
--- a/test/testutil/syscfg.yml
+++ b/test/testutil/syscfg.yml
@@ -20,3 +20,7 @@ syscfg.defs:
     TESTUTIL_SYSTEM_ASSERT:
         description: 'Crash the system on test failure'
         value: '0'
+    TESTUTIL_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for testutil functionality.
+        value: 1
diff --git a/time/timesched/pkg.yml b/time/timesched/pkg.yml
index e1317a0..8dcc7e3 100644
--- a/time/timesched/pkg.yml
+++ b/time/timesched/pkg.yml
@@ -29,4 +29,4 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
 
 pkg.init:
-    timesched_init: 500
+    timesched_init: 'MYNEWT_VAL(TIMESCHED_SYSINIT_STAGE)'
diff --git a/test/testutil/syscfg.yml b/time/timesched/syscfg.yml
similarity index 85%
copy from test/testutil/syscfg.yml
copy to time/timesched/syscfg.yml
index 073520b..3216cd9 100644
--- a/test/testutil/syscfg.yml
+++ b/time/timesched/syscfg.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,7 +6,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,6 +18,7 @@
 #
 
 syscfg.defs:
-    TESTUTIL_SYSTEM_ASSERT:
-        description: 'Crash the system on test failure'
-        value: '0'
+    TIMESCHED_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for time scheduler functionality.
+        value: 500