From patchwork Thu Nov 12 22:50:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Heinrich Kiwi X-Patchwork-Id: 1399440 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ZjmSu1pM; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CXGzB01D4z9sTv for ; Fri, 13 Nov 2020 09:50:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9664E87242; Thu, 12 Nov 2020 22:50:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O9fkSkDCB2qo; Thu, 12 Nov 2020 22:50:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D154087233; Thu, 12 Nov 2020 22:50:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id C78E41BF41F for ; Thu, 12 Nov 2020 22:50:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BE7A18722B for ; Thu, 12 Nov 2020 22:50:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2s9vqrcq-Lqa for ; Thu, 12 Nov 2020 22:50:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0AE5487174 for ; Thu, 12 Nov 2020 22:50:36 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0ACMY0nD141078 for ; Thu, 12 Nov 2020 17:50:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=pp1; bh=DrLP7krTjtQASt676d4DsVkPurCVfrZnNOLspE/amq0=; b=ZjmSu1pMt6gZhNM4X203TvnqBe7qI/A+iCe/1REozUN8au50fR5AhUhu0NPDJXjZ+ZCr G5BaB5Yl+2bTsAWgelQ6BcnPSH3FbF+pqS6TfEUPCR0CqxkR2h6d8Tbq6OiFD3MaI18M NhwWGX0qQ/8APzQJ0wBmnFAFKyLuOwnqRtuh/9OsIEaI/KGGoXxHQmgkOxbyB9wZeaiG WgT2YA7KTMOWKE2dvVHw1CsEaP8Ob6i2TkNTJjHk33DHiV2SfO2Q1NF9uVdkLcmnlkln i45hwHajaifgt8J3OIqOxEPNJX4ryYCVtB+GbFGBMT10h2u1GJyeEQRPjSSKJyJD65Lx PA== Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 34s7m3vvp2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Nov 2020 17:50:35 -0500 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0ACMgAcT006081 for ; Thu, 12 Nov 2020 22:50:34 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma04wdc.us.ibm.com with ESMTP id 34q5nf74p5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Nov 2020 22:50:34 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0ACMoRUv35258938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Nov 2020 22:50:27 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57FFB78067; Thu, 12 Nov 2020 22:50:33 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FBD67805F; Thu, 12 Nov 2020 22:50:32 +0000 (GMT) Received: from klaus-virtual-ubuntu.mshome.net (unknown [9.65.243.55]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 12 Nov 2020 22:50:32 +0000 (GMT) From: Klaus Heinrich Kiwi To: buildroot@buildroot.org Date: Thu, 12 Nov 2020 19:50:16 -0300 Message-Id: <20201112225016.20297-1-klaus@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <87wnyqi8x4.fsf@dell.be.48ers.dk> References: <87wnyqi8x4.fsf@dell.be.48ers.dk> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-12_14:2020-11-12, 2020-11-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 impostorscore=0 mlxscore=0 bulkscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011120127 Subject: [Buildroot] [PATCH v2] package/busybox: Fix hwclock for glibc 2.31+ 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: Klaus Heinrich Kiwi MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Pick the below patch from upstream, in order to fix 'settimeofday: Invalid argument' introduced by using glibc v2.31+. (busybox hasn't tagged a new version since). See https://bugs.busybox.net/show_bug.cgi?id=12756 for more info. commit 1a5d6fcbb5e606ab4acdf22afa26361a25f1d43b Author: Eddie James hwclock: Fix settimeofday for glibc v2.31+ Signed-off-by: Klaus Heinrich Kiwi --- Changes v1 -> V2: - format-patch from the commit itself, instead of applying staged patches on top of 1_32_0 --- ...ock-Fix-settimeofday-for-glibc-v2.31.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 package/busybox/0003-hwclock-Fix-settimeofday-for-glibc-v2.31.patch diff --git a/package/busybox/0003-hwclock-Fix-settimeofday-for-glibc-v2.31.patch b/package/busybox/0003-hwclock-Fix-settimeofday-for-glibc-v2.31.patch new file mode 100644 index 0000000000..486d3dead3 --- /dev/null +++ b/package/busybox/0003-hwclock-Fix-settimeofday-for-glibc-v2.31.patch @@ -0,0 +1,58 @@ +From 1a5d6fcbb5e606ab4acdf22afa26361a25f1d43b Mon Sep 17 00:00:00 2001 +From: Eddie James +Date: Mon, 10 Aug 2020 09:59:02 -0500 +Subject: [PATCH] hwclock: Fix settimeofday for glibc v2.31+ + +The glibc implementation changed for settimeofday, resulting in "invalid +argument" error when attempting to set both timezone and time with a single +call. Fix this by calling settimeofday twice + +Signed-off-by: Eddie James +Signed-off-by: Denys Vlasenko +--- + util-linux/hwclock.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c +index 357906cca..e85bca2b2 100644 +--- a/util-linux/hwclock.c ++++ b/util-linux/hwclock.c +@@ -121,16 +121,20 @@ static void to_sys_clock(const char **pp_rtcname, int utc) + struct timeval tv; + struct timezone tz; + +- tz.tz_minuteswest = timezone/60; ++ tz.tz_minuteswest = timezone / 60; + /* ^^^ used to also subtract 60*daylight, but it's wrong: + * daylight!=0 means "this timezone has some DST + * during the year", not "DST is in effect now". + */ + tz.tz_dsttime = 0; + ++ /* glibc v2.31+ returns an error if both args are non-NULL */ ++ if (settimeofday(NULL, &tz)) ++ bb_simple_perror_msg_and_die("settimeofday"); ++ + tv.tv_sec = read_rtc(pp_rtcname, NULL, utc); + tv.tv_usec = 0; +- if (settimeofday(&tv, &tz)) ++ if (settimeofday(&tv, NULL)) + bb_simple_perror_msg_and_die("settimeofday"); + } + +@@ -282,7 +286,11 @@ static void set_system_clock_timezone(int utc) + gettimeofday(&tv, NULL); + if (!utc) + tv.tv_sec += tz.tz_minuteswest * 60; +- if (settimeofday(&tv, &tz)) ++ ++ /* glibc v2.31+ returns an error if both args are non-NULL */ ++ if (settimeofday(NULL, &tz)) ++ bb_simple_perror_msg_and_die("settimeofday"); ++ if (settimeofday(&tv, NULL)) + bb_simple_perror_msg_and_die("settimeofday"); + } + +-- +2.17.1 +