The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



"Systemd в Debian остался без мэйнтейнера из-за разногласий с..."
Версия для распечатки Пред. тема | След. тема
Форум Разговоры, обсуждение новостей
Исходное сообщение [ Отслеживать ]
Заметили полезную информацию ? Пожалуйста добавьте в FAQ на WIKI.
. "Systemd в Debian остался без мэйнтейнера из-за разногласий с..." +/
Сообщение от Аноним (498), 18-Янв-19, 13:30 
> я ниасилил нормальную автоматизацию/опакечивание процесса сборки - вообще

...
> то ли проблема эмержа как такового
> то ли проблема мозгов.

Я тоже не осилил. Взял ebuild из Calculate и немножко его почикал. Ты тут наверняка что-то исправишь, так как знаешь баш, в отличие от меня.


# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# This hack builds binary kernel packege.
# Loosely based on calculate-kernel-7.eclass
# Original Author: © 2007-2009 Mir Calculate, Ltd.

EAPI="6"
K_SECURITY_UNSUPPORTED="1"
ETYPE="sources"
inherit kernel-2
detect_version
detect_arch

DESCRIPTION="Prebuilt Linux kernel"
HOMEPAGE="https://www.kernel.org"
SRC_URI="${KERNEL_URI} ${GENPATCHES_URI}"

KEYWORDS="amd64 x86"

SLOT=${PV}
EXTRAVERSION="-${KERNELNAME:-supa-dupa-kernel}"
KV_FULL="${PV}${EXTRAVERSION}"

S="${WORKDIR}/linux-${KV_FULL}"

pkg_setup() {
    kernel-2_pkg_setup
    ewarn "After the kernel assemble perform command to update modules:"
    ewarn "  emerge @modules-rebuild"
}

src_prepare() {
    kernel-2_src_prepare
    eapply "${FILESDIR}/5010_enable-additional-cpu-optimizations-for-gcc.patch"
    eapply "${FILESDIR}/config-${KV_MAJOR}.${KV_MINOR}.patch"
}

vmlinuz_clean_localversion() {
    sed -ri 's/^(CONFIG_LOCALVERSION=")[^"]+"/\1"/' .config
    sed -ri 's/^(CONFIG_LOCALVERSION_AUTO)=.*$/# \1 is not set/' .config
    rm -f localversion*
}

src_compile() {
    # disable sandbox
    local GENTOOARCH="${ARCH}"
    unset ARCH
    cd "${S}"
    vmlinuz_clean_localversion
    emake olddefconfig || die "kernel configure failed"
    emake && emake modules || die "kernel build failed"
    cp .config .config.save
    ARCH="${GENTOOARCH}"
}

vmlinuz_src_install() {
    # dracut change this files in chroot of ramdisk
    cd "${S}"
    dodir /boot
    INSTALL_PATH=${D}/boot emake install
    echo 'placeholder' > ${D}/boot/initramfs-${KV_FULL}.img
    INSTALL_MOD_PATH=${D} emake modules_install
    /sbin/depmod -b "${D}" "${KV_FULL}" || die "depmod failed"

    # recreate symlink in /lib/modules because symlink point to tmp/portage after make install
    rm "${D}/lib/modules/${KV_FULL}/build"
    rm "${D}/lib/modules/${KV_FULL}/source"
    dosym "/usr/src/linux-${KV_FULL}" \
        "/lib/modules/${KV_FULL}/source" ||
        die "cannot install source symlink"
    dosym "/usr/src/linux-${KV_FULL}" \
        "/lib/modules/${KV_FULL}/build" ||
        die "cannot install build symlink"
}

# FUNCTION: clean_for_minimal
# DESCRIPTION:
# Clear kernel sources, keeping only need for custom modules compilation
clean_for_minimal() {
    local GENTOOARCH="${ARCH}"
    unset ARCH
    ARCH="${GENTOOARCH}"

    mkdir backup
    cp Module.symvers backup
    emake distclean &>/dev/null || die "cannot perform distclean"
    mv .config.save .config
    ebegin "kernel: >> Running modules_prepare..."
    emake modules_prepare &>/dev/null
    eend $? "Failed modules prepare"
    einfo "Cleaning sources"
    for rmpath in $(ls arch | grep -v x86)
    do
        rm -r arch/$rmpath
    done
    mv backup/Module.symvers .
    rmdir backup
    KEEPLIST="scripts/Makefile.lib scripts/module-common.lds \
        scripts/gcc-version.sh scripts/Makefile.help \
        scripts/Makefile.modinst scripts/Makefile.asm-generic \
        scripts/Makefile.modbuiltin scripts/Makefile.fwinst \
        scripts/Makefile.extrawarn scripts/Makefile.kasan \
        scripts/depmod.sh scripts/Makefile.host \
        scripts/Makefile.gcc-plugins \
        Module.symvers \
        scripts/Makefile.ubsan \
        scripts/Makefile.kcov \
        scripts/Kbuild.include scripts/Makefile.modpost \
        scripts/gcc-goto.sh scripts/Makefile.headersinst \
        scripts/Makefile.build scripts/basic/fixdep \
        scripts/Makefile.clean scripts/mod/modpost \
        tools/objtool/objtool \
        include/config/kernel.release include/config/auto.conf \
        arch/x86/Makefile_32.cpu arch/x86/Makefile \
        System.map Kconfig Makefile Kbuild"
    find . -type f -a \! -wholename ./.config \
        `echo $KEEPLIST | sed -r 's/(\S+)(\s|$)/-a \! -wholename .\/\1 /g'` \
        -a \! -name "*.h" -delete
    find . -type l -delete
    rm -r drivers
    rm -r Documentation
}

src_install() {
    vmlinuz_src_install
    clean_for_minimal
    kernel-2_src_install
}

pkg_postinst() {
    kernel-2_pkg_postinst
    dracut -f -H --lzo --kver "${KV_FULL}" && \
    cp -f /boot/initramfs-${KV_FULL}.img /boot/initramfs.img && \
    cp -f /boot/vmlinuz-${KV_FULL} /boot/vmlinuz
}

pkg_postrm() {
    rm -rf /lib/modules/${KV_FULL}
}


Ответить | Правка | Наверх | Cообщить модератору

Оглавление
Systemd в Debian остался без мэйнтейнера из-за разногласий с..., opennews, 16-Янв-19, 22:06  [смотреть все]
Форумы | Темы | Пред. тема | След. тема



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру