summaryrefslogtreecommitdiffstats
path: root/source/a/mkinitrd
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2013-11-04 17:08:47 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:57:36 +0200
commit76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (patch)
tree9b98e6e193c7870cb27ac861394c1c4592850922 /source/a/mkinitrd
parent9664bee729d487bcc0a0bc35859f8e13d5421c75 (diff)
downloadcurrent-76fc4757ac91ac7947a01fb7b53dddf9a78a01d1.tar.gz
current-76fc4757ac91ac7947a01fb7b53dddf9a78a01d1.tar.xz
Slackware 14.1slackware-14.1
Mon Nov 4 17:08:47 UTC 2013 Slackware 14.1 x86_64 stable is released! It's been another interesting release cycle here at Slackware bringing new features like support for UEFI machines, updated compilers and development tools, the switch from MySQL to MariaDB, and many more improvements throughout the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-)
Diffstat (limited to '')
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch12
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch75
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch34
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch11
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch25
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch11
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch67
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch123
-rwxr-xr-xsource/a/mkinitrd/init31
-rw-r--r--source/a/mkinitrd/mkinitrd13
-rwxr-xr-xsource/a/mkinitrd/mkinitrd.SlackBuild18
-rw-r--r--source/a/mkinitrd/mkinitrd_command_generator.sh21
12 files changed, 285 insertions, 156 deletions
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch
deleted file mode 100644
index a012a7063..000000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- busybox-1.20.1/shell/ash.c
-+++ busybox-1.20.1-ash/shell/ash.c
-@@ -6846,8 +6846,7 @@ evalvar(char *p, int flags, struct strli
- patloc = expdest - (char *)stackblock();
- if (NULL == subevalvar(p, /* varname: */ NULL, patloc, subtype,
- startloc, varflags,
--//TODO: | EXP_REDIR too? All other such places do it too
-- /* quotes: */ flags & (EXP_FULL | EXP_CASE),
-+ /* quotes: */ flags & (EXP_FULL | EXP_CASE | EXP_REDIR),
- var_str_list)
- ) {
- int amount = expdest - (
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch
deleted file mode 100644
index b2a945614..000000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch
+++ /dev/null
@@ -1,75 +0,0 @@
---- busybox-1.20.1/networking/ifupdown.c
-+++ busybox-1.20.1-ifupdown/networking/ifupdown.c
-@@ -140,8 +140,6 @@ static const char keywords_up_down[] ALI
- "up\0"
- "down\0"
- "pre-up\0"
-- "pre-down\0"
-- "post-up\0"
- "post-down\0"
- ;
-
-@@ -895,6 +893,11 @@ static struct interfaces_file_t *read_in
- if (rest_of_line[0] == '\0')
- bb_error_msg_and_die("option with empty value \"%s\"", buf);
-
-+ if (strcmp(first_word, "post-up") == 0)
-+ first_word += 5; /* "up" */
-+ else if (strcmp(first_word, "pre-down") == 0)
-+ first_word += 4; /* "down" */
-+
- /* If not one of "up", "down",... words... */
- if (index_in_strings(keywords_up_down, first_word) < 0) {
- int i;
-@@ -963,7 +966,7 @@ static char *setlocalenv(const char *for
- return result;
- }
-
--static void set_environ(struct interface_defn_t *iface, const char *mode)
-+static void set_environ(struct interface_defn_t *iface, const char *mode, const char *opt)
- {
- int i;
- char **pp;
-@@ -976,7 +979,7 @@ static void set_environ(struct interface
- }
-
- /* note: last element will stay NULL: */
-- G.my_environ = xzalloc(sizeof(char *) * (iface->n_options + 6));
-+ G.my_environ = xzalloc(sizeof(char *) * (iface->n_options + 7));
- pp = G.my_environ;
-
- for (i = 0; i < iface->n_options; i++) {
-@@ -990,6 +993,7 @@ static void set_environ(struct interface
- *pp++ = setlocalenv("%s=%s", "ADDRFAM", iface->address_family->name);
- *pp++ = setlocalenv("%s=%s", "METHOD", iface->method->name);
- *pp++ = setlocalenv("%s=%s", "MODE", mode);
-+ *pp++ = setlocalenv("%s=%s", "PHASE", opt);
- if (G.startup_PATH)
- *pp++ = setlocalenv("%s=%s", "PATH", G.startup_PATH);
- }
-@@ -1044,21 +1048,21 @@ static int check(char *str)
- static int iface_up(struct interface_defn_t *iface)
- {
- if (!iface->method->up(iface, check)) return -1;
-- set_environ(iface, "start");
-+ set_environ(iface, "start", "pre-up");
- if (!execute_all(iface, "pre-up")) return 0;
- if (!iface->method->up(iface, doit)) return 0;
-+ set_environ(iface, "start", "post-up");
- if (!execute_all(iface, "up")) return 0;
-- if (!execute_all(iface, "post-up")) return 0;
- return 1;
- }
-
- static int iface_down(struct interface_defn_t *iface)
- {
- if (!iface->method->down(iface,check)) return -1;
-- set_environ(iface, "stop");
-- if (!execute_all(iface, "pre-down")) return 0;
-+ set_environ(iface, "stop", "pre-down");
- if (!execute_all(iface, "down")) return 0;
- if (!iface->method->down(iface, doit)) return 0;
-+ set_environ(iface, "stop", "post-down");
- if (!execute_all(iface, "post-down")) return 0;
- return 1;
- }
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch
deleted file mode 100644
index f382e078f..000000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- busybox-1.20.1/miscutils/man.c
-+++ busybox-1.20.1-man/miscutils/man.c
-@@ -129,27 +129,21 @@ static int show_manpage(const char *page
- #endif
- #if ENABLE_FEATURE_SEAMLESS_XZ
- strcpy(ext, "xz");
-- if (run_pipe(pager, man_filename, man, level))
-+ if (run_pipe(pager, filename_with_zext, man, level))
- return 1;
- #endif
- #if ENABLE_FEATURE_SEAMLESS_BZ2
- strcpy(ext, "bz2");
-- if (run_pipe(pager, man_filename, man, level))
-+ if (run_pipe(pager, filename_with_zext, man, level))
- return 1;
- #endif
- #if ENABLE_FEATURE_SEAMLESS_GZ
- strcpy(ext, "gz");
-- if (run_pipe(pager, man_filename, man, level))
-+ if (run_pipe(pager, filename_with_zext, man, level))
- return 1;
- #endif
-
--#if SEAMLESS_COMPRESSION
-- ext[-1] = '\0';
--#endif
-- if (run_pipe(pager, man_filename, man, level))
-- return 1;
--
-- return 0;
-+ return run_pipe(pager, man_filename, man, level);
- }
-
- int man_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch
deleted file mode 100644
index 4129b6517..000000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- busybox-1.20.1/archival/libarchive/get_header_tar.c
-+++ busybox-1.20.1-tar/archival/libarchive/get_header_tar.c
-@@ -84,7 +84,7 @@ static unsigned long long getOctal(char
- first >>= 1; /* now 7th bit = 6th bit */
- v = first; /* sign-extend 8 bits to 64 */
- while (--len != 0)
-- v = (v << 8) + (unsigned char) *str++;
-+ v = (v << 8) + (uint8_t) *++str;
- }
- return v;
- }
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch
new file mode 100644
index 000000000..456fb08e1
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch
@@ -0,0 +1,25 @@
+--- busybox-1.20.2/libbb/kernel_version.c
++++ busybox-1.20.2-kernel_ver/libbb/kernel_version.c
+@@ -20,18 +20,15 @@
+ int FAST_FUNC get_linux_version_code(void)
+ {
+ struct utsname name;
+- char *s;
++ char *s, *t;
+ int i, r;
+
+- if (uname(&name) == -1) {
+- bb_perror_msg("can't get system information");
+- return 0;
+- }
+-
++ uname(&name); /* never fails */
+ s = name.release;
+ r = 0;
+ for (i = 0; i < 3; i++) {
+- r = r * 256 + atoi(strtok(s, "."));
++ t = strtok(s, ".");
++ r = r * 256 + (t ? atoi(t) : 0);
+ s = NULL;
+ }
+ return r;
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch
new file mode 100644
index 000000000..17fc0b1c4
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch
@@ -0,0 +1,11 @@
+--- busybox-1.20.2/networking/ntpd.c
++++ busybox-1.20.2-ntpd/networking/ntpd.c
+@@ -1840,7 +1840,7 @@ recv_and_process_client_pkt(void /*int f
+
+ /* Build a reply packet */
+ memset(&msg, 0, sizeof(msg));
+- msg.m_status = G.stratum < MAXSTRAT ? G.ntp_status : LI_ALARM;
++ msg.m_status = G.stratum < MAXSTRAT ? (G.ntp_status & LI_MASK) : LI_ALARM;
+ msg.m_status |= (query_status & VERSION_MASK);
+ msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ?
+ MODE_SERVER : MODE_SYM_PAS;
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch
new file mode 100644
index 000000000..f39250c85
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch
@@ -0,0 +1,67 @@
+From b1cec5003b73080a8aa7ea277621bf1c71c3e8d6 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 20 Oct 2012 15:01:26 -0400
+Subject: [PATCH] build system: use pkg-config to look up selinux libs
+
+Newer versions of libselinux has started linking against more libs.
+Rather than continuing hardcoding things, switch to using pkg-config
+to query for its dependencies.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 1 +
+ Makefile.flags | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index fccde4a..3a0a5e1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -297,6 +297,7 @@ NM = $(CROSS_COMPILE)nm
+ STRIP = $(CROSS_COMPILE)strip
+ OBJCOPY = $(CROSS_COMPILE)objcopy
+ OBJDUMP = $(CROSS_COMPILE)objdump
++PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
+ AWK = awk
+ GENKSYMS = scripts/genksyms/genksyms
+ DEPMOD = /sbin/depmod
+diff --git a/Makefile.flags b/Makefile.flags
+index c43c8dc..15dcc1f 100644
+--- a/Makefile.flags
++++ b/Makefile.flags
+@@ -74,6 +74,12 @@ ARCH_FPIC ?= -fpic
+ ARCH_FPIE ?= -fpie
+ ARCH_PIE ?= -pie
+
++# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES))
++define pkg_check_modules
++$(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2))
++$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2))
++endef
++
+ ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
+ # on i386: 14% smaller libbusybox.so
+ # (code itself is 9% bigger, we save on relocs/PLT/GOT)
+@@ -85,6 +91,7 @@ endif
+
+ ifeq ($(CONFIG_STATIC),y)
+ CFLAGS_busybox += -static
++PKG_CONFIG_FLAGS += --static
+ endif
+
+ ifeq ($(CONFIG_PIE),y)
+@@ -127,7 +134,10 @@ LDLIBS += pam pam_misc pthread
+ endif
+
+ ifeq ($(CONFIG_SELINUX),y)
+-LDLIBS += selinux sepol
++SELINUX_PC_MODULES = libselinux libsepol
++$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
++CPPFLAGS += $(SELINUX_CFLAGS)
++LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%))
+ endif
+
+ ifeq ($(CONFIG_EFENCE),y)
+--
+1.7.12
+
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch
new file mode 100644
index 000000000..7b1850084
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch
@@ -0,0 +1,123 @@
+From 5a5dfcad6ba96d12d68bd7b39279215a8fee70d3 Mon Sep 17 00:00:00 2001
+From: Tias Guns <tias@ulyssis.org>
+Date: Sun, 10 Jun 2012 14:19:01 +0200
+Subject: [PATCH] inetd: fix build failure in Android
+
+Signed-off-by: Tias Guns <tias@ulyssis.org>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+(cherry picked from commit 64f763b42a43cbf36e401690ff6767c25575e520)
+---
+ networking/inetd.c | 1 +
+ 1 file changed, 1 insertion(+)
+--
+1.7.12
+
+From 246ea72843d5b7e9d4cd902dc5e9d71359196303 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 5 Jul 2012 23:19:09 -0400
+Subject: [PATCH] include sys/resource.h where needed
+
+We use functions from sys/resource.h in misc applets, but don't include
+the header. This breaks building with newer glibc versions, so add the
+include where needed.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+(cherry picked from commit c5fe9f7b723f949457263ef8e22ab807d5b549ce)
+---
+ loginutils/passwd.c | 1 +
+ miscutils/time.c | 1 +
+ networking/inetd.c | 1 +
+ networking/ntpd.c | 1 +
+ networking/ntpd_simple.c | 1 +
+ runit/chpst.c | 1 +
+ shell/shell_common.c | 1 +
+ 7 files changed, 7 insertions(+)
+
+diff --git a/loginutils/passwd.c b/loginutils/passwd.c
+index b83db00..a7006f0 100644
+--- a/loginutils/passwd.c
++++ b/loginutils/passwd.c
+@@ -15,6 +15,7 @@
+
+ #include "libbb.h"
+ #include <syslog.h>
++#include <sys/resource.h> /* setrlimit */
+
+ static void nuke_str(char *str)
+ {
+diff --git a/miscutils/time.c b/miscutils/time.c
+index 945f15f..ffed386 100644
+--- a/miscutils/time.c
++++ b/miscutils/time.c
+@@ -16,6 +16,7 @@
+ //usage: "\n -v Verbose"
+
+ #include "libbb.h"
++#include <sys/resource.h> /* getrusage */
+
+ /* Information on the resources used by a child process. */
+ typedef struct {
+diff --git a/networking/inetd.c b/networking/inetd.c
+index 1308d74..00baf69 100644
+--- a/networking/inetd.c
++++ b/networking/inetd.c
+@@ -165,6 +165,8 @@
+ //usage: "\n (default: 0 - disabled)"
+
+ #include <syslog.h>
++#include <sys/resource.h> /* setrlimit */
++#include <sys/socket.h> /* un.h may need this */
+ #include <sys/un.h>
+
+ #include "libbb.h"
+diff --git a/networking/ntpd.c b/networking/ntpd.c
+index 603801e..b885215 100644
+--- a/networking/ntpd.c
++++ b/networking/ntpd.c
+@@ -46,6 +46,7 @@
+ #include "libbb.h"
+ #include <math.h>
+ #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
++#include <sys/resource.h> /* setpriority */
+ #include <sys/timex.h>
+ #ifndef IPTOS_LOWDELAY
+ # define IPTOS_LOWDELAY 0x10
+diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c
+index 4ad44e4..1b7c66b 100644
+--- a/networking/ntpd_simple.c
++++ b/networking/ntpd_simple.c
+@@ -7,6 +7,7 @@
+ */
+ #include "libbb.h"
+ #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
++#include <sys/resource.h> /* setpriority */
+ #ifndef IPTOS_LOWDELAY
+ # define IPTOS_LOWDELAY 0x10
+ #endif
+diff --git a/runit/chpst.c b/runit/chpst.c
+index ac296ba..ed72c8b 100644
+--- a/runit/chpst.c
++++ b/runit/chpst.c
+@@ -91,6 +91,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ //usage: "\n a SIGXCPU after N seconds"
+
+ #include "libbb.h"
++#include <sys/resource.h> /* getrlimit */
+
+ /*
+ Five applets here: chpst, envdir, envuidgid, setuidgid, softlimit.
+diff --git a/shell/shell_common.c b/shell/shell_common.c
+index 51c92d6..780e27e 100644
+--- a/shell/shell_common.c
++++ b/shell/shell_common.c
+@@ -18,6 +18,7 @@
+ */
+ #include "libbb.h"
+ #include "shell_common.h"
++#include <sys/resource.h> /* getrlimit */
+
+ const char defifsvar[] ALIGN1 = "IFS= \t\n";
+
+--
+1.7.12
+
diff --git a/source/a/mkinitrd/init b/source/a/mkinitrd/init
index ae475d890..b31eb0e4c 100755
--- a/source/a/mkinitrd/init
+++ b/source/a/mkinitrd/init
@@ -4,7 +4,7 @@
# This requires that your kernel supports initramfs!!!
#
# Copyright 2004 Slackware Linux, Inc., Concord, CA, USA
-# Copyright 2007, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,8 +23,8 @@
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
+#
+##################################################################################
# With a generic kernel, you need to load the modules needed to mount the
# root partition. This might mean a SCSI, RAID, or other drive controller
# module, as well as the module to support the root filesystem. Once the
@@ -62,6 +62,13 @@
# need to make it executable:
#
# chmod 755 load_kernel_modules
+##################################################################################
+# Changelog
+# 10-Dec-2012 <mozes@slackware.com>
+# * Added support for the official Kernel parameters to select root filesystem
+# type ('rootfstype') and pause before attempting to mount the root filesystem
+# ('rootdelay'). The original parameters may continue to be used.
+##################################################################################
INITRD=$(cat /initrd-name)
ROOTDEV=$(cat /rootdev)
@@ -115,10 +122,10 @@ for ARG in $(cat /proc/cmdline); do
root=UUID=*)
ROOTDEV=$(echo $ARG | cut -f2- -d=)
;;
- rootfs=*)
+ rootfs=*|rootfstype=*)
ROOTFS=$(echo $ARG | cut -f2 -d=)
;;
- waitforroot=*)
+ waitforroot=*|rootdelay=*)
WAIT=$(echo $ARG | cut -f2 -d=)
;;
esac
@@ -163,11 +170,15 @@ fi
if [ "$RESCUE" = "" ]; then
# Initialize RAID:
if [ -x /sbin/mdadm ]; then
- /sbin/mdadm -E -s >/etc/mdadm.conf
- /sbin/mdadm -S -s
- /sbin/mdadm -A -s
- # This seems to make the kernel see partitions more reliably:
- fdisk -l /dev/md* 1> /dev/null 2> /dev/null
+ # If /etc/mdadm.conf is present, udev should DTRT on its own;
+ # If not, we'll make one and go from there:
+ if [ ! -r /etc/mdadm.conf ]; then
+ /sbin/mdadm -E -s >/etc/mdadm.conf
+ /sbin/mdadm -S -s
+ /sbin/mdadm -A -s
+ # This seems to make the kernel see partitions more reliably:
+ fdisk -l /dev/md* 1> /dev/null 2> /dev/null
+ fi
fi
# Unlock any encrypted partitions necessary to access the
diff --git a/source/a/mkinitrd/mkinitrd b/source/a/mkinitrd/mkinitrd
index c5e30218b..fdc269348 100644
--- a/source/a/mkinitrd/mkinitrd
+++ b/source/a/mkinitrd/mkinitrd
@@ -45,7 +45,7 @@
# Modified by Patrick Volkerding <volkerdi@slackware.com> 21 August 2012
# Add Btrfs multi-device filesystem support option (-B).
-MKINITRD_VERSION=1.4.7
+MKINITRD_VERSION=1.4.8
# Don't include these things from /lib/udev/ in the initrd image
LIBUDEV_BLACKLIST="\
@@ -101,7 +101,7 @@ initrd, and the script is easy to modify. Be creative. :-)
then you need to pass: -K LABEL=TRAVELSTICK:/keys/alien.luks
-B Add /sbin/btrfs to enable scanning for a root filesystem that is
part of a Btrfs multi-device filesystem.
- -M Add the files in /etc/modprobe.d/ to the initrd
+ -M Add the files in /etc/modprobe.d/ and /lib/modprobe.d/ to the initrd
-R Add support for RAID partitions
-V Display version number
@@ -422,6 +422,10 @@ fi
# (unless we find that value is already set in the initrd-tree):
if [ -z "$WAIT" -a -z "$(cat $SOURCE_TREE/wait-for-root)" ]; then
WAIT=1
+ # ARM devices need even more time:
+ case "$( uname -m )" in
+ arm*) WAIT=4;;
+ esac
fi
if [ ! -z "$WAIT" ]; then
echo $WAIT > $SOURCE_TREE/wait-for-root
@@ -479,6 +483,9 @@ if [ ! -z "$RAID" ]; then
mkdir -p $SOURCE_TREE/lib/udev/rules.d
echo 'KERNEL=="dm-[0-9]*", OPTIONS+="db_persist"' > \
$SOURCE_TREE/lib/udev/rules.d/95-dm-initrd.rules
+ if [ -r /etc/mdadm.conf ] ; then
+ cp /etc/mdadm.conf $SOURCE_TREE/etc
+ fi
else
echo "ERROR: mdadm and/or mdmon binary is missing, RAID support not installed"
fi
@@ -674,7 +681,7 @@ if [ ! -z "$MODULE_LIST" ]; then
# Pregenerate the module dependency information
depmod -a -b $SOURCE_TREE ${KERNEL_VERSION}
- # Copy /etc/modprobe.d/* if desired
+ # Copy /{etc,lib}/modprobe.d/* if desired
if [ ! -z $MODCONF ]; then
copy_modconf
fi
diff --git a/source/a/mkinitrd/mkinitrd.SlackBuild b/source/a/mkinitrd/mkinitrd.SlackBuild
index 322fa8c5d..4683a17f4 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 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,9 +21,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=${VERSION:-1.4.7}
-BB=1.20.1
-BUILD=${BUILD:-6}
+VERSION=${VERSION:-1.4.8}
+BB=1.20.2
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -83,6 +83,11 @@ chmod 644 $PKG/usr/share/mkinitrd/keymaps.tar.gz
( cd $PKG/usr/share/mkinitrd/initrd-tree
tar xf $CWD/_initrd-tree.tar.gz
cat $CWD/init > init
+
+ # These are useful for ARM:
+ mknod -m 644 dev/random c 1 8
+ mknod -m 644 dev/urandom c 1 9
+
tar czf ../initrd-tree.tar.gz .
)
rm -rf $PKG/usr/share/mkinitrd/initrd-tree
@@ -107,6 +112,11 @@ cat $CWD/mkinitrd.conf.5 | gzip -9c > $PKG/usr/man/man5/mkinitrd.conf.5.gz
mkdir -p $PKG/etc
cp -a $CWD/mkinitrd.conf.sample $PKG/etc/mkinitrd.conf.sample
+# ARM systems often need more time to find devices:
+case "$( uname -m )" in
+ arm*) sed -e 's@#WAIT="1"@#WAIT="4"@g' \
+ -i $PKG/etc/mkinitrd.conf.sample;;
+esac
chown root:root $PKG/etc/mkinitrd.conf.sample
chmod 644 $PKG/etc/mkinitrd.conf.sample
diff --git a/source/a/mkinitrd/mkinitrd_command_generator.sh b/source/a/mkinitrd/mkinitrd_command_generator.sh
index 04c0c2a03..16893b05b 100644
--- a/source/a/mkinitrd/mkinitrd_command_generator.sh
+++ b/source/a/mkinitrd/mkinitrd_command_generator.sh
@@ -1,5 +1,6 @@
#!/bin/sh
# $Id: mkinitrd_command_generator.sh,v 1.45 2011/02/17 09:27:05 eha Exp eha $
+# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# Copyright 2008, 2009, 2010, 2011 Eric Hameleers, Eindhoven, Netherlands
# Contact: <alien@slackware.com>
# Copyright 2008, 2009 PiterPUNK, Sao Paulo, SP, Brazil
@@ -50,7 +51,12 @@ SOURCE_TREE=${SOURCE_TREE:-"/boot/initrd-tree"}
CLEAR_TREE=${CLEAR_TREE:-1}
KEYMAP=${KEYMAP:-"us"}
UDEV=${UDEV:-1}
-WAIT=${WAIT:-1}
+# ARM devices need more time:
+case "$( uname -m )" in
+ arm*) WAIT_DEFAULT=4;;
+ *) WAIT_DEFAULT=1;;
+esac
+WAIT=${WAIT:-$WAIT_DEFAULT}
# A basic explanation of the commandline parameters:
basic_usage() {
@@ -108,7 +114,7 @@ extended_usage() {
the script determines, you can pass then to the script using the '-m'
parameter as follows:
- $(basename $0) -m "uhci-hcd:usbhid"
+ $(basename $0) -m "uhci-hcd:usbhid:hid_generic"
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
@@ -219,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"
+ USBMOD="usbhid:hid_generic"
[ -n "$MLIST" ] && MLIST="$MLIST:$USBMOD" \
|| MLIST="$USBMOD"
fi
@@ -375,7 +381,7 @@ while [ ! -z "$1" ]; do
KFILE=$(basename $KFILE)
fi
KFILE=${KFILEPATH}/$KFILE
- if [ -z "$(file $KFILE | grep 'Linux kernel x86 boot')" ]; then
+ if [ -z "$(file $KFILE | grep -E 'Linux kernel x86 boot|x86 boot sector')" ]; then
echo "File '$KFILE' does not look like it is a kernel file!"
exit 1
fi
@@ -439,7 +445,8 @@ if echo $MLIST | grep -q "virtio"; then
MLIST="$MLIST:virtio:virtio_balloon:virtio_blk:virtio_ring:virtio_pci:virtio_net"
fi
-# Determine if a USB keyboard is in use and include usbhid to module list
+# Determine if a USB keyboard is in use and include usbhid and hid_generic
+# to module list
MLIST=$(add_usb_keyboard)
# If we use any USB module, try to determine the Host Controller
@@ -546,7 +553,7 @@ configurations are optional and you can stick to the defaults." 11 72 3 \
$([ $USING_LUKS = 1 ] && echo on || echo off) \
"RESUMEDEV" "Select device for 'suspend-to-disk' feature" off \
"UDEV" "Use UDEV in the initrd for device configuration" $(test $UDEV -eq 1 && echo on || echo off) \
-"WAIT" "Add delay to allow detection of slow disks at boot" $(test WAIT -gt 1 && echo on || echo off) )
+"WAIT" "Add delay to allow detection of slow disks at boot" $(test $WAIT -gt $WAIT_DEFAULT && echo on || echo off) )
if [ "$?" != "0" ]; then
exit 1
fi
@@ -794,7 +801,7 @@ if [ $UDEV -eq 1 ]; then
# Add UDEV support:
MKINIT="$MKINIT -u"
fi
-if [ -n "$WAIT" -a $WAIT -ne 1 ]; then
+if [ -n "$WAIT" -a $WAIT -ne $WAIT_DEFAULT ]; then
# Add non-default wait time:
MKINIT="$MKINIT -w $WAIT"
fi