Bug 18498 - [boot] [patch] allowing ELF_VERBOSE in /etc/make.conf
Summary: [boot] [patch] allowing ELF_VERBOSE in /etc/make.conf
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 5.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-05-11 14:10 UTC by mellon
Modified: 2019-04-21 04:26 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (402 bytes, patch)
2000-05-11 14:10 UTC, mellon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mellon 2000-05-11 14:10:00 UTC
For debugging the loader, the following trivial change to
src/sys/boot/common/Makefile.inc will allow placing ELF_VERBOSE=true
in /etc/make.conf instead of having to change the makefile; this
makes life a little bit brighter and is exactly the arrangement
already existing with BTXLDR_VERBOSE in sys/boot/i386/btx/btxldr/Makefile,
for instance.
Comment 1 Jeroen Ruigrok/Asmodai 2000-05-13 12:48:11 UTC
>Index: Makefile.inc
>===================================================================
>RCS file: /freebsd/cvs/src/sys/boot/common/Makefile.inc,v
>retrieving revision 1.9
>diff -u -r1.9 Makefile.inc
>--- Makefile.inc	1999/08/28 00:39:44	1.9
>+++ Makefile.inc	2000/05/11 15:53:43
>@@ -16,3 +16,9 @@
> .if BOOT_FORTH
> SRCS+=	interp_forth.c
> .endif
>+
>+.if defined(ELF_VERBOSE)
>+CFLAGS+=-DELF_VERBOSE
>+.endif
>+
>+

Why those two trailing newlines?

Anyways, John, what do you think of this change?

I think it would make debugging easier for those who want it, however
the ELF_VERBOSE name is a tad bit generic to make it a make.conf
variable.  I prefer it to be ELF_BOOT_VERBOSE or something like that.
Or ELF_BOOT_DEBUG.

Just my interpretation to get this integrated.

-- 
Jeroen Ruigrok vd Werven/Asmodai    asmodai@[wxs.nl|bart.nl|freebsd.org]
Documentation nutter/C-rated Coder BSD: Technical excellence at its best  
The BSD Programmer's Documentation Project <http://home.wxs.nl/~asmodai>
Sleep tonight, sweet summer light, scattered yesterdays, the past is far
 away...
Comment 2 John Baldwin freebsd_committer freebsd_triage 2000-05-13 13:00:03 UTC
On 13-May-00 Jeroen Ruigrok/Asmodai wrote:
> Why those two trailing newlines?

They don't have to be in the final commit. :)

> Anyways, John, what do you think of this change?
> 
> I think it would make debugging easier for those who want it, however
> the ELF_VERBOSE name is a tad bit generic to make it a make.conf
> variable.  I prefer it to be ELF_BOOT_VERBOSE or something like that.
> Or ELF_BOOT_DEBUG.

Probably BOOT_ELF_{DEBUG,VERBOSE} and with some tweaks we could
make it so that all boot variables start with BOOT_, that way
we can avoid nameclashes, and indicate that it is a variable
that applies only to BOOT related stuff.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
Comment 3 Jeroen Ruigrok/Asmodai 2000-05-13 13:14:24 UTC
-On [20000513 14:11], John Baldwin (jhb@FreeBSD.org) wrote:

[snip]

>> Why those two trailing newlines?
>
>They don't have to be in the final commit. :)

Of course, just trying to make sure what the originator's intent was. ;)

>Probably BOOT_ELF_{DEBUG,VERBOSE} and with some tweaks we could
>make it so that all boot variables start with BOOT_, that way
>we can avoid nameclashes, and indicate that it is a variable
>that applies only to BOOT related stuff.

I agree, that makes more sense than my suggestions.

However, you can thus agree in principle with the patch [basically the
moving of the make variable to make.conf]?

Will you assign the pr to yourself and deal with it as you see fit? ;)

-- 
Jeroen Ruigrok vd Werven/Asmodai    asmodai@[wxs.nl|bart.nl|freebsd.org]
Documentation nutter/C-rated Coder BSD: Technical excellence at its best  
The BSD Programmer's Documentation Project <http://home.wxs.nl/~asmodai>
I know you have tried, to feel...
Comment 4 mellon 2000-05-13 14:49:50 UTC
You, Jeroen Ruigrok/Asmodai, were spotted writing this on Sat, May 13, 2000 at 02:14:24PM +0200:
> Of course, just trying to make sure what the originator's intent was. ;)

They were a part of the evil plan to bloat FreeBSD CVS repository
out of all rational bounds by overwhelming it with carefully placed
newlines. But now that this attempt has been foiled, I shall have
to find some new ways of doing that ;)

> >Probably BOOT_ELF_{DEBUG,VERBOSE} and with some tweaks we could
> >make it so that all boot variables start with BOOT_, that way
> >we can avoid nameclashes, and indicate that it is a variable
> >that applies only to BOOT related stuff.

Great idea. Then if you do this with ELF_VERBOSE, please take care
to treat BTXLDR_VERBOSE similarly, it's in sys/boot/i386/btx/btxldr/Makefile .

-- 
Anatoly Vorobey,
mellon@pobox.com http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton
Comment 5 John Baldwin freebsd_committer freebsd_triage 2000-05-13 15:00:01 UTC
Responsible Changed
From-To: freebsd-bugs->jhb

I'll take this one. 

Comment 6 John Baldwin freebsd_committer freebsd_triage 2000-05-13 15:01:57 UTC
On 13-May-00 Jeroen Ruigrok/Asmodai wrote:
> I agree, that makes more sense than my suggestions.
> 
> However, you can thus agree in principle with the patch [basically the
> moving of the make variable to make.conf]?

Yeah.

> Will you assign the pr to yourself and deal with it as you see fit? ;)

I've taken it.  Note that due to graduation and moving back home and stuff
I may not get to this for a week or two, but I will get to it
eventually. :)

> -- 
> Jeroen Ruigrok vd Werven/Asmodai    asmodai@[wxs.nl|bart.nl|freebsd.org]
> Documentation nutter/C-rated Coder BSD: Technical excellence at its best  
> The BSD Programmer's Documentation Project <http://home.wxs.nl/~asmodai>
> I know you have tried, to feel...

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
Comment 7 John Baldwin freebsd_committer freebsd_triage 2000-05-13 20:27:36 UTC
On 13-May-00 Anatoly Vorobey wrote:
> Great idea. Then if you do this with ELF_VERBOSE, please take care
> to treat BTXLDR_VERBOSE similarly, it's in sys/boot/i386/btx/btxldr/Makefile .

That is my intention, along with all the other BTX variables, etc.

> Anatoly Vorobey,

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
Comment 8 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:42 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 9 commit-hook freebsd_committer 2019-01-07 05:49:32 UTC
A commit references this bug:

Author: imp
Date: Mon Jan  7 05:49:28 UTC 2019
New revision: 342840
URL: https://svnweb.freebsd.org/changeset/base/342840

Log:
  Create MK_LOADER_VERBOSE and connect it to ELF_VERBOSE in the loader
  code.

  PR: 18498
  Submitted by: mellon at pobox dot com

Changes:
  head/share/mk/src.opts.mk
  head/stand/loader.mk
  head/tools/build/options/WITH_LOADER_VERBOSE
Comment 10 Warner Losh freebsd_committer 2019-01-07 05:50:22 UTC
Modernized the diff and committed as r342840
Comment 11 commit-hook freebsd_committer 2019-04-21 04:26:52 UTC
A commit references this bug:

Author: kevans
Date: Sun Apr 21 04:26:04 UTC 2019
New revision: 346482
URL: https://svnweb.freebsd.org/changeset/base/346482

Log:
  MFC r341101, r341231, r341276, r341329, r341433, r341780, r342054-r342055,
  r342721, r342742, r342840, r343008, r343225

  r341101:
  powerpcspe: Don't crash the loader on ubldr with SPE instructions.

  -msoft-float seems to be insufficient for disabling the SPE on powerpcspe.
  Force it off with -mno-spe as well.  This prevents a crash in ubldr on
  powerpcspe.

  r341231:
  loader: command_bcache() should print unsigned values

  All bcache counters are unsigned.

  r341276:
  When handling CMD_CRIT error set command_errmsg to NULL after we dump it out,
  so that it does not result in error message printed twice.

  OK load doodoo
  can't find 'doodoo'
  can't find 'doodoo'
  OK

  r341329:
  loader.efi: fix EFI getchar() for multiple consoles

  This fix is ported from illumos (issue #9970), the analysis and initial
  implementation was done by John Levon.

  See also: https://www.illumos.org/issues/9970

  Currently, efi_cons_getchar() will wait for a key. While this seems to make
  sense, the implementation of getchar() in common/console.c will loop across
  getchar() for all consoles without doing ischar() first.

  This means that if we've configured multiple consoles, we can't input into
  the serial, as getchar() will be sat waiting for input only from efi_console.c

  This patch does implement a bit more generic key buffer to support
  translation of input keys, and we use generic efi_readkey() to reduce
  duplication from calls from getchar() and poll().

  r341433:
  Move inclusion of src.opts.mk later.

  src.opts.mk includes bsd.own.mk. This in turn defines CTFCONVERT_CMD
  depending on the MK_CTF value. We then set MK_CTF to no, which has no
  real effect. The solution is to set all the MK_foo values before
  including src.opts.mk.

  This should stop the cdboot binary from exploding in size for releases
  built WITH_CTF=yes in src.conf.

  r341780:
  powerpc/ubldr: Teach powerpc's ubldr to boot 64-bit kernels

  This is just a copy of powerpc/ofw's ppc64_elf_freebsd.c modified to fit
  ubldr's boot format.

  r342054:
  Print an error message in efi_main.c if we can't allocate memory for the heap

  With the default Qemu parameters, only 128MB RAM gets given to a VM. This causes
  the loader to be unable to allocate the 64MB it needs for the heap. This change
  makes the cause of the error more obvious.

  r342055:
  Cast error message in efi_main.c to CHAR16* to avoid build error

  r342721:
  loader.efi: update memmap command to recognize new attributes

  Also move memory type to string translation to libefi for later use.

  r342742:
  loader.efi: efi variable rework and lsefi command added

  This update does add diag and debug capabilities to interpret the efi
  variables, configuration and protocols (lsefi).

  The side effect is that we add/update bunch of related headers.

  r342840:
  Create MK_LOADER_VERBOSE and connect it to ELF_VERBOSE in the loader
  code.

  r343008:
  Add Dell Chromebook to the list of devices with E820 extmem quirk enabled

  Just like for Acer C270 chromebook the E820 extmem workaround is required for
  FreeBSD to boot on Dell chromebook.

  r343225:
  Unbreak mip64 build after r328437

  Add exit and getchar functions to beri/boot2 code. They are required by
  panic_action functin introduced in r328437

  PR:		18498, 204916

Changes:
_U  stable/11/
  stable/11/share/mk/src.opts.mk
  stable/11/stand/common/bcache.c
  stable/11/stand/common/interp_forth.c
  stable/11/stand/defs.mk
  stable/11/stand/efi/include/Guid/
  stable/11/stand/efi/include/Protocol/
  stable/11/stand/efi/include/efi.h
  stable/11/stand/efi/include/efiapi.h
  stable/11/stand/efi/include/eficon.h
  stable/11/stand/efi/include/efidef.h
  stable/11/stand/efi/include/efigpt.h
  stable/11/stand/efi/include/efiip.h
  stable/11/stand/efi/include/efilib.h
  stable/11/stand/efi/include/efipciio.h
  stable/11/stand/efi/include/efipoint.h
  stable/11/stand/efi/include/efitcp.h
  stable/11/stand/efi/include/efiudp.h
  stable/11/stand/efi/libefi/efi_console.c
  stable/11/stand/efi/libefi/env.c
  stable/11/stand/efi/loader/efi_main.c
  stable/11/stand/efi/loader/main.c
  stable/11/stand/i386/libi386/biosmem.c
  stable/11/stand/loader.mk
  stable/11/stand/mips/beri/boot2/boot2.c
  stable/11/stand/powerpc/uboot/Makefile
  stable/11/stand/powerpc/uboot/conf.c
  stable/11/stand/powerpc/uboot/ppc64_elf_freebsd.c
  stable/11/tools/build/options/WITH_LOADER_VERBOSE