From nobody Fri Jul 15 22:18:06 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ll5Mz0YK6z4WnBk; Fri, 15 Jul 2022 22:18:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ll5My5p4sz423w; Fri, 15 Jul 2022 22:18:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657923486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fd48RMe9CAxKB1SKSEaZ99V58UvslWdFlCWWs30Msk4=; b=UyHaDQDkosWahJPscL8vyO9kMvPUnKxBPwgCYUpy1rp1blwAyCn3HBN4GfqBr7hCFmIDFc WkLythkllpJPfcZyi1mscq0yZ+NBz+FIY05P0FVjOeh/8X0KcLIeApMuZL/lxi94KKcPVa vvUbQX+f7ObG0P4LhrY5VDV7je5rbpjKtyT38JNXvIw8bZMHWTo5UmJIgiiwJkJZ0DNSBp IX+pn3EGw3zkDv74ytbTDP+TClrC/UPQh8731H8z85tmJ/Xh7pw1ZOLnKYFlEhEGtEov+z wNwrHcwYpeEabeODw1It1CMpOAZ7B0DQgrhM45k8qNoOWVgG7jODbNQBzRLUFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ll5My4wCDzyDf; Fri, 15 Jul 2022 22:18:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26FMI6FU099954; Fri, 15 Jul 2022 22:18:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26FMI6Yg099953; Fri, 15 Jul 2022 22:18:06 GMT (envelope-from git) Date: Fri, 15 Jul 2022 22:18:06 GMT Message-Id: <202207152218.26FMI6Yg099953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: cefe58791b0f - main - release: Support GNU stat in mkisoimages.sh List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cefe58791b0fc5243250b2449107540b03d64689 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657923486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fd48RMe9CAxKB1SKSEaZ99V58UvslWdFlCWWs30Msk4=; b=JZg5l4RiesmeFIt00yGnSyyOBJutzQsQS3/BKY4WmOpPXAa0LLyocpvT6L9hV4G0exb8DM 3Hd4rfPc17gSbyL9fPh8MCCBjlAKy+GOoDAv6mhirVXXATGoVhPBZluSfESdPkppYNDWUX EPyYaciktDHqeZ8GM4X2P+FTiAcAdqT5H/soyjBXxQ2uP7cS9WJ7hVZfxqYExqYszLBodE E3dzz53J7fyXjsoclqksM11HFQAGRUCMhc87SDlBwDZqClaZNPMY6JUUysDS2pxeg1a2OV ZOgX9iDZUipoVSwr1DaI11GC90SryvdD4hObJFykeqCSR4tJcboSPji98o0xsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657923486; a=rsa-sha256; cv=none; b=IRXMfJn1IC9w9Xb0z1IRVYmXXuMoiaKBJXHTqPM8j/naYhsyGudrtizQm10T06b0c4cY1c d/ksLZAaBY015UYbtt1w9JraME/O1iyxLLkagzH33m/Ng3F75nUkvz39pxovYElzm4X5oW ojJZvNabaNHHMe6EdPdJ6i0QUFCLVN8a6sm9d+byM4uG0fWgBbl7xdNT4G0BHyPDXhdHDO 0HDZ6l+TTxdk7fBP37rFrziOr4rCg1R6PSyPvPsbxA2OMzJl45iDqPaKNvjK594jahtamB fhp7UizhzhUYejK8RHYZBSd1yihVBZpX2eVgBOz8J6qV1rSQAJxxhHCTW7GCWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=cefe58791b0fc5243250b2449107540b03d64689 commit cefe58791b0fc5243250b2449107540b03d64689 Author: Jessica Clarke AuthorDate: 2022-07-15 22:04:48 +0000 Commit: Jessica Clarke CommitDate: 2022-07-15 22:04:48 +0000 release: Support GNU stat in mkisoimages.sh BSD stat and GNU stat differ significantly when it comes to using a custom format string, both in the option name and in the format string itself. Handle both here (assuming Linux means GNU stat rather than BSD stat). Reviewed by: brooks, gjb Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D35814 --- release/amd64/mkisoimages.sh | 6 +++++- release/arm64/mkisoimages.sh | 6 +++++- release/riscv/mkisoimages.sh | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh index a90578c02ebd..a8bf186247f0 100644 --- a/release/amd64/mkisoimages.sh +++ b/release/amd64/mkisoimages.sh @@ -112,7 +112,11 @@ if [ "$bootable" != "" ]; then # Create a GPT image containing the partitions we need for hybrid boot. hybridfilename=$(mktemp /tmp/hybrid.img.XXXXXX) - imgsize=`stat -f %z "$NAME"` + if [ "$(uname -s)" = "Linux" ]; then + imgsize=`stat -c %s "$NAME"` + else + imgsize=`stat -f %z "$NAME"` + fi $MKIMG -s gpt \ --capacity $imgsize \ -b "$BASEBITSDIR/boot/pmbr" \ diff --git a/release/arm64/mkisoimages.sh b/release/arm64/mkisoimages.sh index e7e56eef1cb6..2a30c8e3e975 100644 --- a/release/arm64/mkisoimages.sh +++ b/release/arm64/mkisoimages.sh @@ -107,7 +107,11 @@ if [ "$bootable" != "" ]; then # Create a GPT image containing the EFI partition. efifilename=$(mktemp /tmp/efi.img.XXXXXX) - imgsize=`stat -f %z "$NAME"` + if [ "$(uname -s)" = "Linux" ]; then + imgsize=`stat -c %s "$NAME"` + else + imgsize=`stat -f %z "$NAME"` + fi $MKIMG -s gpt \ --capacity $imgsize \ $espparam \ diff --git a/release/riscv/mkisoimages.sh b/release/riscv/mkisoimages.sh index e7e56eef1cb6..2a30c8e3e975 100644 --- a/release/riscv/mkisoimages.sh +++ b/release/riscv/mkisoimages.sh @@ -107,7 +107,11 @@ if [ "$bootable" != "" ]; then # Create a GPT image containing the EFI partition. efifilename=$(mktemp /tmp/efi.img.XXXXXX) - imgsize=`stat -f %z "$NAME"` + if [ "$(uname -s)" = "Linux" ]; then + imgsize=`stat -c %s "$NAME"` + else + imgsize=`stat -f %z "$NAME"` + fi $MKIMG -s gpt \ --capacity $imgsize \ $espparam \