gpart show mmcsd1
root@CyStat-BBB:~ # gpart show mmcsd1
=> 63 7552961 mmcsd1 MBR (3.6G)
63 8129 - free - (4.0M)
8192 8192 1 fat32 [active] (4.0M)
16384 7536640 2 freebsd (3.6G)
gpart delete -i 2 mmcsd1
gpart add -t freebsd mmcsd1
gpart create -s bsd mmcsd1s2
gpart add -t freebsd-ufs mmcsd1s2
gpart show mmcsd1s2
root@CyStat-BBB:~ # gpart show mmcsd1s2
=> 0 7536640 mmcsd1s2 BSD (3.6G)
0 7536640 1 freebsd-ufs (3.6G)
newfs -ntEU -L system /dev/mmcsd1s2a
tunefs -a enable /dev/mmcsd1s2a
pkg install clone
mount -o noatime /dev/mmcsd1s2a /mnt
clone -c rwoff / /mnt
nano /mnt/etc/fstab
/dev/ufs/system / ufs rw,noatime 0 1
/dev/label/boot /boot/msdos msdosfs rw,noatime 0 0
tmpfs /tmp tmpfs rw,mode=1777,size=50m 0 0
umount /mnt
mount_msdosfs -o noatime /dev/mmcsd1s1 /mnt
rm -r /mnt/*
cp -p /boot/msdos/* /mnt/
umount /mnt
glabel label boot /dev/mmcsd1s1
chmod +x
to it and run the script from the sdcard / directory..# Remove the following line to make this script actually do something.
exit 1
You could boot your Beaglebone from the SD card and then use dd(1) to burn the latest Beaglebone FreeBSD 12.0-CURRENT snapshot image to /dev/mmcsd1, by using pretty much the same command which you used for preparing your SD card.
If you want to clone the contents of the working SD card to the internal eMMC, then dd(1) is not that adequate, because most probably the size of the SD card is different from the internal eMMC and in addition dd'ing a live file system is not guaranteed to result in a healthy one on the clone. Therefore, I suggest the following procedure:
1. Convert the Linux partition into a FreeBSD slice using gpart(8)
gpart show mmcsd1
This command will show you the current partitioning of the eMMC. My Beaglebone Black got already FreeBSD on the internal eMMC, and therefore the following output is different from the one which above command would output on your Beaglebone:
Anyway, the structure should be similar, and you need to identify and delete the partition which contains the Linux OS, which is most probably the one having index 2 -- verify!!! -- the following assumes that it is really 2.Code:root@CyStat-BBB:~ # gpart show mmcsd1 => 63 7552961 mmcsd1 MBR (3.6G) 63 8129 - free - (4.0M) 8192 8192 1 fat32 [active] (4.0M) 16384 7536640 2 freebsd (3.6G)
gpart delete 2
gpart add -t freebsd mmcsd1
gpart create -s bsd mmcsd1s2
gpart add -t freebsd-ufs mmcsd1s2
gpart show mmcsd1s2
Code:root@CyStat-BBB:~ # gpart show mmcsd1s2 => 0 7536640 mmcsd1s2 BSD (3.6G) 0 7536640 1 freebsd-ufs (3.6G)
2. Create the file system on the new FreeBSD slice
newfs -ntEU -L system /dev/mmcsd1s2a
tunefs -a enable /dev/mmcsd1s2a
3. clone(1) the whole FreeBSD 12 installation on the startup volume of your SD card to /dev/mmcsd1s2a
pkg install clone
mount -o noatime /dev/mmcsd1s2a /mnt
clone -c rwoff / /mnt
Now, don't forget to edit the fstab on the cloned volume:
nano /mnt/etc/fstab
Code:/dev/ufs/system / ufs rw,noatime 0 1 /dev/label/boot /boot/msdos msdosfs rw,noatime 0 0 tmpfs /tmp tmpfs rw,mode=1777,size=50m 0 0
umount /mnt
4. Replace the Linux U-Boot image by the FreeBSD one
mount_msdosfs -o noatime /dev/mmcsd1s1 /mnt
rm -r /mnt/*
cp -p /boot/msdos/* /mnt/
umount /mnt
glabel label boot /dev/mmcsd1s1
dd if=FreeBSD-11.1-RELEASE-arm-armv6-BEAGLEBONE.img of=/dev/mysd
scp FreeBSD-11.1-RELEASE-arm-armv6-BEAGLEBONE.img freebsd@mybeagleboneIP
dd if=FreeBSD-11.1-RELEASE-arm-armv6-BEAGLEBONE.img of=/dev/mmcsd1
df -lh
Filesystem Size Used Avail Capacity Mounted on
/dev/ufs/rootfs 1.7G 906M 718M 56% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/msdosfs/MSDOSBOOT 2.0M 944K 1.1M 47% /boot/msdos
tmpfs 50M 4.0K 50M 0% /tmp
Absolutely nothing is wrong, it's a very good and clean approach.What is wrong with this installation schema and what should I fix?
Card did not respond to voltage select!
?I think this is how I got ADC working with dtbo on FreeBSD 11.1. The newer uboot allows overlays.The latest u-boot is capable of loading DTB(O)s,
gpart delete 2
gpart delete -i 2 mmcsd1
Thank you, I corrected the instructions.I think this command should read:gpart delete -i 2 mmcsd1
Any ideas regarding that flood of messages?Does anybody know why when I run FreeBSD 11.1 form eMMC I get 800 or so lines:
Card did not respond to voltage select!
?
It looks to be u-boot output, and eventually FreeBSD boots and works properly. The same BBB boots fine from an SD card.
[EDIT] It's not u-boot, but ubldr.bin output. Those warnings start right after jumping to ubldr.bin address.