Files
buildroot/package/screen/screen.mk
Bernd Kuhls 21311f79c6 package/screen: fix usage with readonly rootfs
Buildroot commit 4769724ee2 bumped the
package from 4.9.1 to 5.0.0 which includes a major rewrite of the
configure script
https://cgit.git.savannah.gnu.org/cgit/screen.git/log/src/configure.ac?h=v.4.9.1
https://cgit.git.savannah.gnu.org/cgit/screen.git/log/src/configure.ac?h=v.5.0.0

By default, screen puts the socket directory in $HOME/.screen, which
is not writable when the rootfs is readonly:

 # screen
 Cannot access /root/.screen: No such file or directory

The --enable-socket-dir option added in upstream commit
https://cgit.git.savannah.gnu.org/cgit/screen.git/commit/?id=78a961188f7da528c7cefcc63e07f35f04e69a93
allows to configure this, and actually its default value of
/run/screen is sensible, so we fix the problem by simply passing
--enable-socket-dir, and rely on its default setting.

Fixes:

  https://gitlab.com/buildroot.org/buildroot/-/issues/123

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-02-04 11:31:53 +01:00

44 lines
1.3 KiB
Makefile

################################################################################
#
# screen
#
################################################################################
SCREEN_VERSION = 5.0.1
SCREEN_SITE = $(BR2_GNU_MIRROR)/screen
SCREEN_LICENSE = GPL-3.0+
SCREEN_LICENSE_FILES = COPYING
SCREEN_CPE_ID_VENDOR = gnu
SCREEN_SELINUX_MODULES = screen
SCREEN_DEPENDENCIES = ncurses
SCREEN_AUTORECONF = YES
SCREEN_CONF_ENV = CFLAGS="$(TARGET_CFLAGS)"
SCREEN_CONF_OPTS = --enable-colors256 --enable-socket-dir
SCREEN_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) SCREEN=screen install_bin
ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
SCREEN_DEPENDENCIES += libxcrypt
endif
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
SCREEN_DEPENDENCIES += linux-pam
SCREEN_CONF_OPTS += --enable-pam
else
SCREEN_CONF_OPTS += --disable-pam
endif
define SCREEN_INSTALL_SCREENRC
$(INSTALL) -m 0755 -D $(@D)/etc/screenrc $(TARGET_DIR)/etc/screenrc
endef
SCREEN_POST_INSTALL_TARGET_HOOKS += SCREEN_INSTALL_SCREENRC
# Add /usr/bin/screen to /etc/shells otherwise some login tools like dropbear
# can reject the user connection. See man shells.
define SCREEN_ADD_SCREEN_TO_SHELLS
grep -qsE '^/usr/bin/screen$$' $(TARGET_DIR)/etc/shells \
|| echo "/usr/bin/screen" >> $(TARGET_DIR)/etc/shells
endef
SCREEN_TARGET_FINALIZE_HOOKS += SCREEN_ADD_SCREEN_TO_SHELLS
$(eval $(autotools-package))