Karel Zak [Fri, 24 May 2013 09:48:58 +0000 (11:48 +0200)]
libfdisk: make it possible to reset device properties
- remember user C/H/S and sector size
- reset all device properties before create a new label (maybe the
old setting has been affected by previous on-disk label)
- always apply user setting after the reset
- improve topology/geometry debug messages
Note that for fdisk "user C/H/S and sector size" means on command line
specified values. If you override the setting by c/h/s commands in
expert menu then the setting is applied to the current disk label
only. If you create a new disk label (e.g change MBR to GPT) then
fdisk will use the original setting.
Karel Zak [Wed, 22 May 2013 12:41:58 +0000 (14:41 +0200)]
libfdisk: clean up sun geometry stuff
- move fdisk_sun_set_* functions to public API file
- remove extra function to set ncyl -- this has to follow regular
geo.cylinders
- set alternative cylinders to zero (to be compatible with parted)
- it seems that the previous code completely ignored relation between
geo.cylinders, sunlabel->acyl and sunlabel->ncyl.
Karel Zak [Tue, 21 May 2013 13:30:16 +0000 (15:30 +0200)]
libfdisk: add FDISK_DEBUG_FRONTEND
Currently we use private libfdisk in fdisk code, because the library
API is not stable yet. Let's add debug flag to make it obvious in the
debug output what is from libfdisk and what is from fdisk frontend.
Karel Zak [Fri, 17 May 2013 10:35:23 +0000 (12:35 +0200)]
fdisk: add new stuff to display menus
fdisk menus:
- driven by menu and menu_entry structs
- supports normal and expect mode
- supports multiple independent menus
- supports menu separators to make output more readable
- allows to exclude by whole menu or menu entries by label type
TODO:
- define per label menus
- per menu callback
- sensitive only to keys defined in the currently printed menu
Karel Zak [Thu, 12 Sep 2013 10:44:09 +0000 (12:44 +0200)]
agetty: add \S to output /etc/os-release data
This patch allows to use a new \S or \S{VARNAME} sequence in the
/etc/issue file. The sequence prints data from /etc/os-release. The
reason is to keep /etc/issue file distribution and release
independent.
The \S{ANSI_COLOR} is converted to the real terminal escape seq.
For example:
\S
Kernel \r on an \m (\l)
or more complex example:
Welcome to \S{ANSI_COLOR}\S{NAME}\e0m \S{VERSION}
Report bugs at \S{BUG_REPORT_URL}.
See http://www.freedesktop.org/software/systemd/man/os-release.html
fr more details about /etc/issue.
Based on patch from Bill Nottingham <notting@redhat.com>.
Karel Zak [Wed, 11 Sep 2013 13:37:05 +0000 (15:37 +0200)]
libblkid: don't use UUID= for xfs external log
The log UUID is usually the same as filesystem UUID, it is bad idea to
have two devices with the same UUID in the system. It seems batter to
use only LOGUUID= for xfs external log.
Karel Zak [Wed, 11 Sep 2013 09:15:33 +0000 (11:15 +0200)]
libblkid: populate jbd LOGUUID in addition to UUID
The LOGUUID is alias for UUID, this alias is necessary to standardize
the tag name (we want to use the same tag LOGUUID= for all external
logs on all filesystems).
Note that for another filesystems (e.g. xfs) we have to differentiate
between the journal and filesystem uuids to avoid collisions, because
both devices use the same uuid.
Eric Sandeen [Mon, 5 Aug 2013 23:09:35 +0000 (18:09 -0500)]
libblkid: Detect external XFS log device
Detects external XFS log devices with a minimum size of 10MB. It's possible to
craft a smaller log, but that would be very unlikely; it'd require a small XFS
filesystem and an intentionally small log, which would defeat the performance
goal of an external log in the first place.
[kzak@redhat.com: - use UUID_LOG variable name for the log uuid]
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
This happen because oversight when 'exitval' gets to be set. By clance,
one might expect main() to call next() which will return value for
'exitval'. That assessment misses later call chain main() -> display()
-> get() -> next(), which in reverse should return correct value for
'exitval'.
It was mentioned in util-linux maillist that Ondrej Oprala is working on
major renewal of the hexdump . That in mind it seems best to simply to
revert the global 'exitval' and avoid conflict with Ondrej's work.
Reference: http://markmail.org/message/sbnvuhkboreujj5p Reported-by: Dave Reisner <d@falconindy.com> CC: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Thu, 29 Aug 2013 09:34:00 +0000 (10:34 +0100)]
utmpdump: make IPv6 addresses work
(unless bug[s]) This change is backwards compatibile. Earlier binary to
text dumps can be converted back to binary, or otherway around.
The only thing that will not work are IPv6 addresses that possible
earlier conversion had broke. Such conversions resulted with random IPv4
in place of IPv6 address in text format, and original information is gone
forever.
Sami Kerola [Thu, 29 Aug 2013 06:46:46 +0000 (07:46 +0100)]
last, utmpdump, agetty, wall, write: avoid compatibility hacks
In include/bits/utmp.h the ut_user and ut_time macros are marked with
comment they are backwards compatibility hacks. It is probably best to
avoid use of these macros where ever possible.
Sami Kerola [Wed, 28 Aug 2013 17:53:22 +0000 (18:53 +0100)]
last: tell verbally system is still running
Use of uptime time stamp as previous boot login time makes the output not
constant, which is rather difficult to test. Verbal message 'system is
still running' makes testing easy, and noticing which boot is still
running clear to a person.
Sami Kerola [Tue, 27 Aug 2013 12:48:27 +0000 (13:48 +0100)]
last: add --time-format with iso-8601 format
The ISO-8601 format makes consuming time stamps easy with various
parsers. The format includes time zone information which is crucial when
an investigator is trying to make sense outputs collected from systems
all a across planet.
Sami Kerola [Sun, 18 Aug 2013 09:44:13 +0000 (10:44 +0100)]
write: change determination can user write to a terminal
Earlier test failed when user had write permission, but was not in
special group that owns terminal devices, usually tty.
This made write(1) to fail for root, if the root did not happen to be in
tty group. In this commit root is granted ot write to anyone, even if
they have mesg(1) turned off. For an user who is trying to write to own
other session the group write bit is significant only for whether mesg(1)
are enabled.
Sami Kerola [Sun, 18 Aug 2013 08:51:46 +0000 (09:51 +0100)]
docs: add note to wall(1) about sessions which will not get message
Sessions that has in utmp data ut_line begining with ':' are skipped.
This is done to avoid write errors to devices such as '/dev/:0'. For
example wdm is reported to to generate such utmp line.
Perhaps in future this code should be revalidated. If an utmp data
contains broken device lines it might be best inform user with a error
message, rather than skipping silently suspicious device entries.