Debug Notesπ
notes on script designπ
nfs attach scriptπ
# notes - follow freebsd-m1 setup page
echo "mount -v -t nfs 192.168.64.1:/System/Volumes/Data/Users/smk/personal/gsoc/fbsd/tools/boot/bootloader_test /root/freebsd-src/tools/boot/bootloader_test" >> mount.sh
chmod +x mount.sh
# later configure to execute on bootup
- There is an issue when mounting entire freebsd-src from Mac. Seems like its attaching in a read-only mode which interferes with
buildworld
,buildkernel
steps - There is another issue while running
amd64
builds fromarm64
qemu running requires to build toolchain
# building toolchain
cd freebsd-src
# assumes buildworld and buildkernel is done
make -j `sysctl -n hw.ncpu` TARGET=amd64 TARGET_ARCH=amd64 toolchain
# optionally could use : toolchains to build everything
notes on amd64π
- really already been solved by warner
notes on arm64π
- Check nfs attach script sectionβs 2nd portion
notes on riscvπ
default boot mode for my script is using opensbi
notes on armv7π
This image is always released as IMG file, which could be tricky to handle in bootloader_tests script which is a lua script.
- Decided to convert
.img
into.iso
How do we get all the files ?
# uncompress the xz
xz -k FreeBSD-13.2-RELEASE-arm-armv7-GENERICSD.img.xz
# then create a virtual device with this uncompressed image
mdconfig -a -t vnode -f FreeBSD-13.2-RELEASE-arm-armv7-GENERICSD.img -u 0
# this should mount the virtual device as md0 & confirm it as
mdconfig -l
ls /dev/md0* # output should be md0, md0s1, md0s2, md0s2a
# lets find out file-system of each of them
file FreeBSD-13.2-RELEASE-arm-armv7-GENERICSD.img
fstyp /dev/md0s2a # this should be required ufs partition
# mounting
mount -t ufs /dev/md0s2a /mnt/armv7
# cleanup: unmount & delete virtual device
unmount /mnt/armv7
mdconfig -d -u 0
# reference
# discord discussions & https://gist.github.com/yzgyyang/4965d5673b5c79c644a695dd75fa8e05
# https://www.freebsddiary.org/iso-mount.php
# https://www.cs.ait.ac.th/~on/technotes/archives/2013/12/11/mount_a_file_system_image_in_freebsd/index.html
Creating ISO
# install cdutils
pkg install sysutils/cdrtools
# in qemu cd-writer needs to configured so rather let's write the folder into iso
# method-1 directly make iso from /mnt/armv7
mkisofs -o FreeBSD-13.2-RELEASE-arm-armv7-bootonly.iso /mnt/armv7
# method-2 cause big image :(
cp -r /mnt/armv7 ~/data_src/armv7
mkisofs -o FreeBSD-13.2-RELEASE-arm-armv7-bootonly.iso ~/data_src/armv7
# if not in qemu
cdrecord dev=md0 imagefile.iso
# reference : https://docs.freebsd.org/en/books/handbook/disks/#creating-cds
notes on powerpc64π
adalava, dbaio, jhibbits on efnet:#powerpc64
- There is no
loader.efi
, freebsd-doesnβt support efi boot