I have module param name "debug" in a module and the module is part of kernel image(uImage).
Is it possible to pass a value to this module param(debug) through kernel command line?
If different modules will have the same module parameter name then how I can pass the module param value to the desired module?
Standard practice is to pass module.parameter[=value].
Related
I just got started on a Jenkins pipeline school assignment. The pipeline structure resides in a library and there is a client module that refers to it, in its Jenkinsfile.
Is it possible to delegate execution to a class in the client module without invoking a script using env (sh or cmd).
I want to invoke a class directly. Does Jenkins maintain classloader isolation b/n library and external module?
Does it explode both client and lib in a common workspace and then load them together?
Or
Can I load a class lazily at runtime? Say, the pipeline in the library knows the client class (startup param or script invocation) and then instantiates it and transfers control to it? Something like an SPI.
App design:
Library ABC with src/vars/resources.
Module X uses #Library('ABC') -Jenkinsfile invokes pipeline in the Library ABC.
Module X structure
src/
package/class1
I am trying to use the GroovyClassLoader to load a groovy src file for class1 in Library script and invoke it. The Jenkins pipeline however, does not permit GroovyClassLoader in the script. How do I whitelist it?
I assume that your Jenkins shared library has the following structure.
ABC
|
|----src/
|----resorces/
|----var/
You can create a Test.groovy file under src
package com.jenkins
class Test {
def execute(def dsl){
dsl.echo "I am inside the Test class"
println("I am also inside the Test class")
}
}
Create a pipeline.groovy under var directory.
An example pipeline.groovy will be
import com.jenkins.Test
def call(final Map parameters = [:]) {
node('master'){
Test.execute(this) //This utilizes the class that you have defined. I
}
}
Now the module can have a Jenkins file with the following content.
#Library('ABC')_
pipeline // This invokes pipeline.groovy
I want to tweak one Ansible module, I am using multiple modules. Now I want minor tweaks in one of them. How can I override default code?
I am not sure but my assumption is if I created a similar directory structure of modules in current directory, it will refer this code and for rest of module it will refer default code eg. for yum_repository module, default path is:
/usr/local/Cellar/ansible/2.4.1.0/libexec/lib/python2.7/site-packages/ansible/modules/packaging/os/yum_repository.py
but If I create the directory structure in my working directory as:
ansible/modules/packaging/os/ and keep edited file yum_repository.py there, it should refer this edited file.
Ansible will look for modules in ./library subdirectory of the playbook dir.
You can also use library parameter in the Ansible configuration file to specify a common directory for your modules.
Here is a sample of my Makefile.
define Package/luci-app-myapp
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=GUI for myapp package
PKGARCH:=all
DEPENDS:=+myapp
endef
What is the exact role of the DEPENDS in this Makefile?
And what elements can be the value of the DEPENDS?
DEPENDS is basically a variable. In openwrt this variable is used to define dependency between the packages.
Detailed use of this variable is documented in openwrt link
I am trying to create a LWRP to extend a supermarket cookbook 'webpshere'.
In my resource file, I am trying to extend this class with a base class found in parent cook book.
In the code below, 'WebsphereBase' is defined in the parent library 'websphere_base'. Can I get help on how to reference it?
Thanks
#require 'websphere_base'
module PIWebsphereCookBook
class WebsphereJbdc < WebsphereBase
require_relative 'helper'
In the source of the cookbook, you can see that the WebsphereBase class is defined inside the WebsphereCookbook module.
To reference this class from outside this module, you have to name the nesting so that Ruby is able to find the class you are referring to. With youur example, this can look similar to:
module PIWebsphereCookBook
class WebsphereJbdc < WebsphereCookbook::WebsphereBase
require_relative 'helper'
# ...
end
end
You don't need to require things coming from upstream cookbooks, nor can you (except for my weirdo cookbooks). All libs for cookbooks you depend on will be loaded by the time your library files run.
So I've just recently started writing some Ruby and whilst I understand how modules work, the following behaviour still throws me off.
module ModuleA
def a_greet
'Hello from module A'
end
end
module ModuleB
def b_greet
'Hello from module B'
end
end
include ModuleA
include ModuleB
# WHY DOES THIS WORK !!!!!
p ModuleA.b_greet
I get that the functions from the modules can be called without specifying Module. and that I'd never write code in this way, but I cannot understand why you can call a method included from ModuleB when explicitly stating ModuleA?
Wait, there's more:
"Why does this work?".b_greet # => "Hello from module B"
You're including those modules in a top-level object main. It's a special object: all methods defined on it become available to all objects (see the line above, there's now b_greet method on a String). ModuleA is an object too, so, when you include ModuleB, ModuleA gets its methods. If you include those modules in a regular class/object, you won't get this "sharing" behaviour.