[Bug 221550] kern.bootfile returns only /kernel on mips64 (ERL) platform

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Aug 15 23:07:16 UTC 2017


            Bug ID: 221550
           Summary: kern.bootfile returns only /kernel on mips64 (ERL)
           Product: Base System
           Version: CURRENT
          Hardware: mips
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: lidl at FreeBSD.org

The kern.bootfile sysctl returns just /kernel on an ERL, using the stock
configuration where the boot filesystem (a FAT32 filesystem) is mounted
into /boot.

root at erl2-148: df
Filesystem  1K-blocks    Used    Avail Capacity  Mounted on
/dev/da0s2a  28810359 9965044 16540487    38%    /
devfs               1       1        0   100%    /dev
/dev/da0s1     262008  181248    80760    69%    /boot
fdescfs             1       1        0   100%    /dev/fd
tmpfs         2062880       4  2062876     0%    /tmp

>From the perspective of the uboot system, this is correct, as my uboot
boot command is similar to the ones referenced at rtfm.net:

setenv boot_freebsd 'fatload usb 0 $loadaddr kernel/kernel ; bootoctlinux
$loadaddr coremask=0x3'

However, since the uboot boot partition is mounted as /boot, the sysctl answer
is wrong.

Why do I care?

Because the logic that backs up the old kernel to kernel.old when running
'make installkernel' doesn't work right - my existing kernel is always
destroyed and the new kernel installed as /boot/kernel.


thiskernel=`sysctl -n kern.bootfile` ;  if [ ! "`dirname "$thiskernel"`" -ef
/boot/kernel ] ; then  chflags -R noschg /boot/kernel ;  rm -rf /boot/kernel ; 
rm -rf /usr/lib/debug/boot/kernel ;  else  if [ -d /boot/kernel.old ] ; then 
chflags -R noschg /boot/kernel.old ;  rm -rf /boot/kernel.old ;  fi ;  mv
/boot/kernel /boot/kernel.old ;  if [ -n "/usr/lib/debug" -a  -d
/usr/lib/debug/boot/kernel ]; then  rm -rf /usr/lib/debug/boot/kernel.old ;  mv
/usr/lib/debug/boot/kernel /usr/lib/debug/boot/kernel.old ;  fi ;  sysctl
kern.bootfile=/boot/kernel.old/"`basename "$thiskernel"`" ;  fi
mkdir -p /boot/kernel
install -p -m 555 -o root -g wheel kernel /boot/kernel/

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list