Royaume de France: A Bodhi MacBook Air Installation: Step by Step : (with instr. included for those formatting via Linux)

Tuesday, April 9, 2019

Queen of France

A Bodhi MacBook Air Installation: Step by Step : (with instr. included for those formatting via Linux)



Turning a Macbook Air (1.1 from 2008) into a Gnu Linux Bodhi 5.
Starting with a Linux (Bodhi, Ubuntu,etc) system, to format your installation stick.

Proceed at your own risk

As prior files stored on the Mac could be lost in the process.
Other hindrances, wifi and the default grub configuration are not always compatible, I have listed many good options, however, the grub configuration may have to be updated occasionally due to other updates, etc. All-in-all, the system is more considerably more stable with ethernet.

A Bodhi OS

The Installation is for a Bodhi 5 app pack. This version has the least problems,
leaving only 2 boot errors and happily include the suspend when lid closed feature.
2 other distros also achieve similar results,
namely XUbuntu 18.04 and Ubuntu 18.04*.
(*Also works with a minimal or normal Ubuntu, available with the standard iso for 18.04 64-AMD)
however, they had problems with lid-suspend and a few more boot errors:
Starting out with a smaller system like Bodhi is better,
as too many exotic applications could bring upsets to the original installation process.
Add them on later, and avoid system takeover programs like dconf editors and Compiz,
etc, as the system has to first be working, without any strange errors being included.
Because, just after the installation, it starts with a loud CPU issue, (which is subsequently fixed, see below)
it's better not to over-tax your system with more, until the CPU is finally quieted down.
After completion, then add your favorite major programs, libreoffice, gimp, etc.
The Completed Bodhi Mac Airbook is still a little slow-to-boot, 1-2 minutes. (even after using the grub changes shown below, to quicken the boots).
Before the grub file changes occur, the boot time was 3-5 minutes.

Time Required to Install

The install can take anywhere from 2-5 hours, more time if you have problems with your original USB installer stick.

Formatting the USB Stick

Use Gparted to wipe out any former mentions of a partition or an operating system.
Then Format in GUID only, which is also known as "GPT", instead of MS DOS.
The stick is only for the Installation program itself, not for other files.
Therefore, better to use a smaller USB, of 8GB or less.

The USB OS Installer Stick

For the Installation use, either USB Creator or UNetbootin,
add in a copy of the new OS iso, and the USB becomes an OS installer after a few minutes.

To the Macbook Air itself:


Assuming you have a hard drive there with an old partion,
Start The Mac and press your Option key,
Your EFI boot screen will load in after a while.
If the EFI boot screen does not appear,
start with the installer stick at boot,
and press the obnoxious power-on and option key together,
after 30-60 seconds, then EFI boot screen should appear.

At the EFI Boot Screen

At this time, plug in your Bodhi USB and Ethernet cable to a USB extender hub.
If you don't have a USB extender hub during the install, well, it does get a bit tenuous.
The Macbook Air has a small Ethernet-USB contraption,
and the USB extender usually has 4-5 ports,
one for the ETH USB and one for the USB Installer.
Once, I had Ethernet unplugged at the router, and even used a MS_DOS formatted USB by mistake,
it returned broken pipes, it just brought in a mega-slow boot and seized to a halt.
So, it's always better to use the GPT formatted version, and have the Ethernet active.
I just bypass the EFI Boot "wifi password field",
as my Ethernet is working, and wifi needs to be re-installed anyway.
but if you're without Ethernet and Wifi is available go ahead and use it.
Better though get the BCWM 43 cutter firmware (supports lots of wifi) downloaded,
via the "TRY Bodhi" installation terminal prompt,
and then save it to a another USB stick to reinstall later.
I'm dyslexic, so these types of Ethernet instructions are no fun.

The Install

The load time is very slow,
for either Try Bodhi or Install Bodhi, just be patient.
The Try Bodhi, does allow for a re-partition option
via the terminal for gparted, that's usually not needed though,
because a partition manager is already included with the installation.

Installing with Bodhi's "Something Else" Option

EFI for 600 MB

Format as EFI Boot (It think it says EFI restore or recovery, it's not the bios boot one)

EXT4, Primary, /, approx. 40,000 MB

Saving some free space, for another partition, if available.

Swap for 2400 MB

(probably should be in increments on 1024),
set it as Logical, End of Disk
With the Boot Drive; set to the new partition,
ie ADA Sda or ADA Sdb
Just leave any of the other partitions there, they can be deleted later, after the install is successful.
If you did resize to make space, you most likely will lose the data from the older partition(s).
If you could not save the older partitions data before starting the install, and you want the data,
stop, rethink, try to copy it somehow, before proceeding. Search out for that info.
***If other Swap Partitions exist...
Set them to "Do Not Use This Partition"

Press Install

3 formats should conclude, prior the install,
EFI, EXT, and SWAP
After 20 minutes or so exit and remove the USB when the program says so, and reboot.

It seems a Fail! ...Slow boot & It's running louder... Off To The Completion Stage Then!

Your boot starts from the white screen into Bodhi as it was set as Primary /.
It loads slowly, to the main OS screen, now to all the fixes, as listed below:

The Fixes

Fix # 1 :Install another Terminal

sudo apt install gnome-terminal
Just because the cut and paste, is functioning easier

Fix # 2: No Wifi:

With Ethernet plugged-in and working:
sudo apt-get purge bcmwl-kernel-source
sudo apt update
resist the sudo upgrade option, and wait til later.
sudo update-pciids
sudo apt install firmware-b43-installer
sudo service network-manager restart
To assure Wifi stays connected on reboots without Ethernet:
/etc/rc.local
sudo ifconfig wlan0* or eno1* up
sudo service network-manager restart
exit 0
save the file.
Where either wlan0 or enol1; could be your wifi call-throughs.
no reboot yet...

Slight Upset may occur with Ubuntu Installs: if the Modem-Router is Unplugged

The Wifi modem/router itself, might have to be turned-on before the boot sequence begins.
I believe Bodhi always finds wifi on suspend wake ups.
(However, I have had problems with Ubuntu returning into wifi, needing a reboot.)
If the router/modem is disconnected and then reconnected
during an online session,
Then, the wifi connection re-establishes again as normal, without a reboot required.
So, if you installed Ubuntu instead, and you unplug the router from the wall every night,
or a maid removes the router connections, and your machine is powered-off.
Plug-in the modem/router first, before you reboot your machine.

(Wifi instructions elsewhere: with the same instructions:
one useful site is: https://askubuntu.com/questions/55868/installing-broadcom-wireless-drivers).

Fix # 3 : add the fan program mbpfan

sudo apt install mbpfan
sudo systemctl enable mbpfan.service
One good thing is: the fan program puts the Macbook into normal quiet,
On bad thing is: boot time appears to take a little longer.

Fix # 4: Overloaded Kworker ACPI:

From Root
# grep . -r /sys/firmware/acpi/interrupts/
# crontab -e
nano
@reboot echo "disable" > /sys/firmware/acpi/interrupts/gpe17
save & close the file
then:
# echo "disable" > /sys/firmware/acpi/interrupts/gpe17

Confirming Graphics

sudo lshw -c video | grep 'configuration'
confirm -i915
This is if you use, the second grub option below, for i915.

Fix # 5: To The Grub Boot:

For some reason, the OS install with wifi,
seems to hinge upon these grub settings,
and the above fix of the rc.local, and this combo of the grub...helped them all behave.
sudo nano /etc/default/grub
"text hpet=disable irqpoll acpi_osi=\"Linux\" acpi_sleep=nonvs video=SVIDEO-1:d" ,
has been the most stable, and thus far preferred.
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=7
GRUB_CMDLINE_LINUX_DEFAULT="text hpet=disable irqpoll acpi_osi=\"Linux\" acpi_sleep=nonvs video=SVIDEO-1:d"
GRUB_CMDLINE_LINUX=""

Add a Grub Menu image

GRUB_BACKGROUND=”/home/your-username/Pictures/background.png”

Fix # 6: Powertop

sudo apt install powertop
sudo powertop -calibrate (with battery only)

Fix # 7: To Suspend on Lid Closed

Display blank-out, is as normal, it's just the lid issue.
Suspend works, and upon resume, if the cursor crashes on wake, it shouldn't anymore, yet if it does
use power-off or hibernate instead.
A blank out screen given requires the power-on button to be pushed, to restore.
This lid suspend issue, is the most problematic of the install thus far.
sudo cp /etc/systemd/logind.conf /etc/systemd/logind.conf.back
sudo nano /etc/systemd/logind.conf
HandleLidSwitch=suspend
systemctl restart systemd-logind.service

Fix # 8: Turn off apport

$ sudo nano /etc/default/apport
enabled=0
Save and restart
$ sudo service apport restart

Fix # 9: Relax and Reboot

The old boot errors:
modsign couldn't get uefi db list
irq16/9
drm atomic helper drm kms flip
most likely becomes:
modsign couldn't get uefi db list
Invalid PCI ROM header
Some people suggest Calibrating Powertop again, 2-4 more times,
I found this unnecessary with Bodhi.

Fix # 10: Upgrade

and the long wanted ...
sudo apt upgrade can now be used.

Fix # 11: UFW firewall

Controversial if really needed.
sudo ufw enable
sudo ufw allow 21
sudo ufw allow 22
sudo ufw allow 443
sudo ufw reload
sudo ufw status
& Other apps can be installed,
I installed gnome-session-flashback
which is sometimes easier for elderly people,
as the screen icons are placed at the bottom.
Plus, it's less-resource intensive.
Ready for instant movie watching, Bodhi includes Chrome and Midori.
Powering off, it takes about 30 seconds - 1 minute. Otherwise, Suspend with closed lid 5-15 seconds

Congratulations! if you made it this far.

If you still have a mac partition, you could delete it, and install Ubuntu over its partition.
via the same Ubuntu Installer USB.

A Possible Fix # 12: A Saucy TLP for battery maintenance, (I currently am not using it.)

sudo apt update
sudo apt install tlp
sudo nano /etc/default/tlp
to open the tlp file; edit & add 1 line to the following fields:
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=1
MAX_LOST_WORK_SECS_ON_BAT=15
DISK_APM_LEVEL_ON_BAT="1 1"
RUNTIME_PM_ALL=1
RESTORE_DEVICE_STATE_ON_STARTUP=1
Restart TLP:
sudo /etc/init.d/tlp restart

A no-Fix # 13 that fails: That old Mac Movie Woe, may still remain, though...

When movies on Firefox and Wifi are somehow disconnected,
and the swirly circle loop occurs.

One stated fix:
Set up IP6 to Link-Local instead of Automatic, via the Network Manager.
However, it's not helping, as it slows down the boot and brings wifi issues.

Fix # 14 A Busy Box Lockout:

If after many reboots and shutdowns later
In one case, with Ubuntu, an extra Firefox couldn't be shutdown,
during the reboot, the journal became corrupted.
Bringing the boot into the busybox prompt of initramfs
enter fsck /dev/sda2 (if that is your primary boot: sda1/sda2/sda3)
and answer yes.

Back to Saving the World... from Becoming a Garbage Dump

All-in All, of the 5.3 million Macs sold thus far,
it looks good, that they can be refurbished --- through-to-Linux,
rather than thrown away, due to their former upgrade incompatibilities.