Notes of installing Chakra Linux (2017/10) on MacBook Pro (2015-mid)
Contents
1. Disk Partition2. Wifi
3. fn key + F1 ~ 12
4. Input Method (fcitx)
5. Hi-res Display (Hi-DPI / Retina)
6. SSH Agent
7. freedesktop.org standard directories
8. monospace font in Konsole
9. Firefox
10. [TODO] Encrypt Home
11. [FIXME] ctrl alt super (scancode -> keycode conversion)
Disk Partition
My usage senario
- Left macOS (currently High Sierra + APFS) minimun required space to upgrade itself.
- Defaultly enter Linux when booting.
- Enter macOS by press alt key when booting.
Step 1: macOS’s DiskUtility.app
Use macOS to resize APFS partition.
- Ensure FileVault has been disabled and decryption is finished. (I doesn’t try to skip this step so I don’t know what will happen if not)
- Left default 200MB EFI System Partition (ESP) untouched.
- Resize original macOS’ APFS partition until 20GB free space left for system upgrading.
- Created a FAT32 partition on all remained unallocated space.
Step 2: Partition within Chakra installation:
- Delete the FAT32 partition just created.
- Except for ~500MB space lefted unallocated, create & mount your
/
and/home
partition. - Create a ~500MB FAT32 partition, mount to
/boot/efi
, add flagsboot
andesp
.
My example:
MountPoint Number Start End Size File system Name Flags
1 20.5kB 210MB 210MB fat32 EFI System Partition boot, esp
2 210MB 90.9GB 90.7GB apfs Macintosh HD
/home 3 90.9GB 216GB 125GB ext4
/ 4 216GB 250GB 34.0GB ext4
/boot/efi 5 250GB 251GB 472MB fat32 boot, esp
Wifi
MacBook Pro mid-2015 use BCM43602
network card:
$ lspci | grep Network
03:00.0 Network controller: Broadcom Corporation BCM43602 802.11ac Wireless LAN SoC (rev 01)
$ dmesg | grep brcm
$ lsmod | grep brcmfmac
According to Arch Wiki, this card should has been supported by kernel itself (brcmfmac
).
I don’t know why it doesn’t enabled out-of-box, but it still can be enabled manually:
modprobe brcmfmac
Auto start after booting
echo brcmfmac > /etc/modules-load.d/brcmfmac.conf
Trouble shooting: Still not works after adding
.conf
intomodules-load.d
?It’s possible that
brcmfmac
was added intoblacklist
inmodprobe.d
.
According to the man page of modprobe.d,modprobe.d
is located at:
/lib/modprobe.d/*.conf
/etc/modprobe.d/*.conf
/run/modprobe.d/*.conf
Ensure
brcmfmac
is not be added into blacklist by any.conf
file. (That is to say, if you findblacklist brcmfmac
, remove that line.)
Cannot suspend
This is Source
Add to rc.local
1 | #!/bin/sh -e |
fn
key + F1 ~ 12
Test
echo 2 > /sys/module/hid_apple/parameters/fnmode
Permanently:
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple_fnmode.conf
Reboot, done!
Input Method (fcitx)
https://wiki.chakralinux.org/index.php?title=Fcitx#CTRL.2BSpace_does_not_work
If you cannot invoke fcitx
when Ctrl + Space
, but fcitx
runs in background without problem, please check your locale, and make sure your locale is un-commented in /etc/locale.gen.
If you sure locale is correct, run fcitx-diagnose
to see what should added to ~/.xprofile
.
Hi-res Display (Hi-DPI / Retina)
KDE system settings
- Fonts -> Font
- Leave Font’s DPI untouched (96)
Adjust all fonts
-> Set size to14.0
- Minimun set to
12.0
96
font DPI seems to be default value. Not recommend to increase font’s DPI for enlarging text, because this makeGDK_DPI_SCALE
a mess.
- Display and Monitor -> Displays
- Click
Scale Display
, adjust to 1.0
- Click
- Icon -> Icon
- Detail Options -> customize icon sizes
~/.xprofile
1 | # === Qt ========================================= |
Adjusting
Scale Display
to 1.3 will cause Konsole’s display broken.
- KDE system settings -> Fonts -> Font
- Set Font’s DPI to 148
- Display and Monitor -> Displays
- Click
Scale Display
, adjust to 1.3
Icons size on Plasma’s System Tray
Open ~/.config/plasma-org.kde.plasma.desktop-appletsrc
, find a section looks like this, a lot of items:
1 | [Containments][8][General] |
Append one line in this section:
iconSize=2
Save file, Alt + F2
kquitapp plasmashell;kstart plasmashell
to apply.
kquitapp
can also bekquitapp5
orkillall
SSH Agent
Method 1: ssh-agent
+ ssh-add
+ ksshaskpass
Use
ssh-agent
to cache your SSH passphrase when login into KDE, so you needn’t enter passphrase whenevergit push
.
- Install
ksshaskpass
Edit (if not exist, create it)
~/.xprofile
(or~/.xinitrc
), add following 3 lines:export SSH_ASKPASS="/usr/bin/ksshaskpass" eval $(ssh-agent)
Add
ssh-add
intoKDE System Setting -> Startup and Shutdown -> Autostart -> Add Program...
I don’t recommend to place
ssh-add
also into~/.xprofile
, because when you login from SDDM, you cannot use the saved passphrase in (locked) KWallet.
freedesktop.org standard directories
Run xdg-user-dirs-update
, then ~/Picture
, ~/Movie
… generated. See https://wiki.archlinux.org/index.php/XDG_user_directories
monospace
font in Konsole
See my another article configure monospace fonts for terminal
Firefox
- Install
hunspell
and its directories for Firefox’s spell checking
[TODO] Encrypt Home
suspend
SYSTEMD_LOG_LEVEL=debug systemctl status mbp-suspend.service
[FIXME] SD Card Reader
Just buy a USB external SD card reader to solve this shit.
dmesg | grep SD
[ 1.084301] scsi 0:0:0:0: Direct-Access ATA APPLE SSD SM0256 SA0Q PQ: 0 ANSI: 5
[ 1.975499] scsi 1:0:0:0: Direct-Access APPLE SD Card Reader 3.00 PQ: 0 ANSI: 6
[12968.934410] scsi 1:0:0:0: Direct-Access APPLE SD Card Reader 3.00 PQ: 0 ANSI: 6
[FIXME] ctrl alt super (scancode
-> keycode
conversion)
I still not found the solution for this need. I’ve asked and been waiting for answser on StackExchange
See https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes
Generic input devices (also USB keyboards) identified by the usb kernel modalias:
evdev:input:bBUSIDvVENDORIDpPRODUCTIDeVERSION-MODALIAS
1. Find the vendor id / product id / version of build-in keyboard:
Run less /proc/bus/input/devices
and find section like this:
I: Bus=0003 Vendor=05ac Product=0274 Version=0110
N: Name="Apple Inc. Apple Internal Keyboard / Trackpad"
P: Phys=usb-0000:00:14.0-12/input1
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12:1.1/0003:05AC:0274.0004/input/input7
U: Uniq=D3H624316K1FTV4A63PS
H: Handlers=sysrq kbd leds event7
B: PROP=0
B: EV=120013
B: KEY=10000 0 0 0 1007b00011007 ff9f217ac14057ff ffbeffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=1f
2. Get scancodes
Run showkey --scancodes
in TTY:
scancode (hex) | keycode | |
---|---|---|
capslock | 3a ba | 58 |
———– | —————- | ——— |
fn | – – | 464 |
leftctrl | 1d 9d | 29 |
leftalt | 38 b8 | 56 |
leftmeta | e0 5b e0 db | 125 |
———– | —————- | ——— |
r_control | e0 5c e0 dc | 126 |
r_alt | e0 38 e0 b8 | 100 |
3. Create config file in /etc/udev/hwdb.d/
/etc/udev/hwdb.d/10-apple-kb.hwdb
1 | evdev:input:b0003v05acp0274e0110* |