LeMaker Guitar:How to update Linux platform firmware

From BananaPro/Pi
Jump to: navigation, search
Translate this page; This page has changes since it was last marked for translation.

Other languages:
English • ‎中文(简体)‎

Introduction

Linux platform firmware package is named as xxx.hwpack.tar.xz. You can download the Linux platform firmware package to update your LeMaker Guitar’s booloader, u-boot, linux kernel, and rootfs. The following steps running on LeMaker Guitar will teach you how to update system firmware.

Notice: mmcblkX represents mmcbkl0, or mmcblk1. When the OS boot from eMMC NAND Flash, /dev/mmcblk0 is the device node of eMMC NAND Flash. If you insert a MicroSD card into MicroSD card slot, you will find /dev/mmcblk1 become the device node of MicroSD card. But when the OS boot from the MicroSD card, /dev/mmcblk0 is the device node of MicroSD card, and /dev/mmcblk1 is the device node of eMMC NAND Flash. You should clearly know which storage media you're going to update the firmware on.

Get Linux platform firmware package

We can download a pre-built firmware package or build from scratch to get the firmware package. Here we describe how to download a firmware package:

sudo apt-get update
sudo apt-get install git
sudo mkdir -p /home/lemaker/git
cd /home/lemaker/git
git clone https://github.com/LeMaker/hwpack-actions

We also can refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP to generate the Linux platform firmware that was be saved in the output directory.

Extract Linux platform firmware package

Extract the firmware package, we will get three directories: bootloader, kernel, rootfs.

sudo -s
cd hwpack-actions/lemaker_guitar
tar Jxvf xxx.hwpack.tar.xz


Update bootloader.bin

sudo fdisk -l
cd bootloader/
sudo dd if=bootloader.bin of=/dev/mmcblkX bs=512 seek=4097


Update u-boot

sudo dd if=u-boot-dtb.img of=/dev/mmcblkX bs=512 seek=6144
sync


Update misc.img

cd ../kernel/
sudo dd if=misc.img of=/dev/mmcblkXp1
sync

or

cd ../kernel/
sudo mkdir /mnt/misc1
sudo mkdir /mnt/misc2
sudo mount -o loop misc.img /mnt/misc1
sudo mount /dev/mmcblkXp1 /mnt/misc2
sudo cp -a /mnt/misc1/* /mnt/misc2/
sync
sudo umount  /mnt/misc1
sudo umount  /mnt/misc2


Update filesystem

cd ../rootfs/
sudo rm -rf /lib/modules
sudo cp -a etc/* /etc/
sudo cp -a lib/* /lib/
sudo cp -a usr/* /usr/
sudo reboot

You can refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_make_LeMaker_Guitar_OS_image to know more about MicroSD card layout