Opened 23 years ago

Closed 23 years ago

Last modified 23 years ago

#96 closed defect (fixed)

automated COL and WCOL settings

Reported by: gerard@… Owned by: markh@…
Priority: normal Milestone:
Component: Book Version: CVS
Severity: normal Keywords:
Cc:

Description

Test this out (make sure when you test it, boot with different vga resolutions to really test it).

From: Andre Wyrwa <a.wyrwa@…> ... # Begin smart COL and WCOL test -z "$CONSOLE" && CONSOLE=/dev/console COL=$[$(stty size < $CONSOLE | cut -f2 -d" ")-10] WCOL=$[$COL-20] # End smart COL and WCOL

Change History (5)

comment:1 by markh@…, 23 years ago

Owner: changed from lfs-book@… to mark-lfs@…
Status: newassigned

I've tested this out with the following resolutions:

80x[25,50,43,28,30,34,60] 132x[25,43,50,60] 40x25 (no idea why this one is on my system - looks like an old bbc-b!)

There are two issues with this:

1) If we implement this, we need to move cut from /usr/bin to /bin as lots of people won't have /usr mounted at the point at which we start using the init.d scripts. I don't have a problem with this.

2) If you run scripts in xterm and konsole, it looks wierd. I'd argue however that you shouldn't be running these scripts in xterms etc that often.

I think that the fact it looks a lot better at bootup and shutdown outweighs these issues.

As usual, if there's no opposition in the next few days, I'll add this to cvs (the change to textutils install to move cut and the change to the bootscripts). Opinions please...

comment:2 by gerard@…, 23 years ago

Moving cut would violate the FHS. People who are abiding to the FHS won't be able to use these boot scripts which isn't an option.

An alternative would be for the functions script to test for /bin/cut. If it's there, use the dynamic way of assigning a value to COL and WCOL. If /bin/cut doesn't exist, then use the static values that we are using right now.

But this discussion should move to lfs-discuss as well. I'll forward a copy

comment:3 by gerard@…, 23 years ago

Correction: <markh> Gerard: I've just read your email about putting cut in /bin. I don't think it does violate the FHS as it says in its description of /bin that it may contain commands which "are used indirectly by scripts"

comment:4 by markh@…, 23 years ago

This is a modified version supplied by Thomas Beaudry which doesn't need cut, nicely avoiding the FHS issue.

# If COLUMNS hasn't been set yet, do it ourself if [ -z "$COLUMNS" ]

then

# Get the console device if we don't have it already test -z "$CONSOLE" && CONSOLE=/dev/console

# Get the console size (rows columns) SIZE=$(stty size < $CONSOLE)

# Strip off the rows leaving the columns COLUMNS=${SIZE#*\ }

fi

COL=$[$COLUMNS - 10] WCOL=$[$COLUMNS - 30]

comment:5 by markh@…, 23 years ago

Resolution: fixed
Status: assignedclosed

I've added the change to the CVS book. They seem to be ok but no doubt if there are any problems we'll hear sharpish :-)

Note: See TracTickets for help on using tickets.