summaryrefslogtreecommitdiffstats
path: root/kernel/lib/of-reconfig-notifier-error-inject.c
blob: 8dc79861758a1744aa2ebcafcf941ccd897c429f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>

#include "notifier-error-inject.h"

static int priority;
module_param(priority, int, 0);
MODULE_PARM_DESC(priority, "specify OF reconfig notifier priority");

static struct notifier_err_inject reconfig_err_inject = {
	.actions = {
		{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ATTACH_NODE) },
		{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_DETACH_NODE) },
		{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ADD_PROPERTY) },
		{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_REMOVE_PROPERTY) },
		{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_UPDATE_PROPERTY) },
		{}
	}
};

static struct dentry *dir;

static int err_inject_init(void)
{
	int err;

	dir = notifier_err_inject_init("OF-reconfig",
		notifier_err_inject_dir, &reconfig_err_inject, priority);
	if (IS_ERR(dir))
		return PTR_ERR(dir);

	err = of_reconfig_notifier_register(&reconfig_err_inject.nb);
	if (err)
		debugfs_remove_recursive(dir);

	return err;
}

static void err_inject_exit(void)
{
	of_reconfig_notifier_unregister(&reconfig_err_inject.nb);
	debugfs_remove_recursive(dir);
}

module_init(err_inject_init);
module_exit(err_inject_exit);

MODULE_DESCRIPTION("OF reconfig notifier error injection module");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>");
sole access via pwd cat <<EOF >/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg manage_etc_hosts: True password: RANDOM chpasswd: { expire: False } ssh_pwauth: True EOF linuxheadersversion=$(echo ls /boot/vmlinuz* | cut -d- -f2-) apt-get update apt-get install -y \ bc \ fio \ gcc \ git \ iperf3 \ iproute2 \ ethtool \ linux-tools-common \ linux-tools-generic \ lmbench \ make \ unzip \ netperf \ patch \ perl \ rt-tests \ stress \ sysstat \ linux-headers-"${linuxheadersversion}" \ libpcap-dev \ lua5.2 \ net-tools \ wget \ unzip \ libpcap-dev \ ncurses-dev \ libedit-dev \ pciutils \ pkg-config \ liblua5.2-dev \ libncursesw5-dev \ ncurses-dev \ libedit-dev dpkg -L liblua5.2-dev cp /usr/include/lua5.2/lua.h /usr/include/ cp /usr/include/lua5.2/lua.h /usr/include/x86_64-linux-gnu/ git clone http://dpdk.org/git/dpdk git clone http://dpdk.org/git/apps/pktgen-dpdk CLONE_DEST=/opt/tempT # remove before cloning rm -rf -- "${CLONE_DEST}" git clone https://github.com/kdlucas/byte-unixbench.git "${CLONE_DEST}" make --directory "${CLONE_DEST}/UnixBench/" git clone https://github.com/beefyamoeba5/ramspeed.git "${CLONE_DEST}/RAMspeed" cd "${CLONE_DEST}/RAMspeed/ramspeed-2.6.0" mkdir temp bash build.sh git clone https://github.com/beefyamoeba5/cachestat.git "${CLONE_DEST}"/Cachestat cd /root wget http://dpdk.org/browse/dpdk/snapshot/dpdk-17.02.zip unzip dpdk-17.02.zip cd dpdk-17.02 make install T=x86_64-native-linuxapp-gcc cd /root wget https://01.org/sites/default/files/downloads/intelr-data-plane-performance-demonstrators/dppd-prox-v035.zip unzip dppd-prox-v035.zip cd dppd-PROX-v035 chmod +x helper-scripts/trailing.sh export RTE_SDK=/root/dpdk-17.02 export RTE_TARGET=x86_64-native-linuxapp-gcc make # restore symlink ln -sfrT /run/resolvconf/resolv.conf /etc/resolv.conf