Creating Ghost14 aarch64 ARM64 boot image from Klara Systems Document

Creating Ghost14 aarch64 ARM64 boot image from Klara Systems Document. update Dec/10/2023



https://klarasystems.com/articles/building-customized-freebsd-images/  Read and study this document to understand how to build a bootable image. you need 3 partitions for a minimal bootable image:
  1. ESP EFI FAT32  need a 50MB-760MB FAT32 filesystem GPT partition for the U-BOOT files needed by the raspberry pi 4B, 3B, 400 hardware  label esp

  2. SWAP space 2 GB on the USB Flash drive stick or on a USB SSD disk device label swapfs
  3. GhostBSD rootfs /  for the UFS file system to exist for booting the /boot/kernel/kernel image file.   If you 'dd' write this Ghost14_selfbuilt.img to a 16GB or larger USB Flash Drive Stick device,  You may resize the UFS file system to fill up the unused partition with a larger file space to fill up to the drive size. label rootfs

Use resize command with the disk name, ada0, ada1 da0, da1

camcontrol devlist
geom disk list
gpart status
gpart show -lp
gpart resize -i 3 -s 15G -a 4k ada0
growfs ada0p3 

https://unixcop.com/how-to-resize-and-growing-disks-in-freebsd/ 

https://fluca1978.github.io/2021/02/11/FreeBSDExpandingRootFilesystem.html 

https://www.reddit.com/r/BSD/comments/sziir9/how_to_resize_partition/

You might wish to  gpart recover ada0  to fix corrupt partition tables at the end of the ada0 disk.

note to me,Fred;  here is where to find the Ghost14_selfbuilt.img file root@fredselfbuilt_rpi4b:~ # ln -s /root/Ghost14_selfbuilt.img  /usr/local/poudriere/data/packages/ghostbsd-14-aarch64-ghostbsd_ports/.latest/All/Ghost14_selfbuilt.img

Update December 10, 2023 image created

 ln -s /root/Ghost14_selfbuilt_raspi4b.img.xz  /usr/local/poudriere/data/packages/ghostbsd-14-aarch64-ghostbsd_ports/Ghost14_selfbuilt_raspi4b.img.xz

  ln -s /root/Ghost14_selfbuilt_raspi4b.img.xz  /usr/local/poudriere/data/packages/Ghost14_selfbuilt_raspi4b.img.xz


Now see where we are with Print Working Directory  pwd
What disks we have available with  camcontrol devlistgpart show -lp
See what disks are presently mounted with  mount;  df -h

root@fredselfbuilt_rpi4b:~ # pwd
/root
root@fredselfbuilt_rpi4b:~ # camcontrol devlist
<Samsung SSD 870 QVO 1TB 4103>     at scbus0 target 0 lun 0 (da0,pass0)
<Kingston DataTraveler 3.0 >       at scbus1 target 0 lun 0 (da1,pass1)
root@fredselfbuilt_rpi4b:~ # mount
arm64pool/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs)
arm64pool/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls)
arm64pool/var/mail on /var/mail (zfs, local, nfsv4acls)
arm64pool/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls)
arm64pool/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls)
arm64pool/home on /arm64pool/home (zfs, local, noatime, nfsv4acls)
arm64pool/usr/src on /usr/src (zfs, local, noatime, nfsv4acls)
arm64pool/poudriere on /arm64pool/poudriere (zfs, local, noatime, nfsv4acls)
arm64pool/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls)
arm64pool/poudriere/jails/ghostbsd-13-2-aarch64 on /usr/local/poudriere/jails/ghostbsd-13-2-aarch64 (zfs, local, noatime, nfsv4acls)
arm64pool/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls)
arm64pool/poudriere/ports/ghostbsd_ports on /usr/local/poudriere/ports/ghostbsd_ports (zfs, local, noatime, nfsv4acls)
arm64pool/poudriere/ports/default on /usr/local/poudriere/ports/default (zfs, local, noatime, nfsv4acls)
arm64pool/poudriere/jails/ghostbsd-14-aarch64 on /usr/local/poudriere/jails/ghostbsd-14-aarch64 (zfs, local, noatime, nfsv4acls)
arm64pool/poudriere/jails on /arm64pool/poudriere/jails (zfs, local, noatime, nfsv4acls)
arm64pool/poudriere/ports on /arm64pool/poudriere/ports (zfs, local, noatime, nfsv4acls)
arm64pool/var/ccache on /var/ccache (zfs, local, noatime, nfsv4acls)
root@fredselfbuilt_rpi4b:~ # df -h
Filesystem                                         Size    Used   Avail Capacity  Mounted on
arm64pool/ROOT/default                             773G     45G    728G     6%    /
devfs                                                       1.0K      0B    1.0K     0%    /dev
arm64pool/tmp                                      728G    264K    728G     0%    /tmp
arm64pool/var/mail                                 728G    260K    728G     0%    /var/mail
arm64pool/var/log                                  728G    5.5M    728G     0%    /var/log
arm64pool/usr/ports                                748G     20G    728G     3%    /usr/ports
arm64pool/home                                     728G     96K    728G     0%    /arm64pool/home
arm64pool/usr/src                                  729G    1.3G    728G     0%    /usr/src
arm64pool/poudriere                                728G    104K    728G     0%    /arm64pool/poudriere
arm64pool/var/tmp                                  728G    112K    728G     0%    /var/tmp
arm64pool/poudriere/jails/ghostbsd-13-2-aarch64    730G    2.1G    728G     0%    /usr/local/poudriere/jails/ghostbsd-13-2-aarch64
arm64pool/var/crash                                728G     96K    728G     0%    /var/crash
arm64pool/poudriere/ports/ghostbsd_ports           731G    3.1G    728G     0%    /usr/local/poudriere/ports/ghostbsd_ports
arm64pool/poudriere/ports/default                  729G    890M    728G     0%    /usr/local/poudriere/ports/default
arm64pool/poudriere/jails/ghostbsd-14-aarch64      729G    1.3G    728G     0%    /usr/local/poudriere/jails/ghostbsd-14-aarch64
arm64pool/poudriere/jails                          728G     96K    728G     0%    /arm64pool/poudriere/jails
arm64pool/poudriere/ports                          728G     96K    728G     0%    /arm64pool/poudriere/ports
arm64pool/var/ccache                               731G    3.5G    728G     0%    /var/ccache

Check directories  /media  /mnt  for mounted file systems:

root@fredselfbuilt_rpi4b:~ # ls -l /media
total 2
drwxr-xr-x  2 root wheel 2 Sep  2 19:19 da0p1
drwxr-xr-x  2 root wheel 2 Jul 22 21:52 gprootfs
drwxr-xr-x  2 root wheel 2 Sep 20 21:51 rootfs
root@fredselfbuilt_rpi4b:~ # ls -l /media/da0p1
total 0
root@fredselfbuilt_rpi4b:~ # ls -l /media/gprootfs
total 0
root@fredselfbuilt_rpi4b:~ # ls -l /media/rootfs
total 0
root@fredselfbuilt_rpi4b:~ # ls -l /mnt
total 1
drwxr-xr-x  2 root wheel 2 Sep 19 23:00 da1s1
drwxr-xr-x  2 root wheel 2 Nov  1 11:26 msdos

Use gpart commands to see what GPT partitions are already listed on the disk device:

root@fredselfbuilt_rpi4b:~ # gpart status
 Name  Status  Components
da0p1      OK  da0
da0p2      OK  da0
da0p3      OK  da0
da1p1      OK  da1
da1p2      OK  da1
root@fredselfbuilt_rpi4b:~ # gpart show -lp
=>        40  1953525088    da0  GPT  (932G)
          40        2008         - free -  (1.0M)
        2048     6291456  da0p1  efibootarm  (3.0G)
     6293504  1761607680  da0p2  zfs  (840G)
  1767901184    16777216  da0p3  swap  (8.0G)
  1784678400   168846728         - free -  (81G)

=>       34  241660849    da1  GPT  (115G)
         34       2014         - free -  (1.0M)
       2048  241593296  da1p1  Ventoy  (115G)
  241595344      65536  da1p2  VTOYEFI  (32M)
  241660880          3         - free -  (1.5K)

=>       63  241593233  da1p1  MBR  (115G)
         63  241593233         - free -  (115G)

=>       63  241593233  gpt/Ventoy  MBR  (115G)
         63  241593233              - free -  (115G)

 From previous camcontrol devlist  command, we see that da1 is a used Ventoy.net
USB 128GB Flash Disk drive stick.  I have previously copied the information '.ISO files' to another disk for safe keeping. Now, I will overwrite with a new image file.

I am going to 'dd' write the file Ghost14_selfbuilt.img ,write over the top of this Kingston DataTraveler USB 3.0 128GB disk device stick.

<Kingston DataTraveler 3.0 >       at scbus1 target 0 lun 0 (da1,pass1)

root@fredselfbuilt_rpi4b:~ # gpart status da1
 Name  Status  Components
da1p1      OK  da1
da1p2      OK  da1
root@fredselfbuilt_rpi4b:~ # gpart show -lp da1
=>       34  241660849    da1  GPT  (115G)
         34       2014         - free -  (1.0M)
       2048  241593296  da1p1  Ventoy  (115G)
  241595344      65536  da1p2  VTOYEFI  (32M)
  241660880          3         - free -  (1.5K)

root@fredselfbuilt_rpi4b:~ #
 

How to  XZ compress an image file, or uncompress

 
xz --compress  --keep  Ghost14_selfbuilt.img       Compress image file
xz --decompress --keep Ghost14_selfbuilt.img.xz    Decompress image file.xz
xz --test -v Ghost14_selfbuilt.img.xz
xz --list   Ghost14_selfbuilt.img.xz
 

Checksum 256 or 512, the image file Ghost14_selfbuilt.img.xz


Sha512 Ghost14_selfbuilt.img.xz
root@fredselfbuilt_rpi4b:/usr/ports/www/firefox # xz --test --verbose /root/Ghost14_selfbuilt.img.xz
/root/Ghost14_selfbuilt.img.xz (1/1)
  100 %        694.2 MiB / 12.0 GiB = 0.056    99 MiB/s       2:05             
 
root@fredselfbuilt_rpi4b:/usr/ports/www/firefox # sha512 /root/Ghost14_selfbuilt.img.xz
SHA512 (/root/Ghost14_selfbuilt.img.xz) = 6539c89e533333669fc88f5b51a78e26fce45fe7d441d1100fc0faacc6357212967b2398406bd5a7af920b6e59236264a1f1b8d25f38ca5dc3b85b3a35a22033
 
root@fredselfbuilt_rpi4b:/usr/ports/www/firefox # sha256 /root/Ghost14_selfbuilt.img.xz
SHA256 (/root/Ghost14_selfbuilt.img.xz) = e48aa9bd0277632ad3ee904c1981dc229a082c149348106ec27365bea6e37cb3
root@fredselfbuilt_rpi4b:/usr/ports/www/firefox #
 
Fred Finster, [11/25/23 10:43 AM]
Well I got XFCE Desktop running on older image GhostSBD 14.0 ARM64 yesterday.  Wahoo!!  Yeah!


sha256 /root/Ghost14_selfbuilt.img
SHA256 (/root/Ghost14_selfbuilt.img) = bb989e391119c77590e970db7ecb452d75b3bc7a756b8158710fc9dabd6b15af
December 10, 2023
sha512 /root/Ghost14_selfbuilt_raspi4b.img.xz  
SHA512 (/root/Ghost14_selfbuilt_raspi4b.img.xz) = fb82e8655cde4ce26db3866a9bb2e230684d96ad8dd58b6c0b82380c0d341710621e320b70d6984c7c1c72f94016a6ec5995454ad908c39bb12a0a891c6e9002
sha256 /root/Ghost14_selfbuilt_raspi4b.img.xz
SHA256 (/root/Ghost14_selfbuilt_raspi4b.img.xz) = 4168897fc4c9d56eaf4e09470cfcdf71b7e358171f3f3851c5581408d3f912a9

 Download the compressed source image  file

Note the 'http' port 80 use; not 'https' port 443 use!  You can use any one of these tools to get the file downloaded:

fetch ,  wget , curl

whoami
pwd
fetch  http://76.14.239.229/packages/Ghost14_selfbuilt.img.xz
wget  -c http://76.14.239.229/packages/Ghost14_selfbuilt.img.xz
curl -O http://76.14.239.229/packages/Ghost14_selfbuilt.img.xz

root@fredselfbuilt_rpi4b:~ # ls -l Ghost14*
-rw-r--r--  1 root wheel 12937333248 Nov 25 15:44 Ghost14_selfbuilt.img
root@fredselfbuilt_rpi4b:~ # ls -lh Ghost14*
-rw-r--r--  1 root wheel   12G Nov 25 15:44 Ghost14_selfbuilt.img
root@fredselfbuilt_rpi4b:~ # 

Update: December 10, 2023
fetch  http://76.14.239.229/packages/Ghost14_selfbuilt_raspi4b.img.xz
wget  -c http://76.14.239.229/packages/Ghost14_selfbuilt
_raspi4b.img.xz
curl -O http://76.14.239.229/packages/Ghost14_selfbuilt
_raspi4b.img.xz
 

-rw-r--r--  1 root wheel  694M Dec 10 20:59 Ghost14_selfbuilt_raspi4b.img.xz 

 time xz --decompress --keep Ghost14_selfbuilt_raspi4b.img.xz
time xz --decompress --keep Ghost14_selfbuilt_raspi4b.img.xz
date
      245.87 real       143.57 user        91.87 sys
root@Ghost14_selfbuilt_rpi4B_nginx:~ # date
Sun Dec 10 23:28:56 PST 2023
ls -l Gho*
-rw-r--r--  1 root wheel 12937333248 Dec 10 20:59 Ghost14_selfbuilt_raspi4b.img
-rw-r--r--  1 root wheel   727882156 Dec 10 20:59 Ghost14_selfbuilt_raspi4b.img.xz
-rw-r--r--  1 root wheel 12937333248 Nov 25 15:44 Ghost14_selfbuilt.img
-rw-r--r--  1 root wheel   727968072 Nov 25 15:44 Ghost14_selfbuilt.img.xz
-rw-r--r--  1 root wheel         936 Nov 26 08:42 GhostBSD.conf

time sha512 Ghost14_selfbuilt_raspi4b.img

SHA512 (Ghost14_selfbuilt_raspi4b.img) = 3d1906e0f10b54b402a5fe9cbed66b6865d8b38cf2d3daec6840fdb6fb92b2d2db76243a4d4bcf765a6a1b0ee88d6d64cde376a1a67ae9ac
6625ab0e2dbdbb75

      113.29 real        82.73 user        30.55 sys
 time sha256 Ghost14_selfbuilt_raspi4b.img
SHA256 (Ghost14_selfbuilt_raspi4b.img) = 8ab94e406c3b74fd872b456e0ff164aebd29579a544107a214f82409e3904018
      139.23 real       109.16 user        30.05 sys


 

 

https://www.cyberciti.biz/faq/how-to-write-freebsd-image-to-usb-disk-for-installation-using-dd-command/ 

dd if=Ghost14_selfbuilt.img of=/dev/da1 bs=1M conv=sync status=progress      

time dd if=Ghost14_selfbuilt_raspi4b.img of=/dev/da1 bs=1M conv=sync status=progress     

time dd if=Ghost14_selfbuilt_raspi4b.img of=/dev/da1 bs=1M conv=sync status=progress

GEOM: da1: the secondary GPT header is not in the last LBA.9937 kB/s   

12339+0 records in
12339+0 records out
12938379264 bytes transferred in 1301.764407 secs (9939110 bytes/sec)
     1301.77 real         2.34 user        44.10 sys
root@Ghost14_selfbuilt_rpi4B_nginx:~ #

root@Ghost14_selfbuilt_rpi4B_nginx:~ # camcontrol devlist
<Samsung SSD 870 QVO 1TB 4103>     at scbus0 target 0 lun 0 (da0,pass0)
<Verbatim ClickUSB PMAP>           at scbus1 target 0 lun 0 (da1,pass1)
root@Ghost14_selfbuilt_rpi4B_nginx:~ # gpart status da1
 Name   Status  Components
da1p1  CORRUPT  da1
da1p2  CORRUPT  da1
da1p3  CORRUPT  da1
root@Ghost14_selfbuilt_rpi4B_nginx:~ # gpart recover da1
da1 recovered
root@Ghost14_selfbuilt_rpi4B_nginx:~ # gpart status da1
 Name  Status  Components
da1p1      OK  da1
da1p2      OK  da1
da1p3      OK  da1
root@Ghost14_selfbuilt_rpi4B_nginx:~ # gpart show -lp da1
=>      3  30261237    da1  GPT  (14G)
         3    102400  da1p1  esp  (50M)
    102403   4194304  da1p2  swapfs  (2.0G)
   4296707  20971520  da1p3  rootfs  (10G)
  25268227   4993013         - free -  (2.4G)
 
ls -l /mnt /media
/media:
total 2
drwxr-xr-x  2 root wheel 2 Sep  2 19:19 da0p1
drwxr-xr-x  2 root wheel 2 Jul 22 21:52 gprootfs
drwxr-xr-x  2 root wheel 2 Sep 20 21:51 rootfs

/mnt:
total 1
drwxr-xr-x  2 root wheel 2 Sep 19 23:00 da1s1
drwxr-xr-x  2 root wheel 2 Nov  1 11:26 msdos
root@Ghost14_selfbuilt_rpi4B_nginx:~ # mkdir -p /mnt/rootfs
root@Ghost14_selfbuilt_rpi4B_nginx:~ # mkdir -p /mnt/esp
root@Ghost14_selfbuilt_rpi4B_nginx:~ # mount_msdosfs /dev/da1p1 /mnt/esp
root@Ghost14_selfbuilt_rpi4B_nginx:~ # mount /dev/da1p3 /mnt/rootfs

mount
arm64pool/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs)
/dev/da1p1 on /mnt/esp (msdosfs, local)
/dev/da1p3 on /mnt/rootfs (ufs, local, soft-updates)

df -h
Filesystem                Size    Used   Avail Capacity  Mounted on
arm64pool/ROOT/default    764G     49G    716G     6%    /
devfs                     1.0K      0B    1.0K     0%    /dev
/dev/da1p1                49M     26M     23M    53%    /mnt/esp
/dev/da1p3                9.7G    3.1G    5.8G    34%    /mnt/rootfs

 From this blog article here:

https://ghostbsd-arm64.blogspot.com/2023/11/creating-ghost14-aarch64-arm64-boot.html   This blog you are reading now, here.

https://ghostbsd-arm64.blogspot.com/2023/11/arm64-boot-usb-flash-drive-hey-buddy.html  How the image file was built



mkdir -p /usr/local/etc/pkg/repos

cp -p  GhostBSD.conf /usr/local/etc/pkg/repos/


Place this file,  GhostBSD.conf  in the repos directory.  

DO NOT edit /etc/pkg/GhostBSD.conf or /etc/pkg/FreeBSD.conf  configuration files.
Edit these same configuration files in /usr/local/etc/pkg/repos



$ cat GhostBSD.conf
# $GhostBSD$
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/GhostBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "GhostBSD: { enabled: no }" > /usr/local/etc/pkg/repos/GhostBSD.conf
#

        GhostBSD: {
        #   url: "http://192.168.1.7/packages/ghostbsd-14-aarch64-ghostbsd_ports/.latest",
          url: "http://
ghostbsdarm64.hopto.org/packages/ghostbsd-14-aarch64-ghostbsd_ports/.latest",
        #    url: "http://76.14.239.229/packages/ghostbsd-14-aarch64-ghostbsd_ports/All",
        #    url: "http://76.14.239.229/stable/${ABI}/.latest",
        #    url: "https://pkg.ghostbsd.org/stable/${ABI}/.latest",
           mirror_type: "none",
            signature_type: "pubkey",
           pubkey: "/usr/share/keys/ssl/certs/ghostbsd.cert",
           enabled: yes
        }

su -
mkdir -p /usr/local/etc/pkg/repos
cd /usr/local/etc/pkg/repos
pwd
ls -lh

Pick one tool to download the file GhostBSD.conf and place into directory /usr/local/etc/pkg/repos

fetch     http://ghostbsdarm64.hopto.org/packages/GhostBSD.conf
wget  -c  http://
ghostbsdarm64.hopto.org/packages/GhostBSD.conf
curl -O   http://ghostbsdarm64.hopto.org/packages/GhostBSD.conf

If the following steps work,  You might have a GUI XFCE desktop to use and enjoy. I expect problems and missing packages.  Best of luck and report back in the comments your success or the problems you found. You might have to edit file /usr/local/etc/pkg/repos/GhostBSD.conf by changing url to:

  url: "https://76.14.239.229/packages/ghostbsd-14-aarch64-ghostbsd_ports/All",
#   url: "https://76.14.239.229/packages/ghostbsd-14-aarch64-ghostbsd_ports/.latest",

Fred Finster November 26, 2023

pkg -N
pkg list
pkg -d update
pkg search - | wc     how many packages exist in this repository
pkg  install  xorg  xfce  xfce4-goodies lightdm    or  slim instead of lightdm

If package tool  pkg is not connecting or working for you.  You may first save the file into  GhostBSD.conf.orig file name with:
cd  /usr/local/etc/pkg/repos
ls -lh
cp -p GhostBSD.conf GhostBSD.conf.orig

vi  GhostBSD.conf  and change the URL to something that works for your needs.
Change either the IP number of the website, or change the ending of the directory names from  All, Latest, .latest  to be able to  pkg bootstrap or   pkg bootstrap -f

As of December 10, 2023  pkg --version  is 1.20.9  https://www.freshports.org/ports-mgmt/pkg/

 

fred@rpi-fred4B_test_Dec10_1:~ $ cat /etc/fstab
/dev/gpt/rootfs  /         ufs     rw,noatime 1 1
# /dev/diskid/DISK-FBBEB3E9875A4AA4p3  /         ufs     rw,noatime 1 1
# /dev/gpt/esp     /boot/efi msdosfs rw,noatime 0 0
# /dev/diskid/DISK-FBBEB3E9875A4AA4p2  none      swap    sw         0 0
/dev/gpt/swapfs  none      swap    sw         0 0


root@Ghost14_selfbuilt_rpi4B_nginx_tst1:~ # cat GhostBSD.conf
# $GhostBSD$
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/GhostBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "GhostBSD: { enabled: no }" > /usr/local/etc/pkg/repos/GhostBSD.conf
#

        GhostBSD: {
        #  url: "http://192.168.1.7/packages/ghostbsd-14-aarch64-ghostbsd_ports/All",
          url: "http://ghostbsdarm64.hopto.org/packages/ghostbsd-14-aarch64-ghostbsd_ports/Latest",
        # url: "http://76.14.239.229/packages/ghostbsd-14-aarch64-ghostbsd_ports/.latest",
        #  url: "http://76.14.239.229/packages/ghostbsd-14-aarch64-ghostbsd_ports/All",
        #    url: "http://76.14.239.229/stable/${ABI}/latest",
        #    url: "https://pkg.ghostbsd.org/stable/${ABI}/latest",
           mirror_type: "none",
           signature_type: "pubkey",
           pubkey: "/usr/share/keys/ssl/certs/ghostbsd.cert",
           enabled: yes
        }

root@NanoPC-T6:~ # cat /usr/local/etc/pkg/repos/PersonalBSD.conf
#
# My FreeBSD repo
#
PersonalBSD: {
        url: "http://pkg.personalbsd.org/${ABI}-default",
        priority: 1
        enabled: yes
}


root@Ghost14-selfbuilt-rpi4B-nginx-tst1:/etc/pkg # cat FreeBSD.conf
# $FreeBSD$
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
#   url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
   url: "http://pkg.FreeBSD.org/${ABI}/latest",
#   url: "pkg+http://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest",
#   url: "http://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}



-rwxr-xr-x  1 root wheel  397 Dec 10 20:23 makefs_10G_boot_image.sh
root@Ghost14_selfbuilt_rpi4B_nginx_tst1:~ # cat makefs_10G_boot_image.sh
#!/bin/sh
# cat makefs_10G_boot_image.sh
# echo  Make a UFS  FILE system for the:   This command creates a new file rootfs.ufsGhost14arm64
# containing a UFS partition made up of the contents of $ROOTFSDIR.
# This is the first piece of our final bootable system image.
makefs -B little \
    -o label=rootfs -o version=2 -o softupdates=1 \
    -D -s 10g \
    rootfs.ufs.Ghost14arm64 $ROOTFSDIR

root@Ghost14_selfbuilt_rpi4B_nginx_tst1:~ # time ./makefs_10G_boot_image.sh
Calculated size of `rootfs.ufs.Ghost14arm64': 10737418240 bytes, 27650 inodes
Extent size set to 32768
density reduced from 388334 to 8192
rootfs.ufs.Ghost14arm64: 10240.0MB (20971520 sectors) block size 32768, fragment size 4096
        using 17 cylinder groups of 626.31MB, 20042 blks, 80256 inodes.
super-block backups (for fsck -b #) at:
      192,  1282880,  2565568,  3848256,  5130944,  6413632,  7696320,
  8979008, 10261696, 11544384, 12827072, 14109760, 15392448, 16675136,
 17957824, 19240512, 20523200
Populating `rootfs.ufs.Ghost14arm64'
Image `rootfs.ufs.Ghost14arm64' complete
      309.30 real        22.00 user       267.34 sys


cat make_ghost14_selfbuilt_final_image_3_partitions_raspi4b.sh
#!/bin/sh
#  filename make_ghost14_selfbuilt_final_image_3_partitions_raspi4b.sh
# echo create the selfbuilt_raspi4b image file
mkimg -s gpt -f raw \
    -p efi/esp:=efi.part \
    -p freebsd-swap/swapfs::2G \
    -p freebsd-ufs/rootfs:=rootfs.ufs.Ghost14arm64 \
    -o Ghost14_selfbuilt_raspi4b.img
    
root@Ghost14_selfbuilt_rpi4B_nginx_tst1:~ # time ./make_ghost14_selfbuilt_final_image_3_partitions_raspi4b.sh
      147.48 real         0.80 user        70.73 sys


 time xz --compress --keep --verbose Ghost14_selfbuilt_raspi4b.img
root@Ghost14_selfbuilt_rpi4B_nginx_tst1:~ # time xz --compress --keep --verbose Ghost14_selfbuilt_raspi4b.img
Ghost14_selfbuilt_raspi4b.img (1/1)

 58.2 %     691.0 MiB / 7,190.3 MiB = 0.096   2.0 MiB/s    1:01:18       44 min
 58.3 %     691.0 MiB / 7,196.3 MiB = 0.096   2.0 MiB/s    1:01:19       44 min
  100 %        694.1 MiB / 12.0 GiB = 0.056   2.7 MiB/s    1:15:59             
     4559.67 real      4247.31 user       310.68 sys
root@Ghost14_selfbuilt_rpi4B_nginx_tst1:~ #

-rw-r--r--  1 root wheel  694M Dec 11 05:08 Ghost14_selfbuilt_raspi4b.img.xz
 ls -l /usr/local/poudriere/data/packages
total 24
lrwxr-xr-x  1 root wheel  38 Dec 10 22:43 Ghost14_selfbuilt_raspi4b.img.xz -> /root/Ghost14_selfbuilt_raspi4b.img.xz

curl -O http://
ghostbsdarm64.hopto.org/packages/Ghost14_selfbuilt_raspi4b.img.xz
wget -c  http://ghostbsdarm64.hopto.org/packages/Ghost14_selfbuilt_raspi4b.img.xz
fetch  http://ghostbsdarm64.hopto.org/packages/Ghost14_selfbuilt_raspi4b.img.xz

xz --decompress --keep --verbose Ghost14_selfbuilt_raspi4b.img.xz

Select  da1, da2, da0  whichever is proper for your setup.

time dd if=Ghost14_selfbuilt_raspi4b.img of=/dev/da1 bs=4M conv=sync status=progress

Files to pay attention to in this aarch64 Arm64 build for problems booting:

/boot/loader.conf , /boot/defaults/loader.conf , /etc/rc.conf , /etc/fstab, /etc/sysctl.conf, /etc/wpa_supplicant.conf, /usr/local/etc/pkg/repos/GhostBSD.conf

Examine the contents of these files and modify to match your needs.

 

Comments

Popular posts from this blog

FreeBSD 14.0 Compiling kernel for Raspberry Pi 4B

HDMI Audio sound patches into GhostBSD source code /usr/ghost14/ghostbsd-src SOLVED Jan20 2024

How to install GhostBSD-Arm64 into a USB Flash Drive stick April 24, 2024 update edition.