public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/
@ 2012-11-05 18:30 Richard Yao
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Yao @ 2012-11-05 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     7e224199ffbf67af99e57d4aa2cf3a7a625b87ac
Author:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
AuthorDate: Mon Apr  9 18:03:01 2012 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Tue Oct 16 00:02:31 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=7e224199

Support using init= on the command line

We do not support ramdisk, only initramfs nowdays.
So init= is a dead command, and we may as well have it do the same as
it does for dracut and in the Linux kernel documentation.
(Use rdinit to choose the initramfs init file)

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

---
 ChangeLog        |    3 +++
 defaults/linuxrc |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dfe39e2..023016b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
 # Distributed under the GPL v2
 # $Id$
 
+  15 Oct 2012; Peter Hjalmarsson <xake@rymdraket.net> defaults/linuxrc:
+  Support using init= on the command line.
+
   15 Oct 2012; Peter Hjalmarsson <xake@rymdraket.net> README,
   doc/genkernel.8.txt, gen_bootloader.sh, genkernel:
   Update the documentation to reflect current status re real_root/init.

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 48446ba..1bc09a7 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -36,6 +36,7 @@ quiet_kmsg
 CMDLINE=$(cat /proc/cmdline)
 # Scan CMDLINE for any specified real_root= or cdroot arguments
 FAKE_ROOT=''
+FAKE_INIT=''
 REAL_ROOTFLAGS=''
 ROOTFSTYPE='auto'
 CRYPT_SILENT=0
@@ -56,6 +57,9 @@ do
 		real_init=*)
 			REAL_INIT=${x#*=}
 		;;
+		init=*)
+			FAKE_INIT=${x#*=}
+		;;
 		init_opts=*)
 			INIT_OPTS=${x#*=}
 		;;
@@ -263,6 +267,10 @@ if [ -z "${REAL_ROOT}" -a \( "${CDROOT}" = '0' \)  -a \( "${FAKE_ROOT}" != "/dev
 then
 	REAL_ROOT="${FAKE_ROOT}"
 fi
+if [ -z "${REAL_INIT}" -a \( "${CDROOT}" = '0' \)  -a \( "${FAKE_INIT}" != "/linuxrc" \) ]
+then
+	REAL_INIT="${FAKE_INIT}"
+fi
 
 # Set variables based on the value of REAL_ROOT
 case "${REAL_ROOT}" in


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/
@ 2013-06-03 23:35 Richard Yao
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Yao @ 2013-06-03 23:35 UTC (permalink / raw
  To: gentoo-commits

commit:     3a054014e880e5b1ff28e3d87767c45a073da6b5
Author:     Fabio Erculiani <lxnay <AT> sabayon <DOT> org>
AuthorDate: Tue Apr 23 15:21:53 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Thu Apr 25 07:19:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=3a054014

Drop our own /sbin/modprobe and use busybox built-in applet instead

Our modprobe is an ancient heritage from the past, probably dating to
a time where busybox's modprobe features were limited. There is no reason
at all to keep using our own version instead of the busybox one.
This commit also makes modules_scan 15% faster.

---
 defaults/initrd.defaults |   8 +--
 defaults/initrd.scripts  |  35 +++++------
 defaults/modprobe        | 147 -----------------------------------------------
 gen_initramfs.sh         |  25 +++++---
 4 files changed, 36 insertions(+), 179 deletions(-)

diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index 90f73f4..8ff5510 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -58,13 +58,7 @@ fi
 QUIET='1'
 ROOT_LINKS='bin sbin lib lib32 lib64 boot usr opt emul'
 ROOT_TREES='etc root home var'
-INSMOD='insmod'
-if [ "${KMAJOR}" -ge 3 ] || [ "${KMAJOR}" -eq 2 -a "${KMINOR}" -gt '4' ]
-then
-	KSUFF='.ko'
-else
-	KSUFF='.o'
-fi
+KSUFF='.ko'
 
 REAL_ROOT=''
 CONSOLE='/dev/console'

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 2e8e744..7ec5c94 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -2,10 +2,6 @@
 
 . /etc/initrd.defaults
 
-backup() {
-	echo -ne "\033[0G\033[0K"
-}
-
 modules_load() {
 	for module in $*
 	do
@@ -17,30 +13,37 @@ modules_load() {
 
 modules_scan() {
 	local MODS
-	[ -d "/etc/modules/${1}" ] || touch /etc/modules/${1}
+	local loaded
+
+	MODS=$(cat /etc/modules/${1} 2>/dev/null)
+	[ -n "${MODS}" ] && echo -ne "${BOLD}   ::${NORMAL} "
+	[ -n "${MODS}" ] && echo -ne "Loading from ${1}: "
 
-	[ -f "/etc/modules/${1}" ] && MODS=`cat /etc/modules/${1}`
 	for x in ${MODS}
 	do
-		MLOAD=`echo ${MLIST} | sed -e "s/.*${x}.*/${x}/"`
+		MLOAD=$(echo ${MLIST} | sed -e "s/.*${x}.*/${x}/")
 		if [ "${MLOAD}" = "${x}" ] # Only module to no-load
 		then
 			echo -e "${BOLD}   ::${NORMAL} Skipping ${x}..."
-		elif [ "${MLOAD}" = "${MLIST}" ] # == No change == No specified no-load
+		elif [ "${MLOAD}" = "${MLIST}" ]
 		then
-			[ -n "${DEBUG}" ] && echo -ne "${BOLD}   ::${NORMAL} Checking for ${x}..."
-			# find -name does not work since the return status is always zero
-			if find /lib/modules/${KV} | grep /"${x}${KSUFF}" >/dev/null 2>&1
-			then
-				echo -ne "${BOLD}   ::${NORMAL} Scanning for ${x}..."
-				modprobe ${x} -n
-				backup
-				echo -ne "${NORMAL}"
+			if [ -n "${DEBUG}" ]; then
+				echo -ne "${BOLD}   ::${NORMAL} "
+				echo -ne "Scanning for ${x}..."
 			fi
+			modprobe ${x} > /dev/null 2>&1
+			loaded=${?}
+			[ -n "${DEBUG}" -a "${loaded}" = "0" ] && \
+				echo "loaded"
+			[ -n "${DEBUG}" -a "${loaded}" != "0" ] && \
+				echo "not loaded"
+			[ -z "${DEBUG}" -a "${loaded}" = "0" ] && \
+				echo -en "${x} "
 		else
 			echo -e "${BOLD}   ::${NORMAL} Skipping ${x}..."
 		fi
 	done
+	[ -n "${MODS}" ] && echo
 }
 
 uppercase(){

diff --git a/defaults/modprobe b/defaults/modprobe
deleted file mode 100755
index 6bbe7e4..0000000
--- a/defaults/modprobe
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/ash
-# Apparently, this is required for proper functionality with busybox 1.1.3
-# Check out bug #197730 for more details.
-
-. /etc/initrd.defaults
-
-usage() {
-	echo 'Usage:'
-	echo '  modprobe moduleprefix'
-	echo
-	echo 'Example:'
-	echo '  modprobe eepro100'
-	echo
-	echo 'Note: Do not pass the suffix to modprobe!'
-	exit 1
-}
-
-# Pass module name to this function
-modules_dep_list() {
-	if [ "$#" -lt '1' ]
-	then
-		echo 'modules_dep_list(): Improper usage!'
-		exit 1
-	fi
-	cat /lib/modules/${KV}/modules.dep | grep /"${1}${KSUFF}:" | cut -d':'  -f2
-}
-
-
-# Pass module deps list
-strip_mod_paths() {
-	local x
-	local ret
-	local myret
-
-	[ "$#" -lt '1' ] && return
-
-	for x in ${*}
-	do
-		ret=`basename ${x} | cut -d. -f1`
-		myret="${myret} ${ret}"
-	done
-	echo "${myret}"
-}
-
-LOADED_MODULES=''
-is_module_already_loaded() {
-	local x
-	if [ "$#" != '1' ]
-	then
-		echo 'is_module_already_loaded(): Improper usage!'
-	fi
-
-	for x in ${LOADED_MODULES}
-	do
-		if [ "${x}" = "${1}" ]
-		then
-			# Yep, module is loaded
-			return 0
-		fi
-	done
-	return 1
-}
-
-real_mod_path() {
-	# Find -name is no good since the return status is always zero
-	find "/lib/modules/${KV}" | grep /"${1}${KSUFF}"
-}
-
-modprobe2() {
-	local x
-	local deps
-	local real_path
-	local modlist
-	local ret
-
-	local echoAppend
-	local echoFlags
-
-	if [ "$#" -lt '1' ]
-	then
-		usage
-		exit 1
-	fi
-	real_path=`real_mod_path ${1}`
-	if [ "${real_path}" = '' -o "${real_path}" = ' ' ]
-	then
-		[ "${2}" = '-n' ] && echo -n " -> $1"
-		echo ' module not found.'
-		exit 2
-	fi
-	modlist=`modules_dep_list ${1}`
-	if [ "${modlist}" != '' -a "${modlist}" != ' ' ]
-	then
-		deps=`strip_mod_paths ${modlist}`
-	else
-		deps=''
-	fi
-	# Make sure we don't do any endless loops!
-
-	LOADED_MODULES="${LOADED_MODULES} ${1}"
-	for x in ${deps}
-	do
-		if ! is_module_already_loaded ${x}
-		then
-			if [ "${x}" != '' -a "${x}" != ' ' ]
-			then
-				modprobe2 "${x}" -n
-			fi
-		else
-			filler=1
-		fi
-	done
-	# placing options into x
-	x="${real_path##*/}"
-	x="`cat "/etc/module_options/${x%.ko*}".* 2>/dev/null`"
-	${INSMOD} ${real_path} ${x} > /dev/null 2>&1
-	ret=$?
-	if [ ${ret} -eq 0 ]
-	then
-		echoAppend=' loaded.'
-		[ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', '
-		echo ${echoFlags} "${1}${echoAppend}"
-	fi
-	return $ret
-}
-
-if [ "$#" -lt '1' ]
-then
-	usage
-fi
-
-[ -f '/modules.cache' ] || touch /modules.cache
-for x in `cat /modules.cache`
-do
-	LOADED_MODULES="${LOADED_MODULES} ${x}"
-done
-
-modprobe2 ${1}
-modprobe_ret=$?
-
-[ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1
-for x in ${LOADED_MODULES}
-do
-	echo $x >> /modules.cache
-done
-
-exit $modprobe_ret

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index af6dff6..784c0cc 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -120,12 +120,26 @@ append_busybox() {
 	chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script"
 
 	# Set up a few default symlinks
-	for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do
-		rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null
+	local default_applets="[ ash sh mount uname echo cut cat"
+	for i in ${BUSYBOX_APPLETS:-${default_applets}}; do
+		rm -f ${TEMP}/initramfs-busybox-temp/bin/$i
 		ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i ||
 			gen_die "Busybox error: could not link ${i}!"
 	done
 
+	local mod_applets="sbin/modprobe sbin/insmod sbin/rmmod bin/lsmod"
+	local dir=
+	local name=
+	for i in ${mod_applets}; do
+		dir=$(dirname $i)
+		name=$(basename $i)
+		rm -f ${TEMP}/initramfs-busybox-temp/$dir/$name
+		mkdir -p ${TEMP}/initramfs-busybox-temp/$dir ||
+			gen_die "Busybox error: could not create dir: $dir"
+		ln -s ../bin/busybox ${TEMP}/initramfs-busybox-temp/$dir/$name ||
+			gen_die "Busybox error: could not link ${i}!"
+	done
+
 	cd "${TEMP}/initramfs-busybox-temp/"
 	log_future_cpio_content
 	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
@@ -705,12 +719,6 @@ append_auxilary() {
 	done
 	echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
 
-	if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ]
-	then
-		cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
-	else
-		cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
-	fi
 	if isTrue $CMD_DOKEYMAPAUTO
 	then
 		echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
@@ -728,7 +736,6 @@ append_auxilary() {
 	chmod +x "${TEMP}/initramfs-aux-temp/init"
 	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
 	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
-	chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
 
 	if isTrue ${NETBOOT}
 	then


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/
@ 2013-06-03 23:43 Richard Yao
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Yao @ 2013-06-03 23:43 UTC (permalink / raw
  To: gentoo-commits

commit:     ebbb119b5b760200a8cb1fbdd43ea96f15efb6f7
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  3 23:40:28 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Mon Jun  3 23:43:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=ebbb119b

Fix /etc/modprobe.d regression

Commit 3a054014e880e5b1ff28e3d87767c45a073da6b5 replaced our modprobe
with busybox's modprobe, which broke the code responsible for making
options from /etc/modprobe.d work. We replace the old mechanism with a
new one that copies /etc/modprobe.d to correct that.

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

---
 defaults/linuxrc |  7 -------
 gen_initramfs.sh | 20 ++------------------
 2 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 4bbe5e2..9ea305b 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -262,13 +262,6 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-		*=*)
-			case "${x%%=*}" in
-			*.*)
-				echo "${x#*.}" >> "/etc/module_options/${x%%.*}.conf"
-			;;
-			esac
-		;;
 	esac
 done
 

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 784c0cc..427ffad 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -625,24 +625,8 @@ append_modprobed() {
 		rm -r "${TDIR}"
 	fi
 
-	mkdir -p "${TDIR}/etc/module_options/"
-
-	# Load module parameters
-	for dir in $(find "${MODPROBEDIR}"/*)
-	do
-		while read x
-		do
-			case "${x}" in
-				options*)
-					module_name="$(echo "$x" | cut -d ' ' -f 2)"
-					[ "${module_name}" != "$(echo)" ] || continue
-					module_options="$(echo "$x" | cut -d ' ' -f 3-)"
-					[ "${module_options}" != "$(echo)" ] || continue
-					echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
-				;;
-			esac
-		done < "${dir}"
-	done
+	mkdir -p "${TDIR}/etc"
+	cp -r "/etc/modprobe.d" "${TDIR}/etc/modprobe.d"
 
 	cd "${TDIR}"
 	log_future_cpio_content


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/
@ 2013-06-03 23:47 Richard Yao
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Yao @ 2013-06-03 23:47 UTC (permalink / raw
  To: gentoo-commits

commit:     4a1fe88b46fa1e42b7023bdbb3cc326df6a2efea
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  3 23:40:28 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Mon Jun  3 23:46:09 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=4a1fe88b

Fix /etc/modprobe.d regression

Commit 3a054014e880e5b1ff28e3d87767c45a073da6b5 replaced our modprobe
with busybox's modprobe, which broke the code responsible for making
options from /etc/modprobe.d work. We replace the old mechanism with a
new one that copies /etc/modprobe.d to correct that.

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

---
 defaults/linuxrc |  7 -------
 gen_initramfs.sh | 20 ++------------------
 2 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 4bbe5e2..9ea305b 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -262,13 +262,6 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-		*=*)
-			case "${x%%=*}" in
-			*.*)
-				echo "${x#*.}" >> "/etc/module_options/${x%%.*}.conf"
-			;;
-			esac
-		;;
 	esac
 done
 

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 784c0cc..427ffad 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -625,24 +625,8 @@ append_modprobed() {
 		rm -r "${TDIR}"
 	fi
 
-	mkdir -p "${TDIR}/etc/module_options/"
-
-	# Load module parameters
-	for dir in $(find "${MODPROBEDIR}"/*)
-	do
-		while read x
-		do
-			case "${x}" in
-				options*)
-					module_name="$(echo "$x" | cut -d ' ' -f 2)"
-					[ "${module_name}" != "$(echo)" ] || continue
-					module_options="$(echo "$x" | cut -d ' ' -f 3-)"
-					[ "${module_options}" != "$(echo)" ] || continue
-					echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
-				;;
-			esac
-		done < "${dir}"
-	done
+	mkdir -p "${TDIR}/etc"
+	cp -r "/etc/modprobe.d" "${TDIR}/etc/modprobe.d"
 
 	cd "${TDIR}"
 	log_future_cpio_content


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/
@ 2013-06-03 23:49 Richard Yao
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Yao @ 2013-06-03 23:49 UTC (permalink / raw
  To: gentoo-commits

commit:     f9d68e00da0f44d2a0f9ebad2e3c706f3d9769c1
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  3 23:40:28 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Mon Jun  3 23:48:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=f9d68e00

Fix /etc/modprobe.d regression

Commit 3a054014e880e5b1ff28e3d87767c45a073da6b5 replaced our modprobe
with busybox's modprobe, which broke the code responsible for making
options from /etc/modprobe.d work. We replace the old mechanism with a
new one that copies /etc/modprobe.d to correct that.

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

---
 defaults/linuxrc |  7 -------
 gen_initramfs.sh | 20 ++------------------
 2 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 4bbe5e2..9ea305b 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -262,13 +262,6 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-		*=*)
-			case "${x%%=*}" in
-			*.*)
-				echo "${x#*.}" >> "/etc/module_options/${x%%.*}.conf"
-			;;
-			esac
-		;;
 	esac
 done
 

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 784c0cc..427ffad 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -625,24 +625,8 @@ append_modprobed() {
 		rm -r "${TDIR}"
 	fi
 
-	mkdir -p "${TDIR}/etc/module_options/"
-
-	# Load module parameters
-	for dir in $(find "${MODPROBEDIR}"/*)
-	do
-		while read x
-		do
-			case "${x}" in
-				options*)
-					module_name="$(echo "$x" | cut -d ' ' -f 2)"
-					[ "${module_name}" != "$(echo)" ] || continue
-					module_options="$(echo "$x" | cut -d ' ' -f 3-)"
-					[ "${module_options}" != "$(echo)" ] || continue
-					echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
-				;;
-			esac
-		done < "${dir}"
-	done
+	mkdir -p "${TDIR}/etc"
+	cp -r "/etc/modprobe.d" "${TDIR}/etc/modprobe.d"
 
 	cd "${TDIR}"
 	log_future_cpio_content


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/
@ 2013-06-06  3:36 Richard Yao
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Yao @ 2013-06-06  3:36 UTC (permalink / raw
  To: gentoo-commits

commit:     ddf2c5b934da598d33f4db0457cc8806f86bba2d
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  3 23:40:28 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Mon Jun  3 23:49:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=ddf2c5b9

Fix /etc/modprobe.d regression

Commit 3a054014e880e5b1ff28e3d87767c45a073da6b5 replaced our modprobe
with busybox's modprobe, which broke the code responsible for making
options from /etc/modprobe.d work. We replace the old mechanism with a
new one that copies /etc/modprobe.d to correct that.

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

---
 defaults/linuxrc |  7 -------
 gen_initramfs.sh | 20 ++------------------
 2 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 4bbe5e2..9ea305b 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -262,13 +262,6 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-		*=*)
-			case "${x%%=*}" in
-			*.*)
-				echo "${x#*.}" >> "/etc/module_options/${x%%.*}.conf"
-			;;
-			esac
-		;;
 	esac
 done
 

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 784c0cc..427ffad 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -625,24 +625,8 @@ append_modprobed() {
 		rm -r "${TDIR}"
 	fi
 
-	mkdir -p "${TDIR}/etc/module_options/"
-
-	# Load module parameters
-	for dir in $(find "${MODPROBEDIR}"/*)
-	do
-		while read x
-		do
-			case "${x}" in
-				options*)
-					module_name="$(echo "$x" | cut -d ' ' -f 2)"
-					[ "${module_name}" != "$(echo)" ] || continue
-					module_options="$(echo "$x" | cut -d ' ' -f 3-)"
-					[ "${module_options}" != "$(echo)" ] || continue
-					echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
-				;;
-			esac
-		done < "${dir}"
-	done
+	mkdir -p "${TDIR}/etc"
+	cp -r "/etc/modprobe.d" "${TDIR}/etc/modprobe.d"
 
 	cd "${TDIR}"
 	log_future_cpio_content


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/
@ 2013-06-09  6:43 Richard Yao
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Yao @ 2013-06-09  6:43 UTC (permalink / raw
  To: gentoo-commits

commit:     ee71084ed92acfd1a91e9358f72313e06793899d
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  9 06:38:55 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Sun Jun  9 06:41:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=ee71084e

Remove zpool.cache from initramfs

Importing the root pool with zpool.cache present will fail in rare
circumstances. This commit removes zpool.cache from initramfs and
simplifies the zpool import code.

The simplification should have the side effect of eliminating an
incorrect error message that has been observed on some systems.

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

---
 defaults/initrd.scripts | 25 ++++++-------------------
 gen_initramfs.sh        | 16 ++++++++--------
 2 files changed, 14 insertions(+), 27 deletions(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index ef58b5b..b8c355a 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -722,28 +722,15 @@ startVolumes() {
 				bad_msg "Imported ZFS pools failed"
 			fi
 		else
+			good_msg "Importing ZFS pool ${ZFS_POOL}"
 
-			if [ "$(zpool list -H -o name ${ZFS_POOL} 2>&1)" = "$ZFS_POOL" ]
-			then
-				good_msg "ZFS pool ${ZFS_POOL} already imported."
+			/sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}"
 
-				if [ -n "${CRYPT_ROOT}" -o -n "${CRYPT_SWAP}" ]
-				then
-					good_msg "LUKS detected. Reimporting ${ZFS_POOL}"
-					/sbin/zpool export -f "${ZFS_POOL}"
-					/sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}"
-				fi
+			if [ "$?" = '0' ]
+			then
+				good_msg "Import of ${ZFS_POOL} succeeded"
 			else
-				good_msg "Importing ZFS pool ${ZFS_POOL}"
-
-				/sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}"
-
-				if [ "$?" = '0' ]
-				then
-					good_msg "Importing ${ZFS_POOL} succeeded"
-				else
-					bad_msg "Importing ${ZFS_POOL} failed"
-				fi
+				bad_msg "Import of ${ZFS_POOL} failed"
 			fi
 		fi
 	fi

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 6ad51c1..3be93c0 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -424,14 +424,14 @@ append_zfs(){
 		rm -r "${TEMP}/initramfs-zfs-temp"
 	fi
 
-	mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs/"
-
-	# Copy files to /etc/zfs
-	for i in /etc/zfs/{zdev.conf,zpool.cache}
-	do
-		cp -a "${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \
-			|| print_warning 1 "Could not copy file ${i} for ZFS"
-	done
+	# Copy system zdev.conf
+	if [ -f /etc/zfs/zdev.conf ]
+	then
+		print_info 1 "  >> Copying system zdev.conf into initramfs..."
+		mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs/"
+		cp -a "/etc/zfs/zdev.conf" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \
+			|| gen_die "Could not copy file ${i} for ZFS"
+	fi
 
 	# Copy binaries
 	copy_binaries "${TEMP}/initramfs-zfs-temp" /sbin/{mount.zfs,zfs,zpool}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-09  6:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 23:35 [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/ Richard Yao
  -- strict thread matches above, loose matches on Subject: below --
2013-06-09  6:43 Richard Yao
2013-06-06  3:36 Richard Yao
2013-06-03 23:49 Richard Yao
2013-06-03 23:47 Richard Yao
2013-06-03 23:43 Richard Yao
2012-11-05 18:30 Richard Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox