How to set the permissions of my driver file using udev rules - linux-kernel

I am trying to set the permissions on my device driver file to read/write for all users using udev rules but it does work.
here the udev rules :
SUBSYSTEM=="lpc*", KERNEL=="lpc?*", DRIVER=="lpc", GROUP="users", MODE="0666"
When I test it using :
sudo udevadm test $(udevadm info -q path -n /dev/lpc_peach)2>&1
this is what i get at the bottom lines :
preserve permissions /dev/lpc_peach, 020600, uid=0, gid=0
preserve already existing symlink '/dev/char/248:0' to '../lpc_peach'
I can't identify what is wrong! Any help will be useful.
Edit 1 : When I run udevadm info -q all -n /dev/lpc_peach here is what I get:
P: /devices/virtual/lpc_spartan/lpc_peach
N: lpc_peach
E: DEVNAME=/dev/lpc_peach
E: DEVPATH=/devices/virtual/lpc_spartan/lpc_peach
E: MAJOR=247
E: MINOR=0
E: SUBSYSTEM=lpc_spartan

Related

Kernel panic after ubi rootfs size increased

I'm currently working with LTIB tool to generate linux kernel 3.0.25, with u-boot-2009-08, for iMX6 solo core board.
I use mfg tool to flash. When I installed new packages, the rootfs size changed from 147 to 162MiB. Since then, I can't boot anymore, the ubi doesn't get attached.
I have a kernel panic with the following logs :
**UBI error: process_eb: bad image sequence number 1588612812 in PEB 720, expected 1344834100**
UBI error: ubi_attach_mtd_dev: failed to attach by scanning, error -22
UBI error: ubi_init: cannot attach mtd9
UBIFS error (pid 1): ubifs_mount: cannot open "ubi0:root", error -19
VFS: Cannot open root device "ubi0:root" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
UBI error screenshot
Kernel Panic Screenshot
To get rid of this, I changed the u-boot mfg CONFIG_BOOTARGS as follows :
#define CONFIG_BOOTARGS "console=ttymxc1,115200 rdinit=/linuxrc mtdparts=gpmi-
nand:4m(boot),256k(bootenv),2m(splashscreen),10m(ramdisk),5m(kernel),5m(flasherkernel),256k(updater
),256k(flag1),256k(flag2),170m(rootfs),32m(userpart1),32m(userpart2),-(userpart)"\
Here's the ubinize.cfg :
[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=170MiB
vol_type=dynamic
vol_name=root
vol_flags=autoresize
And the ubi generation commands :
sudo mkfs.ubifs -r $ROOTFS -m 4096 -e 253952 -c 1184 -o ubifs.img
sudo ubinize -o $BUILT_IMG/ubi.img -m 4096 -p 256KiB ubinize.cfg
And the flash commands :
$ flash_eraseall /dev/mtd9 # Erasing Rootfs partition
$ send" file="files/ubi.img # Sending Root filesystem
$ ubiformat /dev/mtd9 -f $FILE -s 4096 -O 4096 # Flashing Root Filesystem
Any idea ?
Thanks

XAMPP problem MAC address and HV_error not detected

Cannot calculate MAC address: Using fd 7 for I/O notifications
hv_vm_create HV_ERROR (unspecified error)
[![enter image description here][2]][2g
STEP 1: Take a backup of your current files
cp -rp ~/.bitnami ~/.bitnami.back
STEP 2: Download the new hyperkit binary
cd /tmp
curl -LJO "https://downloads.bitnami.com/files/hyperkit/hyperkit-testing-20210430"
STEP 3: Ensure that the md5 checksum matches with this one
md5 /tmp/hyperkit-testing-20210430
Results => MD5 (/tmp/hyperkit-testing-20210430) = 37495adde6a3279dd7265904b85c3dc9
Warning: Do not continue with the next step if the md5 checksum doesn’t match
STEP 4: Replace your current hyperkit binary with the downloaded one
mv /tmp/hyperkit-testing-20210430 ~/.bitnami/stackman/helpers/hyperkit
chmod +x ~/.bitnami/stackman/helpers/hyperkit
CREDITS : https://community.bitnami.com/t/bitnami-wordpress-mac-os-11-3-big-sur-error-starting-wordpress-stack/94776/9
For more information please refer the above link

libvirt image based provisioning using logical volumes

Are there known issues with image based provisioning using logical volumes in libvirt? I am getting this error while trying to do the same
Unable to save
Failed to create a compute kvm2 (Libvirt) instance test3.xxx.local: Call
to virNetworkCreateXML failed:
internal error: Child process (/usr/sbin/lvcreate --name
test3.xxx.local-disk1 -L 1K --type snapshot --virtualsize 10485760K -s
/vm-images-pool/images-vol/template_minimal) unexpected exit status 3: 2017-
01-05 00:42:08.133+0000: 12330: debug : virFileClose:102 : Closed fd 29
2017-01-05 00:42:08.133+0000: 12330: debug : virFileClose:102 : Closed fd 31
2017-01-05 00:42:08.133+0000: 12330: debug : virFileClose:102 : Closed fd 27
Volume group name expected (no slash) Run `lvcreate --help' for more
information
This link from Red Hat flags it as a known issue:
https://access.redhat.com/solutions/1995053
That doc has a date of October 20 2015. Not sure if anythig changed after that to support LV.
I tried to satisfy the requirement in that doc by creating a pool based on dir like this:
Setup:
Storage pool vm-images-pool-dir of type dir
Storage pool vm-images-pool of type logical
template_minimal is the image template.
[root#kvm2 libvirt]# virsh vol-list vm-images-pool-dir
Name Path
----------------------------------------------------------------------------
template_minimal /vm-images-pool/images-vol/template_minimal
vm-images-pool storage pool is of type VG with one volume:
images-vol vm-images-pool -wi-ao---- 249.00g
images-vol is mounted under /vm-images-pool/images-vol/
Any insight is appreciated.
Thanks,
TG
=======================================
more details.
Daniel, Thanks. I am a bit confused. I couldn't put the actual commands earlier since I had cleaned them up. I recreated the setup. Here are the commands I used:
virsh pool-define-as vm-images-pool logical --source-dev /dev/mapper/mpathd
virsh pool-build vm-images-pool
virsh pool-start vm-images-pool
virsh vol-create-as vm-images-pool images-vol --capacity 249G
virsh pool-define-as vm-images-pool-dir dir - - - - /vm-images-pool/images- vol/
virsh pool-build vm-images-pool-dir
virsh pool-start vm-images-pool-dir
[root#kvm2 ~]# virsh vol-list vm-images-pool-dir
Name Path
---------------------------------------------------------------------------- --
lost+found /vm-images-pool/images-vol/lost+found
template_minimal /vm-images-pool/images-vol/template_minimal
=======================================
/vm-images-pool/images-vol/template_minimal is the path used for template image
==================================
more tests:
mounted the logical volume at a mount point to match the directory based storage pool:
[root#kvm2 ~]# df -h /vm-images-pool-dir/images-vol
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vm--images--pool-images--vol 245G 1.2G 232G 1% /vm-images- pool-dir/images-vol
[root#kvm2 ~]# virsh vol-list vm-images-pool-dir
Name Path
------------------------------------------------------------------------------
lost+found /vm-images-pool-dir/images-vol/lost+found
template_minimal /vm-images-pool-dir/images-vol/template_minimal
[root#kvm2 ~]#
used /vm-images-pool-dir/images-vol/template_minimal as the template path
same result
Unable to save
Failed to create a compute kvm2 (Libvirt) instance test3.xxx.local: Call
to virNetworkCreateXML failed: internal error: Child process
(/usr/sbin/lvcreate --name test3.xxx.local-disk1 -L 1K --type
snapshot --virtualsize 10485760K - s /vm-images-pool-dir/images-
vol/template_minimal) unexpected exit status 3: 2017-01-05
16:45:10.694+0000: 40712: debug : virFileClose:102 : Closed fd 27 2017-
01-05 16:45:10.694+0000: 40712: debug : virFileClose:102 : Closed fd 29
2017-01-05 16:45:10.694+0000: 40712: debug : virFileClose:102 : Closed fd 24
Volume group name expected (no slash) Run `lvcreate --help' for more
information.
the source of the image is "/vm-images-pool-dir/images-vol/template_minimal" and the guest's target back end is a LV of 10G on another storage pool called "virtual-machines"
Not understanding what the 'lvcreate' commmand is trying to do, shouldnt it at least use "virtual-machines" as the target VG. The tool I am using is Satellite 6.2. I am thinking its something silly that I am overlooking. Not sure where :)
Thanks
TG
Based on the paths in that command, it seems you wanted to create a new file based volume in the /vm-images-pool/images-vol/, ie your "vm-images-pool-dir" pool. The fact that you are seeing an error from "lvcreate" though, suggests that you mistakenly specified "vm-images-pool" to libvirt as the pool to use, causing it to try to create a logical volume instead. You don't show the actual command / API you are running, but check that you've given the right pool name to it.
I know the question has long been asked, but I just hit the same problem and found the answer. I couldn't find the exact virsh command you are using leading to this error, but here I used the following XML file with virsh vol-create libvirtVG logical.xml
<volume >
<name>vol02</name>
<capacity unit='KiB'>2097152</capacity>
<allocation unit='KiB'>0</allocation>
<backingStore>
<path>/dev/libvirtVG/sles15sp1</path>
</backingStore>
</volume>
To be able to get rid of the error I had to set the allocation to the value of the capacity. You can also see that virt-manager is automatically doing it for you:
https://github.com/virt-manager/virt-manager/blob/master/virtinst/storage.py#L646
The equivalent using the virsh vol-create-as command would be:
virsh vol-create-as libvirtVG vol02 2048MiB --allocation 2048MiB \
--backing-vol /dev/libvirtVG/sles15sp1

apache chown on its files not working

My apache user generate one file :
# ls -lsa /tmp/reference_file.csv
76 -rwxrwxrwx 1 apache apache 69921 Aug 16 14:14 /tmp/reference_file.csv
the user and the group belong to apache, but when i am trying to change it :
su -l apache -s /bin/bash
-bash-3.00$ whoami
apache
-bash-3.00$ chown explorer:btunix /tmp/reference_file.csv
chown: changing ownership of `/tmp/reference_file.csv': Operation not permitted
I tried to another folder, but the result was the same, I ve also checked attribut :
# lsattr /tmp/reference_file.csv
------------- /tmp/reference_file.csv
there is no immutable attribut
How can I do ?
Thanks
There are criteria associated with chown. Only super-user can chown files willy-nilly. Whether you can give away a file that you own depends on your UNIX flavor and how associated kernel configuration parameters (like K_CHOWN_MAY_GIVE_AWAY, for argument's sake) may have been, well, configured. This is the most GENERALLY correct answer.

Gumstix Overo wifi drops continously

I am using Gumstix overo and from the past many days I am unable to get my Wifi working correctly.
I followed the instructions from Gumstix Overo Wifi and Overo Wifi to set correct parameters in /etc/network/interfaces and /etc/wpa_supplicant.conf.
/etc/network/interfaces file:
# Wireless interfaces
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
down killall -q wpa_supplicant
wpa_supplicant.conf:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
eapol_version=1
ap_scan=1
fast_reauth=1
network={
ssid="xxxxxx"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
scan_ssid=1
psk="xxxxx"
priority=10
}
After setting up and running ifdown wlan0 && ifup wlan0 i constantly get this message:
[ 1176.528778] cfg80211: Calling CRDA to update world regulatory domain
[ 2155.687255] cfg80211: Calling CRDA to update world regulatory domain
[ 1175.293609] cfg80211: Calling CRDA to update world regulatory domain
My iwconfig:
lo no wireless extensions.
wlan0 IEEE 802.11bg ESSID:off/any
Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
My lsmod looks like this:
root#overo:~# lsmod
Module Size Used by
libertas_sdio 16484 0
libertas 99993 1 libertas_sdio
firmware_class 6920 2 libertas_sdio,libertas
ipv6 252525 22
cfg80211 172644 1 libertas
rfkill 17524 3 cfg80211
lib80211 5138 1 libertas
mt9v032 7169 1
omap3_isp 132270 0
v4l2_common 8681 2 omap3_isp,mt9v032
ads7846 10528 0
videodev 98880 3 omap3_isp,mt9v032,v4l2_common
media 12853 3 omap3_isp,mt9v032,videodev
I am using yocto project for gumstix cloned from https://github.com/gumstix/Gumstix-YoctoProject-Repo
It would be great help if I could get any inputs where I am doing wrong.
The reason for wifi drop is the Network manager. By disabling it we can run ifconfig, iwconfig without any interference from the NetworkManager.
or Another workaround is this which is quite successful:
After creating SD card with proper Image on, do not unmount the partitions.
Install a Custom systemd Service
To bring up the wireless interface on boot, you will need to create and install a custom systemd service on the microSD card.
In the rootfs partition, create a new service script:
$sudoedit /media/rootfs/etc/systemd/system/network-wireless#.service
Copy and paste the following into the file:
Description=Wireless network connectivity (%i)
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ifconfig %i up
ExecStart=/usr/sbin/wpa_supplicant -B -i %i -c /etc/wpa_supplicant.conf
ExecStart=/sbin/dhclient %i
RestartSec=1min
Restart=on-failure
ExecStop=/sbin/ifconfig %i down
[Install]
WantedBy=multi-user.target
Save this file.
Because we are editing these files on a development machine, the normal systemd method of enabling services (systemctl) will not work. To enable our new service:
~ Change into the multi-user.target.wants directory on the root filesystem:
$cd /media/rootfs/etc/systemd/system/multi-user.target.wants/
~ Create a symbolic link to enable the service:
Overo Series COMs
$sudo ln -s ../network-wireless#.service network-wireless#wlan0.service
Finally, edit the wpa_supplicant configuration file:
$sudoedit /media/rootfs/etc/wpa_supplicant.conf
Change it to look like the following:
network={
ssid="Your Network's SSID"
psk="Your WPA2 Passkey"
}
Save the file.
Unmount the partitions on the microSD card.
SSH Into Your System
1) If you don't know the ip $ssh root#overo.local
2) If you know the IP address $ssh root#192.xx.xx.xx.local

Resources