-
Notifications
You must be signed in to change notification settings - Fork 0
Loading Linux on Macho Man
###Setup
Clone Toolchain-Release and then run ./update-repos.py and ./build-repos.py.
###Install
-
Plug in a USB drive, and run
sudo fdisk -lto locate it. If it is mounted, unmount it usingsudo umount /dev/[DRIVE]. -
Navigate to
Toolchain-Release/Installand runsudo ./prep_usb.sh /dev/sd<whatever>, making sure that you're running e.g./dev/sdcnot/dev/sdc1. This will put everything on the drive. -
Plug the USB in to Macho Man, turn the boot header on by putting a jumper on the headers labelled "Jumper to boot from UART", and plug in the TTL cable. The black wire will be next to the white dot by the port.
-
Navigate to
Toolchain-Release/Toolchain/morepork-u-boot/utiland runsudo ./uartflash.py -p /dev/TTLPORT. The TTL port will be something like/dev/ttyUSB0. This utility will send the bootloader to the board and boot from USB. -
The uartflash program will launch xmodem as an interface, close it using
Ctrl-\ q. A better solution is to use GNU screen by runningsudo screen /dev/ttyUSB0 115200, where ttyUSB0 is the TTL port and 115200 is the baud rate. -
You can now talk to the board's linux environment.
###Making Changes
When you want to change things, there's two things to know:
-
When you're compiling a repository in Toolchain-Release, always do it by going to the repository you want to build and doing
../../build-repos.py --this-dir. This makes sure that dependencies get met and things are installed into the right place. -
Unless you run build-repos with the repository
bundle-morepork, if you then do anotherprep_usb.shyour changes won't make it onto the file system. So either copy individual files to the USB (they live inToolchain-Release/Install/rootfs/or run the fullbuild-repos.pybefore making a new file system.
###The Kernel
The way the kernel build works, is that it has three artifacts:
-
The compiled device tree binary. This will have the same name as the device tree but the suffix
.dtband live inToolchain-Release/Install/rootfs/boot/. -
The zipped kernel binary. This will be called zImage and live in
Toolchain-Release/Install/rootf/boot/. -
The modulized kernel drivers. These live in
Toolchain-Release/Install/rootfs/lib/modules/and you need the whole directory
The kernel, when it boots, will refuse to load modules that don't have the same build hash as it. The board will still boot, but if you had any drivers you were relying on, they won't run.
Also, since drivers get put in subdirectories according to their build hash in that directory, it can build up a lot of old drivers that should be deleted every now and again.