Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge @module-rebuild from another ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
nick87720z
n00b
n00b


Joined: 22 Mar 2017
Posts: 32

PostPosted: Wed Mar 22, 2017 7:51 am    Post subject: emerge @module-rebuild from another ebuild Reply with quote

I'm using calculate linux, where one good feature, is that kernel may be built during emerge. But still it is not completely automatic upgrade, as it requires to emerge @module-rebuild.
I tried to implement automatic module rebuild with something like...

Code:

USE+="module_rebuild"
REQUIRED_USE+="module_rebuild? ( symlink vmlinuz )"
........
PDEPEND+="module_rebuild? ( @module-rebuld )"


But ebuild manifest command complains:
PDEPEND: Invalid atom (@module-rebuild), token 3

Seems, that DEPEND may include only direct dependencies on <category>/<package> things.

Is it possible, to cause effect of emerge @module-rebuild from ebuild?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43562
Location: 56N 3W

PostPosted: Wed Mar 22, 2017 10:42 am    Post subject: Reply with quote

Moved from Portage & Programming to Unsupported Software.
Calculate linux is a Gentoo derivative.

nick87720z,

Unsupported Software does not mean that you won't get support. Its a warning to Gentoo users that solutions found here may not work for them.

@module-rebuld is a set. Its a list of packages that should be treated as one entitiy.
It contains only out of kernel modules, like nvidia-drivers, wirtualbox-drivers, dm-raid and so on.

All these modules are built against the kernel pointed to by /usr/src/linux, you need to test that it points to the kernel you have just built.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 844

PostPosted: Wed Mar 22, 2017 11:10 am    Post subject: Reply with quote

You can build this functionality into /etc/portage/bashrc

I use this to rebuild initramfs when busybox is updated

Code:

#!/bin/bash

# This file is used to customize the portage process.

# Notice the use of $FEATURES. 
# Portage variables are available too (default and in /etc/make.conf).

# Note this uses the "has" commands that ebuilds use. 
# This is because this file is sourced from ebuild.sh, and therefore has its functions.

# Function List:
# addread
# addwrite
# adddeny
# addpredict
# esyslog
# use
# usev
# useq
# has
# hasv
# hasq
# has_version
# portageq
# best_version
# use_with
# use_enable
# diefunc
# check_KV
# keepdir
# unpack
# strip_duplicate_slashes
# all the stuff described in man 5 ebuild (too lazy to list here)
# killparent
# remove_path_entry
# do_newdepend
# inherit (yes.. you can inherit eclasses.. weird ain't it...)
# debug-print-function
# debug-print-section

# EBUILD_PHASE
# ============
# clean
# setup
# unpack
# prepare
# configure
# compile
# test
# install
# preinst
# prerm
# postrm
# cleanrm
# postinst
# clean

case "$EBUILD_PHASE" in
        postinst)       post_install    ;;
        *)              :               ;;
esac

#       printf "\n EBUILD_PHASE=$EBUILD_PHASE : Package %s/%s \n\n" ${CATEGORY} ${PN}   ;;

post_install()
{
case "${CATEGORY}/${PN}" in

        sys-apps/busybox|media-gfx/splashutils)
                elog Making new initramfs
                mkinitramfs
                elog Running lilo and umounting /boot
                lilo
                umount /boot
        ;;

        *)      :
        ;;

esac
}


This structure is a departure from the default /etc/portage/bashrc, but offered here just to show "it can be done." mkinitramfs is a homebrew srcipt on the systems here that copies necessary files and libraries to /usr/src/initramfs, then runs cpio/gz, then mounts /boot, then copies the initramfs to /boot.

There are significant issues with trying to build a kernel without manual intervention, in particular getting the kernel .config in good order. There is no way I would automate kernel configuration. I do have some automation on kernel and module building and install, similar to what mkinitramfs does. But that is a step after I have reviewed the kernel .config.

Still, that is my practice and my opinion. YMMV. If you want to run genkernel, then build the kernel, then install it, etc., you can do that from /etc/portage/bashrc
Back to top
View user's profile Send private message
nick87720z
n00b
n00b


Joined: 22 Mar 2017
Posts: 32

PostPosted: Wed Mar 22, 2017 5:19 pm    Post subject: Reply with quote

Ok, thanks.
I mentioned calculate as just example - it is just yet another kernel sources ebuild, notably differing from all others by additional vmlinuz use flag.
When successful and working good, it might be applied for any other kernel sources ebuilds too - last time, upgrading kernel, i built it with USE=-vmlinuz (not building the kernel), then tried to rebuild modules... only one problem was - warning, that module will not include into about dependencies and versions.
Is it critical?
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 844

PostPosted: Wed Mar 22, 2017 7:26 pm    Post subject: Reply with quote

The warning you describe follows from a kernel setting, that allows modules (and associated kernels) to be built without that self-checking function. I would say that the warning is a non-issue for most users. If you have different kernels, each kernel has a separate space where its modules are kept - this is a sort of "external check" on compatibility, although it is by far not a comprehensive check.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum