From patchwork Thu Nov 16 03:49:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 838386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ycnNk61fWz9s7g for ; Thu, 16 Nov 2017 14:51:34 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ycnNk5JJlzDqrG for ; Thu, 16 Nov 2017 14:51:34 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=gmail.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=cyrilbur@gmail.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ycnLZ3kQtzDqvV for ; Thu, 16 Nov 2017 14:49:42 +1100 (AEDT) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAG3n5mJ053166 for ; Wed, 15 Nov 2017 22:49:39 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e91jsbuh3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 15 Nov 2017 22:49:39 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 16 Nov 2017 03:49:38 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 16 Nov 2017 03:49:35 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAG3nZDu42598412 for ; Thu, 16 Nov 2017 03:49:35 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 859FA42045 for ; Thu, 16 Nov 2017 03:44:28 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0727D42041 for ; Thu, 16 Nov 2017 03:44:28 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Thu, 16 Nov 2017 03:44:27 +0000 (GMT) Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 67611A018E for ; Thu, 16 Nov 2017 14:49:32 +1100 (AEDT) From: Cyril Bur To: petitboot@lists.ozlabs.org Subject: [PATCH 1/4] configure.ac: Fix unmatched brackets Date: Thu, 16 Nov 2017 14:49:11 +1100 X-Mailer: git-send-email 2.15.0 X-TM-AS-GCONF: 00 x-cbid: 17111603-0040-0000-0000-0000040EDEE8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111603-0041-0000-0000-000020B1983E Message-Id: <20171116034914.7820-1-cyrilbur@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-16_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711160052 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Signed-off-by: Cyril Bur --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a4b5fc7..3ed41ee 100644 --- a/configure.ac +++ b/configure.ac @@ -59,7 +59,7 @@ AC_CHECK_LIB([udev], [udev_new], PKG_CHECK_EXISTS(libudev >= 218, [old_udev=no], [old_udev=yes]) if test "$old_udev" = "yes" ; then - AC_DEFINE(UDEV_LOGGING, 1, [Support old udev logging interface])], + AC_DEFINE(UDEV_LOGGING, 1, [Support old udev logging interface]) fi AC_CHECK_LIB([devmapper], [dm_task_create], From patchwork Thu Nov 16 03:49:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 838385 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ycnNf6yRnz9s7M for ; Thu, 16 Nov 2017 14:51:30 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ycnNf5rRjzDqvS for ; Thu, 16 Nov 2017 14:51:30 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=gmail.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=cyrilbur@gmail.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ycnLY6Fw9zDr1t for ; Thu, 16 Nov 2017 14:49:41 +1100 (AEDT) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAG3n6oJ147369 for ; Wed, 15 Nov 2017 22:49:39 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e90guecd0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 15 Nov 2017 22:49:39 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 16 Nov 2017 03:49:37 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 16 Nov 2017 03:49:35 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAG3nZBl42598410 for ; Thu, 16 Nov 2017 03:49:35 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8590842042 for ; Thu, 16 Nov 2017 03:44:28 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05E2B4203F for ; Thu, 16 Nov 2017 03:44:28 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Thu, 16 Nov 2017 03:44:27 +0000 (GMT) Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 72FA1A01E1 for ; Thu, 16 Nov 2017 14:49:32 +1100 (AEDT) From: Cyril Bur To: petitboot@lists.ozlabs.org Subject: [PATCH 2/4] Fix bootstrap warning: noinst_PROGRAMS was already defined Date: Thu, 16 Nov 2017 14:49:12 +1100 X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171116034914.7820-1-cyrilbur@gmail.com> References: <20171116034914.7820-1-cyrilbur@gmail.com> X-TM-AS-GCONF: 00 x-cbid: 17111603-0020-0000-0000-000003CCDC78 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111603-0021-0000-0000-0000426213FF Message-Id: <20171116034914.7820-2-cyrilbur@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-16_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711160052 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" utils/Makefile.am:27: warning: noinst_PROGRAMS was already defined in condition TRUE, which includes condition HAVE_LIBFDT ... utils/Makefile.am should probably be adding to noinst_PROGRAMS rather than reclaring it. Signed-off-by: Cyril Bur --- utils/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/Makefile.am b/utils/Makefile.am index 3ef3fe8..c9015a0 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -24,7 +24,7 @@ utils_hooks_30_dtb_updates_LDADD = $(top_builddir)/lib/libpbcore.la \ $(FDT_LIBS) if HAVE_LIBFDT -noinst_PROGRAMS = \ +noinst_PROGRAMS += \ utils/hooks/30-dtb-updates endif From patchwork Thu Nov 16 03:49:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 838387 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ycnP13lGFz9s7M for ; Thu, 16 Nov 2017 14:51:49 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ycnP12fTbzDqw8 for ; Thu, 16 Nov 2017 14:51:49 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=gmail.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=cyrilbur@gmail.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ycnMC2dhLzDqyQ for ; Thu, 16 Nov 2017 14:50:15 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAG3o4T0117885 for ; Wed, 15 Nov 2017 22:50:12 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e91wytw37-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 15 Nov 2017 22:50:11 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 16 Nov 2017 03:49:37 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 16 Nov 2017 03:49:34 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAG3nYRs17301538 for ; Thu, 16 Nov 2017 03:49:34 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E2BF11C04C for ; Thu, 16 Nov 2017 03:44:21 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E14411C04A for ; Thu, 16 Nov 2017 03:44:21 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Thu, 16 Nov 2017 03:44:21 +0000 (GMT) Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 75360A0217 for ; Thu, 16 Nov 2017 14:49:32 +1100 (AEDT) From: Cyril Bur To: petitboot@lists.ozlabs.org Subject: [PATCH 3/4] Better recognition of ncurses header files Date: Thu, 16 Nov 2017 14:49:13 +1100 X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171116034914.7820-1-cyrilbur@gmail.com> References: <20171116034914.7820-1-cyrilbur@gmail.com> X-TM-AS-GCONF: 00 x-cbid: 17111603-0040-0000-0000-0000040EDEE7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111603-0041-0000-0000-000020B1983D Message-Id: <20171116034914.7820-3-cyrilbur@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-16_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711160052 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" This patch was lifted directly from: https://github.com/Tlf/tlf/commit/a21513254ce8bf66d0b019f6075eea918958741a The commit message reads: If ax_with_ncurses finds a ncursesw instance the former code checks only for . If not there the search fails. That let to problems at least in Arch Linux which has only installed. The patched version here checks first for and if not found also for . Tested for the following distributions: Gentoo, Debian 7..9, Linux Mint 17 and 18.1, Arch Linux, Ubuntu ARCH Linux builds ncurses with wide character support but does not add any ncurses specific headers. nurses its self (by default) adds almost no ncurses specific headers. No {prefix}/include/ncurses directory. In fact the only ncurses specific file is the ncurses.h symlink to curses.h, other than that there are no ncurses headers. The ax_with_curses.m4 script detects if the installed ncurses has wide character support. It checks using code snippets against all possible ncurses header files. If the ax_with_curses.m4 script detects wide character support the ax_with_curses_extra.m4 will only look for extra curses features (in the case of petitboot, form.h and menu.h) inside the {prefix}/include/ncurses directory, when they could simply be in {prefix}/include. Signed-off-by: Cyril Bur --- As an added side note: carrying these is an extremely good idea, it appears upstream is subtly broken (I really didn't go that much into it), just know that pulling upstream doesn't work. Confirmed here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840974 m4/ax_with_curses_extra.m4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/m4/ax_with_curses_extra.m4 b/m4/ax_with_curses_extra.m4 index e0de4a6..67a1a68 100644 --- a/m4/ax_with_curses_extra.m4 +++ b/m4/ax_with_curses_extra.m4 @@ -200,6 +200,11 @@ AC_DEFUN([_AX_WITH_CURSES_EXTRA], [ ], [ AS_IF([test "x$ax_cv_curses_which" = xncursesw], [ _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [ncursesw/$4], [$5]) + dnl This fixes problem building on distos with 'odd' + dnl ncurses header file setups + AS_IF([test x$[]ax_cv_[]m4_tolower($1) != "xyes"], [ + _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$5]) + ]) ], [test "x$ax_cv_curses_which" = xncurses], [ _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [ncurses/$4], [$6]) _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$6]) From patchwork Thu Nov 16 03:49:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 838384 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ycnNb1dnMz9s7g for ; Thu, 16 Nov 2017 14:51:27 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ycnNb0ZfszDqwr for ; Thu, 16 Nov 2017 14:51:27 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=gmail.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=cyrilbur@gmail.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ycnLX3Zv3zDqyR for ; Thu, 16 Nov 2017 14:49:40 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAG3n5mo139016 for ; Wed, 15 Nov 2017 22:49:37 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e925njcbq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 15 Nov 2017 22:49:37 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 16 Nov 2017 03:49:36 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 16 Nov 2017 03:49:34 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAG3nYWY50331898 for ; Thu, 16 Nov 2017 03:49:34 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4E52AE053 for ; Thu, 16 Nov 2017 03:42:57 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 81EB9AE051 for ; Thu, 16 Nov 2017 03:42:57 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Thu, 16 Nov 2017 03:42:57 +0000 (GMT) Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 77BE9A0252 for ; Thu, 16 Nov 2017 14:49:32 +1100 (AEDT) From: Cyril Bur To: petitboot@lists.ozlabs.org Subject: [PATCH 4/4] discover/pxe-parser: Fine grained proxy control Date: Thu, 16 Nov 2017 14:49:14 +1100 X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171116034914.7820-1-cyrilbur@gmail.com> References: <20171116034914.7820-1-cyrilbur@gmail.com> X-TM-AS-GCONF: 00 x-cbid: 17111603-0012-0000-0000-0000058DE012 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111603-0013-0000-0000-00001908A025 Message-Id: <20171116034914.7820-4-cyrilbur@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-16_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711160052 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Petitboot provides a method for a user to manually specify a configuration file that should be retrieved. Petitboot also has a global proxy configuration. This patch aims to marry the two so that a custom configuration file can specify that a specific proxy should be used to access one (or all) of the options within it. This makes custom configuration files more powerful as they can point to files behind proxies without the user needing to also specify the global proxy for that specific custom configuration file to work. This adds parsing for a `proxy` option which will apply to all boot items found after. Signed-off-by: Cyril Bur --- discover/boot.c | 5 +++++ discover/device-handler.h | 1 + discover/pxe-parser.c | 14 +++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/discover/boot.c b/discover/boot.c index fab4b61..ba4e720 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -579,6 +579,11 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt, dtb = opt->dtb->url; } + if (opt && opt->proxy) { + setenv("http_proxy", opt->proxy, 1); + setenv("https_proxy", opt->proxy, 1); + } + boot_task = talloc_zero(ctx, struct boot_task); boot_task->dry_run = dry_run; boot_task->status_fn = status_fn; diff --git a/discover/device-handler.h b/discover/device-handler.h index a95cc9d..771cd06 100644 --- a/discover/device-handler.h +++ b/discover/device-handler.h @@ -45,6 +45,7 @@ struct discover_boot_option { struct discover_device *device; struct boot_option *option; struct list_item list; + const char *proxy; struct resource *boot_image; struct resource *initrd; diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index aef43b8..7183ecf 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -31,13 +31,17 @@ struct pxe_parser_info { char **pxe_conf_files; struct pb_url *pxe_base_url; int current; + char *proxy; }; static void pxe_finish(struct conf_context *conf) { struct pxe_parser_info *info = conf->parser_info; - if (info->opt) + if (info->opt) { + if (info->proxy) + info->opt->proxy = talloc_strdup(info->opt, info->proxy); discover_context_add_boot_option(conf->dc, info->opt); + } } /* We need a slightly modified version of pb_url_join, to allow for the @@ -148,6 +152,14 @@ static void pxe_process_pair(struct conf_context *ctx, return; } + if (streq(name, "PROXY")) { + if (parser_info->proxy) + talloc_free(parser_info->proxy); + + parser_info->proxy = talloc_strdup(parser_info, value); + return; + } + if (streq(name, "LABEL") || streq(name, "PLUGIN")) { if (opt) pxe_finish(ctx);