/usr/sbin/kboot-mkconfig is in kboot-utils 0.4-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | #! /bin/sh
# Generate kboot.conf by inspecting /boot contents.
# Copyright (C) 2011 Antonio Ospite <ospite@studenti.unina.it>
#
# Inspired by grub-mkconfig
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra, is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
set -e
PACKAGE_NAME=kboot-mkconfig
PACKAGE_VERSION=0.4
prefix=/usr
exec_prefix=${prefix}
sbindir=${exec_prefix}/sbin
bindir=${exec_prefix}/bin
sysconfdir=/etc
host_os=linux-gnu
datarootdir=${prefix}/share
datadir=${datarootdir}
pkgdatadir=${datadir}/kboot
kboot_conf=""
self=`basename $0`
# Usage: usage
# Print the usage.
usage () {
cat <<EOF
Usage: $self [OPTION]
Generate a kboot config file
-o, --output=FILE output generated config to FILE [default=stdout]
-h, --help print this message and exit
-v, --version print the version information and exit
Report bugs to <bug-kboot@gnu.org>.
EOF
}
argument () {
opt=$1
shift
if test $# -eq 0; then
echo "$0: option requires an argument -- '$opt'" 1>&2
exit 1
fi
echo $1
}
# Check the arguments.
while test $# -gt 0
do
option=$1
shift
case "$option" in
-h | --help)
usage
exit 0 ;;
-v | --version)
echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
exit 0 ;;
-o | --output)
kboot_conf=`argument $option "$@"`; shift;;
--output=*)
kboot_conf=`echo "$option" | sed 's/--output=//'`
;;
-*)
echo "Unrecognized option \`$option'" 1>&2
usage
exit 1
;;
# Explicitly ignore non-option arguments, for compatibility.
esac
done
. ${datadir}/kboot/kboot-mkconfig_lib
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
fi
if [ "$EUID" != 0 ] ; then
root=f
case "`uname 2>/dev/null`" in
CYGWIN*)
# Cygwin: Assume root if member of admin group
for g in `id -G 2>/dev/null` ; do
case $g in
0|544) root=t ;;
esac
done ;;
esac
if [ $root != t ] ; then
echo "$self: You must run this as root" >&2
exit 1
fi
fi
if test -f ${sysconfdir}/default/kboot ; then
. ${sysconfdir}/default/kboot
fi
# Default values
if [ "x${KBOOT_TIMEOUT}" = "x" ] ; then KBOOT_TIMEOUT=5 ; fi
if [ "x${KBOOT_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${KBOOT_DISTRIBUTOR} GNU/Linux"
fi
# These are optional, user-defined variables.
export KBOOT_TIMEOUT \
KBOOT_DISTRIBUTOR \
KBOOT_CMDLINE_LINUX \
KBOOT_CMDLINE_LINUX_DEFAULT \
KBOOT_DISABLE_RECOVERY
if test "x${kboot_conf}" != "x"; then
rm -f ${kboot_conf}.new
exec > ${kboot_conf}.new
fi
echo "Generating kboot.conf ..." >&2
cat << EOF
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by $self
# with settings from ${sysconfdir}/default/kboot
#
timeout=${KBOOT_TIMEOUT}
EOF
echo "### BEGIN list of kernels ###"
list_kernels
echo "### END list of kernels ###"
if test "x${kboot_conf}" != "x" ; then
# none of the children aborted with error, install the new kboot.cfg
mv -f ${kboot_conf}.new ${kboot_conf}
fi
echo "done" >&2
|