From patchwork Sun Sep 18 00:13:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 671305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sc8kg5FPBz9t14 for ; Sun, 18 Sep 2016 10:18:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Kn/Lp4AX; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1blPkR-0000bl-De; Sun, 18 Sep 2016 00:14:19 +0000 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1blPkM-0000P7-6a for lede-dev@lists.infradead.org; Sun, 18 Sep 2016 00:14:17 +0000 Received: by mail-oi0-x244.google.com with SMTP id v62so5915516oig.1 for ; Sat, 17 Sep 2016 17:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=jMg8XtdtuXGLZa1BoyH3q78WMRBGc/0ffb+wqU4jK5s=; b=Kn/Lp4AXhKHCh2jqeN9f4z0gZtNwCzXaPuNJ05RZIgpbqwzHp3sIvT8I+/8iFYvOoS vhOZbiapoPzr+2x6h28lMQqKCDSV1w0OolWl8C+bCud3G/AyWNroKqaH86VrIgQgxVCH cpW/AYnV5m6iXGBgq1OhCcPDSbcELXDRPVYuQrYqimh3MaX6LzgCpM3noKqbPmwNxTn1 pVh9880+gCvXTy47OI4owBDCVyZRcOxEYPe5aqh2Q85cie7su/gNlfYOkxx0xsQMKhZ7 ToxgtLhL/1GjipCx0MjG0nVDDdH5yI3D7/lP+ghGe4ikK7gSc7wiUE17gsILWE06V5Zc WgoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jMg8XtdtuXGLZa1BoyH3q78WMRBGc/0ffb+wqU4jK5s=; b=dIP+3oT38PMCs4XLKjOg7umL1jU/RTI9Pef5b+/vRDEHZcStvj/5RsVLzkwAKNUuk2 LctJ45TnQuPXKCG/vEB7RlcLIkKB3f/uOfCS6Li++ztnL6R7MnHUqdyoFGAWDVS62Y8F UFsYYEu/zroXe2AK5+yLjY+Au2ymCv5Kp2dhLpRnDYzPZBDMMh/tal3IOFDh1p9qGclk V0qbCI9jd0w556ucUamrplAqzPAHkvSuzRzqNZRuFCt3zfCiAL2b5IKbHZT9UWyE/ih+ QPJPRNEuSJmp+sL3QaOSE12R6V9jlN2++4c1YqNwmxuh2X7TCzQk6nIfxag/PBHjyTso 5ZYA== X-Gm-Message-State: AE9vXwM8X5Djrx2fR5QLz+0IZYGF0GURsgX3lOizK+K22dYtocAUocTWydtN1SLvCvN8/g== X-Received: by 10.202.6.196 with SMTP id 187mr20753095oig.195.1474157632061; Sat, 17 Sep 2016 17:13:52 -0700 (PDT) Received: from ?IPv6:2001:470:d:73f:68f7:5f02:a64d:b5e9? ([2001:470:d:73f:68f7:5f02:a64d:b5e9]) by smtp.googlemail.com with ESMTPSA id p8sm5000407otd.35.2016.09.17.17.13.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Sep 2016 17:13:51 -0700 (PDT) To: Etienne Champetier References: <1474143421-26561-1-git-send-email-f.fainelli@gmail.com> From: Florian Fainelli Message-ID: Date: Sat, 17 Sep 2016 17:13:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160917_171416_455200_8965AFB3 X-CRM114-Status: GOOD ( 15.86 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4003:c06:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: Re: [LEDE-DEV] [PATCH ubox] getrandom: Define SYS_getrandom if no definition exists X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: john@phrozen.org, lede-dev@lists.infradead.org, Felix Fietkau Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Le 17/09/2016 à 16:49, Etienne Champetier a écrit : > Hi Florian, > > What is your use case? Pre-built toolchain which ships with kernel headers 3.8 at the moment. > If you run it on kernel less than 3.17 this will then fail at run time ... I run a kernel newer than 3.17, but that's a good point. > I would prefer to not compile it instead of having an unusable binary Ok, so something more like that: $(LN) ../../sbin/kmodloader $(1)/usr/sbin/rmmod > > Regards > Etienne > > > Le 17 sept. 2016 10:17 PM, "Florian Fainelli" > a écrit : > > Building ubox against kernel headers earlier than 3.17 would fail since > SYS_getrandom was not defined, so provide a definition for it. > > Signed-off-by: Florian Fainelli > > --- > getrandom.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/getrandom.c b/getrandom.c > index 96712028589b..e324072fcf0e 100644 > --- a/getrandom.c > +++ b/getrandom.c > @@ -32,6 +32,10 @@ static int usage(char *name) > return EXIT_FAILURE; > } > > +#ifndef SYS_getrandom > +#define SYS_getrandom 278 > +#endif > + > int main(int argc, char *argv[]) > { > if (argc != 2) > -- > 2.7.4 > diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cf0c934aac6..1d04c1d77662 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,10 +16,15 @@ IF(DEBUG) ADD_DEFINITIONS(-DDEBUG -g3) ENDIF() -ADD_EXECUTABLE(getrandom getrandom.c) -INSTALL(TARGETS getrandom +INCLUDE (CheckSymbolExists) +CHECK_SYMBOL_EXISTS(SYS_getrandom sycall.h getrandom) + +IF(getrandom) + ADD_EXECUTABLE(getrandom getrandom.c) + INSTALL(TARGETS getrandom RUNTIME DESTINATION bin -) + ) +ENDIF() ADD_EXECUTABLE(kmodloader kmodloader.c) TARGET_LINK_LIBRARIES(kmodloader ubox) diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index 9f0c4dc10250..48371e168fd3 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -32,7 +32,7 @@ define Package/ubox/install $(INSTALL_DIR) $(1)/sbin $(1)/usr/sbin $(1)/lib $(1)/usr/bin $(1)/etc/init.d $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{kmodloader,validate_data} $(1)/sbin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/ + -$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib