3 Replies Latest reply on Oct 28, 2020 5:53 PM by apadana1984

    Minized Petalinux 2020 - WiFi Shell Script




      I am building Petalinux 2020.1 for my Minized Board. I downloaded the Avnet BSP package. I noticed that the default Shell script for enabling the WiFi module has an issue:


      #Mount the eMMC

      echo "Mount the eMMC."

      mount /dev/mmcblk1p1 /mnt


      When I boot my Petalinux, there is not such "mmcblk1p1". There is "mmcblk0p1". What is the best way to correct this file? I changed it and re-built my Petalinux, however, the shell script in the image file didn't change!!! Am I missing something?


      Also, I changed my "wpa_supplicant.conf" file to include my WiFi user ID&PASSWD, however, the file doesn't change in the linux image file.


      I appreciate if someone can look into this problem.


      Thank you

        • Re: Minized Petalinux 2020 - WiFi Shell Script

          I fixed the issues as follows:


          1- Regarding the wifi.sh script, I changed the script to:


          #Overwrite the default wpa_supplicant setup with one edited with

          #the WLAN SSID and password that was previously copied to the eMMC.

          echo "Copy the wpa_supplicant.conf file from eMMC to /etc."

          echo "NOTE!  This file must have been previously edited with"

          echo "the WLAN SSID and password!"

          #Mount the eMMC

          echo "Copy the wpa_supplicant.conf file from eMMC to /etc."

          cp -f /media/sd-mmcblk0p2/usr/local/bin/wpa_supplicant.conf /etc/.


          #Run wpa_supplicant for secure networking:

          echo "Bringup the WiFi interface."


          The files already exists in /media/sd-mmcblk0p2/usr/local/bin folder. We don't need to mount it again in order to use it. I removed those the lines related to mounting and un-mounting.


          2- As for non-updating the rootfs.wic even after I rebuild the Petalinux, I noticed that those in /pre-built/linux/images are not being updated, however, the one in /images/linux directory is in fact being updated.


          My Minized now loads the correct shell scripts and WiFi modules works perfect.


          Thank you

          • Re: Minized Petalinux 2020 - WiFi Shell Script

            Hi Iman,


            That shell script (wifi.sh?) has been used for years, so I am surprised that it is breaking now.  I will look into this.


            The reason why the script reverts to its original state on a reboot is because the MiniZed, by default, boots a RAMdisk root filesystem.  This means the entire filesystem exists in RAM while the system is booted and is thus volatile.  Changes and edits to files are not persistent on a reboot.  That is why the wpa_supplicant.conf file, once edited with your WLAN SSID and password information, is meant to be stored on the FAT partition of the eMMC (mmcblk<0|1>p1) memory.


            The MiniZed can be configured to boot the Linux kernel from QSPI and mount a persistent filesystem on a EXT4 partition of the eMMC.  I believe there are shell scripts provided in the BSP that will program the QSPI and eMMC for this boot method.



            2 of 2 people found this helpful
              • Re: Minized Petalinux 2020 - WiFi Shell Script

                Thank you Tom. By non-updating scripts, I meant the scripts in "rootfs.wic" file created in the host Linux machine. There are two directories in which we can find "rootfs.wic":


                1. <project-home>/images/linux/
                2. <project-home>/pre-built/linux/images


                The first one updates once we build the Petalinux project. But the second one doesn't update. Maybe its name "pre-built" implies that.(?!)