:: Re: [DNG] vdev
Top Page
Delete this message
Reply to this message
Author: aitor_czr
Date:  
To: Ralph Ronnquist, richard lucassen, dng
Subject: Re: [DNG] vdev

Hi Ralph, Richard:

On 08/12/2016 03:50 AM, Ralph Ronnquist <ralph.ronnquist@???> wrote:
> The set up I now have, does the right thing on boot. I think.
>
> Firstly, it loads vdev from initrd during the first stage boot, and then
> it exits. A snapshot of /dev taken before the next start shows all
> filemod settings to be fine.
>
> Secondly it loads vdev anew at the sysvinit startup, and then this stays
> on as a daemon. The filemod settings at this time remain good.
>
> Plugging in a USB disk via virtio redirection gains two new entries
> /dev/sdd and /dev/sdd1, with appropriate filemod settings.
>
> This is with vdev installed from the debs, followed by my hands-on,
> which resulted in the snapshot files and links. Exactly. I also have
> removed all*udev* links from /etc/rcS.d (as otherwise update-rc.d gets
> upset about two different udev provisions)
>
> The diff relative a clean debs install tells of a) two revisions for the
> provided files: the changes to /usr/etc/vdev/vdevd.conf, and to
> /usr/lib/vdev/udev-compat.sh, b) the additions of
> /usr/lib/vdev/daemonlet and /usr/etc/vdev/acls/00-whitelist-root.acl,
> and c) the additional /root tree for initrd building.
>
> Now, I would suggest a blanket revision to the debs, to remove the /usr
> prefix from all its file paths. Then change /etc/vdev/vdevd.conf and the
> initrd building scripts accordingly. Thereafter work out how to
> postinstall vdev to also purge systemd-udev without it messing with its
> dependencies. (You don't want the kernel uninstalled)


I'm applying changes to the packages. This is my vdev.conf file:

________    *vdev.conf*    _________


[vdev-config]
firmware=/usr/lib/firmware
acls=/etc/vdev/acls
actions=/etc/vdev/actions
helpers=/usr/lib/vdev
hwdb=/usr/lib/vdev/hwdb/hwdb.squashfs
ifnames=/etc/vdev/ifnames.conf
pidfile=/run/vdev/vdevd.pid
default_permissions=0600
loglevel=debug
logfile=/var/log/vdev/vdevd.log
preseed=/usr/lib/vdev/dev-setup.sh



I also added the following files:



________    *vdevd.postinst*    _________


I also added a *vdevd.postint* file:

#!/bin/sh

set -e

ln -s /usr/sbin/vdevd /sbin/vdevd

#DEBHELPER#



________    *vdev-example.postinst*    _________


#!/bin/sh

set -e

PREFIX=/

if [ $# -gt 1 ]; then
    PREFIX=$1
    shift 1
fi


update-rc.d -f udev remove
update-rc.d -f udev-finish remove

ln -s /usr/etc/init.d/vdev /etc/init.d/vdev
ln -s /usr/etc/vdev /etc/vdev
update-rc.d -f vdev defaults
insserv

cd /etc/rcS.d
rm S03udev S10udev-finish
ln -s ../init.d/vdev K02vdev
update-rc.d vdev enable S

mkdir /etc/vdev/acls
echo \
"[vdev-acl]
uid=0" > "/etc/vdev/acls/00-whitelist-root.acl"

update-rc.d -f udev remove
update-rc.d -f udev-finish remove
update-rc.d -f vdev defaults
insserv

#DEBHELPER#



________    *vdevfs.postinst*    _________


#!/bin/sh

set -e

ln -s /usr/sbin/vdevfs /sbin/vdevfs

#DEBHELPER#



________    *vdev-fs.postinst*    _________


#!/bin/sh

set -e

ln -s /usr/sbin/vdevfs /sbin/vdevfs

#DEBHELPER#



I also have to add the *.postrm files.

Cheers,

Aitor.