1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lenovo Thinkpad T520 doesn't boot with GPT slices on FreeBSD 9- BETA3

Discussion in 'Mobile Computing' started by Lothlorien, Oct 2, 2011.

  1. Lothlorien

    Lothlorien New Member

    Messages:
    6
    Likes Received:
    0
    Hi!

    I've bought a brand new :e Lenovo Thinkpad T520 laptop and decided to install FreeBSD 9 Beta 3 following this guide (it's close to GPTZFSBoot wiki page, but considers an new installation layout on FreeBSD 9).

    But when I rebooted the system, it simply doesn't boot (turns out to the BIOS boot menu). It's even doesn't boot with default FreeBSD 9 UFS-on-GPT installation scheme through bsdInstaller, but FreeBSD 9 UFS-on-MBR installation works.

    I've tried to change BIOS Startup->UEFI/Legacy Boot from "Both" to "Legacy only" (AFAIK, FreeBSD doesn't support UEFI boot process), but there was no effect. I have latest BIOS (1.31) installed.

    On the other thread there was a similar problem with Lenovo T420s laptop.

    Is there any chance to get FreeBSD 9 working with gpt partition scheme on this laptop?
     
  2. Crest

    Crest Member

    Messages:
    117
    Likes Received:
    0
    I ran into the same problem with my T420. It sucks. The /boot/loader can't read from GPT formatted disks with a MBR partition type != 0xEE. I tried to use an invalid partition type to fool the UEFI. The FreeBSD kernel accepts this kludge. It is possible to boot from a UFS /boot on MBR+bsdlabel.
     
  3. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,157
    Likes Received:
    5
    Have you contacted Lenovo about this? If enough people complain, maybe they'll issue a BIOS update.
     
  4. Crest

    Crest Member

    Messages:
    117
    Likes Received:
    0
    I have not. I found several threads in Linux distro specific forums and mailing lists on this issue suggesting Lenovo broke booting legacy operating systems from GPT formatted disks for everyone not just FreeBSD's /boot/gptzfsboot. One ugly workaround would be to patch /boot/loader into accepting PMBR's of invalid type (geom_part does). This prevents triggering the special case for GPT with valid PMBR in the UEFI. I'll look into it once I got acpi_ibm to work.

    The acpi_ibm.ko module checks for IBM0068. Adding "LEN0068" to ibm_ids in sys/dev/acpi_support/acpi_ibm.c:293 allows the acpi_ibm module to attach but some features don't work (most important fan and brightness control). The read only fan speed valid but to high (i don't need my CPU to be cooled down to 40C). The brightness control with acpi_video (via sysctl) or function keys works on console, but results in one "CPU0: local APIC error 0x80" message per change. Brightness is not changeable while X.org (with nvidia blob version 280.13) controls the screen. I'm open to suggestions ;-).
     
  5. Crest

    Crest Member

    Messages:
    117
    Likes Received:
    0
    Adding this line to the device section in the xorg.conf enables brightness control in X.org with the nvidia blob on the T420.
    Code:
    Option "RegistryDwords" "EnableBrightnessControl=1"
    
    Still each change triggers this message
    Code:
    CPU0: local APIC error 0x80
    
     
  6. Lothlorien

    Lothlorien New Member

    Messages:
    6
    Likes Received:
    0
    Unfortunately they haven't an e-mail address for technical support, and the phone support knows nothing but Windows. :(

    I've wrote the same topic on Lenovo forums, but have no response from Lenovo officials.
     
  7. Lothlorien

    Lothlorien New Member

    Messages:
    6
    Likes Received:
    0
    Thanks. Well, I've also thought about adding "LEN0068" to ibm_ids too :)

    I can confirm this on T520 too with 9.0-CURRENT. 8.2 doesn't show up such message.
     
  8. Juh924

    Juh924 New Member

    Messages:
    25
    Likes Received:
    0
    Hello,

    Any news about this issue? I'm planning on buying a T420/420s but I'd like to know if the problem is solved or will be solved in the near future.

    Thanks a lot,

    PS: Just a quick question: Is there any other "big" problem with the T520 and FreeBSD?
     
  9. T-Aoki

    T-Aoki New Member

    Messages:
    22
    Likes Received:
    0
    Thanks to post [post=149737]#8[/post] in this thread by Crest, I could boot my ThinkPad T420 from GPT partition (9-STABLE). Details are in my web page with diffs. My modification in above page is "Quick and Dirty, minimum change to actual code", but "works for me".

    Note that needed modifications are different before and after r243243, as described above page.

    I guess the problem is in Lenovo UEFI BIOS, so modifying loader is quite ugly quirks. So I wonder these kind of quirks should be incorporated to base or not. At least, if genuine loader incorporated,
    • Define an entry in /usr/src/sys/sys/diskmbr.h and use it.
    • /sbin/gpart should have support for managing GPT having non 0xEE ID.
    are needed.

    Probably, porting how GEOM does for detecting partition is best way, but I can't :x.
     
  10. T-Aoki

    T-Aoki New Member

    Messages:
    22
    Likes Received:
    0
    Recently, /usr/src/sys/boot/common/part.c was updated by r246938 (for Boot Camp support) in stable/9 branch.
    FYI, I could confirm it does not affect my modification noted by my previous post.

    But please beware, I've not tested multi boot environment. So modifying dummy partition ID of GPT slice can cause boot problem for other OS'es in multi boot environment!
     
  11. T-Aoki

    T-Aoki New Member

    Messages:
    22
    Likes Received:
    0
    For someone misunderstanding @Crest's post like me...

    Putting above-mentioned option in
    Code:
    Section "Device"
    didn't work.

    Putting the line in
    Code:
    Section "Screen"
    according to hiren panchasara's post in freebsd-acpi ML worked fine for my ThinkPad T420.:)

    But...

    above mentioned ACPI error keeps on emitting.:(
     
    Last edited by a moderator: Oct 16, 2014 at 9:52 PM
  12. darcsis

    darcsis New Member

    Messages:
    53
    Likes Received:
    0
    I've got a T430 and I've installed 9-PRERELEASE several times successfully using ZFS as root. Certainly it is ok to use GPT partition scheme.