Date: Wed, 21 Aug 2019 11:56:09 +0200 (CEST) From: Ronald Klop <ronald-lists@klop.ws> To: Ricky Zhang <zhangchaowang@gmail.com> Cc: freebsd-arm@freebsd.org Subject: Re: How to change rootfs from official RPI3 image Message-ID: <1668312327.7.1566381369480@localhost> In-Reply-To: <0FC8815E-58D7-4196-BF7E-0D6B127B314D@gmail.com> References: <0FC8815E-58D7-4196-BF7E-0D6B127B314D@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Sorry, I did only reply to the mailinglist. I will use reply-all now. You are right about uboot finding /boot/kernel and /boot/loader.conf. What you need to do is mount the SD-card on /bootdir; in fstab: /dev/yoursdcard /bootdir ufs rw,noatime 1 2 And a symlink from /boot -> /bootdir/boot on your SSD. Then installworld/installkernel will do the proper thing. So the complete /boot stays on the SD-card. Regards, Ronald. =20 Van: Ricky Zhang <zhangchaowang@gmail.com> Datum: woensdag, 21 augustus 2019 04:58 Aan: freebsd-arm@freebsd.org Onderwerp: Re: How to change rootfs from official RPI3 image >=20 > > BTW: Yes, u-boot is opensource: /usr/ports/sysutils/u-boot-rpi3 > > There are sysutils/u-boot-* ports for different system. With sysutils/u= -boot-master as the main part of it. > > > > https://www.freshports.org/sysutils/u-boot-rpi3 <https://www.freshports= .org/sysutils/u-boot-rpi3> > > http://www.denx.de/wiki/U-Boot <http://www.denx.de/wiki/U-Boot> > > > > Regards, > > Ronald. >=20 >=20 > Hi Ronald, >=20 > Sorry, if I messed up the mailing list thread. I didn=E2=80=99t receive y= our email directly. Instead, I got your reply from daily digest. I have to = copy subject and quote your reply manually in my email client. I have no id= ea how to fix it after reading all FAQ (https://www.freebsd.org/doc/en_US.I= SO8859-1/articles/mailing-list-faq/article.html#etiquette <https://www.free= bsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/article.html#etiquett= e>). Any other mailing list I subscribed didn=E2=80=99t work this way... >=20 > In any case, the magic works. I did rsync: >=20 > rsync -aAXvr --progress --delete /* /mnt/USB \ > --exclude=3D'/boot/msdos/*' \ > --exclude=3D'/dev/*' \ > --exclude=3D'/proc/*' \ > --exclude=3D'/net/*' \ > --exclude=3D'/tmp/*' \ > --exclude=3D'/mnt/*' \ > --exclude=3D'/media/*' >=20 > I confirmed that it mount ssd as rootfs: >=20 > Ricky@router ~ $ df -h > Filesystem Size Used Avail Capacity Mounted on > /dev/label/gpt/ssdrootfs 407G 5.5G 369G 1% / > devfs 1.0K 1.0K 0B 100% /dev > /dev/msdosfs/MSDOSBOOT 50M 13M 37M 26% /boot/msdos > tmpfs 50M 4.0K 50M 0% /tmp >=20 > As you said, kernel still comes from SD card. I don=E2=80=99t fully under= stand the FreeBSD boot process. Neither am I familiar with UEFI. >=20 > - I guess /boot/msdos/uboot.bin finds the SD card roofs system. Load the = kernel from /boot/kernel in SD card and scan /boot/loader.conf to find the = rootfs. Please correct me if I=E2=80=99m wrong. > - Should I remove /boot folder from SSD to avoid confusion? > - Are there any guide how to compile and deploy kernel? >=20 >=20 >=20 >=20 > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" >=20 >=20 >=20 From owner-freebsd-arm@freebsd.org Wed Aug 21 11:16:15 2019 Return-Path: <owner-freebsd-arm@freebsd.org> Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56355C44C6 for <freebsd-arm@mailman.nyi.freebsd.org>; Wed, 21 Aug 2019 11:16:15 +0000 (UTC) (envelope-from zhangchaowang@gmail.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46D4q22B1Sz3Kby for <freebsd-arm@freebsd.org>; Wed, 21 Aug 2019 11:16:13 +0000 (UTC) (envelope-from zhangchaowang@gmail.com) Received: by mail-qk1-x72f.google.com with SMTP id w18so1442007qki.0 for <freebsd-arm@freebsd.org>; Wed, 21 Aug 2019 04:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=lzmtt2GJxownP5Oh2j74I8hRFZWqKur5qtb4RK6XtG4=; b=fMC6YDz0ObO9Njg9JtL9Ty9A3eE7ZFbRh9Rup7pOvKjonBAhQuva/3/a/0++Fh+TIL /QUgUtJBfwLZjSBqKHfKT/2NwVMF3IGju2g9Wj69UA8ysCJZNemJbprpF3w5k3RKp/uc FRwE+LnZ8UT59tfGgy8bc+4tcjMilivsKaVw4ienYiJEdAfeS/rG6aBUlYYgeasZAgJa WCtd2KyIs6MyL7KKTgabMS7PETGSBkMVmkNurFVDuk67i4pir1cf4EIs0LSBcO2IrPTA f1QsEYRdl98mjdle27LMnWHGWlJifTshfZ6tU8xCZyMaw2SC5oQRsrLd4IeKWqkEb05N qegA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=lzmtt2GJxownP5Oh2j74I8hRFZWqKur5qtb4RK6XtG4=; b=eZYbLQV3EGM4V73RvIyILuZSuUgNmLRit1kPFOWjRS4+h5aLajC8PlIwaTMOwG3To3 kxSmDYMHuNtUnBtG25nqSr6dtB2EN3roH6TSEuIIhigg3Vguf6dQV35mzor0N13Nnzzf vW4UDFvtFyeMlM1sItrch4GtEkYTErT9BPTZo71h4gxjL3DS98VFcig9WBowVcd37hBg WeCAUiFeUJomZVtGGHMiLWIe2Lz/zG+VXpDgHuyd3JH7xSMKbTl109KPW5l651Y2CO5F TKJBLRviUNiHVak+MSVTDQqbEq0eAV3qiv+gEniQgITgSYfzXv32EYWMOTIFpS5Ma93O YnZg== X-Gm-Message-State: APjAAAWWm8qYeI3UflBeYFlRLyvOji9og2Lbo+3gXFjPfEU7tEWTGIBb jVZiPIev0UoR3PtlpQmZApY= X-Google-Smtp-Source: APXvYqwChLEhA2pKEaZLcYGbidOAQNT6KmNDkWbnAoYePcBtWYNXEA8yFIQXUyc4Xjb/66cipsppJw== X-Received: by 2002:a37:4b49:: with SMTP id y70mr28500670qka.447.1566386172918; Wed, 21 Aug 2019 04:16:12 -0700 (PDT) Received: from [192.168.2.15] (cpe-76-182-13-165.nc.res.rr.com. [76.182.13.165]) by smtp.gmail.com with ESMTPSA id x28sm11172767qtk.8.2019.08.21.04.16.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 04:16:12 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: How to change rootfs from official RPI3 image From: Ricky Zhang <zhangchaowang@gmail.com> X-Priority: 3 (Normal) In-Reply-To: <1668312327.7.1566381369480@localhost> Date: Wed, 21 Aug 2019 07:16:11 -0400 Cc: freebsd-arm@freebsd.org Message-Id: <C5D66D8B-05F2-445A-92A5-CD463B393EEA@gmail.com> References: <0FC8815E-58D7-4196-BF7E-0D6B127B314D@gmail.com> <1668312327.7.1566381369480@localhost> To: Ronald Klop <ronald-lists@klop.ws> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 46D4q22B1Sz3Kby X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fMC6YDz0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of zhangchaowang@gmail.com designates 2607:f8b0:4864:20::72f as permitted sender) smtp.mailfrom=zhangchaowang@gmail.com X-Spamd-Result: default: False [-3.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; HAS_X_PRIO_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[165.13.182.76.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[f.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-9.49), ipnet: 2607:f8b0::/32(-2.91), asn: 15169(-2.35), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." <freebsd-arm.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-arm>, <mailto:freebsd-arm-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-arm/> List-Post: <mailto:freebsd-arm@freebsd.org> List-Help: <mailto:freebsd-arm-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-arm>, <mailto:freebsd-arm-request@freebsd.org?subject=subscribe> X-List-Received-Date: Wed, 21 Aug 2019 11:16:15 -0000 Your idea is brilliant. It solved the dilemma.=20 Ricky@router ~ $ sudo cat /etc/fstab # Custom /etc/fstab for FreeBSD embedded images /dev/ufs/rootfs /bootdir ufs rw 1 1 /dev/label/gpt/ssdrootfs / ufs rw 1 1 /dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0 tmpfs /tmp tmpfs rw,mode=3D1777,size=3D50m 0 0 Ricky@router ~ $ mount /dev/label/gpt/ssdrootfs on / (ufs, local, soft-updates) devfs on /dev (devfs, local, multilabel) /dev/ufs/rootfs on /bootdir (ufs, local, soft-updates) /dev/msdosfs/MSDOSBOOT on /bootdir/boot/msdos (msdosfs, local, noatime) tmpfs on /tmp (tmpfs, local) I wrote the whole thing down in my wiki: = https://github.com/rickyzhang82/FreeBSDWiki/wiki/1.-Migrate-SD-card-rootfs= -to-SSD-for-RPI3 = <https://github.com/rickyzhang82/FreeBSDWiki/wiki/1.-Migrate-SD-card-rootf= s-to-SSD-for-RPI3> Thanks Ricky > On Aug 21, 2019, at 5:56 AM, Ronald Klop <ronald-lists@klop.ws> wrote: >=20 > Sorry, I did only reply to the mailinglist. I will use reply-all now. >=20 > You are right about uboot finding /boot/kernel and /boot/loader.conf. >=20 > What you need to do is mount the SD-card on /bootdir; in fstab: > /dev/yoursdcard /bootdir ufs rw,noatime 1 2 >=20 > And a symlink from /boot -> /bootdir/boot on your SSD. >=20 > Then installworld/installkernel will do the proper thing. > So the complete /boot stays on the SD-card. >=20 > Regards, >=20 > Ronald. >=20 > Van: Ricky Zhang <zhangchaowang@gmail.com> > Datum: woensdag, 21 augustus 2019 04:58 > Aan: freebsd-arm@freebsd.org > Onderwerp: Re: How to change rootfs from official RPI3 image >=20 > > BTW: Yes, u-boot is opensource: /usr/ports/sysutils/u-boot-rpi3 > > There are sysutils/u-boot-* ports for different system. With = sysutils/u-boot-master as the main part of it. > > > > https://www.freshports.org/sysutils/u-boot-rpi3 = <https://www.freshports.org/sysutils/u-boot-rpi3> = <https://www.freshports.org/sysutils/u-boot-rpi3 = <https://www.freshports.org/sysutils/u-boot-rpi3>> > > http://www.denx.de/wiki/U-Boot <http://www.denx.de/wiki/U-Boot> = <http://www.denx.de/wiki/U-Boot <http://www.denx.de/wiki/U-Boot>> > > > > Regards, > > Ronald. >=20 >=20 > Hi Ronald, >=20 > Sorry, if I messed up the mailing list thread. I didn=E2=80=99t = receive your email directly. Instead, I got your reply from daily = digest. I have to copy subject and quote your reply manually in my email = client. I have no idea how to fix it after reading all FAQ = (https://www.freebsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/art= icle.html#etiquette = <https://www.freebsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/art= icle.html#etiquette> = <https://www.freebsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/art= icle.html#etiquette = <https://www.freebsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/art= icle.html#etiquette>>). Any other mailing list I subscribed didn=E2=80=99t= work this way... >=20 > In any case, the magic works. I did rsync: >=20 > rsync -aAXvr --progress --delete /* /mnt/USB \ > --exclude=3D'/boot/msdos/*' \ > --exclude=3D'/dev/*' \ > --exclude=3D'/proc/*' \ > --exclude=3D'/net/*' \ > --exclude=3D'/tmp/*' \ > --exclude=3D'/mnt/*' \ > --exclude=3D'/media/*' >=20 > I confirmed that it mount ssd as rootfs: >=20 > Ricky@router ~ $ df -h > Filesystem Size Used Avail Capacity Mounted on > /dev/label/gpt/ssdrootfs 407G 5.5G 369G 1% / > devfs 1.0K 1.0K 0B 100% /dev > /dev/msdosfs/MSDOSBOOT 50M 13M 37M 26% /boot/msdos > tmpfs 50M 4.0K 50M 0% /tmp >=20 > As you said, kernel still comes from SD card. I don=E2=80=99t fully = understand the FreeBSD boot process. Neither am I familiar with UEFI. >=20 > - I guess /boot/msdos/uboot.bin finds the SD card roofs system. Load = the kernel from /boot/kernel in SD card and scan /boot/loader.conf to = find the rootfs. Please correct me if I=E2=80=99m wrong. > - Should I remove /boot folder from SSD to avoid confusion? > - Are there any guide how to compile and deploy kernel? >=20 >=20 >=20 >=20 > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm = <https://lists.freebsd.org/mailman/listinfo/freebsd-arm> > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1668312327.7.1566381369480>