History log of /freebsd-current/usr.sbin/bsdinstall/distextract/distextract.c
Revision Date Author Comments
# 4d65a7c6 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 147585b4 13-May-2022 Brad Davis <brd@FreeBSD.org>

bsdinstall: allow whitelabeling the installer

Override OSNAME to change the name of the OS in the installer.

This is a first step, the shell changes will be separate.

Reviewed by: allanjude
Approved by: allanjude
Differential Revision: https://reviews.freebsd.org/D34878
Sponsored by: Rubicon Communications, LLC ("Netgate")


# f9549860 28-Jan-2022 Baptiste Daroussin <bapt@FreeBSD.org>

disextract: eliminate last use of __DECONST


# dd8ca6b2 28-Jan-2022 Baptiste Daroussin <bapt@FreeBSD.org>

distextract: simply code by using strsep(3)


# 18f20d5d 01-Jan-2022 Alfonso Siciliano <alfsiciliano@gmail.com>

bsddialog: convert bsdinstall/distextract

Differential Revision: https://reviews.freebsd.org/D33581


# ccefbe98 20-Apr-2021 Warner Losh <imp@FreeBSD.org>

bsdinstall: remove compat hacks for FreeBSD 9 and earlier

Sponsored by: Netflix


# a5837f2c 01-Jan-2018 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Skip errors from being unable to set modification and creation times. If
one of the directories in the filesystem hierarchy is a FAT mountpoint,
settings its times will fail, which would cause installation to abort.
Instead, make this a best-effort thing.

Handling this error is a hack and a better internal scheme for handling
this should be added to libarchive.


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 4ff1fc3b 17-Dec-2014 Devin Teske <dteske@FreeBSD.org>

In bsdinstall's distextract, replace mixed_gauge() of dialog(3) with
new dpv(3) wrapper to dialog(3) dialog_gauge(). The dpv(3) library provides
a more flexible and refined interface similar to dialog_mixedgauge() however
is implemented atop the more generalized dialog_gauge() for portability.
Noticeable improvements in bsdinstall's distextract will be a status line
showing data rate information (with support for localeconv(3) to format
numbers according to $LANG or $LC_ALL conversion information), i18n support,
improved auto-sizing of gauge widget, a ``wheel barrow'' to keep the user
informed that things are moving (even if status/progress has not changed),
improved color support (mini-progress bars use the same color, if enabled,
as the main gauge bar), and several other improvements (some not visible).
dpv stands for "dialog progress view" (dpv was introduced in SVN r274116).

Differential Revision: https://reviews.freebsd.org/D714
Discussed on: -current
Reviewed by: julian
MFC after: 3 days
X-MFC-to: stable/10
Relnotes: Improved installer feedback from bsdinstall distextract


# bd1df636 01-Oct-2014 Devin Teske <dteske@FreeBSD.org>

Optimize program flow for execution speed. Also fix some more style(9) nits
while here:
+ Fix an issue when extracting small archives where dialog_mixedgauge was
not rendering; leaving the user wondering if anything happened.
+ Add #ifdef's to assuage compilation against older libarchive
NB: Minimize diff between branches; make merging easier.
+ Add missing calls to end_dialog(3)
+ Change string processing from strtok(3) to strcspn(3) (O(1) optimization)
+ Use EXIT_SUCCESS and EXIT_FAILURE instead of 0/1
+ Optimize getenv(3) use, using stored results instead of calling repeatedly
NB: Fixes copy/paste error wherein we display getenv(BSDINSTALL_DISTDIR) in
an error msgbox when chdir(2) to getenv(BSDINSTALL_CHROOT) fails
(wrong variable displayed in msgbox).
+ Use strtol(3) instead of [deprecated] atoi(3)
+ Add additional error checking (e.g., check return of archive_read_new(3))
+ Assign DECONST strings to static variables
+ Fix typo in distextract.c error message (s/Could could/Could not/)
+ Add comments and make a minor whitespace adjustment

Reviewed by: nwhitehorn, julian


# 82ac9f2b 28-Sep-2014 Devin Teske <dteske@FreeBSD.org>

Use snprintf(3) in place of unbounded sprintf(3) (prevent buffer overflow).
Use adequately sized buffer for error(s) (512 -> PATH_MAX + 512).
Fix the following style(9) nits while here:
- distfetch.c uses PATH_MAX while distextract.c uses MAXPATHLEN;
standardize on one (PATH_MAX)
- Move $FreeBSD$ from comment to __FBSDID()
- Sort included headers (alphabetically, sys/* at top)
- Add missing header includes (e.g., <stdlib.h> for getenv(3),
calloc(3)/malloc(3)/free(3), and atoi(3); <string.h> for strdup(3),
strrchr(3), strsep(3), and strcmp(3); <ctype.h> for isspace(3); and
<unistd.h> for chdir(2), etc.)
- Remove rogue newline at end of distfetch.c
- Don't declare variables in if-, while-, or other statement
NB: To prevent masking of prior declarations atop function
- Perform stack alignment for variable declarations
- Add missing function prototype for count_files() in distextract.c
- Break out single-line multivariable-declarations
NB: Aligning similarly-named variables with one-char difference(s)
NB: Minimizes diffs and makes future diffs more clear
- Use err(3) family of functions (requires s/int err;/int retval;/g)

Reviewed by: nwhitehorn, julian


# ebb8fc42 22-Mar-2013 Martin Matuska <mm@FreeBSD.org>

Replace deprecated (or remove obsolete) libarchive 2.8 functions
with libarchive 3.0 counterparts


# bfd258f7 26-Feb-2012 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Fix segfault if distfetch and distextract binaries are run standalone
without the DISTRIBUTIONS environment variable set.

PR: bin/165492
Submitted by: Fernando Apesteguia
MFC after: 4 days


# c725e3ef 27-Nov-2011 Kevin Lo <kevlo@FreeBSD.org>

Plug memory leaks and fix open(2) error check.

Reviewed by: nwhitehorn
MFC after: 3 days


# 896a9484 13-Mar-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Rewind manifest file in case distributions are in a different order there.


# 46cc2c02 13-Mar-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Use the manifest file count, if available, to determine the number of files
in the archive instead of spinning through it to get a file count for the
progress bar. This speeds up installation a lot on systems with slow
CD drives.


# 57bda1b6 21-Feb-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Add some error checking on the return values of chdir() and calloc(). The
first might actually happen, so it displays the error message in a prettier
way.

Found by: Coverity Prevent(tm)
CID: 9121, 9122, 9123, 9124


# 2118f387 18-Feb-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Import bsdinstall. This is meant to be (eventually in conjunction with
pc-sysinstall) a replacement for sysinstall in the 9.0 release and beyond.
Currently supported platforms are sparc64, pc98, i386, amd64, powerpc, and
powerpc64. Integration into the build system will occur in the coming
weeks.

Merging with pc-sysinstall will use this code as a frontend, while
temporarily retaining the interactive partition editor here. This work
will be done in parallel with improvements on this code and release
integration.

Thanks to all who have provided testing and comments!