Saturday, July 14, 2018

[Tutorial]Linux x64 on Baytrail 32bit EFI(Lenovo Ideapad100s-11iby)

In this tutorial after some pretty "tough" trial&error series i'll show you step-by-step how i managed to get my Lenovo Ideapad 100S -11IBY laptop to successfully boot and install Linux Mint 19 XFCE.

The story behind it:
First thing first , low spec laptop + Windows 10 (Bloatware party) = Slowness.
Also this laptop comes up with pre-installed 32bit Windows10 version and with a 32bit UEFI bios making it a real pain to install an x64 bit os and take advantage of the x64 support of the cpu.

Laptop Specs:


      CPU: 1.33 GHz quad-core Intel Atom Z3735F (64bit support - hence the x64bit OS)  
      Graphics: Intel HD Graphics (Bay Trail)  
       RAM: 2GB  
       Storage: 32GB eMMC  
       Screen: 11.6-inch, 1,366 x 768 matte TN LED display  
      Connectivity: 802.11n Wi-Fi, Bluetooth 4.0 (Low Energy)  
      Weight: 2.2 pounds  Size: 11.5 x 7.95 x 0.69 inches (W X H X D)
  • What we will need:
    1) USB Stick
    2) Rufus
    3) x64 Linux Distro
    4) bootia32.efi

    Lets start:
    1) Burn the image to your usb stick using Rufus , copy-paste the bootia32.efi file inside your usb in the "/EFI/BOOT" directory.
    2) Disable Secure-Boot from your bios.
    3) Boot from your usb , (in Lenovo IDEAPAD 100S you have to press FN+F12)
    4) Select the first option to boot live distro 
    5) From the live linux desktop select the icon to install the OS to your harddrive.
    6) At the last step it will fail showing the following message
                                 
    7) Press okay , the installation will exit , find and open your terminal from the desktop environment.   Type: blkid and right down your partition name of ext4.
    8) After that restart your system.

    9) Boot again from live usb , on the first option instead of pressing enter press the "C" of your keyboard to launch the grub command.
    10) From there we need to jumpstart and point to our installation partition.


    set root=(hd?,?)              HINT: The TAB KEY IS YOUR FRIEND FOR AUTOCOMPLETION 

     Now we need to find the vmlinuz.efi file. Try with the tab to see where your file is ill give you the common locations below to search for it. (Could also be vmlinuz.efi instead of vmlinuz)

    linux /casper/vmlinuz root=/dev/YOURPARTITIONNAME 
    or
    linux /boot/vmlinuz root=/dev/YOURPARTITIONNAME 
    or
    linux /vmlinuz root=/dev/YOURPARTITIONNAME 

    Now lets locate initrd:
    initrd /casper/initrd.lz 
    or
    initrd /boot/initrd.lz

    And after that type "boot"
    boot

    So on your screen you should have these 4 instructions
    set root=(hd1,2)  
    linux /casper/vmlinuz root=/dev/mmcblk1p2
    initrd /casper/initrd.lz
    boot
    

    Your linux distro will boot-up and now we need to configure our 32bit grub loader and we are done.

    11)Open up your terminal and type the following:
    sudo apt-get update
    sudo apt-get install grub-efi-ia32
    sudo update-grub2
12)Thats all folks.The OS is now ready , time to sort-out some issues/bugs.

Sudden Freezing bug:This is a power management bug on baytrail cpus , there has been a patch which i havent really tried out yet (Google c6off+c7on.sh)

Instead of the patch ive used the following:


We will need to pass the parameter "intel_idle_max=1" to grub , for that go to /etc/default and edit the file called grub. Find the parameter GRUB_CMDLINE_LINUX_DEFAULT and paste inside the quotes with 1 space at the end of the current value the next parameter which is "intel_idle_max=1" e.g: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle_max=1" Save your file and then on terminal update the grub "sudo update-grub"

Disable HDMI sound (Known to cause issues):

Go to /etc/modprobe.d/ create a conf called "blacklist_snd_hdmi_lpe_audio.conf"
and inside it paste the following line without quotes "blacklist snd_hdmi_lpe_audio"

Drivers for Audio Built-In Speakers & Mic:

Find your sound card version by opening terminal and typing aplay-l
Go to https://github.com/plbossart/UCM and download the appropriate drivers , copy the whole folder to usr/share/alsa/ucm

Note: If your driver folder contains a file called asound.state copy it to /var/lib/alsa

Keyboard/Trackpad Session Freeze Bug:


This bug occured per session , and with some restarts or shutdowns everything worked until you shutdown your laptop again. The steps below completely fixed the issue for me and now the keyboard always work. Open terminal -> type sudo apt-get install libinput*

Power Management / Charging Issue / (Overheating):
sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw

If you have a thinkpad you will also need the following line:
sudo apt-get install tp-smapi-dkms acpi-call-dkms

2 Network Icons showing up on taskbar:
From the main menu select Preferences > Default applications for LXSession. In the window that then appears, click on the Autostart tab, then find the network uncheck it , log off , log in , and then recheck it.

Some small tweaks for swap:

Tweaks for 2gb<= ram laptops
a. First check your current swappiness value.
Type in the terminal: cat /proc/sys/vm/swappiness P
ress Enter. The result will probably be 60.
b. To change the swappiness into a more sensible setting,
type in the terminal xed admin:///etc/sysctl.conf
Press Enter. Note that you'll be asked twice for your password.
Now a text file opens.
Scroll to the bottom of that text file and add your swappiness parameter to override the default
# Decrease swap usage to a more reasonable level vm.swappiness=10
c. Save and close the text file. Then reboot your computer.
d. After the reboot, check the new swappiness setting: Launch a terminal window.
Type: cat /proc/sys/vm/swappiness Press Enter. Now it should be 10.

                                                    HAPPY LINUX-ING


7 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. when typing initrd /casper/initrd.lz , i get error: file '/casper/initrd.lz' not found , and when i try initrd /boot/initrd.lz i get error: file '/boot/initrd.lz' not found

    ReplyDelete
  3. I followed all of the steps in your guide, including the last step of updating grub, but when I attempt to reboot the laptop, without the USB stick, it can't find the bootloader (GRUB). This continues in an endless loop. Thanks

    ReplyDelete
  4. I could not fix Keyboard/Trackpad Session Freeze Bug. When i use "sudo apt-get install libinput", i get error E: unable to locate package libinput.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. The command is sudo apt-get install libinput*
      But it didn't fix the bug to me either. I installed Mint 19.2 Mate (I find it better than Xfce) with kernel 4.19.13 (tried several and this one works better for me so far. The rest of the things work like a charm

      Delete
  5. I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. furniture removals

    ReplyDelete