/
README.BBB
163 lines (134 loc) · 6.23 KB
/
README.BBB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# FPP BBB Images creation notes (work in progress)
#
# FPP images are currently based on the following Debian BeagleBone images:
# am335x-debian-11.7-minimal-armhf-2023-05-18-2gb.img.xz
# from https://rcn-ee.net/rootfs/bb.org/testing/2023-05-18/bullseye-minimal-armhf/
#
# The below steps (much can be run via copy/paste into a terminal) will
# prepare the "clean image" from above to have the appropriate
# dependencies installed, kernel updated, bootloaders, etc... ready
# to run the FPP_Install script. At this point, parts of it
# require editing of text files with nano. In particular the
# /boot/uEnv.txt file and the various files in /lib/systemd/system
#
# Make sure you read all the comment in this file and follow
# any instructions they may specify.
#
# This NEEDS to be done on a Beaglebone Black variant that
# contains an eMMC (so not a PocketBeagle) and it will wipe out
# the contents of the eMMC. We setup the system on the eMMC
# and then copy the system to the SD card
# Burn the above image onto an SD card and insert into the BBB and boot
# Login with default debian:temppwd then "sudo bash" to become root
cd /tmp
wget https://raw.githubusercontent.com/FalconChristmas/fpp/master/SD/BBB-FlashMMC.sh
chmod +x BBB-FlashMMC.sh
./BBB-FlashMMC.sh -noreboot ext4 /dev/mmcblk1
#copy the ssh keys to allow it to boot and avoid
#having to reset known_hosts while building image
mount -t ext4 /dev/mmcblk1p1 /mnt
cp -a /etc/ssh/* /mnt/etc/ssh
shutdown -h now
#That will flash the buster-console image to the internal eMMC and then shutdown
#Remove the SD card and restart the BBB, re-login with default debian:temppwd
#then "sudo bash" to become root
apt-get update
apt-get -y upgrade
# Need to make sure we get the latest systemd config
echo "#Backports" >> /etc/apt/sources.list
echo "deb http://deb.debian.org/debian bullseye-backports main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
apt-get update
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -t bullseye-backports install systemd udev systemd-resolved wpasupplicant
apt-get install wget
# This MAY cause the beagle to change IP addresses, reboot to get things to settle and continue
rm -f /etc/systemd/network/50-default.network
wget -O /etc/systemd/network/50-default.network https://raw.githubusercontent.com/FalconChristmas/fpp/master/etc/systemd/network/50-default.network
sed -e 's/LinkLocalAddressing=fallback/LinkLocalAddressing=yes/' /etc/systemd/network/50-default.network
systemctl reload systemd-networkd
systemctl unmask systemd-networkd
systemctl unmask systemd-resolved
systemctl restart systemd-networkd
systemctl restart systemd-resolved
systemctl enable systemd-networkd
systemctl enable systemd-resolved
#check
cd /root
export NEW_KERNEL_VERSION=5.10.162-fpp_5.10.162-fpp-1
wget https://github.com/FalconChristmas/fpp-linux-kernel/raw/master/debs/linux-image-${NEW_KERNEL_VERSION}_armhf.deb
wget https://github.com/FalconChristmas/fpp-linux-kernel/raw/master/debs/linux-headers-${NEW_KERNEL_VERSION}_armhf.deb
dpkg -i *.deb
rm -f *.deb
apt-get remove -y --purge --autoremove linux-image-$(uname -r) linux-headers-$(uname -r) bbb.io-kernel-5.10-ti bbb.io-kernel-tasks
# delete old kernels and modules in /boot and /lib/modules
# and in /boot/dtbs and any initrd's
rm -rf /lib/modules/$(uname -r)
rm -rf /boot/dtbs/$(uname -r)
rm -rf /boot/initrd.img*
# remove a bunch of source that is not needed, free's up space
rm -f /etc/modules-load.d/roboticscape_modules.conf
rm -rf /usr/local/lib/node_modules
rm -rf /var/lib/cloud9
rm -rf /opt/source/Robotics_Cape_Installer
rm -rf /opt/source/dtb*
rm -rf /opt/source/u-boot*
rm -rf /opt/source/rcpy
rm -rf /opt/source/pyctrl
rm -rf /opt/source/fb-test-app*
rm -rf /opt/source/beagle-tester*
rm -rf /opt/source/dtb*
rm -rf /opt/source/BB*
rm -rf /opt/source/adafruit*
rm -rf /opt/source/Userspace*
rm -rf /opt/source/py-uio
rm -rf /opt/source/librobotcontrol
rm -rf /usr/local/bin/node-red*
rm -rf /var/cache/doc-beaglebone-getting-started
rm -rf /usr/share/beagle-tester
rm -rf /usr/sbin/beagle-tester*
rm -rf /lib/systemd/system/beagle-tester.service
rm -rf /etc/udev/rules.d/beagle-tester.rules
rm -rf /opt/cloud9
rm -rf /etc/avahi/services/cloud9.service
rm -f /var/local/bb_usb_mass_storage.img
rm -f /etc/bbb.io/templates/beaglebone-getting-started-2022-01-12.img
rm -rf /opt/u-boot/bb-u-boot-am57xx-evm
# blacklist bluetooth (needed if making image on BBGG or BBBW)
echo "blacklist bluetooth" > /etc/modprobe.d/blacklist-bluetooth.conf
echo "blacklist hci_uart" >> /etc/modprobe.d/blacklist-bluetooth.conf
echo "blacklist bnep" >> /etc/modprobe.d/blacklist-bluetooth.conf
# need to reboot so that the new kernel is picked up and used
reboot
#re-login in and make sure "df -k" reports 2.5G+ of space for /
cd /root
wget -O ./FPP_Install.sh http://raw.githubusercontent.com/FalconChristmas/fpp/master/SD/FPP_Install.sh
chmod 700 ./FPP_Install.sh
./FPP_Install.sh --img
# once FPP_Install is done, the wifi drivers and such are installed so the linux-headers
# are no longer needed, remove them to save 150MB of space
apt-get remove -y --purge --autoremove linux-headers-$(uname -r)
apt-get clean
# edit /etc/fstab and make sure it looks OK for tmpfs
reboot
#place 4G SD card in sd slot
# zero out everything unused so compressing the image will work better
dd if=/dev/zero of=/dev/mmcblk0 bs=1M status=progress count=3800
/opt/fpp/SD/BBB-FlashMMC.sh -s 3500M -noreboot -clear ext4 /dev/mmcblk0
rmdir /tmp/rootfs
# Put the SD card back in a Linux system and run the following (substitute
# the proper device name for your SD card in place of '/dev/sdc'):
VERSION=7.0-beta1
DEVICE=/dev/sdc
sudo dd if=${DEVICE} of=FPP-v${VERSION}-BBB.img bs=1M count=3572
# To create the squashfs image needed for OS updates
# On a separate Linux box: (this will take a LOOOONG time)
# mksquashfs is multithreaded so its recommended to use a multicore
# box for this and not an actual BBB
apt-get install squashfs-tools
mount ${DEVICE}1 /mnt
mksquashfs /mnt BBB-${VERSION}.fppos -b 512K -comp xz
cd /mnt/root
tar -czf ~/ccache-BBB-2022.x-v${VERSION}.tar.gz .ccache
cd ~
umount /mnt