User Tools

Site Tools


computing:beaglebone

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:beaglebone [2019/04/06 20:14] oemb1905computing:beaglebone [2023/02/27 00:54] (current) oemb1905
Line 6: Line 6:
  
 ------------------------------------------- -------------------------------------------
 +==Installing Debian on Beagle Boards==
  
-To locate device if auto-mounted +Insert microsd on host workstation, unmount in order to write the .img to the disk
-  sudo dmesg+
  
 +  sudo dmesg
   umount /dev/mmcblk0p1   umount /dev/mmcblk0p1
  
-Optional: use fdisk to remove the partition first before dding ... use blkdiscard before+Write the debian image to the SD Card using dd command
  
   sudo dd of=/dev/mmcblk0 if=/home/sexa/Downloads/bone-debian-9.2-iot-armhf-2017-10-10-4gb.img bs=1M conv=fdatasync [or && sync]   sudo dd of=/dev/mmcblk0 if=/home/sexa/Downloads/bone-debian-9.2-iot-armhf-2017-10-10-4gb.img bs=1M conv=fdatasync [or && sync]
  
-After this, pull out SD card.  Plug back in.  Locate where it mounted, prepare to edit file to allow it to run the installer upon boot.  This is located in boot/enV.txt relative to wherever the media mounted.  Eg., cd /media/sexa/rootfs/boot/+Pull out the SD card and then put back in so that it mounts read/write and then edit
  
-  cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh+  vi /media/username/rootfs/boot/uEnv.txt 
 +  cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh [uncomment this line in the config]
  
-Get out of the directory asap.  then:+Use screen and a serial usb adapter to oversee the installation since ssh will likely get broken during the post-install cleanup. 
 +The adapter's tx goes to bb's rx, and so on.  For the beaglebone black pin setup, see bit.ly/2DhU6Vx
  
-  umount /dev/mmcblk0p1+  sudo screen /dev/ttyUSB0 115200 [Example]
  
-Now that the image has been turned into an installeryou may put the microSD card into the Beagle Bone (without power).  +Once the device powers offremove the microSD card or it will flash the eMMC again and again.  Now, prepare the bb 
 +for shell access by editing your ssh config:
  
-On a typical serial to USB adapter, and almost all others, the colors are white (receive), green (transmit), black (ground), red (5V power).  Do not use the red cable unless you know what you are doing.  Otherwise, make sure that the adapter's transmit goes to the Beagle's receive, and the adapter's receive to the Beagle's transmit.  The diagram below shows the Beagle's perspective. From left to right, there are 6 pins, so it would be : nothing, white, green, nothing, nothing, black.  The adapter commonly has a name like ttyUSB0, therefore this command should do the trick:  +  vi /etc/ssh/sshd_config  
-   +  <PermitRootLogin yes>
-  sudo screen /dev/ttyUSB0 115200 +
-   +
-{{:computing:b1.jpg?400|}}+
  
-Once the Beagle Bone is set upone can leverage the screen command with ssh to tunnel to another hostand then pass a screen command to keep the commands you initiate persistent on the client you connected to.  That syntax looks like this:+Add a password for rootthen test the shell accessadd the public keysto the authorized_keys file
  
-  ssh -p 222 -t user@host.com screen -DRO+  ssh root@xx.xx.xx.xx 
 +  ssh-copy-id root@xx.xx.xx.xx 
 +  vi /root/.ssh/authorized_keys [copy and paste the pub keys]
  
 +==Clean Up Post-Install==
  
-Some other common speeds are 9600, 57600, 38400, 19200.  For the Beagle Bone black, I always use 115200.  These speeds are in baud.+Install deborphan in order to remove hanging dependencies from apps that we will later strip.
  
--- -- -- -- -- -- +  apt-get install screen deborphan ntp 
  
-This section below is from some revisions I wrote for Jason's beaglebone stripping tutorial ..+The new version has an ntp server, but retaining here in case setting up legacy system Now, prepare  network interfaces:
  
-==Clean Up Post-Install==+  vi /etc/network/interfaces  
 +  <uncomment these parameters> 
 +  auto eth0 
 +  iface eth0 inet dhcp 
 +  <comment out any other paramaters besides loopback>
  
-  apt-get install screen deborphan ntp +It is now time to strip the bb of the stock apps, etc.  If you prefer to use ssh over serial, then use screen as follows: 
 +   
 +  ssh -t root@xx.xx.xx.xx screen -DRO 
  
-the new version has an ntp server+Now, let's remove the unnecessary packages (as root) - but bear in mind that these may change in future releases:
  
-be sure to fix /etc/network/interfaces before removing connman - uncomment the lines for DHCP for eth0, remove extraneous lines and the manual entry that comes stock with bbb ... then connect to the beaglebone with ssh and screen ...+  for i in c9-core-installer udhcpd chromium-codecs-ffmpeg-extra connman lximage-qt lxmenu-data pcmanfm-qt qupzilla xserver-xorg-core "light*" chromium-browser nodejs "lxqt*" xserver-common "apache2*" bluez "xfonts*" "x11-*" "x11proto-*" build-essential alsa-utils; do apt-get -y purge $i; done 
 +  apt remove --purge c9-core-installer bonescript bone101
  
-  ssh -t root@<x.x.x.x> screen -DRO  +Sometimes ssh hangs at this stageso if souse serial.
- +
-  for i in udhcpd chromium-codecs-ffmpeg-extra connman lximage-qt lxmenu-data pcmanfm-qt qupzilla xserver-xorg-core "light*" chromium-browser nodejs "lxqt*" xserver-common "apache2*" bluez "xfonts*" "x11-*" "x11proto-*" build-essential alsa-utils; do apt-get -y purge $i; done +
- +
-After this command, the ssh session hung, and we could only access with screen at a different speed of 9600 ... butas long as you took care of /etc/network/interfaces abovethen a reboot (worst case) or waiting should bring it back up.+
  
   apt-get --purge autoremove    apt-get --purge autoremove 
 +  apt-get --purge remove `deborphan`
  
-  apt-get --purge remove `deborphan` OR [apt-get purge `deborphan`] OR [apt-get purge $(deborphan)]+Run this last command a few times until everything is removed.
  
-run deborphan a few times untill all is removed+  apt-get dist-upgrade 
 +  apt-get clean
  
-  apt update +Change hostname, remove the splash/motd 
-  apt dist-upgrade +
-  apt clean +
- +
-edit /etc/issue.net to remove the goofy ssh splash+
  
 +  vi /etc/hosts
 +  vi /etc/hostname
 +  vi /etc/issue.net to remove the goofy ssh splash
 +  
 +Edit logs and cron to limit writes
 +  
   cd /var/log && rm lastlog && ln -s /dev/null lastlog   cd /var/log && rm lastlog && ln -s /dev/null lastlog
   cd /etc/cron.daily && mv man-db man-db.disabled [if it exists]   cd /etc/cron.daily && mv man-db man-db.disabled [if it exists]
  
-to find latest writes to disk: find / -mount -newermt 14:44:00 [to see what logs are post-updates, i.e., for limiting writes to eMMC]+To find latest writes to disk: find / -mount -newermt 14:44:00 [to see what logs are post-updates, i.e., for limiting writes to eMMC]
  
-Verify /etc/fstab configuration, include noatime like this example+Verify /etc/fstab configuration, include noatime, for example:
  
-  FROM FSTAB: 
   UUID=57e4a3f6-7951-40ae-ad25-b445959e1c30  /  ext4  noatime,errors=remount-ro  0  1   UUID=57e4a3f6-7951-40ae-ad25-b445959e1c30  /  ext4  noatime,errors=remount-ro  0  1
   debugfs  /sys/kernel/debug  debugfs  defaults  0  0   debugfs  /sys/kernel/debug  debugfs  defaults  0  0
  
-#if we use an external sdcard, we are less concerned with re-writes, so enable the logs on the sdcard (create directories for each location below, mountpoints, etc.)+#If we use an external sdcard, we are less concerned with re-writes, so enable the logs on the sdcard (create directories for each location below, mountpoints, etc.)
   UUID=eb885f2f-28a4-49a6-99c9-3f8b0b7a871d /sdcard ext4 noatime,nofail,errors=remount-ro  0  2   UUID=eb885f2f-28a4-49a6-99c9-3f8b0b7a871d /sdcard ext4 noatime,nofail,errors=remount-ro  0  2
  
Line 89: Line 99:
   /sdcard/var/lib/ntp    /var/lib/ntp   none bind,nofail 0 0   /sdcard/var/lib/ntp    /var/lib/ntp   none bind,nofail 0 0
  
-End of Jason's stripping tutorial ...+Removing bloat update 
 +   
 +  sudo systemctl stop cloud9.service cloud9.socket 
 +  sudo systemctl disable cloud9.service cloud9.socket 
 +  sudo rm -rf /var/lib/cloud9 /opt/cloud9 /etc/default/cloud9 /lib/systemd/system/cloud9.* 
 +  sudo systemctl daemon-reload                   
 +  sudo systemctl stop bonescript-autorun.service bonescript.service bonescript.socket 
 +  sudo systemctl disable bonescript-autorun.service bonescript.service bonescript.socket 
 +  sudo rm -rf /lib/systemd/system/bonescript* /usr/local/lib/node_modules/bonescript 
 +  sudo systemctl daemon-reload 
 +  sudo apt remove -purge apache2* nginx* 
 +  cd /opt/ 
 +  rm -rf * 
 +  sudo apt autoremove
  
--- -- -- -- -- +Debian Bullseye sources.list
  
-This tutorial is a designated "Invariant Section" of the "Technotronic" section of Haack's Wiki as described on the [[https://jonathanhaack.com/dokuwiki/doku.php?id=start|Start Page]].  This does not include the sections quoted from Jason's tutorial.+  deb http://deb.debian.org/debianbullseye main contrib non-free 
 +  #deb-src http://deb.debian.org/debian/ bullseye main contrib non-free 
 +  deb http://security.debian.org/debian-security bullseye-security main contrib non-free 
 +  #deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free 
 +  deb http://deb.debian.org/debian bullseye-updates main contrib non-free 
 +  #deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free 
 +  deb [arch=armhfhttp://repos.rcn-ee.com/debian/ bullseye main 
 +  #deb-src [arch=armhf] http://repos.rcn-ee.com/debian/ bullseye main
  
- --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2019/01/13 12:22// +This tutorial is a designated "Invariant Section" of the "Technotronic" section of Haack's Wiki as described on the [[https://jonathanhaack.com/dokuwiki/doku.php?id=start|Start Page]].
-  +
  
 + --- //[[jonathan@haacksnetworking.org|oemb1905]] 2023/02/26 17:52//
computing/beaglebone.1554581644.txt.gz · Last modified: 2019/04/06 20:14 by oemb1905