]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - rc.d/rc.sysinit
avoid loading /etc/modules contents twice (modules-load.d/modules.conf is symlink...
[projects/rc-scripts.git] / rc.d / rc.sysinit
index 28da1a9428d7c1761ae91c3abf6da141c7aadcab..d486c8e797bb5ab269b6cc345a49f044d2ad2e12 100755 (executable)
@@ -175,6 +175,9 @@ if ! is_yes "$VSERVER" ; then
        # we need /proc mounted before everything
        is_fsmounted proc /proc || mount -n /proc || mount -n -o gid=17,hidepid=2 -t proc /proc /proc
 
+       # Early sysctls
+       sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
+
        # Only read this once.
        cmdline=$(cat /proc/cmdline)
        if strstr "$cmdline" "pld.no-upstart" ; then
@@ -263,7 +266,7 @@ if ! is_yes "$VSERVER"; then
                dmesg -n $CONSOLE_LOGLEVEL
        fi
 
-       if ! is_no "$START_UDEV" && [ -x /sbin/start_udev ]; then
+       if ! is_no "$START_UDEV" && [ -x /sbin/start_udev ] && [[ "$container" != lxc* ]]; then
                is_fsmounted devtmpfs /dev || mount -n -t devtmpfs devtmpfs /dev
                load_kernel_modules modules.preudev
                /sbin/start_udev
@@ -382,7 +385,7 @@ if ! is_yes "$VSERVER"; then
        _ROOTFS_DEVICE=$(awk '($1 !~ /^#/ && $2 == "/" && NF >= 6) { print $1}' /etc/fstab)
        _ROOTFS_TYPE=$(awk '$2 == "/" && $3 != "rootfs" { print $3 }' /proc/mounts 2>/dev/null)
 
-       if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "aufs" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" -a "$_ROOTFS_TYPE" != "squashfs" -a "$_ROOTFS_PASSNO" != 0 -a -e $_ROOTFS_DEVICE ]; then
+       if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "aufs" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" -a "$_ROOTFS_TYPE" != "squashfs" -a "$_ROOTFS_PASSNO" != 0 -a -e $_ROOTFS_DEVICE ] && [[ "$container" != lxc* ]]; then
                check_root_fs
        fi
 
@@ -570,7 +573,10 @@ if ! is_yes "$VSERVER"; then
        # Load modules
        if ! use_upstart; then
                load_kernel_modules modules
-               for f in /etc/modules-load.d/*.conf ; do
+               for f in /etc/modules-load.d/*.conf; do
+                       # already loaded by implicit "modules" load
+                       [ "${f##*/}" = "modules.conf" ] && continue
+
                        [ -r $f ] || continue
                        load_kernel_modules ${f##/etc/}
                done
@@ -663,9 +669,9 @@ if ! is_yes "$VSERVER"; then
                        golvm=0
                        rc=0
                        if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
-                               if (grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf 2>/dev/null); then
+                               if grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf 2>/dev/null; then
                                        show "Starting up RAID devices"; busy
-                                       /sbin/mdadm --assemble --scan --auto=yes
+                                       /sbin/mdadm --assemble --scan --auto=yes
                                        rc=$?
                                        if [ "$rc" -eq 0 -o "$rc" -eq 2 ]; then
                                                # rc is used later, too so set sane value
@@ -807,7 +813,7 @@ if ! is_yes "$VSERVER"; then
        # option is removed from /etc/mtab
        if [ -z "$fastboot" ] && grep "^[^#].*encryption=" /etc/fstab 2>/dev/null | grep -v -q "noauto" 2>/dev/null; then
                show "Checking encrypted filesystems"; started
-               LOOPLIST="$(awk '
+               LOOPLIST="$(LC_ALL=C awk '
                FILENAME=="/proc/mounts" {
                        TAB[$2]=$1;
                }
@@ -850,7 +856,7 @@ if ! is_yes "$VSERVER"; then
                fi
 
                show "Remounting encrypted filesystems back in rw mode"; busy
-               awk '
+               LC_ALL=C awk '
                FILENAME=="/proc/mounts" {
                        TAB[$2]=$1;
                }
@@ -997,7 +1003,7 @@ if ! is_yes "$VSERVER"; then
 
        # Now that we have all of our basic modules loaded and the kernel going,
        # let's dump the syslog ring somewhere so we can find it later
-       dmesg > /var/log/dmesg
+       dmesg --raw > /var/log/dmesg
        i=5
        while [ $i -ge 0 ]; do
                if [ -f /var/log/dmesg.$i ]; then
This page took 0.281376 seconds and 4 git commands to generate.