前言
Intel 已經沒有維護了才拿出來玩...物盡其用就把它當作小PC使用吧!
BIOS
joule-firmware-2017-06-02-1H3-public
[註]:千萬不要用最新的版本1J2,我當初刷下去後開機會卡在BIOS無法使用
OS
內存:
eMMC 8GB
內建Yocto作業系統
不建議刷掉此作業系統,
作業系統已經設好serial consle,
可以只接serial line直接連進機器
[註]:shutdown -r 0 //Yocto重開機指令
SDCard:
安裝ubuntu-18.04.3-server
安裝過程:
CPU是x86架構沒什麼困難
只要想辦法把OS塞進SDCard插進板子就沒問題了
我下載ubuntu-18.04.3-live-server-amd64.iso
直接使用PC將ubuntu安裝至SDCard
安裝完成順便安裝套件wireless-tools、wpa_supplicant、firmware-iwlwifi
機器插入SDCard,接上HDMI、鍵盤開機
為了方便使用serial line直接Debug,
設定serial consle,Grub及Ubuntu的sericl consle參照下方設定
設定完成後開機過程包含BIOS都可以透過serial去做操作
[註]:baud rate 115200
Serial Consle
GRUB
https://c4691294.coding.me/Linux/Ubuntu-18-04配置serial-console/
我這邊找到serial port是掛在ttyS6
使用dmesg | grep tty
在Yocto跟Ubuntu比對查找
我這邊找到serial port是掛在ttyS6
使用dmesg | grep tty
在Yocto跟Ubuntu比對查找
/etc/default/grub
mowei@mowei:/etc/default$ vim grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS6,115200n8"
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
sudo update-grub
\boot\grub\grub.cfg
下面似乎無效改用getty@.service
vim /etc/init.d/ttyS6.conf
\boot\grub\grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd3,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
else
search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
play 480 440 1
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd3,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
else
search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
fi
echo 'Loading Linux 4.19.0-14-amd64 ...'
linux /boot/vmlinuz-4.19.0-14-amd64 root=UUID=2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-14-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
menuentry 'Debian GNU/Linux, with Linux 4.19.0-14-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-14-amd64-advanced-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd3,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
else
search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
fi
echo 'Loading Linux 4.19.0-14-amd64 ...'
linux /boot/vmlinuz-4.19.0-14-amd64 root=UUID=2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-14-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-14-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-14-amd64-recovery-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd3,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
else
search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
fi
echo 'Loading Linux 4.19.0-14-amd64 ...'
linux /boot/vmlinuz-4.19.0-14-amd64 root=UUID=2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-14-amd64
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Systemd
# ttyS6 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty -L 115200 ttyS6 vt100
getty@.service
sudo nano /lib/systemd/system/serial-getty@.service
First we need to edit the serial-getty service to set the correct bard rate.
# Edit this line
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
# To This
ExecStart=-/sbin/agetty 115200 %I $TERM
Set this to the bard rate that you wish to use. This should be the same at the computer is using at the other end.
systemctl daemon-reload
# For a USB serial adaptor
systemctl enable serial-getty@ttyUSB0.service
# For a built in serial port /dev/ttyS6
systemctl enable serial-getty@ttyS6.service
NetWork
抓取iwlwifi-8000C 至/lib/firmware
modprobe -r iwlwifi; modprobe iwlwifi
安裝wpa_supplicant
sudo ifconfig wlp1s0 up
sudo iwlist wlp1s0 scan
sudo wpa_passphrase EssidName Pass | sudo cat >> /etc/wpa_supplicant/wpa_supplicant.conf
sudo wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -i wls1p0
sudo dhclient wlp1s0
Network設定
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
allow-hotplug wlp1s0
iface wlp1s0 inet dhcp
wireless-essid EssidName
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Bluetooth 設定
https://chenhh.gitbooks.io/ubuntu-linux/content/bluetooth.html
wget http://ftp.tw.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-iwlwifi_20190114-2_all.deb
dpkg -i firmware-iwlwifi_20190114-2_all.deb
sudo apt-get install bluez* bluetooth rfkill
hciconfig -a
sudo hciconfig info
sudo hciconfig hci0 up
sudo hcitool scan
留言
張貼留言