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: 
Highlighted
Visitor mates37
Visitor
179 Views
Registered: ‎12-26-2017

Petalinux automounting File System configuration

Jump to solution

Hi,
yes I know, there is a lot of threads about auto mounting of a filesystems but it differs for different versions of Petalinux and I'm confused.

I need to DISABLE automounting of SD card. The SD is automaticly mounted during system start-up and is mounted as read/write but I need mount the SD manually and as read only to prevent filesystem coruption when power is lost. 

In /etc/udev/rules.d/automount.rules is reference to "mount.sh" script:

SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh"

The mount.sh uses blacklist to ignore some device files:

...
for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*`
do
	if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ];
	then
		logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
		exit 0
	fi
done
..

mount.blacklist:

/dev/loop
/dev/ram
/dev/mtdblock
/dev/md
/dev/dm-*

I modified the mount.blacklist:

/dev/loop
/dev/ram
/dev/mtdblock
/dev/md
/dev/dm-*
/dev/mtd*

Then I made "petalinux-create -t apps -n mountblacklist --enable" for new modified mount.blacklist and I modified recipe .bb as folow:

SUMMARY = " "
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://mount.blacklist \
	"

S = "${WORKDIR}"

do_install() {
 install -d ${D}${sysconfdir}/udev
 install -m 0755 ${S}/mount.blacklist ${D}${sysconfdir}/udev/mount.blacklist
}
FILES_${PN} += "${sysconfdir}/*"

But there is a error during petalinux-build:

...
Error: Transaction check error:
  file /etc/udev/mount.blacklist conflicts between attempted installs of mountblacklist-1.0-r0.cortexa9hf_neon and udev-extraconf-1.1-r0.cortexa9hf_neon
...

How can I replace/modify original mount.blacklist ? 

I'm using Petalinux 2018.2

 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
Visitor mates37
Visitor
119 Views
Registered: ‎12-26-2017

Re: Petalinux automounting File System configuration

Jump to solution

Hi Deville,

thank you for the answer.

Finally I solved the problem by creating file mount.blacklist with content:

/dev/mmcblk*

I did not try to replace the original file as I described in my first post. I just placed the file to the existing dir /etc/udev/mount.blacklist.d/ . The SD is not automatically mounted at this time.

2 Replies
Contributor
Contributor
163 Views
Registered: ‎09-28-2018

Re: Petalinux automounting File System configuration

Jump to solution

Would it help if you set the given kernel parameters to Read Only?

XLXN_WIKI: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842482/Device+Tree+Tips#DeviceTreeTips-8.1KernelBootargs

This is my present system-top.dts entry. I can assume you just can set the "rw" option to "ro" 

	chosen {
		bootargs="earlycon clk_ignore_unused console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio rootfstype=ext4 root=/dev/mmcblk1p2 rw rootwait";
		stdout-path="serial0:115200n8";
	};

There are a bunch of other options available. 

MAN7_WEB: http://man7.org/linux/man-pages/man7/bootparam.7.html

KERNELORG_WEB: https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt

Maybe hd=noprobe is something for you.  

 

What I also usally do on a normal computer is altering the entries in /etc/fstab. There you can load your attached HD's to your needs.

 

Deville

Visitor mates37
Visitor
120 Views
Registered: ‎12-26-2017

Re: Petalinux automounting File System configuration

Jump to solution

Hi Deville,

thank you for the answer.

Finally I solved the problem by creating file mount.blacklist with content:

/dev/mmcblk*

I did not try to replace the original file as I described in my first post. I just placed the file to the existing dir /etc/udev/mount.blacklist.d/ . The SD is not automatically mounted at this time.