wb_editors
14 391
правка
(Новая страница: «== Building Linux ==») |
FuzzyBot (обсуждение | вклад) м (FuzzyBot переименовал страницу Сборка образа для загрузки в режиме USB Mass-Storage/en в Wiren Board 5: Build an image to download in USB Mass-Storage mode/en без оставления перенаправления: Часть переводимой страницы Сборка образа для загрузки в режиме USB Mass-Storage.) |
||
(не показано 6 промежуточных версий 1 участника) | |||
Строка 15: | Строка 15: | ||
== Building Linux == | == Building Linux == | ||
* | * To get the kernel sources from git,'' | ||
<nowiki> | <nowiki> | ||
$ git clone https://github.com/contactless/linux.git | $ git clone https://github.com/contactless/linux.git | ||
$ cd linux | $ cd linux | ||
$ git checkout dev/v4.1.15 </nowiki> | $ git checkout dev/v4.1.15 </nowiki> | ||
* | * Download initramfs from [https://github.com/contactless/wirenboard/tree/master/initramfs_usbgadget repository] and unzip | ||
<nowiki> | <nowiki> | ||
$ unzip initramfs_usbgadget.zip | $ unzip initramfs_usbgadget.zip | ||
$ sudo tar xvf initramfs_usbgadget.tar</nowiki> | $ sudo tar xvf initramfs_usbgadget.tar</nowiki> | ||
* | * Initialize the environment to build the kernel. If necessary, change the ''DT'' and ''CROSS_COMPILE'' variables in this file | ||
<nowiki> | <nowiki> | ||
$ . ./scripts/kbuild-env.sh | $ . ./scripts/kbuild-env.sh | ||
$ set +e</nowiki> | $ set +e</nowiki> | ||
* | * Set the config of the kernel | ||
<nowiki>$ make mxs_usbgadget_defconfig</nowiki> | <nowiki>$ make mxs_usbgadget_defconfig</nowiki> | ||
* | * Build the kernel and modules by installing them in unpacked initramfs | ||
<nowiki>$ INSTALL_MOD_PATH=./initramfs_usbgadget/ ./scripts/kbuild.sh</nowiki> | <nowiki>$ INSTALL_MOD_PATH=./initramfs_usbgadget/ ./scripts/kbuild.sh</nowiki> | ||
* | * Build kernel with appended DTB and initramfs | ||
<nowiki>$ ./scripts/kbuild-dtb.sh</nowiki> | <nowiki>$ ./scripts/kbuild-dtb.sh</nowiki> | ||
== | == Building U-Boot == | ||
* | * Get u-Boot sources from git. You need a ''wb_v2015.07'' branch | ||
<nowiki> | <nowiki> | ||
$ cd .. | $ cd .. | ||
Строка 44: | Строка 44: | ||
$ cd u-boot | $ cd u-boot | ||
$ git checkout wb_v2015.07</nowiki> | $ git checkout wb_v2015.07</nowiki> | ||
* | * Set u-Boot config | ||
<nowiki>$ make mx28_wirenboard5_usbgadget_defconfig</nowiki> | <nowiki>$ make mx28_wirenboard5_usbgadget_defconfig</nowiki> | ||
* | * Copy a previously collected image of '''[[kernel+initramfs]+DTB]''' to the U-Boot folder | ||
$ cp ../linux/zImage-imx28-evk ./zImage | $ cp ../linux/zImage-imx28-evk ./zImage | ||
* | * Build a combined image '''[U-Boot+[[kernel+initramfs]+DTB|kernel+initramfs]+DTB]''' into U-Boot folder | ||
$ cp ../linux/zImage-imx28-evk ./zImage | $ cp ../linux/zImage-imx28-evk ./zImage | ||
* | * Build a combined '''[U-Boot+[[kernel+initramfs]+DTB]]''' image suitable for booting to USB (bootstream) | ||
<nowiki>$ CROSS_COMPILE='arm-linux-gnueabi-' make -j4 u-boot.sb</nowiki> | <nowiki>$ CROSS_COMPILE='arm-linux-gnueabi-' make -j4 u-boot.sb</nowiki> | ||
== | == Assembling mxsldr == | ||
This utility is needed to download the resulting image via USB. Requires ''libusb-1.0'' library installed (<nowiki>apt-get install libusb-1.0-0-dev</nowiki>) | |||
<nowiki> | <nowiki> | ||
Строка 66: | Строка 65: | ||
== | == Loading a built image using mxsldr == | ||
<nowiki>$ ./mxsldr ../u-boot/u-boot.sb</nowiki> | <nowiki>$ ./mxsldr ../u-boot/u-boot.sb</nowiki> |