Debian Flash From Net: Difference between revisions
(Initial: Inherited from Yocto_Flash_From_Net (00:06, 19 January 2023)) |
(Debianize the guide) |
||
Line 1: | Line 1: | ||
<!-- Set release according to "release" parameter in URL and use | <!-- Set release according to "release" parameter in URL and use mx8m-debian-bullseye-5.4-2.1.x-v1.4 as default | ||
--> {{INIT_RELEASE_PARAM| | --> {{INIT_RELEASE_PARAM|mx8m-debian-bullseye-5.4-2.1.x-v1.4}}<!-- | ||
-- | --> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- | ||
--> {{#lst: | --> {{PageHeader|{{#var:HARDWARE_NAME}} - Flash Debian images from network}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Debian}} __toc__ | ||
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Flash | |||
= Flashing a complete | = Flashing a complete Debian system from Network using TFTP & NFS = | ||
{{note| NOTES:<br> | {{note| NOTES:<br> | ||
#Please make sure your host system is ready to use TFTP/NFS. Use our Wiki if required: {{Varlink2| | #Please make sure your host system is ready to use TFTP/NFS. Use our Wiki if required: {{Varlink2|Debian Setup TFTP/NFS|{{#var:RELEASE_LINK}}}} | ||
#This is a concept Wiki. Please adapt it to your system and your requirements. | #This is a concept Wiki. Please adapt it to your system and your requirements. | ||
|info}} | |info}} | ||
== Build minimal file system == | == Build minimal file system == | ||
To setup a build environment follow steps | To setup a build environment follow steps 2 & 3 of the {{Varlink|Debian Build Release Stage|{{#var:RELEASE_LINK}}|Build Debian from source code}} guide.<br> | ||
Then, | Then, disable all distro features listed in {{Varlink|Debian Build Release Stage#Distro features|{{#var:RELEASE_LINK}}|Distro Features}} to get a minimal file system. | ||
}} | |||
And build the image: | And build the image: | ||
$ | $ sudo {{#var:BUILD_SCRIPT}} -c all | ||
Create a root file system and copy files: | Create a root file system and copy files: | ||
Line 31: | Line 21: | ||
<br> | <br> | ||
$ mkdir ~/flash_rootfs | $ mkdir ~/flash_rootfs | ||
$ sudo tar xf | $ sudo tar xf {{#var:BUILD_FOLDER}}/output/rootfs.tar.gz -C ~/flash_rootfs | ||
$ sudo cp -a ~/flash_rootfs/boot/*.dtb /tftpboot | $ sudo cp -a ~/flash_rootfs/boot/*.dtb /tftpboot | ||
$ sudo cp ~/flash_rootfs/boot/{{#var:KERNEL_IMAGE}} /tftpboot | $ sudo cp ~/flash_rootfs/boot/{{#var:KERNEL_IMAGE}} /tftpboot | ||
Line 37: | Line 27: | ||
<br> | <br> | ||
$ mkdir ~/flash_rootfs | $ mkdir ~/flash_rootfs | ||
$ sudo tar xf | $ sudo tar xf {{#var:BUILD_FOLDER}}/output/rootfs.tar.gz -C ~/flash_rootfs | ||
$ sudo cp | $ sudo cp {{#var:BUILD_FOLDER}}/output/{{#var:KERNEL_IMAGE}} /tftpboot | ||
$ for f in | $ for f in {{#var:BUILD_FOLDER}}/output/*.dtb; do if <nowiki>[[ -L $f ]] && [[</nowiki> $f != *{{#var:MACHINE_NAME}}.dtb <nowiki>]]</nowiki>; then sudo cp $f /tftpboot/; fi done | ||
$ sudo rename 's/{{#var:KERNEL_IMAGE}}-imx/imx/' /tftpboot/{{#var:KERNEL_IMAGE}}-*.dtb | $ sudo rename 's/{{#var:KERNEL_IMAGE}}-imx/imx/' /tftpboot/{{#var:KERNEL_IMAGE}}-*.dtb | ||
}} | }} | ||
Line 68: | Line 58: | ||
On the target flash your system: | On the target flash your system: | ||
# | # install_debian.sh | ||
A complete system is flashed into the SOMs internal storage (NAND flash/eMMC).<br> | A complete system is flashed into the SOMs internal storage (NAND flash/eMMC).<br> | ||
Once the file system is built you can use it again and again to flash your {{#var:HARDWARE_NAME}}.<br> | Once the file system is built you can use it again and again to flash your {{#var:HARDWARE_NAME}}.<br> | ||
You can update the images to use your images and/or customize | You can update the images to use your images and/or customize install_debian.sh to your requirements. |
Revision as of 20:28, 8 April 2023
This page is using the default release mx8m-debian-bullseye-5.4-2.1.x-v1.4.
To view this page for a specific Variscite SoM and software release, please follow these steps:
- Visit variwiki.com
- Select your SoM
- Select the software release
Flashing a complete Debian system from Network using TFTP & NFS
- Please make sure your host system is ready to use TFTP/NFS. Use our Wiki if required: Debian Setup TFTP/NFS
- This is a concept Wiki. Please adapt it to your system and your requirements.
Build minimal file system
To setup a build environment follow steps 2 & 3 of the Build Debian from source code guide.
Then, disable all distro features listed in Distro Features to get a minimal file system.
And build the image:
$ sudo MACHINE=imx8mq-var-dart ./var_make_debian.sh -c all
Create a root file system and copy files:
$ mkdir ~/flash_rootfs $ sudo tar xf ~/debian_imx8mq-var-dart_debian_bullseye/output/rootfs.tar.gz -C ~/flash_rootfs $ sudo cp -a ~/flash_rootfs/boot/*.dtb /tftpboot $ sudo cp ~/flash_rootfs/boot/zImage /tftpboot
Edit /etc/exports. E.g.
$ sudo gedit /etc/exports
...and add the following line to it (replace <uname> with the actual username):
/home/<uname>/flash_rootfs *(rw,sync,no_root_squash,no_all_squash,no_subtree_check)
Restart the NFS server:
$ sudo /etc/init.d/nfs-kernel-server restart
Insert the recovery SD card into your host PC and copy the following files from it (assuming it is mounted at /media):
$ sudo cp -a /media/rootfs/opt/images ~/flash_rootfs/opt/ $ sudo cp /media/rootfs/usr/bin/*.sh ~/flash_rootfs/usr/bin/
Boot the board, stop the autoboot to get to the U-Boot command line, and set the following environment variables:
=> setenv serverip <your host ip address> => setenv nfsroot /home/<your username>/flash_rootfs If you want to set the fdt file yourself, instead of using the default auto detection: => setenv fdt_file <relevant device tree>
=> setenv bootcmd 'run netboot' => saveenv => boot
On the target flash your system:
# install_debian.sh
A complete system is flashed into the SOMs internal storage (NAND flash/eMMC).
Once the file system is built you can use it again and again to flash your DART-MX8M.
You can update the images to use your images and/or customize install_debian.sh to your requirements.