Discussion:
should bsdinstall work?
tech-lists
2021-05-04 19:22:35 UTC
Permalink
Hi,

I've been trying to set up a boot-from-usb3 raspberry pi 4. I thought
i'd be able to do this by booting into latest current snapshot image for
arm64 rpi (written to microsd), and then running bsdinstall as root.

I can select the auto-zfs option then select the usb3 disk as
installation destination. The bsdinstall selects the sets and downloads
them, but then get the error:

"error while fetching file://usr/freebsd-dist/MANIFEST : No such file or
directory"

also tried via release/13 image, same error. Looks like it's downloading
the files but then the installer can't see them, something like that.

the downloaded files are there:

***@generic:~ # ls -lah /mnt/usr/freebsd-dist/
total 187454
drwxr-xr-x 2 root wheel 4B Apr 9 06:51 .
drwxr-xr-x 6 root wheel 6B Apr 9 06:50 ..
-rw-r--r-- 1 root wheel 158M Apr 9 06:51 base.txz
-rw-r--r-- 1 root wheel 25M Apr 9 06:51 kernel.txz
***@generic:~ #

worth submitting a PR? or is bsdinstall legacy and I need to use some
other method. I've not tried releng/12.2 yet.

thanks,
--
J.
Nathan Whitehorn
2021-05-04 20:35:17 UTC
Permalink
Yes, it should work just fine; however, we don't provision the microsd
images for the installer, especially for -CURRENT. The actual OS is
fetched in plaintext to allow caching and the MANIFEST files are what
provides authentication -- they provide the checksums of the files that
get fetched so that they can be verified against corruption and
tampering. For snapshots, the current version changes all the time and
that doesn't work; it also means that network-install media have to be
set up with those checksums in advance. Where are you trying to install
to? Usually the assumption is that the microsd images *are* the
installed system rather than a tool you use to install a system.
-Nathan
Post by tech-lists
Hi,
I've been trying to set up a boot-from-usb3 raspberry pi 4. I thought
i'd be able to do this by booting into latest current snapshot image for
arm64 rpi (written to microsd), and then running bsdinstall as root.
I can select the auto-zfs option then select the usb3 disk as
installation destination. The bsdinstall selects the sets and downloads
"error while fetching file://usr/freebsd-dist/MANIFEST : No such file or
directory"
also tried via release/13 image, same error. Looks like it's downloading
the files but then the installer can't see them, something like that.
total 187454
drwxr-xr-x  2 root  wheel     4B Apr  9 06:51 .
drwxr-xr-x  6 root  wheel     6B Apr  9 06:50 ..
-rw-r--r--  1 root  wheel   158M Apr  9 06:51 base.txz
-rw-r--r--  1 root  wheel    25M Apr  9 06:51 kernel.txz
worth submitting a PR? or is bsdinstall legacy and I need to use some
other method. I've not tried releng/12.2 yet.
thanks,
tech-lists
2021-05-05 01:58:54 UTC
Permalink
Hi,
Post by Nathan Whitehorn
Where are you trying to install
to? Usually the assumption is that the microsd images *are* the
installed system rather than a tool you use to install a system.
I'm trying to install -current (or stable/13 or releng/13.0) to a
bootable usb3-connected external hd on raspberry pi 4 hardware. The goal
is to have this pi booting without microsd to a root-on-zfs system.

I have used raspios 64-bit to update its firmware and configured it so
it tries to boot the microsd card and if this fails, boots to usb3. Took
out that card, wrote
FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20210415-14d0cd7225e-246078.img
to another and booted it, then ran bsdinstall and selected the external
hd. The install fails to progress beyond the point I mentioned.

Maybe another wau of doing it would be to just write
FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20210415-14d0cd7225e-246078.img
to the hd from my freebsd desktop. Would that method be expected to
work? The thing is, I want root-on-zfs *and* booting with no microsd.
Just writing the .img to the hd would mean i'd have to abandon zfs.
--
J.
Chris
2021-05-05 02:33:40 UTC
Permalink
Post by tech-lists
Hi,
Post by Nathan Whitehorn
Where are you trying to install
to? Usually the assumption is that the microsd images *are* the
installed system rather than a tool you use to install a system.
I'm trying to install -current (or stable/13 or releng/13.0) to a
bootable usb3-connected external hd on raspberry pi 4 hardware. The goal
is to have this pi booting without microsd to a root-on-zfs system.
I have used raspios 64-bit to update its firmware and configured it so
it tries to boot the microsd card and if this fails, boots to usb3. Took
FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20210415-14d0cd7225e-246078.img
to another and booted it, then ran bsdinstall and selected the external
hd. The install fails to progress beyond the point I mentioned.
Maybe another wau of doing it would be to just write
FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20210415-14d0cd7225e-246078.img
to the hd from my freebsd desktop. Would that method be expected to
work? The thing is, I want root-on-zfs *and* booting with no microsd.
Just writing the .img to the hd would mean i'd have to abandon zfs.
Doesn't bsdinstall allow choosing different means of fetching the
dist files? Last I remember using it, I was able to choose ftp http(s),
etc... Making, or using an already matched MANIFEST is fairly trivial.
You could obtain your desired base files and create or use the one
with it. Then point bsdinstall to somewhere to get them. If you need
a remote. I could give you one to use.

HTH

--Chris
tech-lists
2021-05-05 03:48:13 UTC
Permalink
Post by Chris
Doesn't bsdinstall allow choosing different means of fetching the
dist files?
iirc it gives an ftp list. I tried with ftp.uk and ftp.de.freebsd.org.
Post by Chris
Last I remember using it, I was able to choose ftp http(s),
etc... Making, or using an already matched MANIFEST is fairly trivial.
i'll try downloading a matched manifest by hand, next. Thanks for the
tip.
--
J.
tech-lists
2021-05-05 12:01:01 UTC
Permalink
Post by tech-lists
Post by Chris
Doesn't bsdinstall allow choosing different means of fetching the
dist files?
iirc it gives an ftp list. I tried with ftp.uk and ftp.de.freebsd.org.
Post by Chris
Last I remember using it, I was able to choose ftp http(s),
etc... Making, or using an already matched MANIFEST is fairly trivial.
i'll try downloading a matched manifest by hand, next. Thanks for the
tip.
Clarified there's no http/https in the download list, just ftp urls

I tried running bsdinstall in one console and fetch in another

***@generic:/mnt/usr/freebsd-dist # fetch
ftp://ftp.uk.freebsd.org/pub/FreeBSD/snapshots/arm64/14.0-CURRENT/MANIFEST
MANIFEST 782 B 2145 kBps
00s
***@generic:/mnt/usr/freebsd-dist # fetch
ftp://ftp.uk.freebsd.org/pub/FreeBSD/snapshots/arm64/14.0-CURRENT/MANIFEST
fetch: MANIFEST: stat()
***@generic:/mnt/usr/freebsd-dist # fetch
ftp://ftp.uk.freebsd.org/pub/FreeBSD/snapshots/arm64/14.0-CURRENT/MANIFEST
fetch: MANIFEST: stat()
***@generic:/mnt/usr/freebsd-dist #

bsdinstall bails with the error.

then:
***@generic:/mnt/usr/freebsd-dist # ls -lah
ls: .: Not a directory
***@generic:/mnt/usr/freebsd-dist #

clearly theres an issue with the bsdinstaller unmounting the chroot at
/mnt at the wrong point. If bsdinstall *should* work, I'll raise a PR

looking at man 8 bsdinstall, theres loads of parameters I can set, and
there's also logging. will read all this before making a PR.
--
J.
Mark Millard via freebsd-current
2021-05-04 21:37:30 UTC
Permalink
tech-lists tech-lists at zyxst.net wrote on
Post by tech-lists
I've been trying to set up a boot-from-usb3 raspberry pi 4. I thought
i'd be able to do this by booting into latest current snapshot image for
arm64 rpi (written to microsd), and then running bsdinstall as root.
I've done something similar, deliberately making the root
file system ZFS based to experiment with bectl usage and
to have GPT instead of MBR, for example.

Even when other things work, do not expect bsdinstall to
deal with the RPi firmware or u-boot in the msdos file
system partition. I copied those over separately.
Post by tech-lists
I can select the auto-zfs option then select the usb3 disk as
installation destination. The bsdinstall selects the sets and downloads
"error while fetching
file://usr/freebsd-dist/MANIFEST
: No such file or
directory"
As I remember, I had to use bsdinstall's DISTRIBUTIONS
environment variable to pick what to download in order
to get MANIFEST to download. Otherwise I got just the 2
files (base.txz and kernel.txz) and the complaint that
you report.

Ultimately I picked to get more than just base.txz and
kernel.txz as well.

I'll note that:

http://ftp3.freebsd.org/pub/FreeBSD/releases/arm64/13.0-RELEASE/

has the MANIFIEST file available. As does:

http://ftp3.freebsd.org/pub/FreeBSD/snapshots/arm64/14.0-CURRENT/

Unfortrunately, there has not been a successful snapshot
build for arm64/aarch64 or arm/armv7 recently. So there
are no .../13.0-STABLE/ examples yet.

Another place to stable-13 materials is paths matching:

https://artifact.ci.freebsd.org/snapshot/stable-13/*/arm64/aarch64/

that have MANIFEST and *.txz files. For example,

https://artifact.ci.freebsd.org/snapshot/stable-13/d6d039ea74a26357173d1263682d4f5119037434/arm64/aarch64/

has a snapshot as of one of today's commits. When looking
in such folders, be sure to check the dates on the files:
they might be older than the parent directory dates
suggest. Sometimes one finds the directory is empty
despite the arm64/aarch64/ level being created.)

There is also:

https://artifact.ci.freebsd.org/snapshot/stable-11/
https://artifact.ci.freebsd.org/snapshot/stable-12/
https://artifact.ci.freebsd.org/snapshot/main/

and aliases based on names like 13.0-STABLE and head .
Post by tech-lists
also tried via release/13 image, same error. Looks like it's downloading
the files but then the installer can't see them, something like that.
root at generic
:~ # ls -lah /mnt/usr/freebsd-dist/
total 187454
drwxr-xr-x 2 root wheel 4B Apr 9 06:51 .
drwxr-xr-x 6 root wheel 6B Apr 9 06:50 ..
-rw-r--r-- 1 root wheel 158M Apr 9 06:51 base.txz
-rw-r--r-- 1 root wheel 25M Apr 9 06:51 kernel.txz
Yea, without DISTRIBUTIONS it seemed to grab just the
2 files without also getting MANIFEST. Or at least that
is my memory of how it went. I used DISTRIBUTIONS to
get more files and so also got MANIFEST.

You can also put the files in place separately and
tell bsdinstall to look in a file:///path that you
type as I remember. file:///usr/freebsd-dist could
be an example.
Post by tech-lists
root at generic
:~ #
worth submitting a PR? or is bsdinstall legacy and I need to use some
other method. I've not tried releng/12.2 yet.
===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
tech-lists
2021-05-05 14:11:35 UTC
Permalink
Post by Mark Millard via freebsd-current
As I remember, I had to use bsdinstall's DISTRIBUTIONS
environment variable to pick what to download in order
to get MANIFEST to download. Otherwise I got just the 2
files (base.txz and kernel.txz) and the complaint that
you report.
Thanks Mark, setting DISTRIBUTIONS env var is next on the list
--
J.
Daniel Dowse
2021-05-05 14:37:12 UTC
Permalink
On Tue, 4 May 2021 20:22:35 +0100
Post by tech-lists
"error while fetching file://usr/freebsd-dist/MANIFEST : No such file or
directory"
Hello J.

you can try to run bsdinstall with script option.
Create a file name it e.g rpi.bsdinstall and put


export DISTRIBUTIONS="kernel.txz base.txz"
export
BSDINSTALL_DISTSITE="https://download.freebsd.org/ftp/releases/arm64/13.0-RELEASE/"

bsdinstall zfsboot


inside. Then run

bsdinstall script rpi.bsdinstall

and follow the dialog.

This to be said, i haven't used it with ZFS but with UFS to create VM Images
(amd64) successfully this way.


Daniel
--
Daniel Dowse <freebsd-***@daemonbytes.net>
tech-lists
2021-05-05 17:10:18 UTC
Permalink
Post by Daniel Dowse
Hello J.
you can try to run bsdinstall with script option.
Create a file name it e.g rpi.bsdinstall and put
export DISTRIBUTIONS="kernel.txz base.txz"
export
BSDINSTALL_DISTSITE="https://download.freebsd.org/ftp/releases/arm64/13.0-RELEASE/"
bsdinstall zfsboot
inside. Then run
bsdinstall script rpi.bsdinstall
and follow the dialog.
This to be said, i haven't used it with ZFS but with UFS to create VM Images
(amd64) successfully this way.
Hi Daniel, thanks for yr input.

Managed to get a little further with your instructions, but now the error is
"no root partition found. The root FreeBSD partition must have a mountpoint of '/'".

This happens after the disk is selected to install zfs-on-root

If I remove the zfs element from the script, re-run it then select auto
ufs, it gets a little further then fails at the point where it wants to
alter the MBR, with the same error message.

Maybe I'm going about this the wrong way. What I really need is an
installer. As far as I can tell, the only things available for
arm64.aarch64 for the rpi4 are bootable images - ie without installer.
--
J.
Loading...