source: trunk/debirf/usr/share/debirf/plugins/install/install-kernel @ 345

Last change on this file since 345 was 345, checked in by jrollins, 6 years ago

debirf: tweaked install-kernel plugin to remove dead symlinks.

  • Property svn:executable set to *
File size: 935 bytes
Line 
1#!/bin/sh
2
3# debirf plugin to install a kernel package, indicated by the
4# expected environment variables:
5#  DEBIRF_PATH
6#  DEBIRF_ROOT
7#  DEBIRF_KERNEL_PACKAGE
8
9install_kernel_dpkg() {
10    local KNAME=$(basename "$1")
11    cp "$1" "$DEBIRF_ROOT/root/$KNAME"
12    chroot "$DEBIRF_ROOT" dpkg --install "root/$KNAME"
13    # and clean up, just in case there were missing dependencies.
14    chroot "$DEBIRF_ROOT" apt-get -f install
15    rm "$DEBIRF_ROOT/root/$KNAME"
16}
17
18install_kernel() {
19    # kernel install settings
20    cat >"$DEBIRF_ROOT/etc/kernel-img.conf" <<EOF
21# debirf: default kernel-img options:
22do_symlinks = yes
23do_bootloader = no
24do_initrd = yes
25EOF
26   
27    install_kernel_dpkg "$1"
28   
29    # extract kernel and debian stock initrd:
30    mv "$DEBIRF_ROOT"/boot/{vmlinu*,initrd*} "$DEBIRF_PATH"
31    rm "$DEBIRF_ROOT"/{vmlinuz,initrd.img}
32}
33
34##### install kernel
35msg "installing kernel..."
36install_kernel "$DEBIRF_KERNEL_PACKAGE"
Note: See TracBrowser for help on using the repository browser.