1. 程式人生 > >BeagleBone Black 開機初始化操作

BeagleBone Black 開機初始化操作

beaglebone black 開機初始化操作



0:下載BeagleBone Black操作系統鏡像:

https://debian.beagleboard.org/images/

當前最新的是:

https://debian.beagleboard.org/images/bone-debian-9.2-iot-armhf-2017-10-10-4gb.img.xz


下載後,解壓得到:bone-debian-9.2-iot-armhf-2017-10-10-4gb.img

用dd命令或者Win32DiskImager寫入到TF卡中,建議大於等於4G




1,登錄到bbb,並切換到root權限

Xshell:\> ssh [email protected] #從路由器可以看到BeagleBone Black的IP
password:                    #密碼:temppwd
debian@beaglebone:~$ sudo -s #密碼:temppwd
root@beaglebone:~# userdel -r debian


root@beaglebone:~# vim /etc/ssh/sshd_config
將
#PermitRootLogin prohibit-password
改為
PermitRootLogin yes
#重啟SSHD服務
root@beaglebone:~# /etc/init.d/ssh restart



2,做必要的軟件安裝/卸載

root@beaglebone:~# apt-get update
root@beaglebone:~# apt-get install psmisc
root@beaglebone:~# apt-get autoremove apache2
root@beaglebone:~# apt-get autoremove nodejs
root@beaglebone:~# apt-get install -f
root@beaglebone:~# apt-get autoremove -f



3,擴容

查找腳本路徑
root@beaglebone:~# find / -iname "grow_partition.sh"
/opt/scripts/tools/grow_partition.sh
root@beaglebone:~# 

查看當前磁盤剩余
root@beaglebone:~# df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  217M     0  217M   0% /dev
tmpfs          tmpfs      49M  5.6M   44M  12% /run
/dev/mmcblk0p1 ext4      3.3G  1.6G  1.5G  52% /
tmpfs          tmpfs     244M     0  244M   0% /dev/shm
tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs          tmpfs     244M     0  244M   0% /sys/fs/cgroup
tmpfs          tmpfs      49M     0   49M   0% /run/user/1000
tmpfs          tmpfs      49M     0   49M   0% /run/user/0
root@beaglebone:~# 

執行擴容腳本
root@beaglebone:~# /opt/scripts/tools/grow_partition.sh
root@beaglebone:~# reboot    #手動重新上電,開機
Xshell:\> ssh [email protected]
root@beaglebone:~# df -hT    #擴容成功
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  217M     0  217M   0% /dev
tmpfs          tmpfs      49M  4.9M   44M  11% /run
/dev/mmcblk0p1 ext4      7.4G  1.6G  5.5G  23% /
tmpfs          tmpfs     244M     0  244M   0% /dev/shm
tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs          tmpfs     244M     0  244M   0% /sys/fs/cgroup
tmpfs          tmpfs      49M     0   49M   0% /run/user/0
root@beaglebone:~#




4,其他參考信息:

內存:
root@beaglebone:~# free -m 
              total        used        free      shared  buff/cache   available
Mem:            487          28         375           4          83         443
Swap:             0           0           0
root@beaglebone:~# 

磁盤:
root@beaglebone:~# fdisk -l
Disk /dev/mmcblk0: 7.5 GiB, 8061452288 bytes, 15745024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe6537755

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *     8192 15745023 15736832  7.5G 83 Linux
root@beaglebone:~# 

CPU信息
root@beaglebone:~# cat /proc/cpuinfo 
processor	: 0
model name	: ARMv7 Processor rev 2 (v7l)
BogoMIPS	: 995.32
Features	: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x3
CPU part	: 0xc08
CPU revision	: 2

Hardware	: Generic AM33XX (Flattened Device Tree)
Revision	: 0000
Serial		: 0000000000000000
root@beaglebone:~# 


進程信息
root@beaglebone:~# pstree -ac
systemd
  ├─agetty --noclear tty1 linux
  ├─agetty --keep-baud 115200,38400,9600 ttyS0 vt220
  ├─agetty --keep-baud 115200,38400,9600 ttyGS0 vt220
  ├─atd -f
  ├─avahi-daemon
  │   └─avahi-daemon
  ├─cgmanager -m name=systemd
  ├─connmand -n --nodnsproxy
  ├─cron -f
  ├─dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
  ├─dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service
  ├─haveged --Foreground --verbose=1 -w 1024
  ├─rsyslogd -n
  │   ├─{in:imklog}
  │   ├─{in:imuxsock}
  │   └─{rs:main Q:Reg}
  ├─sshd -D
  │   └─sshd    
  │       └─bash
  │           └─pstree -ac
  ├─systemd --user
  │   └─(sd-pam)  
  ├─systemd-journal
  ├─systemd-logind
  ├─systemd-timesyn
  │   └─{sd-resolve}
  ├─systemd-udevd
  └─wpa_supplicant -u -s -O /run/wpa_supplicant
root@beaglebone:~#




本文出自 “李春利” 博客,請務必保留此出處http://990487026.blog.51cto.com/10133282/1977967

BeagleBone Black 開機初始化操作