Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Aug 2023 15:53:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 273148] [PATCH] scripted installs are unable to verify checksums for fetched dists
Message-ID:  <bug-273148-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273148

            Bug ID: 273148
           Summary: [PATCH] scripted installs are unable to verify
                    checksums for fetched dists
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: lars@oddbit.com

Created attachment 244122
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D244122&action=
=3Dedit
Patch to revert erroneous changes in 1f7746d81f53447ac15cc99395bb714d4dd0a4=
da.

In commit 1f7746d81f53447ac15cc99395bb714d4dd0a4da, a change was introduced
that breaks scripted installs.  Given an installerconfig file like this:

```
export PARTITIONS=3DDEFAULT
export DISTRIBUTIONS=3D"kernel.txz base.txz"
export HOSTNAME=3Dfreebsd
export
BSDINSTALL_DISTSITE=3D"https://download.freebsd.org/releases/amd64/13.2-REL=
EASE"

export nonInteractive=3D"YES"

dhclient $INTERFACES

#!/bin/sh
sysrc ifconfig_DEFAULT=3DDHCP
sysrc sshd_enable=3DYES
```

The installation will always fail with a checksum error. This happens becau=
se
the remote dists are fetched like this:

```
(
        exec 3>&1
        export BSDINSTALL_DISTDIR=3D$(`dirname $0`/fetchmissingdists 2>&1 1=
>&3)
        FETCH_RESULT=3D$?
        exec 3>&-
        return $FETCH_RESULT
) || error "Could not fetch remote distributions"
```

There is an attempt there to change the value of $BSDINSTALL_DISTDIR to the
location of the fetched files, but since this logic was placed in a subshell
that change is now a no-op.

Additionally, this code attempts to "return" from a subshell, but "return" =
is
only valid in functions.

The attached patch reverts this change so that both "auto" and "script" use=
 the
same logic for fetching remote dists, and scripted installs operate as
intended.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273148-227>