From patchwork Mon Apr 27 03:38:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1277296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499Vqq5KBCz9sRY for ; Mon, 27 Apr 2020 13:38:47 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=cqC+qiwJ; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 499Vqq3shjzDqKj for ; Mon, 27 Apr 2020 13:38:47 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=cqC+qiwJ; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 499Vqf5cqVzDqV7 for ; Mon, 27 Apr 2020 13:38:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Subject:From:References: In-Reply-To:Message-Id:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gXDkL+Aw53hHpCGo9nUcw1wutrRGW2P/KHMrxWDh5LU=; b=cqC+qiwJhz5wbpMwzzA0t6pWFa +8Ix/MQhOGY+ZliiWQr0YIKF8mMbTlYhze4ID1dKZNbSuj1AuNIm2fehYRDdQb8wfHN5l99BK19WE XlircwBELcbpn35iP/w6arsF1MVuNcOFU/TSFtrucaYwxtyuTGh22e559zpPmGXP67RlE41VrUGKp pgmf9QWLPXKdwL0xzWxzAHuOK3kWeYCKwinq7zemHS4Uzzse1hfrNwmIU7UwLxTPpWVPvIqVBpZlh ba7wbB7reIigp3tO0xxzgZZxD67tqlJs2tukzUgV/98JLcrbxcCS1kLQFrUQgGiok5QVRy/s8niMe hU6XJIYw==; Received: from geoff by merlin.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSubG-0005VJ-VI; Mon, 27 Apr 2020 03:38:31 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Sun, 26 Apr 2020 20:14:07 -0700 Subject: [PATCH v1 1/5] ncurses/nc-menu: Remove stray declaration To: Jeremy Kerr Date: Mon, 27 Apr 2020 03:38:30 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Signed-off-by: Geoff Levand --- ui/ncurses/nc-menu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/ncurses/nc-menu.h b/ui/ncurses/nc-menu.h index 4d9e188..eb568c8 100644 --- a/ui/ncurses/nc-menu.h +++ b/ui/ncurses/nc-menu.h @@ -61,7 +61,6 @@ void pmenu_item_insert(struct pmenu *menu, struct pmenu_item *item, unsigned int index); void pmenu_item_add(struct pmenu *menu, struct pmenu_item *item, unsigned int insert_pt); -void pmenu_item_delete(struct pmenu_item *item); static inline struct pmenu_item *pmenu_item_from_arg(void *arg) { From patchwork Mon Apr 27 03:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1277298 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499Vr51mNtz9sRY for ; Mon, 27 Apr 2020 13:39:01 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=dHko9Ejd; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 499Vr50vklzDqB0 for ; Mon, 27 Apr 2020 13:39:01 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=dHko9Ejd; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 499Vqf6BPWzDqV9 for ; Mon, 27 Apr 2020 13:38:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:From:References:In-Reply-To:Message-Id: Sender:Reply-To:Content-ID:Content-Description; bh=fQLHqxerTDjXAfaw8486fghVFtbYTWhlnZ1rt+P3KDk=; b=dHko9EjdUJdkcufDDB8yDqAWxr 44lsW2ISBOwPUOdL/R/OSHoBagtHOSh34si7MYVHI42r9B7AQvy4pgkwhhfahQn8MjS/bgbatS5m9 R7VU/+2xS4SJCbgaZWixJ6JINrWnYsFYeu6+I8YdSsU1w89nDeaFqdEUc3lrzMGBcAXITmW+MR0qZ +g038Viv71Zpnha4YxyQ4vnofFLRyz/UxyxWJ28ZEQ6re8eUeaA2ViXP/CYpbRL8Zay0e/hynigTb f8RDGYTkclX++INfE+Ys7mBgu8gKNN9b6JPcaNvgafJEp6F12y7T7uVm3P8HYb3zd0W3ygJBgCi4R QS7vTQRQ==; Received: from geoff by merlin.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSubH-0005VN-23; Mon, 27 Apr 2020 03:38:31 +0000 Message-Id: <42d8c424b52852beefce0885095886edf1ef6eb3.1587958237.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Sun, 26 Apr 2020 20:14:07 -0700 Subject: [PATCH v1 2/5] discover/platform-powerpc: Fix build warning MIME-Version: 1.0 To: Jeremy Kerr Date: Mon, 27 Apr 2020 03:38:31 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Fix bad pointer assignment when coping mailbox data: warning: assignment to ‘uint8_t *’ from incompatible pointer type ‘uint8_t (*)[13]’ Signed-off-by: Geoff Levand --- discover/platform-powerpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index c6ab416..bcb18e1 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -564,7 +564,7 @@ static int get_ipmi_boot_mailbox(struct platform_powerpc *platform, * Enterprise ID number */ block_size -= CHASSIS_BOOT_MBOX_IANA_SZ; - boot_opt_data = &mailbox.b0.data; + boot_opt_data = mailbox.b0.data; /* Check IANA matches the IBM number, '2' */ if (mailbox.b0.iana[0] != 0x02 || @@ -577,7 +577,7 @@ static int get_ipmi_boot_mailbox(struct platform_powerpc *platform, return -1; } } else { - boot_opt_data = &mailbox.data; + boot_opt_data = mailbox.data; } mailbox_buffer = talloc_realloc(platform, mailbox_buffer, From patchwork Mon Apr 27 03:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1277299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499VrB0wtSz9sRY for ; Mon, 27 Apr 2020 13:39:06 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WCngNy9o; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 499Vr96cRbzDqLG for ; Mon, 27 Apr 2020 13:39:05 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WCngNy9o; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 499Vqg06x6zDqVF for ; Mon, 27 Apr 2020 13:38:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:From:References:In-Reply-To:Message-Id: Sender:Reply-To:Content-ID:Content-Description; bh=R/nWLLY6CppyT83Cfx5RAo5lprR59+uzfBpcr8YRtqw=; b=WCngNy9oMal9rQ2/PZYgDuc7Cv Qvr3aj4BQ+WfVJvM+8KhoseUF7WYZHssYelq66Gn250IWSq2aVt9IiMcc66rGUNjNk19lnXUkbnmA QYWIZ6+Obu16BFr0lmxovh3cVTH/z9nlQN/L2XPz8t3Hq/HY9T5Q0lI6FUj99N8o3MZ5zL89mW1iN gRAPHVOhSQIHI7GylWSLc5ujeLj7wvZnQBq7PbhAjz9yiAudeWlsLuA8lN70MYUKJ3Scg8FA+Awwh ogiQdZt2woRiiBGytAiD9dskQSE0TBPsl2HbNkdNN8bANqaTHOW6TG+afx62UMUbc/02nobXqF7h1 OJc+T7tw==; Received: from geoff by merlin.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSubH-0005VR-4n; Mon, 27 Apr 2020 03:38:31 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Sun, 26 Apr 2020 20:14:07 -0700 Subject: [PATCH v1 3/5] lib/efi: Fix build warnings MIME-Version: 1.0 To: Jeremy Kerr Date: Mon, 27 Apr 2020 03:38:31 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Fixes build warnings like these when building as 32-bit: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t’ Signed-off-by: Geoff Levand --- lib/efi/efivar.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/efi/efivar.c b/lib/efi/efivar.c index 37bb6d9..75863ba 100644 --- a/lib/efi/efivar.c +++ b/lib/efi/efivar.c @@ -34,7 +34,7 @@ #include "talloc/talloc.h" #ifndef EFIVARFS_MAGIC -#define EFIVARFS_MAGIC 0xde5e81e4 +#define EFIVARFS_MAGIC 0xde5e81e4UL #endif void efi_init_mount(struct efi_mount *efi_mount, const char *path, @@ -71,7 +71,7 @@ bool efi_check_mount_magic(const struct efi_mount *efi_mount, bool check_magic) return false; } - if (check_magic && s.f_type != EFIVARFS_MAGIC) { + if (check_magic && ((unsigned long)s.f_type != EFIVARFS_MAGIC)) { pb_debug_fn("Bad magic = 0x%lx\n", (unsigned long)s.f_type); return false; } @@ -183,12 +183,12 @@ int efi_get_variable(void *ctx, const struct efi_mount *efi_mount, continue; pb_log("%s: read failed %s: (%ld) (%d) %s\n", __func__, path, - count, errno, strerror(errno)); + (long int)count, errno, strerror(errno)); goto exit; } if (p >= (buf + sizeof(buf))) { pb_log("%s: buffer full %s: (%ld)\n", __func__, path, - sizeof(buf)); + (long int)sizeof(buf)); goto exit; } if (count == 0) @@ -242,7 +242,7 @@ int efi_set_variable(const struct efi_mount *efi_mount, const char *name, count = write(fd, buf, bufsize); if ((size_t)count != bufsize) { pb_log("%s: write failed %s: (%ld) (%d) %s\n", __func__, name, - count, errno, strerror(errno)); + (long int)count, errno, strerror(errno)); goto exit; } rc = 0; From patchwork Mon Apr 27 03:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1277300 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499VrG4y0Hz9sRY for ; Mon, 27 Apr 2020 13:39:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WyzkY1xu; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 499VrG3XzbzDqML for ; Mon, 27 Apr 2020 13:39:10 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WyzkY1xu; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 499Vqg02W1zDqVD for ; Mon, 27 Apr 2020 13:38:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Subject:From:References: In-Reply-To:Message-Id:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=iJz/tG5W35N11XjRTjMjRw9ASzD0T5jDqhMbbCwy1YA=; b=WyzkY1xumCEGayKNJj3K3qqLQz VbVBgWANH2CyjU7ICJc2zYJlFnSnlsjjuqSZpYA+sLZW3xWV9Za1SObeqTbpbnuz1u6HTZ9RvlCKe Qr/EQNWgf1edd0jkzoWL2eNC4NJIJsWAxtiz2ENPNop5pz80SR557PNA8PfYNL5zifT/6kFPEr7Kk 27IBSwJzI1cZ9ikKWwWmmuu/jccUFIEZxNh5w55pJanw8SP1dfhRbwZl9UFbDHzywQ8UXMG3DIH0p +0Av7b1Xo6qslgLWSBNiG5WfeCWKyalf+k557ug3FpAvCdVx/L2yHCN78gxQsb5+OKWWaILO9rIxl djcwdOjQ==; Received: from geoff by merlin.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSubH-0005VV-7E; Mon, 27 Apr 2020 03:38:31 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Sun, 26 Apr 2020 20:14:07 -0700 Subject: [PATCH v1 4/5] pb-discover: Fix signal handler To: Jeremy Kerr Date: Mon, 27 Apr 2020 03:38:31 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Variables shared between signal handlers and the main program need to be of type 'volatile sig_atomic_t'. Also, after a signal is serviced it should be re-enabled, so add a call to signal() in the handler. Signed-off-by: Geoff Levand --- discover/pb-discover.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/discover/pb-discover.c b/discover/pb-discover.c index e2b36dd..f67eea5 100644 --- a/discover/pb-discover.c +++ b/discover/pb-discover.c @@ -113,11 +113,12 @@ static int opts_parse(struct opts *opts, int argc, char *argv[]) return optind != argc; } -static int running; +static volatile sig_atomic_t running; -static void sigint_handler(int __attribute__((unused)) signum) +static void sigint_handler(int signum) { running = 0; + signal(signum, sigint_handler); } int main(int argc, char *argv[]) From patchwork Mon Apr 27 03:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1277301 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499VrR5dT0z9sRY for ; Mon, 27 Apr 2020 13:39:19 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=KHZ3Yhvo; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 499VrR3pwtzDqKV for ; Mon, 27 Apr 2020 13:39:19 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=KHZ3Yhvo; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 499Vqf5PjpzDqV5 for ; Mon, 27 Apr 2020 13:38:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Subject:From:References: In-Reply-To:Message-Id:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Vj8x8fjtqU88h+g5OSvbXERLoeoErgl/gxQQz43Hg2Q=; b=KHZ3YhvoDMT4JcMUSCJaKn4vgR u/Rc2fBglH9BhaoOc/HHvHxuG3eWxp2+urem1XEVxY3lZMoCTJum79tZLHI1epB8qL12qq6imYqxS JiADYbZ7Odb3L+S+WVGpCziExbsJGXEVnoEPauHIuDBzmuTuAJ/pnEwRuSfk0NExwxcuFnfNO8Ubi /0hWYTkTJRglIExTuBXHd8TIol93TBEq9KEQ1wsGOMKZEU+hd0n7k498TXTJGbYVISXaGWpxtTlBm pRk5YtSqDjUy0ZR35X81UYZWrWDUqYmJVeqQRXgaBgIML9ndrDvvMu2Fi86DAUtXcNIFIXnAML+8e p3uS1F0Q==; Received: from geoff by merlin.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSubH-0005VZ-9Q; Mon, 27 Apr 2020 03:38:31 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Sun, 26 Apr 2020 20:14:07 -0700 Subject: [PATCH v1 5/5] ui-system: Use argv for talloc context To: Jeremy Kerr Date: Mon, 27 Apr 2020 03:38:31 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Process instances are no longer allocated using talloc, so use the argv instance as the talloc context. Fixes runtime errors like these when using the --start-daemon option: talloc_chunk_from_ptr: Assertion `0 && "Bad talloc magic value - unknown value"' failed. Signed-off-by: Geoff Levand --- ui/common/ui-system.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c index 02142db..dca581a 100644 --- a/ui/common/ui-system.c +++ b/ui/common/ui-system.c @@ -47,8 +47,8 @@ int pb_start_daemon(void *ctx) process = process_create(ctx); - argv = talloc_array(process, const char *, 2); - name = talloc_asprintf(process, "%s/sbin/pb-discover", + argv = talloc_array(NULL, const char *, 2); + name = talloc_asprintf(argv, "%s/sbin/pb-discover", pb_system_apps.prefix); argv[0] = name; @@ -59,6 +59,7 @@ int pb_start_daemon(void *ctx) result = process_run_async(process); process_release(process); + talloc_free(argv); return result; }