added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,194 @@
SUMMARY = "Admin interface for Linux machines"
DESCRIPTION = "Cockpit makes it easy to administer your GNU/Linux servers via a web browser"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
SRC_URI += " \
https://github.com/cockpit-project/cockpit/releases/download/${PV}/cockpit-${PV}.tar.xz \
file://0001-remove-tests-dep-on-gobject-intro.patch \
file://0002-fix-makefile-use-copy-rule-for-unmodified-files.patch \
file://0001-Warn-not-error-if-xsltproc-is-not-found.patch \
file://cockpit.pam \
"
SRC_URI[sha256sum] = "dde91a157ee8514112334653fa2775a99d71bd1b604067a48eaf7411114d19de"
inherit gettext pkgconfig autotools systemd features_check
DEPENDS += "glib-2.0-native intltool-native gnutls virtual/gettext json-glib krb5 libpam systemd"
COMPATIBLE_HOST:libc-musl = "null"
RDEPENDS:${PN} += "glib-networking"
REQUIRED_DISTRO_FEATURES = "systemd pam"
COCKPIT_USER_GROUP ?= "root"
COCKPIT_WS_USER_GROUP ?= "${COCKPIT_USER_GROUP}"
EXTRA_AUTORECONF = "-I tools"
EXTRA_OECONF = " \
--with-cockpit-user=${COCKPIT_USER_GROUP} \
--with-cockpit-group=${COCKPIT_USER_GROUP} \
--with-admin-group=${COCKPIT_USER_GROUP} \
--with-cockpit-ws-instance-user=${COCKPIT_WS_USER_GROUP} \
--with-cockpit-ws-instance-group=${COCKPIT_WS_USER_GROUP} \
--disable-doc \
--with-systemdunitdir=${systemd_system_unitdir} \
"
PACKAGECONFIG ??= " \
${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)} \
"
PACKAGECONFIG[pcp] = "--enable-pcp,--disable-pcp,pcp"
PACKAGECONFIG[dashboard] = "--enable-ssh,--disable-ssh,libssh"
PACKAGECONFIG[storaged] = ",,,udisks2"
PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit,polkit"
PACKAGES =+ " \
${PN}-pcp \
${PN}-realmd \
${PN}-tuned \
${PN}-shell \
${PN}-systemd \
${PN}-users \
${PN}-kdump \
${PN}-sosreport \
${PN}-storaged \
${PN}-networkmanager \
${PN}-machines \
${PN}-selinux \
${PN}-playground \
${PN}-docker \
${PN}-dashboard \
${PN}-bridge \
${PN}-ws \
${PN}-desktop \
"
SYSTEMD_PACKAGES = "${PN}-ws"
FILES:${PN}-pcp = " \
${libexecdir}/cockpit-pcp \
${datadir}/cockpit/pcp \
${localstatedir}/lib/pcp/config/pmlogconf/tools/cockpit \
"
FILES:${PN}-realmd = "${datadir}/cockpit/realmd"
FILES:${PN}-tuned = "${datadir}/cockpit/tuned"
FILES:${PN}-shell = "${datadir}/cockpit/shell"
FILES:${PN}-systemd = "${datadir}/cockpit/systemd"
FILES:${PN}-users = "${datadir}/cockpit/users"
FILES:${PN}-kdump = " \
${datadir}/cockpit/kdump \
${datadir}/metainfo/org.cockpit-project.cockpit-kdump.metainfo.xml \
"
FILES:${PN}-sosreport = " \
${datadir}/cockpit/sosreport \
${datadir}/metainfo/org.cockpit-project.cockpit-sosreport.metainfo.xml \
${datadir}/pixmaps/cockpit-sosreport.png \
"
FILES:${PN}-storaged = " \
${datadir}/cockpit/storaged \
${datadir}/metainfo/org.cockpit-project.cockpit-storaged.metainfo.xml \
"
FILES:${PN}-networkmanager = "${datadir}/cockpit/networkmanager"
RDEPENDS:${PN}-networkmanager = "networkmanager"
FILES:${PN}-machines = " \
${datadir}/cockpit/machines \
${datadir}/metainfo/org.cockpit-project.cockpit-machines.metainfo.xml \
"
FILES:${PN}-selinux = " \
${datadir}/cockpit/selinux \
${datadir}/metainfo/org.cockpit-project.cockpit-selinux.metainfo.xml \
"
FILES:${PN}-playground = "${datadir}/cockpit/playground"
FILES:${PN}-docker = " \
${datadir}/cockpit/docker \
${datadir}/metainfo/org.cockpit-project.cockpit-docker.metainfo.xml \
"
FILES:${PN}-dashboard = "${datadir}/cockpit/dashboard"
ALLOW_EMPTY:${PN}-dashboard = "1"
FILES:${PN}-bridge = " \
${bindir}/cockpit-bridge \
${libexec}/cockpit-askpass \
"
RDEPENDS:${PN}-bridge = ""
FILES:${PN}-desktop = "${libexecdir}/cockpit-desktop"
RDEPENDS:${PN}-desktop += "bash"
FILES:${PN}-ws = " \
${sysconfdir}/cockpit/ws-certs.d \
${sysconfdir}/pam.d/cockpit \
${sysconfdir}/issue.d/cockpit.issue \
${sysconfdir}/motd.d/cockpit \
${datadir}/cockpit/motd/update-motd \
${datadir}/cockpit/motd/inactive.motd \
${systemd_system_unitdir}/cockpit.service \
${systemd_system_unitdir}/cockpit-motd.service \
${systemd_system_unitdir}/cockpit.socket \
${systemd_system_unitdir}/cockpit-wsinstance-http.socket \
${systemd_system_unitdir}/cockpit-wsinstance-http.service \
${systemd_system_unitdir}/cockpit-wsinstance-http-redirect.socket \
${systemd_system_unitdir}/cockpit-wsinstance-http-redirect.service \
${systemd_system_unitdir}/cockpit-wsinstance-https-factory.socket \
${systemd_system_unitdir}/cockpit-wsinstance-https-factory@.service \
${systemd_system_unitdir}/cockpit-wsinstance-https@.socket \
${systemd_system_unitdir}/cockpit-wsinstance-https@.service \
${systemd_system_unitdir}/system-cockpithttps.slice \
${libdir}/tmpfiles.d/cockpit-tempfiles.conf \
${sbindir}/remotectl \
${libdir}/security/pam_ssh_add.so \
${libdir}/security/pam_cockpit_cert.so \
${libexecdir}/cockpit-ws \
${libexecdir}/cockpit-wsinstance-factory \
${libexecdir}/cockpit-tls \
${libexecdir}/cockpit-session \
${localstatedir}/lib/cockpit \
${datadir}/cockpit/static \
${datadir}/cockpit/branding \
"
CONFFILES:${PN}-ws += " \
${sysconfdir}/issue.d/cockpit.issue \
${sysconfdir}/motd.d/cockpit \
"
RDEPENDS:${PN}-ws += "openssl-bin"
SYSTEMD_SERVICE:${PN}-ws = "cockpit.socket"
FILES:${PN} += " \
${datadir}/cockpit/base1 \
${sysconfdir}/cockpit/machines.d \
${datadir}/polkit-1/actions/org.cockpit-project.cockpit-bridge.policy \
${datadir}/cockpit/ssh \
${libexecdir}/cockpit-ssh \
${datadir}/cockpit \
${datadir}/metainfo/cockpit.appdata.xml \
${datadir}/pixmaps/cockpit.png \
${nonarch_libdir}/tmpfiles.d \
${nonarch_libdir}/firewalld \
"
RDEPENDS:${PN} += "${PN}-bridge"
# Needs bash for /usr/libexec/cockpit-certificate-helper
RDEPENDS:${PN} += "bash"
do_install:append() {
pkgdatadir=${datadir}/cockpit
chmod 4750 ${D}${libexecdir}/cockpit-session
install -d "${D}${sysconfdir}/pam.d"
install -p -m 0644 ${WORKDIR}/cockpit.pam ${D}${sysconfdir}/pam.d/cockpit
# provided by firewalld
rm -rf ${D}${libdir}/firewalld
if ! ${@bb.utils.contains('PACKAGECONFIG', 'storaged', 'true', 'false', d)}; then
for filename in ${FILES:${PN}-storaged}
do
rm -rf ${D}$filename
done
fi
}

View File

@@ -0,0 +1,27 @@
From 588bb5cb248aaeaf0fea33084229c99ad1574291 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 7 Sep 2022 11:12:28 -0700
Subject: [PATCH] Warn not error if xsltproc is not found
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 7659f41..537203e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,7 +177,7 @@ AC_SUBST([systemdunitdir], [$systemdunitdir])
# package as xgettext, and we find them by PATH, so just check for the one.
AC_PATH_PROG([XGETTEXT], [xsltproc], [no])
if test "$XGETTEXT" = "no"; then
- AC_MSG_ERROR([Please install gettext tools])
+ AC_MSG_WARN([Please install gettext tools])
fi
# ssh-add
--
2.37.3

View File

@@ -0,0 +1,60 @@
From 788aace494f79e8201b18ebcdf1592b5030c5295 Mon Sep 17 00:00:00 2001
From: Adrian Freihofer <adrian.freihofer@siemens.com>
Date: Wed, 4 Dec 2019 17:23:46 +0100
Subject: [PATCH] remove tests dep on gobject-intro
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/ws/Makefile-ws.am | 54 ---------------------------------------------------
1 file changed, 54 deletions(-)
--- a/src/ws/Makefile-ws.am
+++ b/src/ws/Makefile-ws.am
@@ -58,46 +58,6 @@ pam_cockpit_cert_so_LDFLAGS = -shared
pam_cockpit_cert_so_SOURCES = src/ws/pam_cockpit_cert.c
# -----------------------------------------------------------------------------
-# test-server: server for running the html/browser unit tests against
-
-check_PROGRAMS += test-server
-
-test_server_CPPFLAGS = $(libcockpit_ws_a_CPPFLAGS) $(TEST_CPP)
-test_server_LDADD = $(libcockpit_ws_a_LIBS) $(TEST_LIBS)
-
-test_server_SOURCES = \
- src/ws/mock-service.c \
- src/ws/mock-service.h \
- src/ws/test-server.c \
- $(NULL)
-
-test_server_CPPFLAGS += -I$(top_builddir)/src/ws
-nodist_test_server_SOURCES = $(GDBUS_CODEGEN_GENERATED)
-
-BUILT_SOURCES += $(GDBUS_CODEGEN_GENERATED)
-CLEANFILES += $(GDBUS_CODEGEN_GENERATED)
-GDBUS_CODEGEN_GENERATED = \
- src/ws/mock-dbus-tests.h \
- src/ws/mock-dbus-tests.c \
- $(NULL)
-
-EXTRA_DIST += $(GDBUS_CODEGEN_XML)
-GDBUS_CODEGEN_XML = $(srcdir)/src/ws/com.redhat.Cockpit.DBusTests.xml
-
-GDBUS_CODEGEN_INVOCATION = \
- $(AM_V_GEN) gdbus-codegen \
- --interface-prefix com.redhat.Cockpit.DBusTests \
- --c-namespace Test \
- --c-generate-object-manager \
- $(NULL)
-
-src/ws/mock-dbus-tests.h: $(GDBUS_CODEGEN_XML)
- $(GDBUS_CODEGEN_INVOCATION) --header --output $@ $<
-
-src/ws/mock-dbus-tests.c: $(GDBUS_CODEGEN_XML)
- $(GDBUS_CODEGEN_INVOCATION) --body --output $@ $<
-
-# -----------------------------------------------------------------------------
# Unit tests
check_SCRIPTS += src/ws/mock-cat-with-init

View File

@@ -0,0 +1,47 @@
From 1edf0756bf4fd002f5b60cf2b86d4b97a00aff20 Mon Sep 17 00:00:00 2001
From: Michael Haener <michael.haener@siemens.com>
Date: Wed, 25 Mar 2020 08:32:07 +0100
Subject: [PATCH] fix(makefile): use copy rule for unmodified files
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
pkg/Makefile.am | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
--- a/pkg/Makefile.am
+++ b/pkg/Makefile.am
@@ -7,6 +7,33 @@ TESTS += $(pkg_TESTS)
%.metainfo.xml: %.metainfo.xml.in
$(AM_V_GEN) mkdir -p $(dir $@) && msgfmt --xml -d $(top_srcdir)/po --template $< --output $@
+dist/playground/hammer.gif: pkg/playground/hammer.gif
+ $(COPY_RULE)
+
+dist/sosreport/sosreport.png: pkg/sosreport/sosreport.png
+ $(COPY_RULE)
+
+dist/apps/default.png: pkg/apps/default.png
+ $(COPY_RULE)
+
+dist/storaged/images/storage-array.png: pkg/storaged/images/storage-array.png
+ $(COPY_RULE)
+
+dist/storaged/images/storage-disk.png: pkg/storaged/images/storage-disk.png
+ $(COPY_RULE)
+
+dist/shell/images/server-error.png: pkg/shell/images/server-error.png
+ $(COPY_RULE)
+
+dist/shell/images/server-large.png: pkg/shell/images/server-large.png
+ $(COPY_RULE)
+
+dist/shell/images/server-small.png: pkg/shell/images/server-small.png
+ $(COPY_RULE)
+
+dist/shell/index.html: pkg/shell/index.html
+ $(COPY_RULE)
+
metainfodir = ${datarootdir}/metainfo
nodist_metainfo_DATA = \
pkg/sosreport/org.cockpit-project.cockpit-sosreport.metainfo.xml \

View File

@@ -0,0 +1,8 @@
#%PAM-1.0
auth required pam_unix.so nullok
account required pam_unix.so
-session optional pam_systemd.so
session required pam_unix.so
session optional pam_keyinit.so force revoke

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
# SPDX-License-Identifier: GPL-3.0-or-later
[Unit]
Description=Real time performance monitoring
RequiresMountsFor=/var
After=network.target
[Service]
Type=simple
ExecStartPre=/bin/mkdir -p /var/log/netdata
ExecStartPre=/bin/chown -R netdata.netdata /var/log/netdata
ExecStart=/usr/sbin/netdata -D -u netdata
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,82 @@
SUMMARY = "Real-time performance monitoring"
DESCRIPTION = "Netdata is high-fidelity infrastructure monitoring and troubleshooting. \
Open-source, free, preconfigured, opinionated, and always real-time."
HOMEPAGE = "https://github.com/netdata/netdata/"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fc9b848046ef54b5eaee6071947abd24"
DEPENDS += "libuv util-linux zlib"
SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz \
"
SRC_URI[sha256sum] = "f4a1233112b55e07e2862ffda0416255f0aa4c8e2b16929b76fa7ad6b69fd931"
# default netdata.conf for netdata configuration
SRC_URI += "file://netdata.conf"
# file for providing systemd service support
SRC_URI += "file://netdata.service"
UPSTREAM_CHECK_URI = "https://github.com/netdata/netdata/releases"
S = "${WORKDIR}/${BPN}-v${PV}"
# Stop sending anonymous statistics to Google Analytics
NETDATA_ANONYMOUS ??= "enabled"
inherit pkgconfig autotools-brokensep useradd systemd
LIBS:toolchain-clang:x86 = "-latomic"
LIBS:riscv64 = "-latomic"
LIBS:riscv32 = "-latomic"
LIBS:mips = "-latomic"
export LIBS
#systemd
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "netdata.service"
SYSTEMD_AUTO_ENABLE:${PN} = "enable"
#User specific
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --home-dir ${localstatedir}/run/netdata --user-group netdata"
PACKAGECONFIG ??= "https"
PACKAGECONFIG[cloud] = "--enable-cloud, --disable-cloud, json-c"
PACKAGECONFIG[compression] = "--enable-compression, --disable-compression, lz4"
PACKAGECONFIG[https] = "--enable-https, --disable-https, openssl"
# ebpf doesn't compile (or detect) the cross compilation well
EXTRA_OECONF += "--disable-ebpf"
do_install:append() {
#set S UID for plugins
chmod 4755 ${D}${libexecdir}/netdata/plugins.d/apps.plugin
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
# Install systemd unit files
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/netdata.service ${D}${systemd_unitdir}/system
sed -i -e 's,@@datadir,${datadir_native},g' ${D}${systemd_unitdir}/system/netdata.service
fi
# Install default netdata.conf
install -d ${D}${sysconfdir}/netdata
install -m 0644 ${WORKDIR}/netdata.conf ${D}${sysconfdir}/netdata/
sed -i -e 's,@@sysconfdir,${sysconfdir},g' ${D}${sysconfdir}/netdata/netdata.conf
sed -i -e 's,@@libdir,${libexecdir},g' ${D}${sysconfdir}/netdata/netdata.conf
sed -i -e 's,@@datadir,${datadir},g' ${D}${sysconfdir}/netdata/netdata.conf
if [ "${NETDATA_ANONYMOUS}" = "enabled" ]; then
touch ${D}${sysconfdir}/netdata/.opt-out-from-anonymous-statistics
fi
install --group netdata --owner netdata --directory ${D}${localstatedir}/cache/netdata
install --group netdata --owner netdata --directory ${D}${localstatedir}/lib/netdata
chown -R netdata:netdata ${D}${datadir}/netdata/web
}
FILES:${PN} += "${localstatedir}/cache/netdata/ ${localstatedir}/lib/netdata/"
RDEPENDS:${PN} = "bash zlib"

View File

@@ -0,0 +1,64 @@
Disable OS version check in status screen
The code is not able to accurately detect the correct distro/version at
the moment.
Upstream-Status: Inappropriate
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Index: webmin-1.850/webmin/webmin-lib.pl
===================================================================
--- webmin-1.850.orig/webmin/webmin-lib.pl
+++ webmin-1.850/webmin/webmin-lib.pl
@@ -1112,28 +1112,28 @@ my %miniserv;
&load_theme_library(); # So that UI functions work
# Need OS upgrade
-my %realos = &detect_operating_system(undef, 1);
-if (($realos{'os_version'} ne $gconfig{'os_version'} ||
- $realos{'os_type'} ne $gconfig{'os_type'}) &&
- $realos{'os_version'} && $realos{'os_type'} &&
- &foreign_available("webmin")) {
- my ($realminor) = split(/\./, $realos{'os_version'});
- my ($minor) = split(/\./, $gconfig{'os_version'});
- if ($realos{'os_type'} eq $gconfig{'os_type'} &&
- $realminor == $minor) {
- # Only the minor version number changed - no need to apply
- &apply_new_os_version(\%realos);
- }
- else {
- # Large enough change to tell the user
- push(@notifs,
- &ui_form_start("$gconfig{'webprefix'}/webmin/fix_os.cgi").
- &text('os_incorrect', $realos{'real_os_type'},
- $realos{'real_os_version'})."<p>\n".
- &ui_form_end([ [ undef, $text{'os_fix'} ] ])
- );
- }
- }
+#my %realos = &detect_operating_system(undef, 1);
+#if (($realos{'os_version'} ne $gconfig{'os_version'} ||
+# $realos{'os_type'} ne $gconfig{'os_type'}) &&
+# $realos{'os_version'} && $realos{'os_type'} &&
+# &foreign_available("webmin")) {
+# my ($realminor) = split(/\./, $realos{'os_version'});
+# my ($minor) = split(/\./, $gconfig{'os_version'});
+# if ($realos{'os_type'} eq $gconfig{'os_type'} &&
+# $realminor == $minor) {
+# # Only the minor version number changed - no need to apply
+# &apply_new_os_version(\%realos);
+# }
+# else {
+# # Large enough change to tell the user
+# push(@notifs,
+# &ui_form_start("$gconfig{'webprefix'}/webmin/fix_os.cgi").
+# &text('os_incorrect', $realos{'real_os_type'},
+# $realos{'real_os_version'})."<p>\n".
+# &ui_form_end([ [ undef, $text{'os_fix'} ] ])
+# );
+# }
+# }
# Password close to expiry
my $warn_days = $config{'warn_days'};

View File

@@ -0,0 +1,29 @@
From 7eba4c98c6953fa6ea76c1620d19524bcfa3a576 Mon Sep 17 00:00:00 2001
From: Kevin Strasser <kevin.strasser@linux.intel.com>
Date: Wed, 1 Aug 2012 11:51:26 -0700
Subject: [PATCH] nfs export: remove nfsd check
nfsd runs as a kernel process and does not have a pid. This means
that the command assigned to apply_cmd will never be executed when
the user tries to apply changes to nfs exports.
Upstream-Status: Inappropriate [config]
Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
---
exports/exports-lib.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: webmin-1.850/exports/exports-lib.pl
===================================================================
--- webmin-1.850.orig/exports/exports-lib.pl
+++ webmin-1.850/exports/exports-lib.pl
@@ -301,7 +301,7 @@ return !&has_command("rpc.nfsd") && !&ha
sub restart_mountd
{
# Try exportfs -r first
-if ($config{'apply_cmd'} && &find_byname("nfsd") && &find_byname("mountd")) {
+if ($config{'apply_cmd'} && &find_byname("mountd")) {
my $out = &backquote_logged("$config{'apply_cmd'} 2>&1 </dev/null");
if (!$? && $out !~ /invalid|error|failed/i) {
# Looks like it worked!

View File

@@ -0,0 +1,75 @@
Hack in support for an "exclude" config option for the init module, so
we can hide certain system services that shouldn't really be configurable
via the web interface
Upstream-Status: Pending
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
init/index.cgi | 27 ++++++++++++++-------------
init/init-lib.pl | 5 +++--
2 files changed, 17 insertions(+), 15 deletions(-)
Index: webmin-1.850/init/index.cgi
===================================================================
--- webmin-1.850.orig/init/index.cgi
+++ webmin-1.850/init/index.cgi
@@ -45,19 +45,20 @@ elsif ($init_mode eq "init" && $access{'
: "$config{'init_dir'}/$ac[0]");
}
@runlevels = &list_runlevels();
- foreach $r (@runlevels) {
- foreach $w ("S", "K") {
- foreach $a (&runlevel_actions($r, $w)) {
- @ac = split(/\s+/, $a);
- if (!$nodemap{$ac[2]}) {
- push(@acts, $ac[1]);
- push(@actsl,
- "1+$r+$ac[0]+$ac[1]+$ac[2]+$w");
- push(@actsf, "$config{'init_base'}/rc$r.d/$w$ac[0]$ac[1]");
- }
- }
- }
- }
+ # Assume there won't be any of these broken actions
+ #foreach $r (@runlevels) {
+ # foreach $w ("S", "K") {
+ # foreach $a (&runlevel_actions($r, $w)) {
+ # @ac = split(/\s+/, $a);
+ # if (!$nodemap{$ac[2]}) {
+ # push(@acts, $ac[1]);
+ # push(@actsl,
+ # "1+$r+$ac[0]+$ac[1]+$ac[2]+$w");
+ # push(@actsf, "$config{'init_base'}/rc$r.d/$w$ac[0]$ac[1]");
+ # }
+ # }
+ # }
+ # }
# For each action, look at /etc/rc*.d/* files to see if it is
# started at boot
Index: webmin-1.850/init/init-lib.pl
===================================================================
--- webmin-1.850.orig/init/init-lib.pl
+++ webmin-1.850/init/init-lib.pl
@@ -124,8 +124,9 @@ List boot time action names from init.d,
=cut
sub list_actions
{
-local($dir, $f, @stbuf, @rv);
+local($dir, $f, @stbuf, @rv, @exclude);
$dir = $config{init_dir};
+@exclude = split(/,/, $config{exclude});
opendir(DIR, $dir);
foreach $f (sort { lc($a) cmp lc($b) } readdir(DIR)) {
if ($f eq "." || $f eq ".." || $f =~ /\.bak$/ || $f eq "functions" ||
@@ -133,7 +134,7 @@ foreach $f (sort { lc($a) cmp lc($b) } r
-d "$dir/$f" || $f =~ /\.swp$/ || $f eq "skeleton" ||
$f =~ /\.lock$/ || $f =~ /\.dpkg-(old|dist)$/ ||
$f =~ /^\.depend\./ || $f eq '.legacy-bootordering' ||
- $f =~ /^mandrake/) { next; }
+ $f =~ /^mandrake/ || grep {$_ eq $f} @exclude ) { next; }
if (@stbuf = stat("$dir/$f")) {
push(@rv, "$f $stbuf[1]");
}

View File

@@ -0,0 +1,69 @@
add mediatomb support
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
diff -Nru webmin-1.570.bak/mediatomb/index.cgi webmin-1.570/mediatomb/index.cgi
--- webmin-1.570.bak/mediatomb/index.cgi 1969-12-31 16:00:00.000000000 -0800
+++ webmin-1.570/mediatomb/index.cgi 2011-10-26 10:00:05.992522036 -0700
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+# index.cgi
+# Display MediaTomb option categories
+
+require './mediatomb-lib.pl';
+
+ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
+
+
+$ipaddress = &get_my_address();
+print &text('index_desc', $ipaddress),"<p>\n";
+
+ui_print_footer("/", $text{'index'});
diff -Nru webmin-1.570.bak/mediatomb/lang/en webmin-1.570/mediatomb/lang/en
--- webmin-1.570.bak/mediatomb/lang/en 1969-12-31 16:00:00.000000000 -0800
+++ webmin-1.570/mediatomb/lang/en 2011-10-26 10:01:13.340522186 -0700
@@ -0,0 +1,2 @@
+index_title=MediaTomb
+index_desc=MediaTomb is an open source (GPL) UPnP MediaServer with a nice web user interface. You can access it via <a href='http://$1:49153'>here</a>.
diff -Nru webmin-1.570.bak/mediatomb/mediatomb-lib.pl webmin-1.570/mediatomb/mediatomb-lib.pl
--- webmin-1.570.bak/mediatomb/mediatomb-lib.pl 1969-12-31 16:00:00.000000000 -0800
+++ webmin-1.570/mediatomb/mediatomb-lib.pl 2011-10-26 10:01:34.692522079 -0700
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+# mediatomb-lib.pl
+# Common functions for the MediaTomb module
+
+BEGIN { push(@INC, ".."); };
+use WebminCore;
+&init_config();
+
+sub get_my_address
+{
+my $myip;
+if (&foreign_check("net")) {
+ # Try to get ethernet interface
+ &foreign_require("net", "net-lib.pl");
+ my @act = &net::active_interfaces();
+ my @ifaces = grep { &net::iface_type($_->{'fullname'}) =~ /ether/i }
+ @act;
+ @ifaces = ( $act[0] ) if (!@ifaces && @act);
+ if (@ifaces) {
+ return wantarray ? ( map { $_->{'address'} } @ifaces )
+ : $ifaces[0]->{'address'};
+ }
+ }
+$myip = &to_ipaddress(&get_system_hostname());
+if ($myip) {
+ # Can resolve hostname .. use that
+ return wantarray ? ( $myip ) : $myip;
+ }
+return wantarray ? ( ) : undef;
+}
+
diff -Nru webmin-1.570.bak/mediatomb/module.info webmin-1.570/mediatomb/module.info
--- webmin-1.570.bak/mediatomb/module.info 1969-12-31 16:00:00.000000000 -0800
+++ webmin-1.570/mediatomb/module.info 2011-10-26 09:59:50.428528369 -0700
@@ -0,0 +1,3 @@
+desc=MediaTomb
+category=others
+longdesc=MediaTomb access module

View File

@@ -0,0 +1,25 @@
Add excludefs config option to mount module
Adds a configuration option (currently hidden) to allow the distro to
hide certain filesystems from the mount module within Webmin (e.g. /dev)
since these shouldn't be modified from the web interface.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Upstream-Status: Pending
--- webmin-1.570.orig/mount/index.cgi
+++ webmin-1.570/mount/index.cgi
@@ -33,10 +33,12 @@ elsif ($config{'sort_mode'} == 1) {
}
# Build visible filesystems list
+@excludefs = split(/,/, $config{excludefs});
foreach $m (@all) {
@minfo = @$m;
$p = &simplify_mount_path($minfo[0], $minfo[2]);
next if ($ignore{$minfo[2]});
+ next if (grep {$_ eq $minfo[2]} @excludefs);
@mmodes = &mount_modes($minfo[2], $minfo[0], $minfo[1]);
$canedit = $can_edit{$minfo[2]} && !$mmodes[4] &&
&can_edit_fs(@minfo);

View File

@@ -0,0 +1,50 @@
From 719206df606acd7a623e8d75da293c25489b7884 Mon Sep 17 00:00:00 2001
From: Diego Rondini <diego.ml@zoho.com>
Date: Thu, 18 Feb 2016 15:44:06 +0100
Subject: [PATCH] Adjust Mysql config defaults
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Diego Rondini <diego.ml@zoho.com>
---
mysql/config | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/mysql/config b/mysql/config
index e5b6fb3..77bfe69 100644
--- a/mysql/config
+++ b/mysql/config
@@ -1,13 +1,13 @@
-start_cmd=cd /usr/local/mysql ; (./bin/safe_mysqld || ./bin/mysqld_safe) &
+start_cmd=/usr/bin/mysqld_safe
perpage=25
-mysql=/usr/local/mysql/bin/mysql
-mysqldump=/usr/local/mysql/bin/mysqldump
-mysqlimport=/usr/local/mysql/bin/mysqlimport
-pass=foo
-mysqlshow=/usr/local/mysql/bin/mysqlshow
+mysql=/usr/bin/mysql
+mysqldump=/usr/bin/mysqldump
+mysqlimport=/usr/bin/mysqlimport
+pass=
+mysqlshow=/usr/bin/mysqlshow
login=root
-mysql_libs=/usr/local/mysql/lib
-mysqladmin=/usr/local/mysql/bin/mysqladmin
+mysql_libs=/usr/lib
+mysqladmin=/usr/bin/mysqladmin
style=0
add_mode=1
nodbi=0
@@ -15,7 +15,7 @@ access=*: *
blob_mode=0
date_subs=0
passwd_mode=0
-mysql_data=/usr/local/mysql/var
+mysql_data=/var/lib/mysql
max_dbs=50
my_cnf=/etc/my.cnf
max_text=1000
--
2.5.0

View File

@@ -0,0 +1,25 @@
Add support for configuring network interfaces on a generic linux system
Upstream-Status: Inappropriate [config]
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Index: webmin-1.850/net/module.info
===================================================================
--- webmin-1.850.orig/net/module.info
+++ webmin-1.850/net/module.info
@@ -14,7 +14,7 @@ desc_ko_KR.UTF-8=네트워크 구성
name=Networking
desc_tr=A<> Yap<61>land<6E>rmas<61>
desc_de=Netzwerkkonfiguration
-os_support=solaris coherent-linux redhat-linux/5.0-* mandrake-linux united-linux suse-linux/6.0-* open-linux unixware turbo-linux/4.0 freebsd/3.2-* openbsd debian-linux/2.2-* cobalt-linux/2.2-* msc-linux gentoo-linux macos/1.5-* trustix-linux slackware-linux/8.0-* openmamba-linux cygwin windows pardus-linux
+os_support=generic-linux solaris coherent-linux redhat-linux/5.0-* mandrake-linux united-linux suse-linux/6.0-* open-linux unixware turbo-linux/4.0 freebsd/3.2-* openbsd debian-linux/2.2-* cobalt-linux/2.2-* msc-linux gentoo-linux macos/1.5-* trustix-linux slackware-linux/8.0-* openmamba-linux cygwin windows pardus-linux
desc_sk=Konfigur<75>cia siete
desc_zh_CN=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
risk=low medium high
Index: webmin-1.850/net/generic-linux-lib.pl
===================================================================
--- /dev/null
+++ webmin-1.850/net/generic-linux-lib.pl
@@ -0,0 +1,2 @@
+do 'linux-lib.pl';
+

View File

@@ -0,0 +1,19 @@
Upstream-Status: Inappropriate [config]
XXX: need to work out a better fix.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
diff -Nru webmin-1.570.orig//net/net-lib.pl webmin-1.570/net/net-lib.pl
--- webmin-1.570.orig//net/net-lib.pl 2011-10-03 09:01:48.000000000 +0800
+++ webmin-1.570/net/net-lib.pl 2011-10-28 13:52:56.138873664 +0800
@@ -21,7 +21,8 @@
do "$gconfig{'os_type'}-9.1-ALL-lib.pl";
}
else {
- do "$gconfig{'os_type'}-lib.pl";
+ #do "$gconfig{'os_type'}-lib.pl";
+ do "debian-linux-lib.pl";
}
# list_hosts()

View File

@@ -0,0 +1,39 @@
commit e48f61d2f6df32a518bcb84db8c6eacfe5435c32
Author: Yu Ke <ke.yu@intel.com>
Date: Fri Oct 28 14:40:51 2011 +0800
NFS export: fix syntax issue
fix two syntax issue in /etc/exports:
1. if it is exported to everyone, should use "*", e.g. "/export *(xxx)"
2. explicitly specify subtree_check or no_subtree_check, required by latest nfs-utils
Upstream-Status: Pending
Signed-off-by: Yu Ke <ke.yu@intel.com>
Index: webmin-1.850/exports/save_export.cgi
===================================================================
--- webmin-1.850.orig/exports/save_export.cgi
+++ webmin-1.850/exports/save_export.cgi
@@ -50,7 +50,7 @@ else {
&error(&text('save_enetmask', $in{'netmask'}));
$exp{'host'} = $in{'network'}."/".$in{'netmask'};
}
- elsif ($in{'mode'} == 3) { $exp{'host'} = ""; }
+ elsif ($in{'mode'} == 3) { $exp{'host'} = "*"; }
else {
$in{'host'} =~ /\*/ || &to_ipaddress($in{'host'}) ||
&error(&text('save_ehost', $in{'host'}));
@@ -87,6 +87,11 @@ else {
delete($opts{'no_subtree_check'});
delete($opts{'subtree_check'});
$opts{'no_subtree_check'} = "" if ($in{'no_subtree_check'});
+ if ($in{'no_subtree_check'}) {
+ $opts{'no_subtree_check'} = "";
+ } else {
+ $opts{'subtree_check'} = "";
+ }
delete($opts{'nohide'});
delete($opts{'hide'});

View File

@@ -0,0 +1,18 @@
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: webmin-1.570/proftpd/config
===================================================================
--- webmin-1.570.orig/proftpd/config 2011-10-25 20:18:37.000000000 +0800
+++ webmin-1.570/proftpd/config 2011-10-25 20:21:13.000000000 +0800
@@ -1,6 +1,6 @@
-proftpd_path=/usr/local/sbin/proftpd
-proftpd_conf=/usr/local/etc/proftpd.conf
-pid_file=/usr/local/var/proftpd.pid
+proftpd_path=/usr/sbin/proftpd
+proftpd_conf=/etc/proftpd.conf
+pid_file=/var/proftpd.pid
ftpusers=/etc/ftpusers
test_config=1
test_always=0

View File

@@ -0,0 +1,25 @@
From 6f04699d5d417122b67e8118fd1955c769f17e76 Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Tue, 2 Sep 2014 00:11:05 -0700
Subject: [PATCH] ajaxterm/ajaxterm/qweb.py: fix hardcode of python2.3
Upstream-Status: Pending
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
ajaxterm/ajaxterm/qweb.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ajaxterm/ajaxterm/qweb.py b/ajaxterm/ajaxterm/qweb.py
index 20c5092..c658a6b 100644
--- a/ajaxterm/ajaxterm/qweb.py
+++ b/ajaxterm/ajaxterm/qweb.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.3
+#!/usr/bin/env python
#
# vim:set et ts=4 fdc=0 fdn=2 fdl=0:
#
--
1.7.9.5

View File

@@ -0,0 +1,29 @@
Remove "start on boot" option from webmin configuration, as
end-users should not need to configure this from the web interface
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
--- webmin-1.570.orig/webmin/index.cgi
+++ webmin-1.570/webmin/index.cgi
@@ -79,20 +79,6 @@ print &ui_buttons_start();
my %miniserv;
&get_miniserv_config(\%miniserv);
-if (&foreign_check("init")) {
- &foreign_require("init");
- my $starting = &init::action_status("webmin");
- print &ui_buttons_row("bootup.cgi",
- $text{'index_boot'},
- $text{'index_bootmsg'}.
- ($miniserv{'inetd'} ? "<b>$text{'index_inetd'}</b>" :
- !$ENV{'MINISERV_CONFIG'} ? "<b>$text{'index_apache'}</b>" : ""),
- &ui_hidden("starting", $starting),
- &ui_radio("boot", $starting == 2 ? 1 : 0,
- [ [ 1, $text{'yes'} ],
- [ 0, $text{'no'} ] ]));
- }
-
# Restart Webmin
if (!$miniserv{'inetd'} && $ENV{'MINISERV_CONFIG'}) {
print &ui_buttons_row("restart.cgi",

View File

@@ -0,0 +1,32 @@
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: webmin-1.570/samba/config-generic-linux
===================================================================
--- webmin-1.570.orig/samba/config-generic-linux 2011-10-25 20:11:35.000000000 +0800
+++ webmin-1.570/samba/config-generic-linux 2011-10-25 20:15:41.000000000 +0800
@@ -1,15 +1,15 @@
list_printers_command=lpc status | grep "[A-z0-9]:" | sed -e 's/://g'
-smb_passwd=/usr/local/samba/private/smbpasswd
+smb_passwd=/usr/bin/smbpasswd
text_lists=0
dont_convert=-499
-name_server=/usr/local/samba/bin/nmbd
-smb_conf=/usr/local/samba/lib/smb.conf
-samba_server=/usr/local/samba/bin/smbd
+name_server=/usr/sbin/nmbd
+smb_conf=/etc/samba/smb.conf
+samba_server=/usr/sbin/smbd
run_from_inetd=0
-samba_password_program=/usr/local/samba/bin/smbpasswd
-samba_status_program=/usr/local/samba/bin/smbstatus
+samba_password_program=/usr/bin/smbpasswd
+samba_status_program=/usr/bin/smbstatus
swat_path=/usr/local/samba/bin/swat
sort_mode=0
smbgroupedit=/usr/local/samba/bin/smbgroupedit
-pdbedit=/usr/local/samba/bin/pdbedit
-net=/usr/local/samba/bin/net
+pdbedit=/usr/bin/pdbedit
+net=/usr/bin/net

View File

@@ -0,0 +1,340 @@
#!/bin/sh
# Modified version of setup.sh distributed with webmin
if [ "$wadir" = "" ]; then
echo "ERROR: wadir not specified"
echo ""
exit 1
fi
config_dir_runtime=$config_dir
config_dir=$prefix$config_dir
wadir_runtime=$wadir
wadir=$prefix$wadir
ver=`cat "$wadir/version"`
cd "$wadir"
# Work out perl library path
PERLLIB=$wadir
# Validate source directory
allmods=`cd "$wadir"; echo */module.info | sed -e 's/\/module.info//g'`
if [ "$allmods" = "" ]; then
echo "ERROR: Failed to get module list"
echo ""
exit 1
fi
echo ""
if [ "$login" = "webmin" ]; then
echo "ERROR: Username 'webmin' is reserved for internal use"
echo ""
exit 14
fi
# Create webserver config file
echo $perl > $config_dir/perl-path
echo $var_dir > $config_dir/var-path
echo "Creating web server config files.."
cfile=$config_dir/miniserv.conf
echo "port=$port" >> $cfile
echo "root=$wadir_runtime" >> $cfile
echo "mimetypes=$wadir_runtime/mime.types" >> $cfile
echo "addtype_cgi=internal/cgi" >> $cfile
echo "realm=Webmin Server" >> $cfile
echo "logfile=$var_dir/miniserv.log" >> $cfile
echo "errorlog=$var_dir/miniserv.error" >> $cfile
echo "pidfile=$var_dir/miniserv.pid" >> $cfile
echo "logtime=168" >> $cfile
echo "ppath=$ppath" >> $cfile
echo "ssl=$ssl" >> $cfile
echo "env_WEBMIN_CONFIG=$config_dir_runtime" >> $cfile
echo "env_WEBMIN_VAR=$var_dir" >> $cfile
echo "atboot=$atboot" >> $cfile
echo "logout=$config_dir_runtime/logout-flag" >> $cfile
if [ "$listen" != "" ]; then
echo "listen=$listen" >> $cfile
else
echo "listen=10000" >> $cfile
fi
echo "denyfile=\\.pl\$" >> $cfile
echo "log=1" >> $cfile
echo "blockhost_failures=5" >> $cfile
echo "blockhost_time=60" >> $cfile
echo "syslog=1" >> $cfile
if [ "$allow" != "" ]; then
echo "allow=$allow" >> $cfile
fi
if [ "$session" != "" ]; then
echo "session=$session" >> $cfile
else
echo "session=1" >> $cfile
fi
if [ "$pam" != "" ]; then
echo "pam=$pam" >> $cfile
fi
if [ "$no_pam" != "" ]; then
echo "no_pam=$no_pam" >> $cfile
fi
echo premodules=WebminCore >> $cfile
echo "server=MiniServ/$ver" >> $cfile
md5pass=`$perl -e 'print crypt("test", "\\$1\\$A9wB3O18\\$zaZgqrEmb9VNltWTL454R/") eq "\\$1\\$A9wB3O18\\$zaZgqrEmb9VNltWTL454R/" ? "1\n" : "0\n"'`
ufile=$config_dir/miniserv.users
if [ "$crypt" != "" ]; then
echo "$login:$crypt:0" > $ufile
else
if [ "$md5pass" = "1" ]; then
$perl -e 'print "$ARGV[0]:",crypt($ARGV[1], "\$1\$XXXXXXXX"),":0\n"' "$login" "$password" > $ufile
else
$perl -e 'print "$ARGV[0]:",crypt($ARGV[1], "XX"),":0\n"' "$login" "$password" > $ufile
fi
fi
chmod 600 $ufile
echo "userfile=$config_dir_runtime/miniserv.users" >> $cfile
kfile=$config_dir/miniserv.pem
openssl version >/dev/null 2>&1
if [ "$?" = "0" ]; then
# We can generate a new SSL key for this host
host=`hostname`
openssl req -newkey rsa:512 -x509 -nodes -out $tempdir/cert -keyout $tempdir/key -days 1825 >/dev/null 2>&1 <<EOF
.
.
.
Webmin Webserver on $host
.
*
root@$host
EOF
if [ "$?" = "0" ]; then
cat $tempdir/cert $tempdir/key >$kfile
fi
rm -f $tempdir/cert $tempdir/key
fi
if [ ! -r $kfile ]; then
# Fall back to the built-in key
cp "$wadir/miniserv.pem" $kfile
fi
chmod 600 $kfile
echo "keyfile=$config_dir_runtime/miniserv.pem" >> $cfile
chmod 600 $cfile
echo "..done"
echo ""
echo "Creating access control file.."
afile=$config_dir/webmin.acl
rm -f $afile
if [ "$defaultmods" = "" ]; then
echo "$login: $allmods" >> $afile
else
echo "$login: $defaultmods" >> $afile
fi
chmod 600 $afile
echo "..done"
echo ""
if [ "$login" != "root" -a "$login" != "admin" ]; then
# Allow use of RPC by this user
echo rpc=1 >>$config_dir/$login.acl
fi
if [ "$noperlpath" = "" ]; then
echo "Inserting path to perl into scripts.."
(find "$wadir" -name '*.cgi' -print ; find "$wadir" -name '*.pl' -print) | $perl "$wadir/perlpath.pl" $perl_runtime -
echo "..done"
echo ""
fi
echo "Creating start and stop scripts.."
rm -f $config_dir/stop $config_dir/start $config_dir/restart $config_dir/reload
echo "#!/bin/sh" >>$config_dir/start
echo "echo Starting Webmin server in $wadir_runtime" >>$config_dir/start
echo "trap '' 1" >>$config_dir/start
echo "LANG=" >>$config_dir/start
echo "export LANG" >>$config_dir/start
echo "#PERLIO=:raw" >>$config_dir/start
echo "unset PERLIO" >>$config_dir/start
echo "export PERLIO" >>$config_dir/start
echo "PERLLIB=$PERLLIB" >>$config_dir/start
echo "export PERLLIB" >>$config_dir/start
uname -a | grep -i 'HP/*UX' >/dev/null
if [ $? = "0" ]; then
echo "exec '$wadir_runtime/miniserv.pl' $config_dir_runtime/miniserv.conf &" >>$config_dir/start
else
echo "exec '$wadir_runtime/miniserv.pl' $config_dir_runtime/miniserv.conf" >>$config_dir/start
fi
echo "#!/bin/sh" >>$config_dir/stop
echo "echo Stopping Webmin server in $wadir_runtime" >>$config_dir/stop
echo "pidfile=\`grep \"^pidfile=\" $config_dir_runtime/miniserv.conf | sed -e 's/pidfile=//g'\`" >>$config_dir/stop
echo "kill \`cat \$pidfile\`" >>$config_dir/stop
echo "#!/bin/sh" >>$config_dir/restart
echo "$config_dir_runtime/stop && $config_dir_runtime/start" >>$config_dir/restart
echo "#!/bin/sh" >>$config_dir/reload
echo "echo Reloading Webmin server in $wadir_runtime" >>$config_dir/reload
echo "pidfile=\`grep \"^pidfile=\" $config_dir_runtime/miniserv.conf | sed -e 's/pidfile=//g'\`" >>$config_dir/reload
echo "kill -USR1 \`cat \$pidfile\`" >>$config_dir/reload
chmod 755 $config_dir/start $config_dir/stop $config_dir/restart $config_dir/reload
echo "..done"
echo ""
if [ "$upgrading" = 1 ]; then
echo "Updating config files.."
else
echo "Copying config files.."
fi
newmods=`$perl "$wadir/copyconfig.pl" "$os_type/$real_os_type" "$os_version/$real_os_version" "$wadir" $config_dir "" $allmods`
# Store the OS and version
echo "os_type=$os_type" >> $config_dir/config
echo "os_version=$os_version" >> $config_dir/config
echo "real_os_type=$real_os_type" >> $config_dir/config
echo "real_os_version=$real_os_version" >> $config_dir/config
if [ -r /etc/system.cnf ]; then
# Found a caldera system config file .. get the language
source /etc/system.cnf
if [ "$CONF_LST_LANG" = "us" ]; then
CONF_LST_LANG=en
elif [ "$CONF_LST_LANG" = "uk" ]; then
CONF_LST_LANG=en
fi
grep "lang=$CONF_LST_LANG," "$wadir/lang_list.txt" >/dev/null 2>&1
if [ "$?" = 0 ]; then
echo "lang=$CONF_LST_LANG" >> $config_dir/config
fi
fi
# Turn on logging by default
echo "log=1" >> $config_dir/config
# Use licence module specified by environment variable
if [ "$licence_module" != "" ]; then
echo licence_module=$licence_module >>$config_dir/config
fi
# Disallow unknown referers by default
echo "referers_none=1" >>$config_dir/config
echo $ver > $config_dir/version
echo "..done"
echo ""
# Set passwd_ fields in miniserv.conf from global config
for field in passwd_file passwd_uindex passwd_pindex passwd_cindex passwd_mindex; do
grep $field= $config_dir/miniserv.conf >/dev/null
if [ "$?" != "0" ]; then
grep $field= $config_dir/config >> $config_dir/miniserv.conf
fi
done
grep passwd_mode= $config_dir/miniserv.conf >/dev/null
if [ "$?" != "0" ]; then
echo passwd_mode=0 >> $config_dir/miniserv.conf
fi
# If Perl crypt supports MD5, then make it the default
if [ "$md5pass" = "1" ]; then
echo md5pass=1 >> $config_dir/config
fi
# Set a special theme if none was set before
if [ "$theme" = "" ]; then
theme=`cat "$wadir/defaulttheme" 2>/dev/null`
fi
oldthemeline=`grep "^theme=" $config_dir/config`
oldtheme=`echo $oldthemeline | sed -e 's/theme=//g'`
if [ "$theme" != "" ] && [ "$oldthemeline" = "" ] && [ -d "$wadir/$theme" ]; then
themelist=$theme
fi
# Set a special overlay if none was set before
if [ "$overlay" = "" ]; then
overlay=`cat "$wadir/defaultoverlay" 2>/dev/null`
fi
if [ "$overlay" != "" ] && [ "$theme" != "" ] && [ -d "$wadir/$overlay" ]; then
themelist="$themelist $overlay"
fi
# Apply the theme and maybe overlay
if [ "$themelist" != "" ]; then
echo "theme=$themelist" >> $config_dir/config
echo "preroot=$themelist" >> $config_dir/miniserv.conf
fi
# Set the product field in the global config
grep product= $config_dir/config >/dev/null
if [ "$?" != "0" ]; then
echo product=webmin >> $config_dir/config
fi
if [ "$makeboot" = "1" ]; then
echo "Configuring Webmin to start at boot time.."
(cd "$wadir/init" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/init/atboot.pl" $bootscript)
echo "..done"
echo ""
fi
# If password delays are not specifically disabled, enable them
grep passdelay= $config_dir/miniserv.conf >/dev/null
if [ "$?" != "0" ]; then
echo passdelay=1 >> $config_dir/miniserv.conf
fi
echo "Changing ownership and permissions .."
# Make all config dirs non-world-readable
for m in $newmods; do
chown -R root $config_dir/$m
chgrp -R bin $config_dir/$m
chmod -R og-rw $config_dir/$m
done
# Make miniserv config files non-world-readable
for f in miniserv.conf miniserv.pem miniserv.users; do
chown -R root $config_dir/$f
chgrp -R bin $config_dir/$f
chmod -R og-rw $config_dir/$f
done
chmod +r $config_dir/version
if [ "$nochown" = "" ]; then
# Make program directory non-world-writable, but executable
chown -R root "$wadir"
chgrp -R bin "$wadir"
chmod -R og-w "$wadir"
chmod -R a+rx "$wadir"
fi
if [ $var_dir != "/var" ]; then
# Make log directory non-world-readable or writable
chown -R root $prefix$var_dir
chgrp -R bin $prefix$var_dir
chmod -R og-rwx $prefix$var_dir
fi
# Fix up bad permissions from some older installs
for m in ldap-client ldap-server ldap-useradmin mailboxes mysql postgresql servers virtual-server; do
if [ -d "$config_dir/$m" ]; then
chown root $config_dir/$m
chgrp bin $config_dir/$m
chmod og-rw $config_dir/$m
chmod og-rw $config_dir/$m/config 2>/dev/null
fi
done
if [ "$nopostinstall" = "" ]; then
echo "Running postinstall scripts .."
(cd "$wadir" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/run-postinstalls.pl")
echo "..done"
echo ""
fi
# Enable background collection
if [ "$upgrading" != 1 -a -r $config_dir/system-status/enable-collection.pl ]; then
echo "Enabling background status collection .."
$config_dir/system-status/enable-collection.pl 5
echo "..done"
echo ""
fi

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Webmin Admin Tool
Requires=local-fs.target
After=basic.target
Conflicts=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@SYSCONFDIR@/webmin/start
ExecStop=@SYSCONFDIR@/webmin/stop
ExecReload=@SYSCONFDIR@/webmin/reload
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,170 @@
SUMMARY = "Web-based administration interface"
HOMEPAGE = "http://www.webmin.com"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENCE;md5=0373ac9f611e542ddebe1ec6394afc3c"
SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \
file://setup.sh \
file://init-exclude.patch \
file://net-generic.patch \
file://remove-startup-option.patch \
file://disable-version-check.patch \
file://nfs-export.patch \
file://exports-lib.pl.patch \
file://mount-excludefs.patch \
file://samba-config-fix.patch \
file://proftpd-config-fix.patch \
file://net-lib.pl.patch \
file://media-tomb.patch \
file://remove-python2.3.patch \
file://mysql-config-fix.patch \
file://webmin.service \
"
SRC_URI[md5sum] = "cd6ee98f73f9418562197675b952d81b"
SRC_URI[sha256sum] = "c66caa9e4cb50d5447bc8aceb7989d2284dde060278f404b13e171c7ce1690e1"
UPSTREAM_CHECK_URI = "http://www.webmin.com/download.html"
UPSTREAM_CHECK_REGEX = "webmin-(?P<pver>\d+(\.\d+)+).tar.gz"
inherit perlnative update-rc.d systemd
do_configure() {
# Remove binaries and plugins for other platforms
rm -rf acl/Authen-SolarisRBAC-0.1*
rm -rf format bsdexports hpuxexports sgiexports
rm -rf zones rbac smf ipfw ipfilter dfsadmin
rm -f mount/freebsd-mounts* mount/netbsd-mounts*
rm -f mount/openbsd-mounts* mount/macos-mounts*
# Remove some plugins for the moment
rm -rf lilo frox wuftpd telnet pserver cpan shorewall webalizer cfengine fsdump pap
rm -rf majordomo fetchmail sendmail mailboxes procmail filter mailcap dovecot exim spam qmailadmin postfix
rm -rf stunnel squid sarg pptp-client pptp-server jabber openslp sentry cluster-* vgetty burner heartbeat
# Adjust configs
[ -f init/config-debian-linux ] && mv init/config-debian-linux init/config-generic-linux
sed -i "s/shutdown_command=.*/shutdown_command=poweroff/" init/config-generic-linux
echo "exclude=bootmisc.sh,single,halt,reboot,hostname.sh,modutils.sh,mountall.sh,mountnfs.sh,networking,populate-volatile.sh,rmnologin.sh,save-rtc.sh,umountfs,umountnfs.sh,hwclock.sh,checkroot.sh,banner.sh,udev,udev-cache,devpts.sh,psplash.sh,sendsigs,fbsetup,bootlogd,stop-bootlogd,sysfs.sh,syslog,syslog.busybox,urandom,webmin,functions.initscripts,read-only-rootfs-hook.sh" >> init/config-generic-linux
echo "excludefs=devpts,devtmpfs,usbdevfs,proc,tmpfs,sysfs,debugfs" >> mount/config-generic-linux
[ -f exports/config-debian-linux ] && mv exports/config-debian-linux exports/config-generic-linux
sed -i "s/killall -HUP rpc.nfsd && //" exports/config-generic-linux
sed -i "s/netstd_nfs/nfsserver/g" exports/config-generic-linux
# Fix insane naming that causes problems at packaging time (must be done before deleting below)
find . -name "*\**" | while read from
do
to=`echo "$from" | sed "s/*/ALL/"`
mv "$from" "$to"
done
# Remove some other files we don't need
find . -name "config-*" -a \! -name "config-generic-linux" -a \! -name "config-ALL-linux" -a \! -name "*.pl" -delete
find . -regextype posix-extended -regex ".*/(openserver|aix|osf1|osf|openbsd|netbsd|freebsd|unixware|solaris|macos|irix|hpux|cygwin|windows)-lib\.pl" -delete
rm -f webmin-gentoo-init webmin-caldera-init webmin-debian-pam webmin-pam
# Don't need these at runtime (and we have our own setup script)
rm -f setup.sh
rm -f setup.pl
# Use pidof for finding PIDs
sed -i "s/find_pid_command=.*/find_pid_command=pidof NAME/" config-generic-linux
}
WEBMIN_LOGIN ?= "admin"
WEBMIN_PASSWORD ?= "password"
do_install() {
install -d ${D}${sysconfdir}
install -d ${D}${sysconfdir}/webmin
install -d ${D}${sysconfdir}/init.d
install -m 0755 webmin-init ${D}${sysconfdir}/init.d/webmin
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/webmin.service ${D}${systemd_unitdir}/system
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
${D}${systemd_unitdir}/system/webmin.service
install -d ${D}${localstatedir}
install -d ${D}${localstatedir}/webmin
install -d ${D}${libexecdir}/webmin
cd ${S} || exit 1
tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \
| tar --no-same-owner -xpf - -C ${D}${libexecdir}/webmin
rm -f ${D}${libexecdir}/webmin/webmin-init
rm -f ${D}${libexecdir}/webmin/ajaxterm/ajaxterm/configure.initd.gentoo
rm -rf ${D}${libexecdir}/webmin/patches
# Run setup script
export perl=perl
export perl_runtime=${bindir}/perl
export prefix=${D}
export tempdir=${S}/install_tmp
export wadir=${libexecdir}/webmin
export config_dir=${sysconfdir}/webmin
export var_dir=${localstatedir}/webmin
export os_type=generic-linux
export os_version=0
export real_os_type="${DISTRO_NAME}"
export real_os_version="${DISTRO_VERSION}"
export port=10000
export login=${WEBMIN_LOGIN}
export password=${WEBMIN_PASSWORD}
export ssl=0
export atboot=1
export no_pam=1
mkdir -p $tempdir
${S}/../setup.sh
# Ensure correct PERLLIB path
sed -i -e 's#${D}##g' ${D}${sysconfdir}/webmin/start
}
INITSCRIPT_NAME = "webmin"
INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ."
SYSTEMD_SERVICE:${PN} = "webmin.service"
SYSTEMD_AUTO_ENABLE:${PN} = "disable"
# FIXME: some of this should be figured out automatically
RDEPENDS:${PN} += "perl perl-module-socket perl-module-exporter perl-module-exporter-heavy perl-module-carp perl-module-strict"
RDEPENDS:${PN} += "perl-module-warnings perl-module-xsloader perl-module-posix perl-module-autoloader"
RDEPENDS:${PN} += "perl-module-fcntl perl-module-tie-hash perl-module-vars perl-module-time-local perl-module-config perl-module-constant"
RDEPENDS:${PN} += "perl-module-file-glob perl-module-file-copy perl-module-sdbm-file perl-module-feature"
PACKAGES_DYNAMIC += "webmin-module-* webmin-theme-*"
RRECOMMENDS:${PN} += "webmin-module-system-status"
PACKAGES += "${PN}-module-proc ${PN}-module-raid ${PN}-module-exports ${PN}-module-fdisk ${PN}-module-lvm"
RDEPENDS:${PN}-module-proc = "procps"
RDEPENDS:${PN}-module-raid = "mdadm"
RDEPENDS:${PN}-module-exports = "perl-module-file-basename perl-module-file-path perl-module-cwd perl-module-file-spec perl-module-file-spec-unix"
RRECOMMENDS:${PN}-module-fdisk = "parted"
RRECOMMENDS:${PN}-module-lvm = "lvm2"
python populate_packages:prepend() {
import os, os.path
wadir = bb.data.expand('${libexecdir}/webmin', d)
wadir_image = bb.data.expand('${D}', d) + wadir
modules = []
themes = []
for mod in os.listdir(wadir_image):
modinfo = os.path.join(wadir_image, mod, "module.info")
themeinfo = os.path.join(wadir_image, mod, "theme.info")
if os.path.exists(modinfo):
modules.append(mod)
elif os.path.exists(themeinfo):
themes.append(mod)
do_split_packages(d, wadir, '^(%s)$' % "|".join(modules), 'webmin-module-%s', 'Webmin module for %s', extra_depends='perl', allow_dirs=True, prepend=True)
do_split_packages(d, wadir, '^(%s)$' % "|".join(themes), 'webmin-theme-%s', 'Webmin theme for %s', extra_depends='perl', allow_dirs=True, prepend=True)
}
# Time-savers
package_do_pkgconfig() {
:
}