This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/OMAP-L138: I got an error when I run a create-sdcard-omapl13x.sh script.

Part Number: OMAP-L138


Tool/software: TI-RTOS

Hi Champs,

Could you please let me know what is to be substituted for sfdisk -D option?
I tried a SD card formatting according to a description below and got an error.

  o TI EP Wiki: Processor SDK RTOS BOOT OMAPL13x
    (processors.wiki.ti.com/.../Processor_SDK_RTOS_BOOT_OMAPL13x)

    - MMCSD Boot Mode

      - Formatting the SD Card

        sudo sh create-sdcard-omapl13x.sh <Drive Name>

The error messages was as below.

  $ sudo sh create-sdcard-omapl13x.sh /dev/sda
  [sudo] password for user:
  create-sdcard-omapl13x.sh: 4: create-sdcard-omapl13x.sh: [[: not found
  Un mounting all the partitions...
  umount: /: target is busy
          (In some cases useful info about processes that
           use the device is found by lsof(8) or fuser(1).)
  1024+0 records in
  1024+0 records out
  1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0118966 s, 88.1 MB/s
  DISK SIZE - 274877906944 bytes
  sfdisk: invalid option -- 'D'

I found that the sfdisk command version is v2.27.1 and it dose not provide the -D option as followings

  $ sfdisk -v
  sfdisk from util-linux 2.27.1

  $ man sfdisk

  NOTES
         Since  version  2.26  sfdisk  does  not  provide  the   --DOS,   --IBM,
         --DOS-extended, --unhide, --show-extended, --cylinders, --heads, --sec‐
         tors, --inside-outer, --not-inside-outer options.

I'm not sure how to avoid the error.

Regards,
j-breeze

  • Hi,

    I am sure you did this, but can you double-check that /dev/sda is your sd card?? Usually this is the hdd.

    Also prior to executing the create-sdcard.sh can you try to delete its partitions & format it? Also try doing umount /dev/sdb before executing the script.

    Best Regards,
    Yordan
  • I think you only have couple options.
    1) Edit the script file. Remove the "-D" from the sfdisk call. The "-D" seems to be for reserving space for a DOS MBR. I don't know enough about MBRs to figure out if there is an equivalent options on the new sfdisk. Try without the "-D" option and see if it works.
    2) Roll back sfdisk to 2.26.
  • Hi Yordan,

    Thank you for your advice.

    >
    > but can you double-check that /dev/sda is your sd card?? Usually this is the hdd.
    >

    I could recognize my sd card as /dev/sdb as below.

     

    Regards,
    j-breeze

  • Hi Norman,

    All options of sfdisk used in the script are not provided already. So, could you please let me know how to roll back sfdisk to 2.25?

    >
    > sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE << EOF
    >

    Regards,
    j-breeze

  • Not sure what you mean bye "not provided already". I suggest modify create-sdcard-omapl13x.sh line from
    sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE << EOF
    to
    sfdisk -H 255 -S 63 -C $CYLINDERS $DRIVE << EOF
    Run the script again. Test the SD Card. It might not matter if the "-D" is missing.

    Rolling back sfdisk depends on your linux host. I haven't worked with linux in a long time. I remember you have to look up how to use the package installer/uninstaller. You should be able to uninstall sfdisk and reinstall an older version.
  • Hi,

    I modified the script as you told me and got an error below.

      sfdisk: invalid option -- 'H'

    -H is same as --heads. -S is same as --sectors. -C is same as --cylinders. So, what I wanted to say is that the sfdisk v2.27.1 dose not provide the -D / -H / -S / -C options

      $ man sfdisk

        NOTES
               Since  version  2.26  sfdisk  does  not  provide  the   --DOS,   --IBM,
               --DOS-extended, --unhide, --show-extended, --cylinders, --heads, --sec‐
               tors, --inside-outer, --not-inside-outer options.

    Regards,
    j-breeze

  • Hi Norman, Hi Yordan,

    I got the v2.25.2 util-linux package file (util-linux_2.25.2-6_amd64.deb) and installed it. Then I could run the script.
    Thank you for your support.

    However, I really hope that "Formatting the SD card from Windows PC" will be supported in the next release.





    Regards,
    j-breeze

  • Ah...I understand now. After reading up on sfdisk, the linux guys seem determined to remove any DOS concepts of C/H/S from all the partition utilities. Reducing the sfdisk command down to
    sfdisk $DRIVE << EOF
    might work. The values for C/H/S that sfdisk thinks it should use might be okay with the OMAP bootloader.

    A search of E2E forum would indicated that this is a recurring problem. TI does not seem aware of the problem with all their SD card scripts. The TI Wiki does not even note sfdisk version requirements.
  • Thanks for updating the thread.

    Best Regards,
    Yordan