You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/06/30 21:13:18 UTC
[mynewt-newt] 01/02: Revert "mfg: account for updated bootloader path in mfg command"
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
commit da94a2a103e2dadbb5adf37ec3b73b25e89e2094
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Wed Jun 29 16:31:17 2022 +0200
Revert "mfg: account for updated bootloader path in mfg command"
This reverts commit 67de80e3a247f2ec9b678e6c3aeffb52e34a23ae.
---
newt/builder/paths.go | 1 -
newt/mfg/build.go | 7 +------
newt/mfg/emit.go | 31 ++++++++-----------------------
3 files changed, 9 insertions(+), 30 deletions(-)
diff --git a/newt/builder/paths.go b/newt/builder/paths.go
index 46b61c6..cc5c2d3 100644
--- a/newt/builder/paths.go
+++ b/newt/builder/paths.go
@@ -28,7 +28,6 @@ import (
"mynewt.apache.org/newt/util"
)
-const BUILD_NAME_BOOT = "app/@mcuboot"
const BUILD_NAME_APP = "app"
const BUILD_NAME_LOADER = "loader"
diff --git a/newt/mfg/build.go b/newt/mfg/build.go
index ccc94bd..d39fad0 100644
--- a/newt/mfg/build.go
+++ b/newt/mfg/build.go
@@ -224,12 +224,7 @@ func newMfgBuildTarget(dt DecodedTarget,
t.App().Name())
man, err := manifest.ReadManifest(mpath)
if err != nil {
- mpath = builder.ManifestPath(dt.Name, builder.BUILD_NAME_BOOT,
- t.App().Name())
- man, err = manifest.ReadManifest(mpath)
- if err != nil {
- return MfgBuildTarget{}, util.FmtNewtError("%s", err.Error())
- }
+ return MfgBuildTarget{}, util.FmtNewtError("%s", err.Error())
}
isBoot := parse.ValueIsTrue(man.Syscfg["BOOT_LOADER"])
diff --git a/newt/mfg/emit.go b/newt/mfg/emit.go
index e6632d7..7a8068f 100644
--- a/newt/mfg/emit.go
+++ b/newt/mfg/emit.go
@@ -99,7 +99,7 @@ type MfgEmitter struct {
// `.bin` files; image targets use `.img`.
func targetSrcBinPath(t *target.Target, isBoot bool) string {
if isBoot {
- return builder.AppBinPath(t.Name(), builder.BUILD_NAME_BOOT,
+ return builder.AppBinPath(t.Name(), builder.BUILD_NAME_APP,
t.App().Name())
} else {
return builder.AppImgPath(t.Name(), builder.BUILD_NAME_APP,
@@ -108,41 +108,26 @@ func targetSrcBinPath(t *target.Target, isBoot bool) string {
}
// Calculates the source path of a target's `.elf` file.
-func targetSrcElfPath(t *target.Target, isBoot bool) string {
- if isBoot {
- return builder.AppElfPath(t.Name(), builder.BUILD_NAME_BOOT, t.App().Name())
- } else {
- return builder.AppElfPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name())
- }
+func targetSrcElfPath(t *target.Target) string {
+ return builder.AppElfPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name())
}
// Calculates the source path of a target's manifest file.
-func targetSrcManifestPath(t *target.Target, isBoot bool) string {
- if isBoot {
- return builder.ManifestPath(t.Name(), builder.BUILD_NAME_BOOT,
- t.App().Name())
- } else {
- return builder.ManifestPath(t.Name(), builder.BUILD_NAME_APP,
- t.App().Name())
- }
+func targetSrcManifestPath(t *target.Target) string {
+ return builder.ManifestPath(t.Name(), builder.BUILD_NAME_APP,
+ t.App().Name())
}
func newMfgEmitTarget(bt MfgBuildTarget) (MfgEmitTarget, error) {
- var build_name string
- if bt.IsBoot {
- build_name = builder.BUILD_NAME_BOOT
- } else {
- build_name = builder.BUILD_NAME_APP
- }
return MfgEmitTarget{
Name: bt.Target.FullName(),
Offset: bt.Area.Offset + bt.Offset,
Size: bt.Size,
IsBoot: bt.IsBoot,
BinPath: targetSrcBinPath(bt.Target, bt.IsBoot),
- ElfPath: targetSrcElfPath(bt.Target, bt.IsBoot),
+ ElfPath: targetSrcElfPath(bt.Target),
ManifestPath: builder.ManifestPath(bt.Target.Name(),
- build_name, bt.Target.App().Name()),
+ builder.BUILD_NAME_APP, bt.Target.App().Name()),
ExtraManifest: bt.ExtraManifest,
}, nil
}