Bug 213488 - bsdinstall wants MANIFEST from filesystem even when installing from ftp
Summary: bsdinstall wants MANIFEST from filesystem even when installing from ftp
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-sysinstall mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-14 21:43 UTC by Petr Fischer
Modified: 2019-09-10 14:29 UTC (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Fischer 2016-10-14 21:43:58 UTC
First of all - this error occurs when I run bsdinstall from already installed FreeBSD system only (not from the official memstick install media - install medias are OK, because everything [base.tgz, kernel.tgz..] is on install media).

When I run bsdinstall from already installed system, program asks for ftp, then downloads install archives [base, kernel...], but, after download, install program wants to check MANIFEST file and this error occurs:

"Error while fetching file:///usr/freebsd-dist/MANIFEST" - no such file or directory.

Of course, there is no MANIFEST on installed FreeBSD system.

Maybe, IMHO, bsdinstall need to download this file from ftp too (not from local filesystem).
Comment 1 Nathan Whitehorn freebsd_committer 2016-10-15 21:45:51 UTC
This is by design, since the manifest file is used to verify checksums. What are you using the installer for post-installation, out of curiosity? That will help me figure out how best to fix your use-case.
Comment 2 Petr Fischer 2016-10-16 00:03:02 UTC
bsdinstall is normal part of installed system, so, you can install FreeBSD to another USB media from a normal running FreeBSD system on your laptop, just run bsdinstall.

In that case, everything (base, kernel, tgzs...) is downloaded from FTP, but MANIFEST.

MANIFEST is normally present on the FTP mirrors, and not present on installed system (of course).

And without MANIFEST, installation fails. Without proper MANIFEST (download?), bsdinstall is useless tool on the already installed system.

Is it explained better?
Comment 3 Victor Sudakov 2016-10-16 05:23:30 UTC
As a workaround, I always place the *.txz archives and the MANIFEST manually into /usr/freebsd-dist/ on the running system, before running bsdinstall. It works this way.

Nathan, there are many legitimate uses for bsdinstall on an installed system. You can generate jails and bhyve images with it, install FreeBSD on removable media etc etc. It even does not have to be interactive, I have a couple of bstinstall scripts for such scenarios.
Comment 4 Victor Sudakov 2016-10-16 05:27:56 UTC
OTOH, I have never considered automatic FTP download that important. You can download everything beforehand into /usr/freebsd-dist and be fine, like

cd / && tar xf /d02/vm/.iso/FreeBSD-10.3-RELEASE-amd64-disc1.iso usr/freebsd-dist
Comment 5 Petr Fischer 2016-10-16 11:35:17 UTC
Yes I investigated (from error message) the solution by placing files in "/usr/freebsd-dist", that is OK (workaround).

But, in fact, you can't install manually with internal bsdinstall ftp download functionality (from installed system) - it's a pity a little...

Is something wrong (unsecure?) with fix bsdinstall and download MANIFEST automatically too?
Comment 6 Nathan Whitehorn freebsd_committer 2016-10-16 17:05:33 UTC
(In reply to Petr Fischer from comment #5)

The jail script already does automatic fetch. Pending real signatures, it would be an issue of 5 lines to duplicate that code and add a security warning on installed systems. I will try to get to that this week.
Comment 7 rahu 2017-09-06 07:17:24 UTC
MARKED AS SPAM
Comment 8 Kuha 2018-05-09 13:37:17 UTC
MARKED AS SPAM
Comment 9 Marcin Gryszkalis 2018-07-22 21:44:57 UTC
It also makes problems with install on OVH from FreeBSD recovery image (root mounted ro from nfs), would be nice to have it fixed.
Comment 10 Andres Montalban 2018-07-24 19:52:04 UTC
Happened to me too.
Comment 11 Tim Chase 2019-09-10 14:29:53 UTC
[sorry ~3yr late to the thread, but this PR was referenced from a blog post I was reading today]

If you're soliciting other use cases in which I've used `bsdinstall` from a running system, I was trying to create a .img file with a file-backed md0

  # IMG=/path/to/freebsd.img
  # truncate -s 20G $IMG
  # mdconfig -f $IMG -u 0
  # bsdinstall # install to md0
  # mdconfig -d -u 0

As a side note, at least the last time I did this, bsdinstall assumes that it can freely and forcibly unmount any previously-mounted ZFS & GELI volumes which is a problem if your existing/running system is ZFS-on-GELI:

  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214911

so either you have to not install to ZFS, run bsdinstall from a UFS (possibly without GELI) system, or you have to comment out the "detach all ZFS & GELI volumes" code from /usr/libexec/bsdinstall/zfsboot (I went with the 3rd option so I could create a ZFS-on-GELI .img file from a ZFS-on-GELI host system)

With the above caveats/modifications, this creates a disk image that I can then dd(1) to a drive (in my case, an OVH disk via the recovery console)