element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Avnet Boards General Enabling the auto-mount scripts (or any shell scripts) on the MiniZed in PetaLinux 2019.2
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 335 subscribers
  • Views 567 views
  • Users 0 members are here
  • minized hardware
  • MiniZed Hardware Design
Related

Enabling the auto-mount scripts (or any shell scripts) on the MiniZed in PetaLinux 2019.2

adorebit
adorebit over 5 years ago

To include the auto-mounting scripts (mount_sda1_usb.sh & mount_emmc.sh) for the MiniZed USB and eMMC (found in Booting_MiniZed_Using_QSPI_and_eMMC_2017_2_01.pdf) but using PetaLinux 2019.2 with the minized_petalinux reference design in the Avnet HDL Git repo (https://github.com/Avnet/hdl/tree/2019.2), modifications must be made:

 

First, from within your PetaLinux project, create an app template using the command: petalinux-create -t apps --name configminized --enable

 

The app template will be located at: <PL_PROJECT>/project-spec/meta-user/recipes-apps

 

Then create the BitBake file below located at: <PL_PROJECT>/project-spec/meta-user/recipes-apps/configminized/configminized.bb:

 

SUMMARY = "Minized Configuration Scripts"

SECTION = "PETALINUX/apps"

LICENSE = "MIT"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

 

SRC_URI = "file://mount_sda1_usb.sh \

           file://mount_emmc.sh \

           file://load_images.sh"

 

S = "${WORKDIR}"

 

do_install() {

        install -d ${D}${bindir}

        install -m 0755 ${S}/mount_sda1_usb.sh ${D}${bindir}

        install -m 0755 ${S}/mount_emmc.sh ${D}${bindir}

        install -m 0755 ${S}/load_images.sh ${D}${bindir}

}

 

Where the auto-mounting scripts (found in the accompanying software for Booting_MiniZed_Using_QSPI_and_eMMC_2017_2_01.pdf on the Avnet website) are located at: <PL_PROJECT>/project-spec/meta-user/recipes-apps/configminized/files

 

Note that since these are Bourne scripts (echo $SHELL on the MiniZed), we don't need a Makefile since we're not actually compiling anything (we're just including the scripts in the rootfs during the PetaLinux build). After creating the above BitBake recipe, and copying the auto-mount scripts, double-check that the scripts will be included in the PetaLinux build: petalinux-config -c rootfs and navigate to Apps --> configminized (obviously make sure it's selected). Then save and exit the configuration manager.

 

From this point, you should be able to build PetaLinux: petalinux-build, package the build images (see: Must use petalinux-package command in newest pull of 2019.2 branch in github.com/Avnet/hdl repo for MiniZed ), then flash the eMMC (image.ub) and QSPI (BOOT.bin), and the mount scripts will be located at /usr/bin on your PetaLinux install on the MiniZed!

 

A few more notes on including custom scripts in the rootfs: If the scripts are modified, it's necessary to clean and re-build the project for the modified scripts to be included in the new image. This can be done with the command: petalinux-build -x mrproper -f, Then re-build the entire project and re-package the eMMC (image.ub) and QSPI (BOOT.bin) using a command like this: petalinux-package --boot --fsbl <PL_PROJECT>/images/linux/zynq_fsbl.elf --fpga <PATH_TO_FPGA_BITFILE>/*.bit --uboot --force. After this, your modified scripts should be included in the build in /usr/bin. It also seems that the clean/build commands must be issued at the root of the PetaLinux project: <PL_PROJECT>.

 

I also wrote some code that mounts the USB and eMMC and writes the boot images. There are three files that are included in the rootfs:

 

1) load_images.sh:       Top-level file that mounts the eMMC and USB, and flashes the QSPI and copies the image.ub to the eMMC

2) mount_emmc.sh:          Mounts the eMMC device

3) mount_sda1_usb.sh: Mounts the USB device

 

Hopefully this will all help someone else get a handle on the MiniZed with PetaLinux 2019.2. Also, please feel free to leave comments on how this stuff can be done differently or more efficiently. -Cody

  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube