View | Details | Raw Unified | Return to bug 114923
Collapse All | Expand All

(-)mkinitrd (-32 / +30 lines)
Lines 533-539 Link Here
533
	NF == 0     { next }
533
	NF == 0     { next }
534
	$1 in seen  { next }
534
	$1 in seen  { next }
535
		    { seen[$1]=1
535
		    { seen[$1]=1
536
		      print
536
		      # drop module parameters here: modprobe in the initrd
537
		      # will pick them up again.
538
		      print $1
537
		    }
539
		    }
538
    '
540
    '
539
    rm -f $temp
541
    rm -f $temp
Lines 1166-1171 Link Here
1166
    cp_bin $initrd_modprobe $tmp_mnt/sbin/modprobe 2>/dev/null \
1168
    cp_bin $initrd_modprobe $tmp_mnt/sbin/modprobe 2>/dev/null \
1167
	|| error 5 "no static modprobe"
1169
	|| error 5 "no static modprobe"
1168
1170
1171
    cp -r $root_dir/etc/modprobe.conf $root_dir/etc/modprobe.conf.local \
1172
	  $root_dir/etc/modprobe.d $tmp_mnt/etc
1173
1169
    # SELinux: Binary policy file and load_policy utility for loading it.
1174
    # SELinux: Binary policy file and load_policy utility for loading it.
1170
    if [ -n "$use_selinux" ] ; then
1175
    if [ -n "$use_selinux" ] ; then
1171
	if [ -f /etc/security/selinux/policy.15 -a \
1176
	if [ -f /etc/security/selinux/policy.15 -a \
Lines 1768-1775 Link Here
1768
    # Copy the modules to the initrd
1773
    # Copy the modules to the initrd
1769
    echo -ne "Driver modules:\t"
1774
    echo -ne "Driver modules:\t"
1770
    initrd_is_using_modules=
1775
    initrd_is_using_modules=
1771
    while read module params ; do
1776
    for module in $drv_modules; do
1772
	[ -z "$module" ] && continue
1773
	echo -n "${module#lib/modules/$kernel_version/} "
1777
	echo -n "${module#lib/modules/$kernel_version/} "
1774
	if [ ! -r $root_dir/$module ]; then
1778
	if [ ! -r $root_dir/$module ]; then
1775
	    oops 9 "Module $module not found."
1779
	    oops 9 "Module $module not found."
Lines 1780-1785 Link Here
1780
	    return
1784
	    return
1781
	fi
1785
	fi
1782
1786
1787
	cat_linuxrc <<-EOF
1788
	|params=
1789
	EOF
1790
1783
	case "$module" in
1791
	case "$module" in
1784
	    */dasd_mod.*)
1792
	    */dasd_mod.*)
1785
		# kernel cmdline dasd parameter is placed into the environment.
1793
		# kernel cmdline dasd parameter is placed into the environment.
Lines 1796-1808 Link Here
1796
		|for p in \$(cat /proc/cmdline) ; do
1804
		|for p in \$(cat /proc/cmdline) ; do
1797
		|  case \$p in
1805
		|  case \$p in
1798
		|    dasd=*)
1806
		|    dasd=*)
1799
		|      dasd_params="\$p"
1807
		|      params="\$params \$p"
1800
		|      ;;
1808
		|      ;;
1801
		|  esac
1809
		|  esac
1802
		|done
1810
		|done
1803
		|mp="/$module\${dasd_params:+ dasd=\"\$dasd_params\"}"
1804
		|echo "Loading \${mp#/lib/modules/$kernel_version/}"	
1805
		|insmod \$mp
1806
		EOF
1811
		EOF
1807
		;;
1812
		;;
1808
	    */ide?core.*)
1813
	    */ide?core.*)
Lines 1819-1827 Link Here
1819
		|      ;;
1824
		|      ;;
1820
		|  esac
1825
		|  esac
1821
		|done
1826
		|done
1822
		|mp="/$module\${ide_params:+ options=\"\$ide_params\"}"
1827
		|if [ -n "\$ide_params" ]; then
1823
		|echo "Loading \${mp#/lib/modules/$kernel_version/}"	
1828
		|  params="\$params options=\"\$ide_params\""
1824
		|insmod \$mp
1829
		|fi
1825
		EOF
1830
		EOF
1826
		;;
1831
		;;
1827
	    */scsi_mod*)
1832
	    */scsi_mod*)
Lines 1835-1841 Link Here
1835
		|for p in \$(cat /proc/cmdline) ; do
1840
		|for p in \$(cat /proc/cmdline) ; do
1836
		|  case \$p in
1841
		|  case \$p in
1837
		|    scsi_mod.*)
1842
		|    scsi_mod.*)
1838
		|	extra_scsi_params="\$extra_scsi_params \${p#scsi_mod.}"
1843
		|	params="\$params \${p#scsi_mod.}"
1839
		|	;;
1844
		|	;;
1840
		|    scsi_reportlun2=1)
1845
		|    scsi_reportlun2=1)
1841
		|	echo "scsi_reportlun2 compat: Use scsi_mod.default_dev_flags=0x20000 instead"
1846
		|	echo "scsi_reportlun2 compat: Use scsi_mod.default_dev_flags=0x20000 instead"
Lines 1867-1895 Link Here
1867
		|	;;
1872
		|	;;
1868
		|    max_luns=*|max_report_luns=*|inq_timeout=*|dev_flags=*|default_dev_flags=*)
1873
		|    max_luns=*|max_report_luns=*|inq_timeout=*|dev_flags=*|default_dev_flags=*)
1869
		|	echo "scsi_mod compat: Please use prefix: scsi_mod.\$p"
1874
		|	echo "scsi_mod compat: Please use prefix: scsi_mod.\$p"
1870
		|	extra_scsi_params="\$extra_scsi_params \$p"
1875
		|	params="\$params \$p"
1871
		|      ;;
1876
		|      ;;
1872
		|  esac
1877
		|  esac
1873
		|done
1878
		|done
1874
		|if [ \$devflags != 0 ]; then 
1879
		|if [ \$devflags != 0 ]; then 
1875
		|    extra_scsi_params="default_dev_flags=\$devflags \$extra_scsi_params"
1880
		|    params="default_dev_flags=\$devflags \$params"
1876
		|fi
1881
		|fi
1877
		|mp="/$module\${extra_scsi_params:+ $extra_scsi_params}"
1878
		|echo "Loading \${mp#/lib/modules/$kernel_version/}"	
1879
		|insmod \$mp
1880
		EOF
1881
		;;
1882
	    *)
1883
		mp="/$module${params:+ $params}"
1884
		cat_linuxrc <<-EOF
1885
		|echo "Loading ${mp#/lib/modules/$kernel_version/}"
1886
		|insmod $mp
1887
		EOF
1882
		EOF
1888
		;;
1883
		;;
1889
	esac
1884
	esac
1885
	module_basename=${module##*/}
1886
	cat_linuxrc <<-EOF
1887
	|echo "Loading ${module_basename%.ko}"
1888
	|modprobe ${module_basename%.ko} \$params
1889
	EOF
1890
1890
1891
	initrd_is_using_modules=1
1891
	initrd_is_using_modules=1
1892
    done < <(echo "$drv_modules")
1892
    done
1893
    echo
1893
    echo
1894
1894
1895
    if [ -z "$initrd_is_using_modules" ]; then
1895
    if [ -z "$initrd_is_using_modules" ]; then
Lines 1906-1919 Link Here
1906
    uld_modules="$(resolve_modules $kernel_version $uld_modules)"
1906
    uld_modules="$(resolve_modules $kernel_version $uld_modules)"
1907
1907
1908
    # Now copy the upper level driver modules
1908
    # Now copy the upper level driver modules
1909
    while read module params ; do
1909
    for module in $uld_modules; do
1910
	if [ ! -f $tmp_mnt/$module ]; then
1910
	if [ ! -f $tmp_mnt/$module ]; then
1911
	    if ! ( cd ${root_dir:-/} ; cp -p --parents $module $tmp_mnt ) ; then
1911
	    if ! ( cd ${root_dir:-/} ; cp -p --parents $module $tmp_mnt ) ; then
1912
		oops 6 "Failed to add module $module."
1912
		oops 6 "Failed to add module $module."
1913
		return
1913
		return
1914
	    fi
1914
	    fi
1915
	fi
1915
	fi
1916
    done < <(echo "$uld_modules")
1916
    done
1917
1917
1918
    if [ -n "$s390_dasd_disks" ]; then
1918
    if [ -n "$s390_dasd_disks" ]; then
1919
	# We only need to activate DASDs manually if it
1919
	# We only need to activate DASDs manually if it
Lines 2264-2271 Link Here
2264
    # Load fs modules _after_ resume
2264
    # Load fs modules _after_ resume
2265
    echo -ne "Filesystem modules:\t"
2265
    echo -ne "Filesystem modules:\t"
2266
    initrd_is_using_modules=
2266
    initrd_is_using_modules=
2267
    while read module params ; do
2267
    for module in $fs_modules; do
2268
	[ -z "$module" ] && continue
2269
	echo -n "${module#lib/modules/$kernel_version/} "
2268
	echo -n "${module#lib/modules/$kernel_version/} "
2270
	if [ ! -r $root_dir/$module ]; then
2269
	if [ ! -r $root_dir/$module ]; then
2271
	    oops 9 "Module $module not found."
2270
	    oops 9 "Module $module not found."
Lines 2276-2288 Link Here
2276
	    return
2275
	    return
2277
	fi
2276
	fi
2278
2277
2279
	mp="/$module${params:+ $params}"
2280
	cat_linuxrc <<-EOF
2278
	cat_linuxrc <<-EOF
2281
	|echo "Loading ${mp#/lib/modules/$kernel_version/}"
2279
	|echo "Loading ${module#/lib/modules/$kernel_version/}"
2282
	|insmod $mp
2280
	|modprobe $module
2283
	EOF
2281
	EOF
2284
	initrd_is_using_modules=1
2282
	initrd_is_using_modules=1
2285
    done < <(echo "$fs_modules")
2283
    done
2286
    echo
2284
    echo
2287
2285
2288
    # And run depmod to ensure proper loading
2286
    # And run depmod to ensure proper loading

Return to bug 114923