Skip to content

Instantly share code, notes, and snippets.

@franga2000
Last active January 31, 2024 21:40
  • Star 82 You must be signed in to star a gist
  • Fork 15 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save franga2000/2154d09f864894b8fe84 to your computer and use it in GitHub Desktop.
Ubuntu on Acer Aspire Switch 10

Ubuntu on Acer Aspire Switch

The problem

What's the problem with this tablet? Why can't I just insert the USB and mash F12 until it boots? The tablet is made to run Windows 8.1 and Windows 8.1 only. Some absolute genius at Acer decided to put a 32-bit UEFI on a 64-bit system, which no reasonable Linux distro supports out-of-the-box.

NOTE: This guide focuses on installing Ubuntu alongside Windows. If you're trying to replace Windows, then I assume you know enough about Linux to know which parts to change.

What works:

  • Keyboard
  • Trackpad
  • Touchscreen
  • Sound (usually)
  • Backlight control (with a patch)

What doesn't work:

  • HDMI output
  • Micro SD reader (read only)

Requirements

Before you start, there's a few things you need:

  • USB flash drive (at least 4GB)
  • USB OTG adapter (not always necessary, but recommended)
  • 32-bit GRUB UEFI binary (explained below)
  • 64-bit Ubuntu ISO
  • BIOS v1.20 installed (required for backlight fix - you can only update BIOS from Windows, so do it now!)
  • Rufus (or an equivalent image writer)
  • USB WiFi or Ethernet card (in case your Wi-Fi doesn't work)

Preparing the USB stick

Installing the ISO (Rufus)

  1. Open Rufus
  2. Select the correct USB Stick
  3. Select "GTP for UEFI computers" as the partition table (if available)
  4. "Select the Ubuntu 64-bit iso
  5. Click "Create"

Building the 32-bit UEFI GRUB bootloader

If you trust me (and the owner of that repo), you can just download the file here, but remember, downloading binaries from random strangers on the internet is not a good idea.

Building it yourself

To build GRUB, run the following commands in a Linux shell:

# Install build dependencies and tools
sudo apt-get install git bison libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev flex libfont-freetype-perl automake autotools-dev libfreetype6-dev texinfo
# Clone the GRUB repo
git clone git://git.savannah.gnu.org/grub.git
cd grub
# Configure GRUB
./autogen.sh
export EFI_ARCH=i386
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""
make
cd grub-core
# Build the GRUB image
../grub-mkimage -d . -o bootia32.efi -O i386-efi -p /boot/grub ntfs hfs appleldr boot cat efi_gop efi_uga elf fat hfsplus iso9660 linux keylayouts memdisk minicmd part_apple ext2 extcmd xfs xnu part_bsd part_gpt search search_fs_file chain btrfs loadbios loadenv lvm minix minix2 reiserfs memrw mmap msdospart scsi loopback normal configfile gzio all_video efi_gop efi_uga gfxterm gettext echo boot chain eval

This will create a file called "bootia32.efi".

Copy "bootia32.efi" to "/EFI/Boot/" on your flash drive.

Booting from the USB

  1. Open the "BIOS" (F2 when you see the Acer logo)
  2. Under "Security" set a supervisor password
  3. Under "Boot" set "Secure boot" to disabled
  4. Set the USB stick to boot first
  5. Press F10 to save changes and reboot

If your USB doesn't show up, try to plug it in to the body directly using an OTG adapter, not via the keyboard dock).

Installing Ubuntu

  1. The laptop should automatically boot into GRUB
  2. In the GRUB menu choose "Try Ubuntu without installing"
  3. Open the terminal and run ubiquity --no-bootloader to start the installer (--no-bootloader isn't usually necessary, but if your installation fails with some bootloader-related error, try this)
  4. When prompted, select "Something else" to manually partition the drive
  5. Add a root (ext4, "/") and swap (swap, "swap") partition
  6. Finish the installation and hope for the best

Booting Ubuntu

In order to boot the Ubuntu we just installed, we need to use the USB GRUB again. Just let the laptop automatically boot from the USB. When in GRUB, press C to open a command line. Run the following commands:

set root=(hd1,gpt5)
linux /vmlinux root=/dev/mmcblk0p5
initrd /initrd.img
boot

If it doesn't work, try with /dev/mmcblk1p5 and/or booting without an SD card inserted.

Permanently installing GRUB

Obviously we can't use the USB GRUB to boot forever. Let's install GRUB: Open the terminal and run the following commands:

# Get the 32-bit UEFI GRUB package
sudo apt-get install grub-efi-ia32 grub-efi-ia32-bin 
# Mount your EFI partition 
mkdir /boot/efi # if the dir already exists, skip the mount command
sudo mount /dev/mmcblk0p1 /boot/efi
# Install GRUB
grub-install --target=i386-efi --efi-directory=/boot/efi/

If the 32-bit grub package doesn't exist, you can compile it yourself like this:

# Get build dependencies
sudo apt-get install autoconf
# Get the GRUB source
git clone git://git.savannah.gnu.org/grub.git
# Compile 32-bit UEFI GRUB
cd grub/
./autogen.sh
./configure --with-platform=efi --target=i386
# Install GRUB
sudo grub-install --target=i386-efi --efi-directory=/boot/efi/

Adding GRUB to the bootloader

Reboot the laptop and press F12 to go into the boot menu. If you see an option called "ubuntu" and it works, you can skip this part.

  1. Go into BIOS
  2. Under "Boot" set "Secure boot" to enabled
  3. Press F10 to save changes and reboot
  4. Go into BIOS again
  5. Under "Security", click "Add trusted executable"
  6. Navigate to *\HD0\EFI\ubuntu* and select grubia32.efi
  7. Enter the name for the bootloader entry and press OK
  8. Press F10 to save changes and reboot
  9. Go into BIOS for the last time
  10. Under "Boot" set "Secure boot" to disabled
  11. Press F10 to save changes and reboot

You should not see the entry in the boot menu (F12)

Making things actually work

Screen backlight

See this comment. Note that this will only work if you're on BIOS v1.20.

Wireless

A lot of this has since been upstreamed, so if it works for you, you can safely skip this section.

BRCM80211

I don't have it so if someone got it working, please comment below so I can add it

RTL8723BS

The drivers for this card have been merged into the kernel, so it should work automatically.

If it doesn't work for you:
# Clone the driver repo - if you don't have a wifi card, do this step onto a USB stick from another device
git clone https://github.com/hadess/rtl8723bs
# Build and install the driver
cd rtl8723bs
make
sudo make install
sudo modprobe r8723bs

If it doesn't work immediately, reboot.

Keyboard

Not required on modern kernels

To make the keyboard work you need to modify the kernel source and recompile it. Before compiling the kernel, open the file include/linux/hid.h and change the value of MAX_HID_USAGES (default is 12288) to 65536 (On aproximately line 346). Then compile and install the kernel.

To see how to do this, read my other guide.

Sources

@harmanjitkapoor
Copy link

Thanks for the helpful instructions! A couple of notes to those still looking here. Acer SW5-012 does not support WPA3 as far as I could see. There is some talk of sending the broadcom wifi chip some additional blob/firmware but no need to mess around if you have a WPA2 network, that just works.

I used Ventoy on USB to test various Linux liveCDs and install things. The USB boots fine if secure boot is disabled, so I am guessing Ventoy already uses 32-bit Grub. Lubuntu was installed fine and after doing the EFI authorization on the /boot/efi ia32 file in BIOS, it booted fine.

My goal is to install Q4OS-Trinity, since that is apparently much leaner and faster than a full-blown Ubuntu or Lubuntu.

So, booted that using the live-CD image on Ventoy USB. WiFi connected, everything looks good (including audio etc.), started the calameras install, chose the existing lubuntu ext4 partition to format and install on, installation proceeded fine till the end where it failed at grub installation.

Never mind. Rebooted into USB Q4OS-Trinity live-CD, restarted install, but this time installed grub-efi-ia32 packages before running Calameras installer. Again the installer barfed at installation of Grub. So I manually installed grub:

grub-install --target=i386-efi --efi-directory=/tmp/calamaresxxx/boot/efi --boot-directory=/tmp/calamaresxxx/boot

Grub install succeeded. Now the /tmp/calamaresxxx/boot/efi contains three directories: EFI, q4os, ubuntu.

Booted again but just got grub command line :-( But that's fine, we can handle it. Gave it the root= linux and initrd parameters and it booted into Q4Os just fine. Then it was just a matter of doing update-grub and on next boot I got the proper Grub menu for Q4OS and automatic boot into Q4OS. Cheers.

@masakk1
Copy link

masakk1 commented Nov 11, 2023

I started tinkering with this computer again. Apparently Fedora 38 and 39 don't like being booted with ventoy, but burning the .iso into a USB manages to boot without any issues. After installing Fedora 39, go to BIOS > enable secure boot > in security, click on add new bios trust thing whatever it was > search fedora, efi, and grubia32.efi > disable secure boot again.
I'm unsure whether secure boot has to be disabled or on but I still do it anyway.

With that done Fedora 39 runs pretty well. However I do find myself with the same problems as last time: brightness, volume, rotation. Sorry for taking like almost a year to answer @funder7 !

1. try to exec in terminal: `cd /sys/class/backlight/intel_backlight/`
2. if the directory doesn’t exists, then you have found the problem: something has not been initialized correctly (try to do `dmesg | grep -i 

Anyway, I suspect that you will stop at point #1, otherwise the backlight would be already working

Like you suspected, intel_backlight isn't a thing in that folder, only acpi_video0.
Here are the logs:

[   18.251118] audit: type=1130 audit(1699729465.242:43): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-backlight@backlight:acpi_video0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1597.389316] video LNXVIDEO:00: Restoring backlight state
[ 1652.339794] video LNXVIDEO:00: Restoring backlight state
.
.
.

That last line is repeated a bunch more times, it appeared after I click on "suspend" which works super weird when closing/opening the lid.
I will try to do a little research on getting these things working, this is what I have for now.

@funder7
Copy link

funder7 commented Dec 10, 2023

Hi @masakk1, unfortunately I can only give you some ideas on what to try, as I don't own that pc anymore 😞

Anyway, secure boot should be enabled if possible, it ensures that your boot image has not been altered with a rootkit. It's not 100% safe, recently a security flaw has been found, it affects the bios from many major manufacturers.
But if you're not familiar with Secure boot, you can leave it disabled until all other problems are fixed, and think about it when you're satisfied with the overall system configuration.

Regarding the backlight problem, it's hard for me to help you without having access to the pc... if I was you, I'd choose to replace it with another model in order to gain more experience on linux with a
"regular" setup first.

I've read here on this post, that apparently this model has some wrong mapping in the ACPI table, which works correctly only on windows. Maybe it's not the case for you, but it's better to check.

Can you run this command please? sudo apt install -y dmidecode && dmidecode > acer-switch10-info.txt
It will generate a txt file containing info about your bios.
If you want to share ACPI tables as well, theoretically you can copy them with this command: sudo cp -R /sys/firmware/acpi/tables <destination-directory>.
Then you can send me the zip containing all the files here.. I need to check if you can use the patch linked by the other guy in the forum.

Is a matter of principle at this point 😆

@masakk1
Copy link

masakk1 commented Dec 12, 2023

Thanks for the reply @funder7!
Honestly I think you're right... I'm probably better off with literally any other computer. I wanted to use to for college but I'm using the PC they have provided for now, since it does the job fine when I'm there.
Realistically, I'm probably not going to use this laptop, but if I could get auto-rotation and backlight working, it'd server as a great alternative for internet browsing on the couch or maybe remote access to my PC. And only in this scenario because it's painfully slow, specially with GNOME.

Oh did I mention that the laptop has a really hard time getting charged? Only at certain positions... I'm not sure if it's the charger or the port on the laptop, but it's a huge pain.

Also I'm not sure what you meant by <destination-directory> on that command you sent, there are many folders under that directory. Do you want me to send them all?

One last thing, I saw that post a little while ago, but a lot of the things he said didn't really make sense to me. As in that some things he said weren't true for my laptop. For example, I was able to boot into Linux without much trouble.

Regarding the dmidecode output, I got it! It's huge. I'll just paste it here.

Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
24 structures occupying 1476 bytes.
Table at 0x7A7B9000.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: INSYDE Corp.
	Version: V1.20
	Release Date: 03/01/2016
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 3 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		ATAPI Zip drive boot is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
	BIOS Revision: 1.32
	Firmware Revision: 0.0

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: Acer
	Product Name: TP-SW5-012-10TM
	Version: V1.20
	Serial Number: NTL4TEB01150278B9C7200
	UUID: 15879c00-242b-81e4-2c8e-40e2301edb33
	Wake-up Type: Power Switch
	SKU Number: TP-SW5-012-10TM_0928_1.20
	Family: BYT-CR

Handle 0x0002, DMI type 2, 17 bytes
Base Board Information
	Manufacturer: Acer
	Product Name: Fendi2
	Version: V1.20
	Serial Number: NBL4S1100444379B457200
	Asset Tag: Type2 - Board Asset Tag
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Type2 - Board Chassis Location
	Chassis Handle: 0x0003
	Type: Motherboard
	Contained Object Handles: 0

Handle 0x0003, DMI type 3, 24 bytes
Chassis Information
	Manufacturer: Acer
	Type: Notebook
	Lock: Not Present
	Version: Chassis Version
	Serial Number: Chassis Serial Number
	Asset Tag: No Asset Tag
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Safe
	Security Status: None
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: 1
	Contained Elements: 0
	SKU Number: Not Specified

Handle 0x0004, DMI type 4, 42 bytes
Processor Information
	Socket Designation: CPU 1
	Type: Central Processor
	Family: Atom
	Manufacturer: Intel(R) Corporation
	ID: 78 06 03 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 55, Stepping 8
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		DS (Debug store)
		ACPI (ACPI supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		SS (Self-snoop)
		HTT (Multi-threading)
		TM (Thermal monitor supported)
		PBE (Pending break enabled)
	Version: Intel(R) Atom(TM) CPU  Z3735F @ 1.33GHz
	Voltage: 0.7 V
	External Clock: 83 MHz
	Max Speed: 1826 MHz
	Current Speed: 1340 MHz
	Status: Populated, Enabled
	Upgrade: None
	L1 Cache Handle: 0x0008
	L2 Cache Handle: 0x0009
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 4
	Core Enabled: 4
	Thread Count: 1
	Characteristics:
		64-bit capable
		Multi-Core
		Execute Protection
		Enhanced Virtualization
		Power/Performance Control

Handle 0x0005, DMI type 6, 12 bytes
Memory Module Information
	Socket Designation: DIMM0
	Bank Connections: 0 0
	Current Speed: Unknown
	Type: None
	Installed Size: 2048 MB (Single-bank Connection)
	Enabled Size: 2048 MB (Single-bank Connection)
	Error Status: OK

Handle 0x0006, DMI type 6, 12 bytes
Memory Module Information
	Socket Designation: DIMM1
	Bank Connections: 0 0
	Current Speed: Unknown
	Type: None
	Installed Size: Not Installed
	Enabled Size: Not Installed
	Error Status: OK

Handle 0x0007, DMI type 7, 19 bytes
Cache Information
	Socket Designation: L1 Cache
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 24 kB
	Maximum Size: 24 kB
	Supported SRAM Types:
		Synchronous
	Installed SRAM Type: Synchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: Fully Associative

Handle 0x0008, DMI type 7, 19 bytes
Cache Information
	Socket Designation: L1 Cache
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 32 kB
	Maximum Size: 32 kB
	Supported SRAM Types:
		Synchronous
	Installed SRAM Type: Synchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Instruction
	Associativity: 8-way Set-associative

Handle 0x0009, DMI type 7, 19 bytes
Cache Information
	Socket Designation: L2 Cache
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 1 MB
	Maximum Size: 1 MB
	Supported SRAM Types:
		Synchronous
	Installed SRAM Type: Synchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Unified
	Associativity: 16-way Set-associative

Handle 0x000A, DMI type 10, 6 bytes
On Board Device Information
	Type: <OUT OF SPEC>
	Status: Disabled
	Description: IGD

Handle 0x000B, DMI type 10, 6 bytes
On Board Device Information
	Type: <OUT OF SPEC>
	Status: Disabled
	Description: Realtek Lan Controller

Handle 0x000C, DMI type 11, 5 bytes
OEM Strings
	String 1: Acer system
	String 2: mZWcC86tNvWpH
	String 3: 77wMsF5rCLn-9
	String 4: A6PQKaeE-83IU
	String 5: String5 for Original Equipment Manufacturer

Handle 0x000D, DMI type 12, 5 bytes
System Configuration Options
	Option 1: SMI:00B2C002
	Option 2: String2 for Type12 Equipment Manufacturer
	Option 3: String3 for Type12 Equipment Manufacturer
	Option 4: String4 for Type12 Equipment Manufacturer
	Option 5: DSN:BAT42b500682015
	Option 6: String6 for Type12 Equipment Manufacturer
	Option 7: String7 for Type12 Equipment Manufacturer

Handle 0x000E, DMI type 16, 15 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 4 GB
	Error Information Handle: No Error
	Number Of Devices: 2

Handle 0x000F, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x000E
	Error Information Handle: No Error
	Total Width: 32 bits
	Data Width: 32 bits
	Size: 2 GB
	Form Factor: SODIMM
	Set: None
	Locator: DIMM0
	Bank Locator: BANK 0
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1333 MT/s
	Manufacturer: To be filled by O.E.M
	Serial Number: To be filled by O.E.M
	Asset Tag: To be filled by O.E.M
	Part Number: To be filled by O.E.M
	Rank: Unknown
	Configured Memory Speed: 1333 MT/s

Handle 0x0010, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x000E
	Error Information Handle: No Error
	Total Width: 32 bits
	Data Width: 32 bits
	Size: No Module Installed
	Form Factor: SODIMM
	Set: None
	Locator: DIMM1
	Bank Locator: BANK 1
	Type: DDR3
	Type Detail: Synchronous

Handle 0x0011, DMI type 19, 15 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Array Handle: 0x000E
	Partition Width: 2

Handle 0x0012, DMI type 20, 19 bytes
Memory Device Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x000F
	Memory Array Mapped Address Handle: 0x0011
	Partition Row Position: Unknown

Handle 0x0013, DMI type 20, 19 bytes
Memory Device Mapped Address
	Starting Address: 0x00080000000
	Ending Address: 0x0007FFFFFFF
	Range Size: Invalid
	Physical Device Handle: 0x0010
	Memory Array Mapped Address Handle: 0x0011
	Partition Row Position: Unknown

Handle 0x0014, DMI type 170, 78 bytes
Acer Hotkey Function
	Function bitmap for Communication Button: 0x0801
		WiFi: Yes
		3G: No
		WiMAX: No
		Bluetooth: Yes
	Function bitmap for Application Button: 0x0000
	Function bitmap for Media Button: 0x00ff
	Function bitmap for Display Button: 0x000f
	Function bitmap for Others Button: 0x0006
	Communication Function Key Number: 3

Handle 0x0015, DMI type 171, 24 bytes
OEM-specific Type
	Header and Data:
		AB 18 15 00 01 86 80 31 0F 07 D0 02 24 43 08 00
		00 00 00 0D 00 00 00 00

Handle 0x0016, DMI type 172, 24 bytes
OEM-specific Type
	Header and Data:
		AC 18 16 00 02 1D 01 FF 00 02 01 00 03 FF 00 04
		01 00 05 0F 00 06 FF 00

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table

@masakk1
Copy link

masakk1 commented Dec 13, 2023

I did some more testing with the auto-rotate issue, which is very important since I want to use the device for reading.

I found a couple posts mentioning it, and ultimately I ended up on the systemd GitHub page to adjust the sensor settings. According to sources, changing the ACCEL_VELOCITY_MATRIX is a solution. There is even an example entry for the Acer Aspire SW5-012, but even after adding the file and restarting my computer, I couldn't get it to work.
Systemd GitHub sensor page: https://github.com/systemd/systemd/blob/main/hwdb.d/60-sensor.hwdb

If anyone has been able to fix this, please LMK.
Here are some photos to see the issue:
IMG_20231213_171522
IMG_20231213_171610

@HITMAN944
Copy link

thank you very much for your help, I succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment