Bug 251086 - bsdinstall doesn't copy /BSDINSTALL_TMPBOOT/zfs/zpool.cache
Summary: bsdinstall doesn't copy /BSDINSTALL_TMPBOOT/zfs/zpool.cache
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-sysinstall (Nobody)
URL:
Keywords: install
Depends on:
Blocks:
 
Reported: 2020-11-12 21:59 UTC by Duane
Modified: 2022-10-13 17:48 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duane 2020-11-12 21:59:44 UTC
In the `bsdinstall/config` script there is the line:

	cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot

which fails to copy the `/boot/zfs/zpool.cache` file.  This is fine if you only have a single boot zpool, but leads to import failures after install if you have other pools.

Note that relatedly the `bsdinstall/partedit/gpart_ops.c` file specifically creates the `zpool.cache` file here:

	if (getenv("BSDINSTALL_TMPBOOT") != NULL) {
		char zfsboot_path[MAXPATHLEN];
		snprintf(zfsboot_path, sizeof(zfsboot_path), "%s/zfs",
		    getenv("BSDINSTALL_TMPBOOT"));
		mkdir(zfsboot_path, S_IRWXU | S_IRGRP | S_IXGRP |
		    S_IROTH | S_IXOTH);
		sprintf(command, "%s -o cachefile=%s/zpool.cache ",
		    command, zfsboot_path);
	}


I suggest that the `cp` should be `cp -R` or `cp -a` instead.