Commit b8794df1 authored by Jonathan Currier's avatar Jonathan Currier

Buildroot 2020.05 has some changes to openrc so adapt the files to work

with it.

Also add a ChangeLog
parent 75da0457
2020-09-09 Jonathan Currier <dullfire@yahoo.com>
* Breaking changes:
the update user no longer allows buildroot to auto assign uid/gui, and
is now hard coded to 768/768. Reason is that auto assigned id can
change, however people may reasonably use the dev-data partion to have
update user/group files, which would randomly and supprisngly break.
This update should prevent future breakage (but can't prevent this
one).
* Buildroot 2020.05.x now recommended, 2019.08 may not work well or at all.
* Notable improvments:
usb-ecm now only uses a random mac if one is not already detected, and
saves the mac for use next time. Obviously only works if persistence
is enable, or if it's burned into dev-data.
* Other notes:
buildroot has a bug in openrc build that results in the 'local'
service not being in default. bangBMC will add it back in, however
hopefully a patch can be merged to upstream buildroot and the
workaround can be dropped.
#!/bin/sh
set -e
TARGET_DIR="$1"
TOPDIR=$(pwd)
......@@ -9,7 +9,7 @@ BOARD_DIR=${BR2_EXTERNAL_bangBMC_PATH}/board/bangBMC
shift 1
. ${BOARD_DIR}/script-support.frag.sh
[ -z "${TARGET_DIR}"] && echo "empty target dir" && exit 1
[ -z "${TARGET_DIR}" ] && echo "empty target dir" && exit 1
echo "disabling undesirable init scripts"
......
......@@ -18,6 +18,5 @@
# Launch a getty on ttyS4
# openrc (a)getty controll is a bit more complex (and flexible)
# but lets just put this one-liner here
ttyS4::respawn:/sbin/getty -L ttyS4 115200 xterm
::shutdown:/sbin/openrc shutdown
#!/bin/sh
# simply sets up an ecm gadget
set -x
mount -t configfs config /config
cd /config/usb_gadget/
set -e
SCRIPT_CFG_FILE="/etc/conf.d/usb-ecm.conf"
if [ -e "${SCRIPT_CFG_FILE}" ] ; then
. "${SCRIPT_CFG_FILE}" || true
fi
CONFIG_DIR="/sys/kernel/config"
# Newer buildroot has openrc set to automount the configfs
# so no need to meddle with it
#mount -t configfs config /config
cd ${CONFIG_DIR}/usb_gadget/
mkdir g0
cd g0/functions/
mkdir ecm.0
# Arbitrarily key off host_addr
if [ -n "${usb_ecm_host_addr}" ] ; then
cd ecm.0
echo "${usb_ecm_host_addr}" >host_addr
echo "${usb_ecm_dev_addr}" >dev_addr
cd -
else
usb_ecm_host_addr="$(cat ecm.0/host_addr)"
usb_ecm_dev_addr="$(cat ecm.0/dev_addr)"
echo '
usb_ecm_host_addr="'${usb_ecm_host_addr}'"
usb_ecm_dev_addr="'${usb_ecm_dev_addr}'"
' >> ${SCRIPT_CFG_FILE}
fi
cd ../configs/
mkdir c.1
cd c.1/
......
../../init.d/local
\ No newline at end of file
......@@ -7,8 +7,15 @@ UPDATE_SHELL_AUTORECONF = YES
UPDATE_SHELL_DEPENDENCIES = host-pkgconf
# Give the shell user a fix uid/gid.
# The reason for this is that buildroot does/has changed their
# uid/gid mapins so auto-assign may drift. this normally would not be
# a problem, however dev-data has uid and gids embedded in it, which means an
# update would break dev-data. This has already happened, so this change should
# prevent further breakage (or at least generated a build time error instead
# of silently breaking things).
define UPDATE_SHELL_USERS
update -1 update -1 * /usr/libexec/update /usr/bin/update-shell - user account for performing system updates
update 768 update 768 * /usr/libexec/update /usr/bin/update-shell - user account for performing system updates
endef
# update-su is only executable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment