summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2016-11-06 16:05:19 +0000
committerV3n3RiX <venerix@rogentos.ro>2016-11-06 16:05:19 +0000
commitb17206c7ee6cf3647d15405ecd25052de4f495eb (patch)
tree9d793ab6591dc2b3611c26bdfe004c23377dbdbf /eclass
parentcf88cf45f8f89b457691d14f606c7da2e9bae7f0 (diff)
fix eclass
Diffstat (limited to 'eclass')
-rw-r--r--eclass/redcore-artwork.eclass61
-rw-r--r--eclass/redcore-kernel.eclass6
2 files changed, 65 insertions, 2 deletions
diff --git a/eclass/redcore-artwork.eclass b/eclass/redcore-artwork.eclass
new file mode 100644
index 00000000..425c9548
--- /dev/null
+++ b/eclass/redcore-artwork.eclass
@@ -0,0 +1,61 @@
+# Copyright 2004-2009 Sabayon Project
+# Copyright 2012-2015 Rogentos Project
+# Distributed under the terms of the GNU General Public License v2
+# $
+
+inherit eutils
+
+# @ECLASS-VARIABLE: KERN_INITRAMFS_SEARCH_NAME
+# @DESCRIPTION:
+# Argument used by `find` to search inside ${ROOT}boot Linux
+# Kernel initramfs files to patch
+KERN_INITRAMFS_SEARCH_NAME="${KERN_INITRAMFS_SEARCH_NAME:-initramfs-genkernel*}"
+
+# @ECLASS-VARIABLE: GFX_SPLASH_NAME
+# @DESCRIPTION:
+# Default splash theme name to use
+GFX_SPLASH_NAME="${GFX_SPLASH_NAME:-redcore}" #we leave this for the moment, even not used
+
+# @ECLASS-VARIABLE: PLYMOUTH_THEME
+# @DESCRIPTION:
+# Default plymouth theme name to use
+PLYMOUTH_THEME="${PLYMOUTH_THEME:-redcore}"
+
+# @FUNCTION: update_kernel_initramfs_splash
+# @USAGE: update_kernel_initramfs_splash [splash_theme] [splash_file]
+# @RETURN: 1, if something went wrong
+#
+# @MAINTAINER:
+# Fabio Erculiani
+update_kernel_initramfs_splash() {
+
+ [[ -z "${2}" ]] && die "wrong update_kernel_splash arguments"
+
+ if ! has_version "media-gfx/splashutils"; then
+ ewarn "media-gfx/splashutils not found, cannot update kernel splash"
+ return 1
+ fi
+ splash_geninitramfs -a "${2}" ${1}
+ return ${?}
+
+}
+
+# @FUNCTION: update_redcore_kernel_initramfs_splash
+# @USAGE: update_redcore_kernel_initramfs_splash
+#
+# @MAINTAINER:
+# Stefan Cristian B.
+update_redcore_kernel_initramfs_splash() {
+ local splash_name="${GFX_SPLASH_NAME}"
+ local override_splash_file="${ROOT}etc/oem/splash_name"
+ if [ -f "${override_splash_file}" ]; then
+ found_splash_name=$(cat "${override_splash_file}" | cut -d" " -f 1)
+ if [ -d "/etc/splash/${found_splash_name}" ]; then
+ splash_name="${found_splash_name}"
+ fi
+ fi
+ for bootfile in `find ${ROOT}boot -name "${KERN_INITRAMFS_SEARCH_NAME}"`; do
+ einfo "Updating boot splash for ${bootfile}"
+ update_kernel_initramfs_splash "${GFX_SPLASH_NAME}" "${bootfile}"
+ done
+}
diff --git a/eclass/redcore-kernel.eclass b/eclass/redcore-kernel.eclass
index ee4a72bd..f8960a94 100644
--- a/eclass/redcore-kernel.eclass
+++ b/eclass/redcore-kernel.eclass
@@ -177,7 +177,7 @@ if [ "${K_KERNEL_NEW_VERSIONING}" = "1" ]; then
CKV="$(get_version_component_range 1-2)"
fi
-inherit eutils multilib kernel-2 mount-boot linux-info
+inherit eutils multilib kernel-2 redcore-artwork mount-boot linux-info
# from kernel-2 eclass
detect_version
@@ -493,7 +493,7 @@ _kernel_src_compile() {
local GKARGS=()
GKARGS+=( "--no-menuconfig" "--all-ramdisk-modules" "--no-save-config" "--e2fsprogs" "--udev" )
use btrfs && GKARGS+=( "--btrfs" )
- use plymouth && GKARGS+=( "--plymouth" "--plymouth-theme=redcore" )
+ use plymouth && GKARGS+=( "--plymouth" "--plymouth-theme=${PLYMOUTH_THEME}" )
use dmraid && GKARGS+=( "--dmraid" )
use iscsi && GKARGS+=( "--iscsi" )
use mdadm && GKARGS+=( "--mdadm" )
@@ -739,6 +739,8 @@ _remove_dkms_modules() {
redcore-kernel_pkg_postinst() {
if _is_kernel_binary; then
+ # Update kernel initramfs to match user customizations
+ use splash && update_redcore_kernel_initramfs_splash
# generate initramfs with dracut
if use dracut ; then
_dracut_initramfs_create