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 <romain.naour@smile.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
$(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))