Skip to content

Commit

Permalink
Initial stab at getting a bundled build
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Lanziano <[email protected]>
  • Loading branch information
arpunk committed May 5, 2024
1 parent 95f23b1 commit 0ddf2f5
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/esp32-mkimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir_version }}
rebar3-version: '3.22.1'

- name: "APT update"
run: apt update -y
Expand Down Expand Up @@ -104,6 +105,16 @@ jobs:
run: |
LANG=en_US.UTF-8 make
- name: "Build the c3card firmware"
working-directory: .
run: |
rebar3 atomvm packbeam
- name: "Copy mkimage.config.in template"
working-directory: .
run: |
cp ./installer/mkimage.config.in ./AtomVM/src/platforms/esp32/tools/
- name: "Use release defaults"
if: startsWith(github.ref, 'refs/tags/')
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ logs
rebar3.crashdump
*~
/include/version.hrl
/VERSION
50 changes: 50 additions & 0 deletions installer/mkimage.config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
%
% This file is not part of AtomVM.
%
% Copyright 2020-2021 Fred Dushin <[email protected]>
% Copyright 2024 Ricardo Lanziano <[email protected]>
%
% Licensed 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, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
%
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
%

#{
segments => [
#{
name => "bootloader",
offset => "0x0",
path => ["${BUILD_DIR}/bootloader/bootloader.bin"]
},
#{
name => "partition-table",
offset => "0x8000",
path => ["${BUILD_DIR}/partition_table/partition-table.bin", "${BUILD_DIR}/partitions.bin"]
},
#{
name => "AtomVM Virtual Machine",
offset => "0x10000",
path => ["${BUILD_DIR}/atomvm-esp32.bin", "${ROOT_DIR}/src/platforms/esp32/build/atomvvm-esp32.bin"]
},
#{
name => "AtomVM Boot and Core BEAM Library",
offset => "0x1D0000",
path => ["${BUILD_DIR}/../../../../build/libs/esp32boot/esp32boot.avm"]
},
#{
name => "C3card firmware",
offset => "0x210000",
path => ["${BUILD_DIR}/../../../../../_build/default/lib/c3card.avm"]
}
]
}.
1 change: 1 addition & 0 deletions scripts/fw-vsn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
main(_Args) ->
Version = string:trim(os:cmd(?GIT_CMD)),
[Tag | _] = string:split(Version, "-"),
ok = file:write_file("./VERSION", string:strip(Version, left, $v)),
ok = file:write_file(
"./include/version.hrl",
io_lib:format("-define(VERSION, ~p).~n-define(TAG, ~p).", [Version, Tag]),
Expand Down
2 changes: 1 addition & 1 deletion src/c3card.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, c3card, [
{description, "c3card reference application"},
{vsn, git},
{vsn, {file, "VERSION"}},
{registered, []},
{mod, {c3card_app, []}},
{applications, [
Expand Down

0 comments on commit 0ddf2f5

Please sign in to comment.