Expand Primary Partition
If you're flashing the image to say a 16gb SD card, you'll notice that there isn't a first boot script yet like you see with the Rpi that will auto expand the primary partition so you can utilize all of the remaining free space of your SD. This guide will help you reclaim the free space to actually make the system usable for growth.
- Secondary linux system (VirtualBox VM is always a good quick option)
- SD card slot, or SD to USB adapter for host machine
Once the requirements are in place, this guide will walk you through expanding the partition: https://elinux.org/RPi_Resize_Flash_Partitions#Manually_resizing_the_SD_card_on_Linux
NOTE: If you currently have critical data on the card, back it up first.
Great blog on Hackster.io to do this.
Here is a shorten version of the blog.
df -h this will show the SD card at only 6.4g
p to show partitions, take note of the start number for the second partition ####### /dev/mmcblk0p2 it should be something like 544768
Press Enter for default last sector
Resolve APT Release File Errors
The second you use apt-get to install a package you may notice a release file error such as the following...
E: Release file for file:///var/lib/local-apt-repository/./Release is not valid yet (invalid for another 223d 12h 43min 26s). Updates for this repository will not be applied.
The issue is actually a simple one... date/time
- Run: timedatectl set-ntp yes
- Run: timedatectl set-timezone America/Chicago (timedatectl list-timezones will list all timezone options)
- Run: apt-get update
FTDI & Usbserial Drivers for USB Serial Support
The shipped image doesn't include any USB Serial support at all. I rebuilt the kernel headers then went ahead and built a driver for FTDI support and the basic usbserial driver for linux. I've attached the drivers to this post along with quick steps on importing it so everyone doesn't have to go through the fun of building the kernel headers and drivers like I did... However I'll make a follow up post detailing the steps you need to take if you want to build new support into the current kernel.
- SSH to your maaxboard
- mkdir /lib/modules/4.14.78/kernel/drivers/usb/serial
- chmod 775 /lib/modules/4.14.78/kernel/drivers/usb/serial
- Copy the attached ftdi_sio.ko and usbserial.ko files to your maaxboard (I use SCP scp files root@maaxboard-ip:/root)
- If you've copied the files to /root, now run cp ftdi_sio.ko usbserial.ko /lib/modules/4.14.78/kernel/drivers/usb/serial
- Plug your device in...
- run dmesg and you should now see that the device was detected and attached to /dev/ttyUSB*
NOTE: usbserial.ko is required by ftdi_sio.ko
[10945.237618] ftdi_sio 3-1:1.0: FTDI USB Serial Device converter detected
[10945.244411] usb 3-1: Detected FT232RL
[10945.248652] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0
ftdi_maaxboard.zip 39.5 KB
Fix corrupted libqmi-glib5 package
When utilizing apt you might notice an error such as:
ldconfig: /usr/lib/aarch64-linux-gnu/libqmi-glib.so.5.4.0 is not an ELF file - it has the wrong magic bytes at the start.
This seemed to be apparent in several instances of the shipped image. The fix is to simply reinstall the parent package libqmi-glib5:
- apt-get reinstall libqmi-glib5
libIL.so.1 is not a symbolic link
You'll notice this error from ldconfig while using apt. The solution is to install the missing parent package libdevil1c2:
- apt-get install libdevil1c2
libOpenVG.so is not a symbolic link
Another ldconfig warning you'll see when using apt is related to libOpenVG.so. This is is a bit more strange and maybe someone from embest/avnet can respond on this. The error is:
ldconfig: /usr/lib/aarch64-linux-gnu/libOpenVG.so is not a symbolic link
It's complaining that the lib is not a symbolic link, but if we look further we can see that the accompanied file libOpenVG.3d.so is actually the same exact file as libOpenVG.so:
root@maaxboard:~# md5sum /usr/lib/aarch64-linux-gnu/libOpenVG*
I'm not sure why this is the case, or if my method is OK/correct, but you can suppress this error by renaming the file. I chose not to remove it just in case something creeps up as a need or alternate fix:
- mv /usr/lib/aarch64-linux-gnu/libOpenVG.so /usr/lib/aarch64-linux-gnu/libOpenVG.so.OLD
1 of 1 people found this helpful
Compiling modules/drivers for kernel 4.14.78
Previously I shared serial related drivers that I compiled for my needs. You may come across support that's missing for your needs, so I thought I'd share how you can compile just what you need which will also lead you on the path of even building your own custom kernel if you choose.
EDIT: I'm somehow just now seeing this... the embest dropbox has a few more details than the resource page: https://www.dropbox.com/sh/ft2o8olt88vm9mi/AAA6RN54yQq6J41JgTphgCDda/01Doc/UM?dl=0&preview=MaaXBoard-Linux-Development_Guide-V1.0-EN.pdf&subfolder_nav_tracking=1
^^Use that if you're compiling from a host machine.
- Copy of the v1.1.1r10 source.
- packages for compiling
- It's actually easiest to build directly from the maaxboard unless you're proficient in correctly cross compiling from another host. If you choose to build from the maaxboard, go ahead and load the base shipped image to a dedicated SD so you're not working from within your current setup
- Once the maaxboard is up, ssh as root with the default pass avnet
- Fix timedate issues first mentioned HERE
- Run apt-update
- Install wget & unrar: apt-get install wget unrar
- Install tools for building: apt-get install build-essential libncurses5-dev gcc libssl-dev bc
- For simplicity sake, make sure you're in /root: cd /root
- Now let's pull the source RAR from the dropbox link. Reason I suggest this is there is a higher risk of corruption if you're downloading, unpacking, uploading, unpacking... 1 hop directly to the device is best: wget https://www.dropbox.com/sh/ft2o8olt88vm9mi/AABd76gFyXGhd-cGU8RDM89la/02Linux/01LinuxSourceCode/MaaXBoard-LinuxSourceCode…
- Unrar the file: unrar e rarfile.rar
- Extract linux_4.14.78_develop_3d21737092eb.tar.gz: tar -zxvf tarfile.tar.gz (I can't remember if this dumps to a tar file next, if so extract it with tar xvf file.tar)
- You should now have a linux directory: cd linux
This is the directory you'll want to run all the following commands from. At this point you could build your own config, but it's best to have a starting point that you know is compatible... which is why we will load the config stored in the source directory /root/linux/arch/arm64/configs/em-sbc-imx8m_defconfig <-- copy this path since you'll need it shortly.
- Now we will load the ncurses menu to simplify selecting the tweaks we want to make. Run: make menuconfig
- In the menu you'll notice a "load" option at the bottom. Select that and load the config we referenced above
- Now you're editing the em-sbc-imx8m_defconfig. I'll build ftdi serial support in this example, but you can modify the selection process to your needs.
- In my case since I'm adding in ftdi serial support I navigate to Device Drivers -> USB Support -> Enable USB Serial Peripheral Support.
- Now I go into the USB Serial Peripheral Support menu and flag USB Serial Generic Support and FTDI as Modules.
- Select save from the bottom menu and simply save as ".config" so you don't overwrite the default config.
Now rather than building the entire kernel for this purpose, we only want to build the modules we've selected. We will need to specify a path in our make command and you can almost guess the path based on the menu selections we made, but you can also run: find . -name "ftdi*" to find the location of the source & header files. In this case, the path is drivers/usb/serial
- Compile the module: make -C . M=path (this will compile all modules in the path)
Once completed you should now have .ko files in the same path which are the compiled modules. The last thing to do is copy them to the active module path and load them.
- Run: cp path/to/.ko /lib/modules/4.14.78/kernel/drivers/usb/serial
- Probe/Load new modules: depmod
Thanks for this tutorial, I only have a small comment: I could only get it to work by adding a few steps after your step 6 (saving the config):
After that, I was able to build the correct modules.
Now that we have the official Debian image for the MaaxBoard we have been tearing away at building the system for our needs. In the process we are coming across some changes and modifications that I'll log in this thread to hopefully save others some time. We are also feeding these details directly to our Avnet engineering team to hopefully help refine future image releases.
I'll try to keep this as organized as possible so I'll update this initial post with quick links to future posts to help save everyone some time on reading through posts that aren't related to what they are searching for:
- FTDI & Usb Serial Support (Pre-Built drivers attached)