FS#18490 - [initscripts] add \n after stat_*

Attached to Project: Arch Linux
Opened by Carl Mueller (cmlr) - Saturday, 27 February 2010, 23:32 GMT
Last edited by Tom Gundersen (tomegun) - Monday, 20 June 2011, 17:46 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

On my laptop, about half way through the boot process, the font switches to about half-size. I guess this is due to changes in the kernel. When it gets to:

checking filesystems [busy]

instead of starting a new line, it reports the first filesystem immediately to the right of [busy]. There needs to be a newline character. This doesn't happen on my other computers for which the font doesn't change size during boot.

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

Boot with a computer for which font changes size during boot.
This task depends upon

Closed by  Tom Gundersen (tomegun)
Monday, 20 June 2011, 17:46 GMT
Reason for closing:  Fixed
Comment by Carl Mueller (cmlr) - Sunday, 28 February 2010, 04:22 GMT
I probably don't see this on my other computers because [busy] is already at the end of the line, so whatever comes after looks like it's on a new line. But with smaller font, [busy] is in the middle of the page.
Comment by Thomas Bächler (brain0) - Thursday, 10 June 2010, 07:12 GMT Comment by Krzysztof Grygiencz (kfgz) - Sunday, 28 November 2010, 12:46 GMT
Proposed (working) solution:

-stat_busy "Checking Filesystems"
-FSCK_OUT=/dev/stdout

+stat_busy "Checking Filesystems"
+echo
+FSCK_OUT=/dev/stdout
Comment by Søren Poulsen (nikor) - Friday, 18 February 2011, 23:08 GMT
This fixes the bug for me, but its a bit ugly (i think). I will clean it up when i wake up.
   patch (2.9 KiB)
Comment by Thomas Bächler (brain0) - Saturday, 19 February 2011, 01:19 GMT
Please move the function to rc.d/functions.
Comment by Søren Poulsen (nikor) - Saturday, 19 February 2011, 10:49 GMT
Maybe I'm misunderstanding what you are saying, but calc_columns() is in rc.d/functions.

I have repackaged the patch with all the "git format-patch" goodies :)
Comment by Thomas Bächler (brain0) - Saturday, 19 February 2011, 12:12 GMT
Ah yes, you're right.
Comment by Tom Gundersen (tomegun) - Monday, 28 March 2011, 12:35 GMT
@Søren: thanks for your work! Could I ask you to submit the patches to <arch-projects@archlinux.org> for review (with a reference to this FS).
Comment by Søren Poulsen (nikor) - Wednesday, 30 March 2011, 22:34 GMT
@Tom: Thank you for your kind response :)

It turns out I don't have permission to post to the arch-projects list, which makes sense since I'm very new here.

I have attached remerged patches against head.

ps. which format do you like your patches? (ex. attached, link to github, pastebin, ...?)
Comment by Tom Gundersen (tomegun) - Wednesday, 30 March 2011, 23:03 GMT
@Søren: I don't think there are any restrictions on posting to the mailinglist, except that I guess you have to sign up: <http://mailman.archlinux.org/mailman/listinfo/arch-projects>. I guess there is no need to post these patches to the mailinglist as they have already been discussed here, and they should be uncontroversial.

In general though: if you have other patches, please sign up to the mailinglist and post them there (for instance using "git send-email") so that everyone can have a chance to comment on them before I push them out.

One question: Where did the first patch (by Aaron) originate? Was it in the link Thomas gave (I couldn't access the link)?
Comment by Tom Gundersen (tomegun) - Wednesday, 30 March 2011, 23:29 GMT
@Søren: I looked through the patches, and I think there is a problem.

The assumption of the first patch is that we know when the display mode might change, but this is not the case. We don't know when udev will get around to loading the graphics modules, nor when they will finish initializing, so the points where calc_columns are called are just random (this might of course work in practice, but I think we can do better). What might make the situation worse in the future is that we might be able to skip call to "udev settle", in which case the display mode might even change after rc.sysinit is completely finished.

My suggestion would be to keep calc_culumns as it is after your second patch, but run it at the start of every stat_* function, rather than in rc.sysinit. This is of course extremely redundant as the column width will change at most once, but I can't think of anything more efficient off the cuff. I guess that it will not slow down boot as the number of calls will be low, but this might be worth checking.

What do you think?
Comment by Søren Poulsen (nikor) - Thursday, 31 March 2011, 00:45 GMT
@Tom: The mailing list permission was my bad. I signed up with another email than I was sending from. I will post the next time I have patches :)

Yes the first patch was from the link Thomas gave. I have also found it here:
http://mailman.archlinux.org/pipermail/arch-dev-public/2010-January/014894.html
The thread has some hints but if we don't have udev settle, I don't think it's useful...

If we have no way of knowing when the display mode might change, then i think your solution to call calc_columns just before outputting (in stat_* and maybe before fsck?) is the best idea. But I'm a fair bit out of my comfort zone so my thoughts should not hold to much weight. I will try to see if i can come up with a better solution tomorrow and if not i will rewrite to your suggestion.
Comment by Tom Gundersen (tomegun) - Monday, 20 June 2011, 17:46 GMT
@Søren: I applied a patch based on a combination of bits from Aaron's patch, and your patch.

I think I was wrong earlier, we will never be able to support running without "udevadm --settle", and we always know that after the call to --settle the resolution will not change again. Hence, it is safe to recalc at this time. If we need to recalc the number of columns in several places, we could do that once we see the bug reports :-)

Thanks for working on this!

Loading...