From patchwork Sun May 12 19:55:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= X-Patchwork-Id: 1098588 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bofc.pl Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 452FCD2yv0z9sNf for ; Mon, 13 May 2019 05:59:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DD92B86EA5; Sun, 12 May 2019 19:59:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0n-u4RzGZ3Ks; Sun, 12 May 2019 19:59:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5EDB386F3A; Sun, 12 May 2019 19:59:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4FB3D1BF215 for ; Sun, 12 May 2019 19:59:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4A99B21FFB for ; Sun, 12 May 2019 19:59:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id THGf-UhK26Tz for ; Sun, 12 May 2019 19:59:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cache12.mydevil.net (cache12.mydevil.net [128.204.216.223]) by silver.osuosl.org (Postfix) with ESMTPS id B683020789 for ; Sun, 12 May 2019 19:59:16 +0000 (UTC) From: =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= To: buildroot@buildroot.org Date: Sun, 12 May 2019 21:55:48 +0200 Message-Id: <20190512195550.24457-11-michal.lyszczek@bofc.pl> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20190512195550.24457-1-michal.lyszczek@bofc.pl> References: <20190512195550.24457-1-michal.lyszczek@bofc.pl> MIME-Version: 1.0 X-AV-Check: Passed X-System-Sender: michal.lyszczek@bofc.pl Subject: [Buildroot] [PATCH v2 11/13] package/openrc: add support to set terminal encoding X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When openrc init is enabled, user can chose to set terminal encoding to ascii, utf-8 or to keep default settings. * system/Config.in New kconfig choice BR2_TARGET_GENERIC_TERMENCODING_* to choose terminal encoding. Depends on openrc init. * package/openrc/openrc.mk monitors BR2_TARGET_GENERIC_TERMENCODING_* choice and make proper changes on TARGET_DIR to enable/disable terminal encoding set. Signed-off-by: Michał Łyszczek --- Changes v1 -> v2 None --- package/openrc/openrc.mk | 19 +++++++++++++++++++ system/Config.in | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/package/openrc/openrc.mk b/package/openrc/openrc.mk index 0feea22818..8d5e6ec381 100644 --- a/package/openrc/openrc.mk +++ b/package/openrc/openrc.mk @@ -55,4 +55,23 @@ endef OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_SET_GETTY endif # BR2_TARGET_GENERIC_GETTY +ifeq ($(BR2_TARGET_GENERIC_TERMENCODING_KEEP),y) +# openrc by default installs service to set terminal encoding, if we want to +# keep default encoding we need to remove service from boot. +define OPENRC_TERMENCODING + $(RM) $(TARGET_DIR)/etc/runlevels/boot/{termencoding,save-termencoding} + $(RM) $(TARGET_DIR)/etc/conf.d/termencoding +endef +OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_TERMENCODING +else +ifeq ($(BR2_TARGET_GENERIC_TERMENCODING_UTF8),y) +# By default openrc will set terminal encoding to ASCII, if we want encoding +# to be utf8, we need to set it. +define OPENRC_TERMENCODING + echo "unicode=\"yes\"" > $(TARGET_DIR)/etc/conf.d/termencoding +endef +OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_TERMENCODING +endif # BR2_TARGET_GENERIC_TERMENCODING_UTF8 +endif # BR2_TARGET_GENERIC_TERMENCODING_KEEP + $(eval $(generic-package)) diff --git a/system/Config.in b/system/Config.in index 32c502e310..08bcb517e4 100644 --- a/system/Config.in +++ b/system/Config.in @@ -390,6 +390,23 @@ comment "automatic network configuration via DHCP needs ifupdown or busybox or n BR2_PACKAGE_SYSTEMD_NETWORKD) && !BR2_PACKAGE_OPENRC) || \ BR2_PACKAGE_OPENRC_NETIFRC) +choice + prompt "Terminal encoding" + default BR2_TARGET_GENERIC_TERMENCODING_KEEP + depends on BR2_INIT_OPENRC + help + Set terminal encoding. This makes sense only when you are going to + use virtual terminals with external monitor (or qemu) that uses + /dev/tty[1-12]. + +config BR2_TARGET_GENERIC_TERMENCODING_KEEP + bool "keep default" +config BR2_TARGET_GENERIC_TERMENCODING_ASCII + bool "ascii" +config BR2_TARGET_GENERIC_TERMENCODING_UTF8 + bool "utf-8" +endchoice + endif # BR2_ROOTFS_SKELETON_DEFAULT config BR2_SYSTEM_DEFAULT_PATH