LeMaker Guitar:How to update Linux platform firmware

From BananaPro/Pi
Jump to: navigation, search
This page is a translated version of the page LeMaker Guitar:How to update Linux platform firmware and the translation is 100% complete.

Other languages:


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

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

Update misc.img

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


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/
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