Skip to content

Commit

Permalink
Merge pull request #1 from gridpoint-com/gridpoint-edge
Browse files Browse the repository at this point in the history
Gridpoint edge
  • Loading branch information
ringlej authored Sep 8, 2023
2 parents 3f24e4a + 2bfa97b commit afd0412
Show file tree
Hide file tree
Showing 13 changed files with 1,285 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nerves_initramfs_*.gz
nerves_initramfs_*.xz
nerves_initramfs_*.uboot
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ repl: build
target:
cd builder && ./build-all.sh

target_one:
cd builder && ./build-one.sh $(config)

build:
$(MAKE) -C src
$(MAKE) -C tests/fixture
Expand All @@ -28,5 +31,6 @@ help:
@echo "repl - Start up a repl on the host"
@echo "clean - Clean up the host build and tests"
@echo "target - Build nerves_initramfs for all configured targets"
@echo "target_one config=/path/to/config - Build nerves_initramfs for the config target"

.PHONY: all check repl clean help
9 changes: 9 additions & 0 deletions builder/board/nerves_initramfs_edge/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

mount /dev/sda1 /mnt
fwup -ad /dev/mtdblock1 -i /mnt/edge_firmware.fw -t complete --unsafe
umount /mnt

reboot -f
5 changes: 5 additions & 0 deletions builder/board/nerves_initramfs_edge/nerves_initramfs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sleep("5000");

cmd("setsid", "cttyhack", "bootstrap.sh");
print("");
cmd("setsid", "cttyhack", "sh");
10 changes: 10 additions & 0 deletions builder/board/nerves_initramfs_edge/post-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

BOARD_DIR=../board/nerves_initramfs_edge/
NERVES_INITRAMFS_CONF=${BOARD_DIR}/nerves_initramfs.conf
BOOTSTRAP_SH=${BOARD_DIR}/bootstrap.sh

cp ${NERVES_INITRAMFS_CONF} ${TARGET_DIR}
cp ${BOOTSTRAP_SH} ${TARGET_DIR}/bin
3 changes: 3 additions & 0 deletions builder/build-one.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ fi
cp "o/$base/images/rootfs.cpio.gz" "../$base.gz"
cp "o/$base/images/rootfs.cpio.xz" "../$base.xz"

if [ -f "o/$base/images/rootfs.cpio.uboot" ]; then
cp "o/$base/images/rootfs.cpio.uboot" "../$base.uboot"
fi
Loading

0 comments on commit afd0412

Please sign in to comment.