NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/53553: gpt biosboot forcibly prepends /usr/mdec to any other paht
>Number: 53553
>Category: bin
>Synopsis: gpt biosboot forcibly prepends /usr/mdec to any other paht
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Aug 25 22:20:00 +0000 2018
>Originator: eric%cirr.com@localhost
>Release: NetBSD 8.0_STABLE
>Organization:
Eric Schnoebelen eric%cirr.com@localhost http://www.cirr.com
IBM is really really good at documentation. They may implement
something so amazingly stupid it makes you slap your forehead,
but darn if they don't document what they did. -- Kevin P. Neal
>Environment:
System: NetBSD snoopy 8.0_STABLE NetBSD 8.0_STABLE (GENERIC) #3: Thu Aug 16 22:38:01 CDT 2018 eric@bob-the-builder:/work/eric/NetBSD-8/obj/amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
Attempting to use a gpt(8) biosboot subcommand with a file
in any location other than /usr/mdec gets /usr/mdec forcibly
prepended to the path.
>How-To-Repeat:
I was attempting to install the -HEAD version of gptmbr.bin
on a disk, on a system running NetBSD 8. The file was in
a subdirectory of my home directory.
Below is a copy of the sessions:
snoopy-> sudo gpt -v biosboot -A -c usr/mdec/gptmbr.bin -i 1 sd0
/dev/rsd0d: mediasize=3000592982016; sectorsize=512; blocks=5860533168
gpt: /dev/rsd0d: Can't open `/usr/mdec/usr/mdec/gptmbr.bin' (No such
file or directory)
gpt: /dev/rsd0d: Error reading bootcode
snoopy-> sudo gpt -v biosboot -A -c ./usr/mdec/gptmbr.bin -i 1 sd0
/dev/rsd0d: mediasize=3000592982016; sectorsize=512; blocks=5860533168
gpt: /dev/rsd0d: Can't open `/usr/mdec/./usr/mdec/gptmbr.bin' (No such
file or directory)
gpt: /dev/rsd0d: Error reading bootcode
snoopy-> sudo install usr/mdec/gptmbr.bin /usr/mdec/gptmbr-8.99.22.bin
snoopy-> sudo gpt -v biosboot -A -c !$ -i 1 sd0
sudo gpt -v biosboot -A -c /usr/mdec/gptmbr-8.99.22.bin -i 1 sd0
/dev/rsd0d: mediasize=3000592982016; sectorsize=512; blocks=5860533168
/dev/rsd0d: Partition 1 marked as bootable
snoopy->
For giggles and grins, I decided to change to the directory
where the gptmbr.bin file is located, and it works.
snoopy-> pushd usr/mdec/
~/usr/mdec ~
snoopy-> sudo gpt -v biosboot -A -c gptmbr.bin -i 1 sd0
/dev/rsd0d: mediasize=3000592982016; sectorsize=512; blocks=5860533168
/dev/rsd0d: Partition 1 marked as bootable
snoopy-> sudo gpt -v biosboot -A -c ./gptmbr.bin -i 1 sd0
/dev/rsd0d: mediasize=3000592982016; sectorsize=512; blocks=5860533168
/dev/rsd0d: Partition 1 marked as bootable
snoopy->
It seems that gpt is forcibly prepending '/usr/mdec' on
any path that has a directory seperator in it? Or any file
that is not in the current working directory? (I haven't
examined the code, but I did quickly check to see if the
code was unchanged between netbsd-8 and HEAD.
>Fix:
Work-around: move to the same directory as the biosboot image file.
Fix: Unknown, I haven't examined the code beyond a 'cvs diff'
between netbsd-8 and -HEAD
Home |
Main Index |
Thread Index |
Old Index