UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
13,312 Views
Registered: ‎07-10-2015

SD Card Automount with fstab petalinux

Jump to solution

# stock fstab - you probably want to override this with a machine specific one

/dev/root / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0

# uncomment this if your device has a SD/MMC/Transflash slot
#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0

 

 

There are 3 fstab files .I uncomment all of them. But after I run petalinux-package cmd, the uncomment is unvalid.

The 3 files are returned.

How can I uncomment the "/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0" this line even though I run the petalinux cmd?

 

Screenshot-1.png
0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
10,497 Views
Registered: ‎04-24-2017

Re: SD Card Automount with fstab petalinux

Jump to solution

Create a base-files directory and bbappend file:

 

$ mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files
$ touch <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files/base-files_%.bbappend

Add your own fstab to bbappend:

$ echo 'SRC_URI += "file://fstab"' >> <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files/base-files_%.bbappend
$ echo 'FILESEXTRAPATHS_prepend := "${THISDIR}/base-files:"' >> <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files/base-files_%.bbappend


Add your auto mount at the end

$ vim <plnx-proj-root>/project-spec/meta-user/recipes-core/ base-files/base-files/fstab

 

 
/dev/root            /                    auto       defaults              1  1
proc                 /proc                proc       defaults              0  0
devpts               /dev/pts             devpts     mode=0620,gid=5       0  0
tmpfs                /run                 tmpfs      mode=0755,nodev,nosuid,strictatime 0  0
tmpfs                /var/volatile        tmpfs      defaults              0  0

# uncomment this if your device has a SD/MMC/Transflash slot
/dev/mmcblk0p1       /media/card          auto       defaults,sync,noauto  0  0

 

Build petalinux

$ petalinux-build
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
11 Replies
Adventurer
Adventurer
13,124 Views
Registered: ‎06-08-2015

Re: SD Card Automount with fstab petalinux

Jump to solution

At http://stackoverflow.com/questions/28545706/do-modification-to-rootfs-petalinux-on-zynq , read the answer that describes creating the "fstab_mount_sd" app. That works for me.

0 Kudos
Adventurer
Adventurer
7,175 Views
Registered: ‎11-14-2008

Re: SD Card Automount with fstab petalinux

Jump to solution

Looks like enough has changed in the latest tools (Petalinux 2017.1, 2017.2) to break the solution explained at stackoverflow.

 

Has anyone found a way to modify /etc/fstab as part of the Petalinux build process?

 

Thanks!

/Matt

Highlighted
Observer fbruder
Observer
6,829 Views
Registered: ‎09-11-2017

Re: SD Card Automount with fstab petalinux

Jump to solution

hey,

have you found a solution for this problem yet?

 

Thanks!

0 Kudos
Moderator
Moderator
6,757 Views
Registered: ‎10-06-2016

Re: SD Card Automount with fstab petalinux

Jump to solution

Hi @christine1225@mattbrowner and @fbruder

 

There are a couple of existing posts in the folder related to how modify the base configuration files in a petalinux image at build time. 

 

Take a look to the following post, which also is used for modifying fstab.

 

Basically the idea is to create your recipe to append the base-file package where the fstab file is created. This way you can overwrite the orignal fstab file with your custom one.

 

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
Moderator
Moderator
10,498 Views
Registered: ‎04-24-2017

Re: SD Card Automount with fstab petalinux

Jump to solution

Create a base-files directory and bbappend file:

 

$ mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files
$ touch <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files/base-files_%.bbappend

Add your own fstab to bbappend:

$ echo 'SRC_URI += "file://fstab"' >> <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files/base-files_%.bbappend
$ echo 'FILESEXTRAPATHS_prepend := "${THISDIR}/base-files:"' >> <plnx-proj-root>/project-spec/meta-user/recipes-core/base-files/base-files_%.bbappend


Add your auto mount at the end

$ vim <plnx-proj-root>/project-spec/meta-user/recipes-core/ base-files/base-files/fstab

 

 
/dev/root            /                    auto       defaults              1  1
proc                 /proc                proc       defaults              0  0
devpts               /dev/pts             devpts     mode=0620,gid=5       0  0
tmpfs                /run                 tmpfs      mode=0755,nodev,nosuid,strictatime 0  0
tmpfs                /var/volatile        tmpfs      defaults              0  0

# uncomment this if your device has a SD/MMC/Transflash slot
/dev/mmcblk0p1       /media/card          auto       defaults,sync,noauto  0  0

 

Build petalinux

$ petalinux-build
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Observer fbruder
Observer
6,271 Views
Registered: ‎09-11-2017

Re: SD Card Automount with fstab petalinux

Jump to solution

Thanks! Works for me! (Petalinux 2017.2)

0 Kudos
Visitor wel
Visitor
3,791 Views
Registered: ‎07-05-2018

Re: SD Card Automount with fstab petalinux

Jump to solution
why did the name include 3.0.14?
0 Kudos
Visitor wel
Visitor
3,778 Views
Registered: ‎07-05-2018

Re: SD Card Automount with fstab petalinux

Jump to solution
This method is not successful for me
0 Kudos
Moderator
Moderator
3,752 Views
Registered: ‎04-24-2017

Re: SD Card Automount with fstab petalinux

Jump to solution

@wel,

 

Which version of petalinux are you using?

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Visitor wel
Visitor
2,612 Views
Registered: ‎07-05-2018

Re: SD Card Automount with fstab petalinux

Jump to solution
the newest version
0 Kudos
Visitor iafolla
Visitor
2,113 Views
Registered: ‎08-17-2018

Re: SD Card Automount with fstab petalinux

Jump to solution

Also with me it is not working anymore. With a previous version was ok.

 

which is the right name?

base-files_3.0.14.bbappend

or

base-files_%.bbappend

 

Please let me know.

0 Kudos