[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-port-arm
Subject:    Re: 2019-09-28-netbsd9-raspi-aarch64.img
From:       mlelstv () serpens ! de (Michael van Elst)
Date:       2019-09-30 6:14:28
Message-ID: qms6fp$cmg$1 () serpens ! de
[Download RAW message or body]

jun@soum.co.jp (Jun Ebihara) writes:

>From: mlelstv@serpens.de (Michael van Elst)
>Subject: Re: 2019-09-28-netbsd9-raspi-aarch64.img
>Date: Sun, 29 Sep 2019 14:57:22 -0000 (UTC)

>> evbarm GENERIC/GENERIC64 configuration is special and uses:
>> sdmmc*          at sdmmcbus?
>> ld0             at sdmmc0
>> ld1             at sdmmc1
>> ld2             at sdmmc2
>> ld3             at sdmmc3
>> ld*             at sdmmc?
>> to bind ld units to sdmmc units. RPI4 has two SD controllers
>> active (one for SDIO, a completely new one for the SD card),
>> that's why the boot device is ld1. ld0 then doesn't exist.

>Thanx,

>RPI3/RPI3B+: use ld0 
>RPI4:        use ld1

>How can I wrote /etc/fstab,which can boot RPI3 and RPI4?

There is a new magic device name "ROOT." that corresponds to the
root device (that was used for booting). So "ROOT.a" refers to
/dev/ld0a or /dev/ld1a, whatever was used for booting.
getfsspecname(3) has the details.

This isn't exactly a RPI issue. Device units depend on how and
when devices get enumerated, and that can happen on any platform.
We currently just benefit from the fact that most platforms are
still pretty static.

Another way is to use named wedges. I run most of my machines with
options DKWEDGE_METHOD_BSDLABEL and assign a unique d_packname
("label:" in disklabel output) based on the hostname. E.g.

arnold# disklabel ld1
# /dev/rld1:
type: SCSI
disk: STORAGE DEVICE
label: arnold                        <----------------
...

and I mount everything by wedge name:

NAME=arnold/a           /               ffs     rw,noatime      1 1
NAME=arnold/b           none            swap    sw      0 0
NAME=arnold/e           /boot           msdos   rw      1 1

For systems with GPT partitioning that of course comes automatic.

One problem with this is that you want a unique label, which is difficult
to do with images that are just copied around. That's why the "ROOT." syntax
was invented but which wasn't made to work with wedges.

-- 
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic