mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@kalray.eu>
To: Ahmad Fatoum <ahmad@a3f.at>
Cc: barebox@lists.infradead.org
Subject: Re: Getting more of Barebox
Date: Fri, 1 Apr 2022 19:43:11 +0200	[thread overview]
Message-ID: <20220401174311.GG4351@tellis.lin.mbt.kalray.eu> (raw)
In-Reply-To: <20220401164558.603727-1-ahmad@a3f.at>

On Fri, Apr 01, 2022 at 06:45:58PM +0200, Ahmad Fatoum wrote:
> Finally, a no-frills way to join the currently relevant $supportgroup. Thx!
> 
> Please squash below for v2, so I don't need to carry patch for
> 
>   global.boot.default="$global.boot.default helpme"
> 
> around. Appreciated!
Thanks, applied as fixup for now. :)

> 
> -------- 8< --------
> 
>  arch/arm/configs/ircbox_defconfig        |  1 +
>  defaultenv/defaultenv-2-base/boot/helpme | 21 +++++++++++++++++++++
>  net/irc.c                                | 13 +++++++++++--
>  3 files changed, 33 insertions(+), 2 deletions(-)
>  create mode 100755 defaultenv/defaultenv-2-base/boot/helpme
> 
> diff --git a/arch/arm/configs/ircbox_defconfig b/arch/arm/configs/ircbox_defconfig
> index 854a80775d79..0232156e624e 100644
> --- a/arch/arm/configs/ircbox_defconfig
> +++ b/arch/arm/configs/ircbox_defconfig
> @@ -13,6 +13,7 @@ CONFIG_CONSOLE_ACTIVATE_NONE=y
>  CONFIG_CONSOLE_ALLOW_COLOR=y
>  CONFIG_PARTITION_DISK_EFI=y
>  CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
> +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG=y
>  CONFIG_STATE=y
>  CONFIG_BOOTCHOOSER=y
>  CONFIG_RESET_SOURCE=y
> diff --git a/defaultenv/defaultenv-2-base/boot/helpme b/defaultenv/defaultenv-2-base/boot/helpme
> new file mode 100755
> index 000000000000..750445f297d7
> --- /dev/null
> +++ b/defaultenv/defaultenv-2-base/boot/helpme
> @@ -0,0 +1,21 @@
> +#!/bin/sh
> +
> +. /env/data/config
> +
> +if [ -n "$CONFIG_ARM" ]; then
> +  supportgroup="armlinux"
> +elif [ -n "$CONFIG_RISCV" ]; then
> +  supportgroup="riscv"
> +elif [ -n "$CONFIG_OPENRISC" ]; then
> +  supportgroup="openrisc"
> +fi
> +
> +if [ -n "$supportgroup" ]; then
> +  readline "Want to ask for support on $supportgroup? [Y/n]  " linuxsupport
> +fi
> +
> +if [ "$linuxsupport" != "Y" ]; then
> +  supportgroup=barebox
> +fi
> +
> +irc -n $global.user -c "/j $supportgroup" irc.libera.chat
> diff --git a/net/irc.c b/net/irc.c
> index 5ce2dbb4c8be..b42d4afc2c30 100644
> --- a/net/irc.c
> +++ b/net/irc.c
> @@ -469,11 +469,15 @@ static int do_irc(int argc, char *argv[])
>  {
>  	int ret;
>  	char *host, *p;
> +	const char *command = NULL;
>  	uint16_t port = 6667;
>  	int opt;
>  
> -	while ((opt = getopt(argc, argv, "n:")) > 0) {
> +	while ((opt = getopt(argc, argv, "c:n:")) > 0) {
>  		switch (opt) {
> +		case 'c':
> +			command = optarg;
> +			break;
>  		case 'n':
>  			strlcpy(nick, optarg, sizeof(nick));
>  			break;
> @@ -516,6 +520,10 @@ static int do_irc(int argc, char *argv[])
>  	if (nick[0] == '\0')
>  		strlcpy(nick, "barebox", sizeof(nick));
>  	irc_login(host, "barebox");
> +
> +	if (command)
> +		irc_input(command);
> +
>  	while (con->state == TCP_ESTABLISHED) {
>  		int len;
>  		len = irc_readline(input_line, sizeof(input_line) - 1);
> @@ -541,11 +549,12 @@ out:
>  BAREBOX_CMD_HELP_START(irc)
>  BAREBOX_CMD_HELP_TEXT("Options:")
>  BAREBOX_CMD_HELP_OPT ("-n NICK\t", "nick to use")
> +BAREBOX_CMD_HELP_OPT ("-c COMMAND\t", "command to run after login")
>  BAREBOX_CMD_HELP_END
>  
>  BAREBOX_CMD_START(irc)
>  	.cmd		= do_irc,
>  	BAREBOX_CMD_DESC("IRC client")
> -	BAREBOX_CMD_OPTS("[-n] DESTINATION[[/]PORT]")
> +	BAREBOX_CMD_OPTS("[-nc] DESTINATION[[/]PORT]")
>  	BAREBOX_CMD_GROUP(CMD_GRP_NET)
>  BAREBOX_CMD_END
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 
> 
> To declare a filtering error, please use the following link : https://www.security-mail.net/reporter.php?mid=15e93.62472cc9.7208e.0&r=jmaselbas%40kalray.eu&s=barebox-bounces%2Bjmaselbas%3Dkalray.eu%40lists.infradead.org&o=Re%3A+Getting+more+of+Barebox&verdict=C&c=727c2b6f1cada1d321c2737135dbdd0d0d4abeda
> 





_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2022-04-01 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 14:59 [ANNOUNCEMENT] " Jules Maselbas
2022-04-01 16:45 ` Ahmad Fatoum
2022-04-01 17:43   ` Jules Maselbas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220401174311.GG4351@tellis.lin.mbt.kalray.eu \
    --to=jmaselbas@kalray.eu \
    --cc=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox