diff options
Diffstat (limited to '')
-rw-r--r-- | source/a/mkinitrd/mkinitrd | 11 | ||||
-rwxr-xr-x | source/a/mkinitrd/mkinitrd.SlackBuild | 9 | ||||
-rw-r--r-- | source/a/mkinitrd/mkinitrd_command_generator.8 | 187 | ||||
-rw-r--r-- | source/a/mkinitrd/mkinitrd_command_generator.sh | 6 |
4 files changed, 202 insertions, 11 deletions
diff --git a/source/a/mkinitrd/mkinitrd b/source/a/mkinitrd/mkinitrd index fdc269348..96e0e388d 100644 --- a/source/a/mkinitrd/mkinitrd +++ b/source/a/mkinitrd/mkinitrd @@ -1,7 +1,7 @@ #!/bin/sh # Copyright 2004 Slackware Linux, Inc., Concord, CA, USA # Copyright 2004 Patrick J. Volkerding, Concord, CA, USA -# Copyright 2007, 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2007, 2008, 2009, 2010, 2011, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -50,9 +50,12 @@ MKINITRD_VERSION=1.4.8 # Don't include these things from /lib/udev/ in the initrd image LIBUDEV_BLACKLIST="\ ipod-set-info \ + iphone-set-info \ check-mtp-device \ check-ptp-camera \ - udev-configure-printer" + udev-configure-printer \ + rules.d/60-openobex.rules \ + " print_usage() { cat << EOF @@ -292,7 +295,7 @@ fi # default no-option actions # Parse for the use config file option first or else the other command # line options can not override /etc/mkinitrd.conf. for opt in "$@"; do - if [ $opt = "-F" ]; then + if [ "$opt" = "-F" ]; then if [ -e /etc/mkinitrd.conf ]; then . /etc/mkinitrd.conf || badconf_file else @@ -466,7 +469,7 @@ if [ ! -z "$LUKSKEY" ]; then # Several extra modules are needed to support a vfat formatted USB stick... # assuming here we are using a western codepage. # This possibly adds doublures, but we clean up the MODULE_LIST further down! - MODULE_LIST="${MODULE_LIST}:ehci-hcd:uhci-hcd:usb-storage:hid:usbhid:fat:nls_cp437:nls_iso8859-1:msdos:vfat" + MODULE_LIST="${MODULE_LIST}:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:ohci-hcd:ehci-hcd:uhci-hcd:usb-storage:hid:usbhid:fat:nls_cp437:nls_iso8859-1:msdos:vfat" # Finally, write the lukskey to the initrd-tree: echo $LUKSKEY > $SOURCE_TREE/lukskey diff --git a/source/a/mkinitrd/mkinitrd.SlackBuild b/source/a/mkinitrd/mkinitrd.SlackBuild index 4683a17f4..8983f34d4 100755 --- a/source/a/mkinitrd/mkinitrd.SlackBuild +++ b/source/a/mkinitrd/mkinitrd.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,12 +23,12 @@ VERSION=${VERSION:-1.4.8} BB=1.20.2 -BUILD=${BUILD:-2} +BUILD=${BUILD:-8} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) export ARCH=i486 ;; + i?86) export ARCH=i586 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; @@ -107,8 +107,9 @@ chown root:root $PKG/sbin/mkinitrd chmod 755 $PKG/sbin/mkinitrd mkdir -p $PKG/usr/man/man{5,8} -cat $CWD/mkinitrd.8 | gzip -9c > $PKG/usr/man/man8/mkinitrd.8.gz cat $CWD/mkinitrd.conf.5 | gzip -9c > $PKG/usr/man/man5/mkinitrd.conf.5.gz +cat $CWD/mkinitrd.8 | gzip -9c > $PKG/usr/man/man8/mkinitrd.8.gz +cat $CWD/mkinitrd_command_generator.8 | gzip -9c > $PKG/usr/man/man8/mkinitrd_command_generator.8.gz mkdir -p $PKG/etc cp -a $CWD/mkinitrd.conf.sample $PKG/etc/mkinitrd.conf.sample diff --git a/source/a/mkinitrd/mkinitrd_command_generator.8 b/source/a/mkinitrd/mkinitrd_command_generator.8 new file mode 100644 index 000000000..954fab484 --- /dev/null +++ b/source/a/mkinitrd/mkinitrd_command_generator.8 @@ -0,0 +1,187 @@ +'\" t +.\" Title: mkinitrd_command_generator +.\" Author: Eric Hameleers +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 2016-02-07 +.\" Manual: Slackware Tools +.\" Source: http://www.slackware.com 1.40 +.\" Language: English +.\" +.TH "MKINITRD_COMMAND_GEN" "8" "2016-02-07" "http://www\&.slackware\&.com" "Slackware Tools" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mkinitrd_command_generator \- mkinitrd the easy way +.SH "SYNOPSIS" +.sp +.nf +mkinitrd_command_generator\&.sh [ \fIoptions\fR ] [ \fIkernel_filename\fR ] +.fi +.SH "OPTIONS" +.PP +\fB\-a \fR\fB\fIadditional params\fR\fR +.RS 4 +Additional parameters to pass to mkinitrd\&. +.RE +.PP +\fB\-c | \-\-conf\fR +.RS 4 +Show a suitable mkinitrd configuration file\&. +.RE +.PP +\fB\-h | \-\-help\fR +.RS 4 +Show this help\&. +.RE +.PP +\fB\-i | \-\-interactive\fR +.RS 4 +Navigate through menus instead of using commandline arguments\&. +.RE +.PP +\fB\-\-longhelp\fR +.RS 4 +Show more detailed information/examples\&. +.RE +.PP +\fB\-k \fR\fB\fIkernelversion\fR\fR +.RS 4 +Use specific kernel version\&. +.RE +.PP +\fB\-m \fR\fB\fIadditional mods\fR\fR +.RS 4 +Additional modules to pass to mkinitrd, separated by colons (:)\&. +.RE +.PP +\fB\-l | \-\-lilo\fR +.RS 4 +Only show lilo\&.conf section (requires a kernel_filename)\&. +.RE +.PP +\fB\-r | \-\-run\fR +.RS 4 +Only show +\fImkinitrd\fR +command\&. +.RE +.SH "DESCRIPTION" +.sp +This script is useful in situations where you require an initrd image to boot your computer\&. +.sp +For instance, when booting a kernel that does not have support for your storage or root filesystem built in (such as the Slackware \fIgeneric\fR kernels)\&. +.sp +When you run the script without parameters, it will examine your running system, your current kernel version and will output an example of a \fImkinitrd\fR commandline that you can use to generate an initrd image containing enough driver support to boot the computer\&. +.sp +You can make it more specific: when you add the filename of a kernel as parameter to the script, it will determine the kernel version from that kernel, and also give an example of the lines that you should add to your \fI/etc/lilo\&.conf\fR file\&. +.sp +If you want your initrd image to have a custom name instead of the default \fI/boot/initrd\&.gz\fR you can add it as another parameter to the script, as follows: +.sp +mkinitrd_command_generator\&.sh \-a "\-o \fI/boot/custom\&.gz\fR" +.sp +The arguments to the \fI\-a\fR parameter will be used as additional arguments to the \fImkinitrd\fR command\&. +.sp +If you need additional modules in the initrd image, apart from what the script determines, you can pass then to the script using the \fI\-m\fR parameter as follows: +.sp +mkinitrd_command_generator\&.sh \-m "uhci\-hcd:usbhid:hid:hid\-generic" +.sp +The above example adds support for USB keyboards to the initrd \- you may need that if you have encrypted your root partition and need to enter a passphrase using a USB keyboard\&. +.sp +Instead of copying and pasting the script\(cqs output, you can create an initrd by directly executing the output, like in this example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$(mkinitrd_command_generator\&.sh \-\-run /boot/vmlinuz\-generic\-4\&.4\&.1) +.fi +.if n \{\ +.RE +.\} +.sp +That used the \fI\-r\fR or \fI\-\-run\fR switch to make the script only write the \fImkinitrd\fR commandline to the terminal\&. +.sp +When you want to add a section for a specific kernel to \fI/etc/lilo\&.conf\fR directly, use the \fI\-l\fR or \fI\-\-lilo\fR switch and use a command like in this example: +.sp +mkinitrd_command_generator\&.sh \-\-lilo /boot/vmlinuz\-generic\-smp\-4\&.4\&.1 >>/etc/lilo\&.conf +.sp +That command will result in the following lines being added to your \fI/etc/lilo\&.conf\fR file (example for my hardware): +.sp +.if n \{\ +.RS 4 +.\} +.nf +\fI# Linux bootable partition config begins\fR +\fI# initrd created with \*(Aqmkinitrd \-c \-k 4\&.4\&.1 \-m mbcache:jbd2:ext4 \-f ext4 \-r /dev/sda7 \-u \-o /boot/initrd\&.gz\fR\*(Aq +image = /boot/vmlinuz\-generic\-4\&.4\&.1 +initrd = /boot/initrd\&.gz +root = /dev/sda7 +label = 4\&.4\&.1 +read\-only +\fI# Linux bootable partition config ends\fR +.fi +.if n \{\ +.RE +.\} +.sp +The last two examples show how easy it is to configure your computer for the use of an initrd if you need one\&. The only thing left to do afterwards is running \fIlilo\fR\&. +.SH "EXIT STATUS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +\fB0\fR Success +\fB1\fR Failure +.fi +.if n \{\ +.RE +.\} +.SH "FILES" +.sp +.if n \{\ +.RS 4 +.\} +.nf +/usr/share/mkinitrd/mkinitrd_command_generator\&.sh +.fi +.if n \{\ +.RE +.\} +.SH "BUGS" +.sp +Report bugs to Eric Hameleers <alien@slackware\&.com> +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +mkinitrd(1), lilo\&.conf(1) +.fi +.if n \{\ +.RE +.\} +.SH "AUTHOR" +.PP +\fBEric Hameleers\fR +.RS 4 +Author. +.RE diff --git a/source/a/mkinitrd/mkinitrd_command_generator.sh b/source/a/mkinitrd/mkinitrd_command_generator.sh index 16893b05b..33d9c9de3 100644 --- a/source/a/mkinitrd/mkinitrd_command_generator.sh +++ b/source/a/mkinitrd/mkinitrd_command_generator.sh @@ -225,7 +225,7 @@ function add_usb_keyboard() { local USBMOD if cat /proc/bus/input/devices | sed -e 's/^$/\$/g' | \ tr "\n$" " \n" | grep -q " Phys=.*usb.* .*Handlers=.*kbd.*B:"; then - USBMOD="usbhid:hid_generic" + USBMOD="xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch" [ -n "$MLIST" ] && MLIST="$MLIST:$USBMOD" \ || MLIST="$USBMOD" fi @@ -235,7 +235,7 @@ function add_usb_keyboard() { # Determine what USB Host Controller is in use function add_usb_hcd() { local USBMOD - for i in $(ls -Ld /sys/module/*_hcd/drivers/*); do + for i in $(ls -Ld /sys/module/*_hcd/drivers/* 2> /dev/null); do if ls -L $i | grep -q "[0-9a-f]*:" ; then USBMOD=$( echo $i | cut -f4 -d/ | tr "_" "-") [ -n "$MLIST" ] && MLIST="$MLIST:$USBMOD" \ @@ -409,7 +409,7 @@ fi # and check if modules for this kernel are actually present: if [ -z "$KVER" ]; then if [ -n "$KFILE" ]; then - KVER="$(strings $KFILE | grep '(.*@.*) #' | cut -f1 -d' ')" + KVER="$(strings $KFILE | grep '([^ ]*@[^ ]*) #' | cut -f1 -d' ')" else KVER="$(uname -r)" fi |