From: Romain Naour Date: Fri, 19 Jan 2018 10:15:07 +0000 (+0100) Subject: package/mksh: add /bin/mksh to /etc/shells X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e05e4de693416e7a099fb87097c21e2b32ae5472;p=buildroot.git package/mksh: add /bin/mksh to /etc/shells When mksh is selected, /bin/mksh is not added to /etc/shells (see man shells). So, login tools like dropbear reject the ssh connections for users using mksh as shell in /etc/passwd. buildroot authpriv.warn dropbear[853]: User 'kubu' has invalid shell, rejected Signed-off-by: Romain Naour Reviewed-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- diff --git a/package/mksh/mksh.mk b/package/mksh/mksh.mk index b5706dbe0f..4fa0e020af 100644 --- a/package/mksh/mksh.mk +++ b/package/mksh/mksh.mk @@ -21,4 +21,12 @@ define MKSH_INSTALL_TARGET_CMDS $(INSTALL) -m 0755 -D $(@D)/mksh $(TARGET_DIR)/bin/mksh endef +# Add /bin/mksh to /etc/shells otherwise some login tools like dropbear +# can reject the user connection. See man shells. +define MKSH_ADD_MKSH_TO_SHELLS + grep -qsE '^/bin/mksh$$' $(TARGET_DIR)/etc/shells \ + || echo "/bin/mksh" >> $(TARGET_DIR)/etc/shells +endef +MKSH_TARGET_FINALIZE_HOOKS += MKSH_ADD_MKSH_TO_SHELLS + $(eval $(generic-package))