Difference between revisions of "IoTGateway/BSP/Linux/iMX6/FAQ"
From ESS-WIKI
Line 56: | Line 56: | ||
*Prerequisites | *Prerequisites | ||
*#one free loop device with partition support | *#one free loop device with partition support | ||
− | *#prewritten script, | + | *#prewritten script tarball, [[:File:Mk_inand.tar.gz|mk_inand.tar.gz]]. |
*#the original sdcard <sub>([[IoTGateway/BSP/Linux/iMX6/Yocto_LBV3_User_Guide#To_build_sdcard_image|LBV3]]) ([[IoTGateway/BSP/Linux/iMX6/Yocto_LBV5_User_Guide#To_build_sdcard_image|LBV5]]) ([[IoTGateway/BSP/Linux/iMX6/Yocto_LBV6_User_Guide#To_build_sdcard_image|LBV6]])</sub> | *#the original sdcard <sub>([[IoTGateway/BSP/Linux/iMX6/Yocto_LBV3_User_Guide#To_build_sdcard_image|LBV3]]) ([[IoTGateway/BSP/Linux/iMX6/Yocto_LBV5_User_Guide#To_build_sdcard_image|LBV5]]) ([[IoTGateway/BSP/Linux/iMX6/Yocto_LBV6_User_Guide#To_build_sdcard_image|LBV6]])</sub> | ||
*#3700MB more available disk space | *#3700MB more available disk space | ||
Line 63: | Line 63: | ||
<div style="margin-left: 5em"><syntaxhighlight lang="bash"> | <div style="margin-left: 5em"><syntaxhighlight lang="bash"> | ||
$ export LODEV=$(sudo losetup -f) | $ export LODEV=$(sudo losetup -f) | ||
+ | $ export MKINAND=mk_inand.tar.gz | ||
$ export SDCARD=fsl-image-qt5-imx6qrsb4410a1.sdcard | $ export SDCARD=fsl-image-qt5-imx6qrsb4410a1.sdcard | ||
$ export LIV=4410A1LIV6000.img | $ export LIV=4410A1LIV6000.img | ||
Line 91: | Line 92: | ||
$ sudo cp ${MKSD} ~/mnt/p2/mk_inand/ | $ sudo cp ${MKSD} ~/mnt/p2/mk_inand/ | ||
$ sudo chmod +x ~/mnt/p2/mk_inand/${MKSD} | $ sudo chmod +x ~/mnt/p2/mk_inand/${MKSD} | ||
+ | $ cat << MKSD_EOF > ${MKSD} | ||
+ | #!/bin/bash | ||
+ | |||
+ | echo -e "\nTransfer U-Boot & Linux to target device\n" | ||
+ | |||
+ | [ $# -lt 1 ] && echo "Please input target device, e.g. ./mksd-linux.sh /dev/mmcblk0" && exit 1 | ||
+ | [ ! -e $1 ] && echo "Device $1 not found" && exit 1 | ||
+ | [ "`cat /sys/block/${1##*/}/device/type`" == "SD" ] && echo "Device $1 is type of SD." && exit 1 | ||
+ | |||
+ | echo "All data on "$1" now will be destroyed! Continue? [y/n]" | ||
+ | read ans | ||
+ | if [ $ans != 'y' ]; then exit 1; fi | ||
+ | |||
+ | echo 0 > /proc/sys/kernel/printk | ||
+ | |||
+ | echo "[Unmounting all existing partitions on the device ]" | ||
+ | |||
+ | umount $1* &> /dev/null | ||
+ | |||
+ | echo "[Partitioning $1...]" | ||
+ | |||
+ | DRIVE=$1 | ||
+ | |||
+ | cd ../image | ||
+ | |||
+ | filename="fsl-image*.sdcard" | ||
+ | current_filename=`ls | grep fsl-image*.sdcard` | ||
+ | |||
+ | if [ -e $filename ];then | ||
+ | echo "[Copy $current_filename image]" | ||
+ | dd if=$current_filename of=$1 &>/dev/null | ||
+ | else | ||
+ | echo $filename does not exist | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | echo "[Resize filesystems...]" | ||
+ | |||
+ | rootfs_start=`fdisk -u -l ${DRIVE} | grep ${DRIVE}p2 | awk '{print $2}'` | ||
+ | |||
+ | # Create partition table for extend root file system (/dev/mmcblk1p2) partition | ||
+ | fdisk -u $DRIVE << EOF &>/dev/null | ||
+ | d | ||
+ | 2 | ||
+ | n | ||
+ | p | ||
+ | 2 | ||
+ | $rootfs_start | ||
+ | |||
+ | w | ||
+ | EOF | ||
+ | |||
+ | if [ -x /sbin/partprobe ]; then | ||
+ | /sbin/partprobe ${DRIVE} &> /dev/null | ||
+ | else | ||
+ | sleep 1 | ||
+ | fi | ||
+ | |||
+ | e2fsck -f -y ${DRIVE}p2 &> /dev/null | ||
+ | resize2fs ${DRIVE}p2 &> /dev/null | ||
+ | |||
+ | if [ -x /sbin/partprobe ]; then | ||
+ | /sbin/partprobe ${DRIVE} &> /dev/null | ||
+ | else | ||
+ | sleep 1 | ||
+ | fi | ||
+ | |||
+ | echo 7 > /proc/sys/kernel/printk | ||
+ | echo "[Done]" | ||
+ | |||
+ | MKSD_EOF | ||
+ | |||
</syntaxhighlight></div> | </syntaxhighlight></div> | ||
Revision as of 11:28, 2 November 2016
Contents
Compiling
U-boot
Please refer to the following sections for details
Kernel
Please refer to the following sections for details
- Getting Started / Build Instructions / To build linux kernel (LBV3) (LBV5) (LBV6)
- Customization / Building & updating kernel/modules/dtb manually (LBV3) (LBV5) (LBV6)
Boot Logo
U-boot
Kernel
In Yocto Project, it is called "boot splashscreen", please refer to the each BSP's corresponding official Yocto website (list as below) for details
SDcard image
To build from prebuilt image, please refer to the following sections for details.
To build from BSP, please refer to the following sections for details.
How To Stress Test On a Linux
Perform the command as below:
stress -c 4 -i 4 -d 1 --hdd-bytes 512
How To create one LIV disk image of SD card
The LIV disk image of SD card is used to boot target device up and to install the entire system to on-baord eMMC.
- Prerequisites
- one free loop device with partition support
- prewritten script tarball, mk_inand.tar.gz.
- the original sdcard (LBV3) (LBV5) (LBV6)
- 3700MB more available disk space
- E.g.
$ export LODEV=$(sudo losetup -f)
$ export MKINAND=mk_inand.tar.gz
$ export SDCARD=fsl-image-qt5-imx6qrsb4410a1.sdcard
$ export LIV=4410A1LIV6000.img
$ cp ${SDCARD} ${LIV}
$ dd if=/dev/zero of=${LIV} bs=1M seek=3700 count=0
- using the following commands to create one
$ sudo losetup ${LODEV} ${LIV}
$ cat << EOF | sudo fdisk -u ${LODEV}
d
2
n
p
2
24576
w
EOF
$ sudo e2fsck -f ${LODEV}p2
$ sudo resize2fs ${LODEV}p2
$ mkdir -p ~/mnt/p2
$ sudo mount /dev/loop0p2 ~/mnt/p2
$ sudo mkdir ~/mnt/p2/{mk_inand,image}
$ sudo cp ${SDCARD} ~/mnt/p2/image/
$ sudo cp ${MKSD} ~/mnt/p2/mk_inand/
$ sudo chmod +x ~/mnt/p2/mk_inand/${MKSD}
$ cat << MKSD_EOF > ${MKSD}
#!/bin/bash
echo -e "\nTransfer U-Boot & Linux to target device\n"
[ $# -lt 1 ] && echo "Please input target device, e.g. ./mksd-linux.sh /dev/mmcblk0" && exit 1
[ ! -e $1 ] && echo "Device $1 not found" && exit 1
[ "`cat /sys/block/${1##*/}/device/type`" == "SD" ] && echo "Device $1 is type of SD." && exit 1
echo "All data on "$1" now will be destroyed! Continue? [y/n]"
read ans
if [ $ans != 'y' ]; then exit 1; fi
echo 0 > /proc/sys/kernel/printk
echo "[Unmounting all existing partitions on the device ]"
umount $1* &> /dev/null
echo "[Partitioning $1...]"
DRIVE=$1
cd ../image
filename="fsl-image*.sdcard"
current_filename=`ls | grep fsl-image*.sdcard`
if [ -e $filename ];then
echo "[Copy $current_filename image]"
dd if=$current_filename of=$1 &>/dev/null
else
echo $filename does not exist
exit 1
fi
echo "[Resize filesystems...]"
rootfs_start=`fdisk -u -l ${DRIVE} | grep ${DRIVE}p2 | awk '{print $2}'`
# Create partition table for extend root file system (/dev/mmcblk1p2) partition
fdisk -u $DRIVE << EOF &>/dev/null
d
2
n
p
2
$rootfs_start
w
EOF
if [ -x /sbin/partprobe ]; then
/sbin/partprobe ${DRIVE} &> /dev/null
else
sleep 1
fi
e2fsck -f -y ${DRIVE}p2 &> /dev/null
resize2fs ${DRIVE}p2 &> /dev/null
if [ -x /sbin/partprobe ]; then
/sbin/partprobe ${DRIVE} &> /dev/null
else
sleep 1
fi
echo 7 > /proc/sys/kernel/printk
echo "[Done]"
MKSD_EOF
Other Features
- see Linux Features