From 9dd6fff1c71d4dc6eeaee79c752567ffbe384df3 Mon Sep 17 00:00:00 2001 From: J Phani Mahesh Date: Mon, 4 Sep 2017 13:02:59 +0530 Subject: [PATCH] add a rootfs overlay, drop to sh on exit --- apps/proxy42_firmware/config/config.exs | 6 ++- .../rootfs_overlay/etc/erlinit.config | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 apps/proxy42_firmware/rootfs_overlay/etc/erlinit.config diff --git a/apps/proxy42_firmware/config/config.exs b/apps/proxy42_firmware/config/config.exs index cec583a..531a448 100644 --- a/apps/proxy42_firmware/config/config.exs +++ b/apps/proxy42_firmware/config/config.exs @@ -9,8 +9,9 @@ use Mix.Config # to add files to the root filesystem or modify the firmware # archive. -# config :nerves, :firmware, -# rootfs_additions: "config/rootfs_additions", + + config :nerves, :firmware, + rootfs_overlay: "rootfs_overlay" # fwup_conf: "config/fwup.conf" # Import target specific config. This must remain at the bottom @@ -22,3 +23,4 @@ use Mix.Config config :bootloader, init: [:nerves_runtime], app: :proxy42_firmware + diff --git a/apps/proxy42_firmware/rootfs_overlay/etc/erlinit.config b/apps/proxy42_firmware/rootfs_overlay/etc/erlinit.config new file mode 100644 index 0000000..9cb14b6 --- /dev/null +++ b/apps/proxy42_firmware/rootfs_overlay/etc/erlinit.config @@ -0,0 +1,40 @@ +# Additional configuration for erlinit + +# Turn on the debug prints +#-v + +# Specify the UART port that the shell should use. +-c tty1 + +# If more than one tty are available, always warn if the user is looking at +# the wrong one. +--warn-unused-tty + +# Use dtach to capture the iex session so that it can be redirected +# to the app's GUI +#-s "/usr/bin/dtach -N /tmp/iex_prompt" + +# Specify the user and group IDs for the Erlang VM +#--uid 100 +#--gid 200 + +# Uncomment to hang the board rather than rebooting when Erlang exits +#--hang-on-exit + +# Optionally run a program if the Erlang VM exits +--run-on-exit /bin/sh + +# Enable UTF-8 filename handling in Erlang and custom inet configuration +-e LANG=en_US.UTF-8;LANGUAGE=en;ERL_INETRC=/etc/erl_inetrc + +# Mount the application partition +# See http://www.linuxfromscratch.org/lfs/view/6.3/chapter08/fstab.html about +# ignoring warning the Linux kernel warning about using UTF8 with vfat. +-m /dev/mmcblk0p3:/root:vfat:: + +# Erlang release search path +-r /srv/erlang + +# Assign a unique hostname based on the board id +-d "/usr/bin/boardid -b rpi -n 4" +-n nerves-%.4s