Changeset 310


Ignore:
Timestamp:
Mar 13, 2007 5:04:35 PM (6 years ago)
Author:
dkg
Message:

debirf: moved kernel installation to its own plugin.

Location:
trunk/debirf
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debirf/make-debirf

    r309 r310  
    99source "$CMD_PATH/debirf.conf" 
    1010 
    11 DEBIRF_KERNEL_PACKAGE="$1" 
     11if [ "$1" ]; then 
     12    DEBIRF_KERNEL_PACKAGE="$1" 
     13fi 
    1214 
    1315cd "$DEBIRF_PATH" 
     
    5658     
    5759    > .stage/1 
    58 } 
    59  
    60 install_kernel_dpkg() { 
    61     local KNAME=$(basename "$1") 
    62     cp "$1" "$DEBIRF_ROOT/root/$KNAME" 
    63     chroot "$DEBIRF_ROOT" dpkg --install "root/$KNAME" 
    64     # and clean up, just in case there were missing dependencies. 
    65     chroot "$DEBIRF_ROOT" apt-get -f install 
    66     rm "$DEBIRF_ROOT/root/$KNAME" 
    67 } 
    68  
    69 install_kernel() { 
    70     # kernel install settings 
    71     cat >"$DEBIRF_ROOT/etc/kernel-img.conf" <<EOF 
    72 # debirf: default kernel-img options: 
    73 do_symlinks = yes 
    74 do_bootloader = no 
    75 do_initrd = yes 
    76 EOF 
    77      
    78     local CANDNAME=$(dpkg -I "$1" | grep '^ Package:' | awk '{ print $2 }' ) 
    79     local CANDVERS=$(dpkg -I "$1" | grep '^ Package:' | awk '{ print $3 }' ) 
    80      
    81     install_kernel_dpkg "$1" 
    82      
    83     # extract kernel, debian stock initrd, and remove them from the fs: 
    84     mkdir -p extras/boot 
    85     local KERNEL="$DEBIRF_ROOT/boot/vmlinu"*"$CANDNAME" 
    86     local INITRD="$DEBIRF_ROOT/boot/initrd"*"$CANDNAME" 
    87     [ -f "$KERNEL" ] && mv "$KERNEL" extras/boot/$(basename "$KERNEL") 
    88     [ -f "$INITRD" ] && mv "$INITRD" extras/boot/$(basename "$INITRD") 
    89      
    90     > .stage/2 
    9160} 
    9261 
     
    163132install_plugins 
    164133 
    165 ##### install kernel 
    166 if [ -r "$DEBIRF_KERNEL_PACKAGE" ] ; then 
    167     read -p "install kernel ${DEBIRF_KERNEL_PACKAGE}? [Y|n]: " -n 1 OK ; [ -z $OK ] || echo 
    168 else  
    169     msg "WARNING: could not find the kernel package '${DEBIRF_KERNEL_PACKAGE}'" 
    170 fi 
    171 if [ -z "$OK" -o "${OK/y/Y}" = 'Y' ] ; then 
    172     msg "installing kernel..." 
    173     install_kernel "$DEBIRF_KERNEL_PACKAGE" 
    174 else 
    175     msg "WARNING: things will not work properly without the proper kernel modules installed unless you've built a non-modular kernel." 
    176 fi 
    177  
    178134##### prune 
    179135msg "pruning..." 
Note: See TracChangeset for help on using the changeset viewer.