Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 2016 10:05:10 +0100 (CET)
From:      =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no>
To:        Matthias Fechner <idefix@fechner.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Switch from legacy to UEFI boot??
Message-ID:  <alpine.BSF.2.20.1602150945350.55912@mail.fig.ol.no>
In-Reply-To: <56BEEEDE.9000201@fechner.net>
References:  <20160203213414.GB60231@rancor.immure.com> <alpine.BSF.2.20.1602040842580.1065@mail.fig.ol.no> <56B353E5.9080605@fechner.net> <alpine.BSF.2.20.1602041447560.1065@mail.fig.ol.no> <56BB9BDE.6030706@fechner.net> <alpine.BSF.2.20.1602110945020.55912@mail.fig.ol.no> <56BCE92B.7030600@fechner.net> <alpine.BSF.2.20.1602120822160.55912@mail.fig.ol.no> <56BEEEDE.9000201@fechner.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 13 Feb 2016 09:52+0100, Matthias Fechner wrote:

> Am 12.02.2016 um 08:28 schrieb Trond Endrestøl:
> > The ESP contains nothing more than the boot1.efi disquised as 
> > /EFI/BOOT/BOOTX64.EFI, i.e. the contents of the /boot/boot1.efifat 
> > image. The bootfs property points to zroot/ROOT/default, and 
> > everything else resides in the zpool.
> > 
> > Somehow your setup is different.
> 
> I will give you as many details as you need to find out why it does not
> work.
> The FreeBSD is running in an Oracle Virtualbox on windows 10 (version
> 5.0.14r105127). I use this version to simulate updates for my real boxes.
> 
> There is a FreeBSD 10.2-RELEASE-p9 installed that is updated using
> freebsd-update.
> 
> The zpool consists of two 20GB harddisk switch together as a mirror:
>   pool: zroot
>  state: ONLINE
>   scan: resilvered 8.82G in 0h12m with 0 errors on Wed Feb 10 08:54:53 2016
> config:
> 
>         NAME           STATE     READ WRITE CKSUM
>         zroot          ONLINE       0     0     0
>           mirror-0     ONLINE       0     0     0
>             gpt/disk0  ONLINE       0     0     0
>             gpt/disk1  ONLINE       0     0     0
> 
> I resized the zpool to have space for the efi partition (was a little
> bit of snapshoting and copying around).
> The new layout of both disks is now:
> $ gpart show
> =>      34  41942973  ada0  GPT  (20G)
>         34         6        - free -  (3.0K)
>         40    262144     1  efi  (128M)
>     262184       128     2  freebsd-boot  (64K)
>     262312  41680688     3  freebsd-zfs  (20G)
>   41943000         7        - free -  (3.5K)
> 
> =>      34  41942973  ada1  GPT  (20G)
>         34         6        - free -  (3.0K)
>         40    262144     1  efi  (128M)
>     262184       128     2  freebsd-boot  (64K)
>     262312  41680688     3  freebsd-zfs  (20G)
>   41943000         7        - free -  (3.5K)
> 
> As you can see, I have legacy and efi partions available so I can boot
> uefi and legacy.
> 
> As freebsd10.2 is not able to boot efi I copied the boot1.efi/loader.efi
> and GNUSparseFile/boot1.efifat (using dd) to the efi partition.
> The efi partition was filled with:
> newfs_msdos ada0p1
> mount -t msdosfs /dev/ada0p1 /mnt
> mkdir -p /mnt/efi/boot/
> cp boot1.efi /mnt/efi/boot/BOOTx64.efi
> mkdir -p /mnt/boot
> cat > /mnt/boot/loader.rc << EOF
> unload
> set currdev=zfs:zroot/ROOT/default:
> load boot/kernel/kernel
> load boot/kernel/zfs.ko
> autoboot
> EOF
> (cd /mnt && find .)
> .
> ./efi
> ./efi/boot
> ./efi/boot/BOOTx64.efi
> ./boot
> ./boot/loader.rc
> umount /mnt
> 
> The same steps are performed on the second disk (but this should make
> for these test not a difference I think).
> 
> I tested boot1.efi/loader.efi and the efifat with dd from 10.3-beta1 and
> 11, but was only able to boot with the loader.rc in place. The moment I
> removed the loader.rc the systems stops on boot prompt and I have to
> type the lines from the loader.rc manually to boot the system.
> 
> The bootfs flag is defined:
> $ zpool get bootfs
> NAME   PROPERTY  VALUE               SOURCE
> zroot  bootfs    zroot/ROOT/default  local
> 
> $ zfs list
> NAME                        USED  AVAIL  REFER  MOUNTPOINT
> zroot                      12.9G  6.19G    19K  none
> zroot/ROOT                  433M  6.19G    19K  none
> zroot/ROOT/default          433M  6.19G   433M  none
> zroot/swap                 4.13G  10.3G     8K  -
> zroot/tmp                  74.5K  6.19G  74.5K  /tmp
> zroot/usr                  5.68G  6.19G  3.42G  /usr
> zroot/usr/home             11.2M  6.19G  11.2M  /usr/home
> zroot/usr/local             895M  6.19G   895M  /usr/local
> zroot/usr/ports             525M  6.19G   280M  /usr/ports
> zroot/usr/ports/distfiles   242M  6.19G   242M  /usr/ports/distfiles
> zroot/usr/ports/packages   2.76M  6.19G  2.76M  /usr/ports/packages
> zroot/usr/src               880M  6.19G   880M  /usr/src
> zroot/var                  2.72G  6.19G  1.18G  /var
> zroot/var/crash              19K  6.19G    19K  /var/crash
> zroot/var/db               1.54G  6.19G  1.50G  /var/db
> zroot/var/db/pkg           38.8M  6.19G  38.8M  /var/db/pkg
> zroot/var/empty              19K  6.19G    19K  /var/empty
> zroot/var/log               243K  6.19G   243K  /var/log
> zroot/var/mail               23K  6.19G    23K  /var/mail
> zroot/var/run                30K  6.19G    30K  /var/run
> zroot/var/tmp               171K  6.19G   171K  /var/tmp
> 
> > $ zfs get mountpoint
> > NAME                       PROPERTY    VALUE                 SOURCE
> > zroot                      mountpoint  none                  received
> > zroot/ROOT                 mountpoint  none                  inherited from zroot
> > zroot/ROOT/default         mountpoint  none                  inherited from zroot
> > zroot/swap                 mountpoint  -                     -
> > zroot/tmp                  mountpoint  /tmp                  received
> > zroot/usr                  mountpoint  /usr                  received
> > zroot/usr/home             mountpoint  /usr/home             inherited from zroot/usr
> > zroot/usr/local            mountpoint  /usr/local            inherited from zroot/usr
> > zroot/usr/ports            mountpoint  /usr/ports            inherited from zroot/usr
> > zroot/usr/ports/distfiles  mountpoint  /usr/ports/distfiles  inherited from zroot/usr
> > zroot/usr/ports/packages   mountpoint  /usr/ports/packages   inherited from zroot/usr
> > zroot/usr/src              mountpoint  /usr/src              inherited from zroot/usr
> > zroot/var                  mountpoint  /var                  received
> > zroot/var/crash            mountpoint  /var/crash            inherited from zroot/var
> > zroot/var/db               mountpoint  /var/db               inherited from zroot/var
> > zroot/var/db/pkg           mountpoint  /var/db/pkg           inherited from zroot/var
> > zroot/var/empty            mountpoint  /var/empty            inherited from zroot/var
> > zroot/var/log              mountpoint  /var/log              inherited from zroot/var
> > zroot/var/mail             mountpoint  /var/mail             inherited from zroot/var
> > zroot/var/run              mountpoint  /var/run              inherited from zroot/var
> > zroot/var/tmp              mountpoint  /var/tmp              inherited from zroot/var
> 
> The boot environments are managed using beadm:
> $ beadm list
> BE      Active Mountpoint  Space Created
> default NR     /          433.0M 2016-02-10 08:10
> 
> I hope the post is not to long ;)

I tried to recreate your setup using 
FreeBSD-10.3-BETA1-amd64-uefi-dvd1.iso.

It booted just fine without any loader.rc stored in the ESP.

To recap:

gpart create -s gpt ada0
gpart create -s gpt ada1

gpart add -a 4K -t efi -s 128M ada0
gpart add -a 4K -t efi -s 128M ada1

gpart add -a 4K -t freebsd-boot -s 64K ada0
gpart add -a 4K -t freebsd-boot -s 64K ada1

gpart add -a 4K -t freebsd-zfs ada0
gpart add -a 4K -t freebsd-zfs ada1

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada1

newfs_msdos ada0p1
newfs_msdos ada1p1

mount -t msdosfs /dev/ada0p1 /mnt
mkdir -p /mnt/EFI/BOOT
cp -p /boot/boot1.efi /mnt/EFI/BOOT/BOOTX64.EFI
umount /mnt

mount -t msdosfs /dev/ada1p1 /mnt
mkdir -p /mnt/EFI/BOOT
cp -p /boot/boot1.efi /mnt/EFI/BOOT/BOOTX64.EFI
umount /mnt

kldload zfs

sysctl vfs.zfs.min_auto_ashift=12

hostname matthias.example.org

zpool create -o autoreplace=on -o cachefile=/tmp/zpool.cache -o failmode=continue -O mountpoint=legacy zroot mirror ada0p3 ada1p3

I used my own recipe for crafting the ZFS pool, you'll find the recipe 
as the files matching 0* at 
http://ximalas.info/~trond/create-zfs/canmount/

The two .vdi files (2x 1,065,353,216 bytes) can be downloaded for 
comparison from http://ximalas.info/~trond/matthias/

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+
From owner-freebsd-questions@freebsd.org  Mon Feb 15 09:06:34 2016
Return-Path: <owner-freebsd-questions@freebsd.org>
Delivered-To: freebsd-questions@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50959AA6719
 for <freebsd-questions@mailman.ysv.freebsd.org>;
 Mon, 15 Feb 2016 09:06:34 +0000 (UTC)
 (envelope-from yurannich@gmail.com)
Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com
 [IPv6:2607:f8b0:4001:c06::22c])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1D8F1195A
 for <freebsd-questions@FreeBSD.org>; Mon, 15 Feb 2016 09:06:34 +0000 (UTC)
 (envelope-from yurannich@gmail.com)
Received: by mail-io0-x22c.google.com with SMTP id g203so126294663iof.2
 for <freebsd-questions@FreeBSD.org>; Mon, 15 Feb 2016 01:06:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=9SOgpjwW+VffjF0JaDeYO70n3PaWiP7A3FdENGQIza0=;
 b=d3DFy7N1iw3XrxJGpf5yLZRxdfgt1X9zuYPPVu7JxgogvDBjUkXmw7l1JC1F3aMDyj
 XeO0JhGwSEWqdP1IMguJDJi9QeQa273UnHHOjeCQgOoOuLrBEpbuUEPf0ndAPfh6btgB
 L16ug62bfRyMvvyux2hpvhntzi01Z5VWDJmifxQTjYGs6xFmTxA8XPVcxtpmSpReHC+O
 E+oO0sB9Jou8bbz0UdWN3pn7d4GED9VC2KqDbXYXBZO0f/LF5HCcmkI+o4hKSOtcuVVi
 +sPEDc7k/qqoRFSgVSGbA6pT6TZFEaIU9xFhdC3upfswKM/s3++TDmwGTNlkxDjMu/Tz
 /7mQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:date:message-id:subject:from:to
 :content-type;
 bh=9SOgpjwW+VffjF0JaDeYO70n3PaWiP7A3FdENGQIza0=;
 b=cAokC5BNy4Fv0R4gS85vNOCGa0/k8BHvi4ESye82+RENUrdYLK6aj1CKJHnAdmwbXL
 o4Xbxc0S2HW37X5Ggi1OIxhl4XXB+LDDnCBLKWdkI24eyrRHarxCOdSjTwEWO9FSWCcy
 dI4cxSoCYHwf87UA2+LfYRkcUwKeZE1tMmPY+FQ0C7Vm9jLjUTKnhwiwnZ2qrL3obhNg
 KkjjEQ5yNOSOQtnhPp3Lf6OD4k5XUSYJJNsB14WWghIB9m3phySvAvfK4FlHPJmjmdnC
 QXnVMfYrshqdyBdGASpLKlROw8AnKLb7JxpCr3Xe7R+mLIXfN2NOdk1CsM5H21URlI4G
 TuhQ==
X-Gm-Message-State: AG10YOQY8e13cf1MJtYlMsWoXQ4h1+mZoCiA+gGqCYMwKUtA0PyUc7ketcbaM8NSwfgWkYYPI+0GerjjDBqSRQ==
MIME-Version: 1.0
X-Received: by 10.107.6.205 with SMTP id f74mr16754898ioi.63.1455527193548;
 Mon, 15 Feb 2016 01:06:33 -0800 (PST)
Received: by 10.36.252.1 with HTTP; Mon, 15 Feb 2016 01:06:33 -0800 (PST)
Date: Mon, 15 Feb 2016 16:06:33 +0700
Message-ID: <CALZMMjTnvJXXmRMX9weHup-1J6VD-kYEef9=BteNQnKKucc41w@mail.gmail.com>
Subject: Support of ARM Odroid X device
From: =?UTF-8?B?0K7RgNC40Lkg0JvRg9C60LjQvQ==?= <yurannich@gmail.com>
To: freebsd-questions@FreeBSD.org
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.20
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>;
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Feb 2016 09:06:34 -0000

Hi! I've been a fan of FreeBSD (since 4) and would like to learn about the
support of other products of ODROID (ODROID X) because support ODROID C1
already be wondering what about the other products?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1602150945350.55912>