Skip to content

Commit 43f4513

Browse files
committed
build-it.sh: always copy required config, post-build.sh: enable ssh root login
1 parent 3ec7024 commit 43f4513

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

build-it.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ ls -lh reswarmos-build/
9898
logging_message "copy required configuration file"
9999

100100
if [[ -f ${cfgfile} ]]; then
101-
if [[ -f ./reswarmos-build/buildroot/.config ]]; then
102-
echo "buildroot configuration .config already present: remove it to employ a new one"
103-
else
104-
cp -v ${cfgfile} ./reswarmos-build/buildroot/.config
105-
fi
101+
# if [[ -f ./reswarmos-build/buildroot/.config ]]; then
102+
# echo "buildroot configuration .config already present: remove it to employ a new one"
103+
# else
104+
cp -v ${cfgfile} ./reswarmos-build/buildroot/.config
105+
# fi
106106
else
107107
echo "sorry, the required config file '${cfgfile}' does not exist!" >&2
108108
exit 1

configs/raspberrypi4/post-build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ chmod 644 ${TARGET_DIR}/etc/profile.d/motd.sh
4444
cp -v ${ASSCNF}/shell-prompt.sh ${TARGET_DIR}/etc/profile.d/shell-prompt.sh
4545
chmod 644 ${TARGET_DIR}/etc/profile.d/shell-prompt.sh
4646
# evtl. allow root login
47-
echo "PermitRootLogin yes" >> ${TARGET_DIR}/etc/ssh/ssh_config
47+
sshdopt="PermitRootLogin yes"
48+
sshdpath="${TARGET_DIR}/etc/ssh/sshd_config"
49+
sshdoptch=$(cat ${sshdpath} | grep -v "^#" | grep "${sshdopt}")
50+
if [ -z "${sshdoptch}" ]; then
51+
echo "${sshdopt}" >> ${sshdpath}
52+
fi
4853

4954
# copy default device to boot partition
5055
cp -v ${DEVCNF}/device-config.ini ${BINARIES_DIR}/device-config.ini

0 commit comments

Comments
 (0)