Due to KMS, the bootup tends to get out of whack sometimes. To
remedy this, we'll try to recalculate the column width after
each operation that has potential to change the display mode
STAT_COL=80
-if [ ! -t 1 ]; then
- USECOLOR=""
+calc_columns() {
+ if [ ! -t 1 ]; then
+ USECOLOR=""
+ # stty will fail when stdin isn't a terminal
+ elif [ -t 0 ]; then
+ STAT_COL="$(/bin/stty size)"
+ # stty gives "rows cols"; strip the rows number, we just want columns
+ STAT_COL="${STAT_COL##* }"
-# stty will fail when stdin isn't a terminal
-elif [ -t 0 ]; then
- STAT_COL="$(/bin/stty size)"
- # stty gives "rows cols"; strip the rows number, we just want columns
- STAT_COL="${STAT_COL##* }"
-
-else
- # is /usr/share/terminfo already mounted, and TERM recognized?
- /bin/tput cols &>/dev/null
- if [ $? -eq 0 ]; then
- STAT_COL=$(/bin/tput cols)
+ else
+ # is /usr/share/terminfo already mounted, and TERM recognized?
+ /bin/tput cols &>/dev/null
+ if [ $? -eq 0 ]; then
+ STAT_COL=$(/bin/tput cols)
+ fi
fi
-fi
-if [ "0$STAT_COL" -eq 0 ]; then
- # if output was 0 (serial console), set default width to 80
- STAT_COL=80
- USECOLOR=""
-fi
+ if [ "0$STAT_COL" -eq 0 ]; then
+ # if output was 0 (serial console), set default width to 80
+ STAT_COL=80
+ USECOLOR=""
+ fi
+
+ # we use 13 characters for our own stuff
+ STAT_COL=$(($STAT_COL - 13))
+}
-# we use 13 characters for our own stuff
-STAT_COL=$(($STAT_COL - 13))
+calc_columns
run_hook sysinit_udevlaunched
@@ -80,6 +81,7 @@ if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
stat_busy "Triggering UDev uevents"
/sbin/udevadm control --property=STARTUP=1
/sbin/udevadm trigger
+ calc_columns
stat_done
fi
@@ -92,6 +94,7 @@ if ! [ "$load_modules" = "off" ]; then
/sbin/modprobe $mod
fi
done
+ calc_columns
stat_done
fi
fi
@@ -101,6 +104,7 @@ if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
stat_busy "Waiting for UDev uevents to be processed"
/sbin/udevadm settle
/sbin/udevadm control --property=STARTUP=
+ calc_columns
stat_done
fi
--
1.6.5.2
01-14-2010, 03:36 AM
Dan McGee
Recalc columns after module loading
On Mon, Jan 11, 2010 at 12:49 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
> Due to KMS, the bootup tends to get out of whack sometimes. To
> remedy this, we'll try to recalculate the column width after
> each operation that has potential to change the display mode
>
> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Seems reasonable to me, although I'm not sure we need to do it that many times.
-Dan
01-15-2010, 06:02 PM
Aaron Griffin
Recalc columns after module loading
On Wed, Jan 13, 2010 at 10:36 PM, Dan McGee <dpmcgee@gmail.com> wrote:
> On Mon, Jan 11, 2010 at 12:49 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
>> Due to KMS, the bootup tends to get out of whack sometimes. To
>> remedy this, we'll try to recalculate the column width after
>> each operation that has potential to change the display mode
>>
>> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
>
> Seems reasonable to me, although I'm not sure we need to do it that many times.
I think I threw it everywhere a module could have been loaded, to try
to get things recalculated as soon as possible. I guess we could strip
it down to 2 spots: after the MODULES array, and after the udev
settle.
Also, this isn't tested (yet). Maybe I'll get around to rebooting this weekend.