# 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
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
_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
# 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
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
# 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;
}
fi
show "Remounting encrypted filesystems back in rw mode"; busy
- awk '
+ LC_ALL=C awk '
FILENAME=="/proc/mounts" {
TAB[$2]=$1;
}
# 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