Alpine on a multiboot device with XFCE4 (separate boot partition)

1 post / 0 new
#1 Sat, 2018-01-13 20:08
templar
  • templar's picture
  • Offline
  • Last seen: 2 months 2 weeks ago
  • Joined: 2018-01-13

First of all hello to the forum members here! Some weeks ago I installed Alpine the first time and I have to admit that I failed miserably. I tried to follow the steps to set up MATE, which actually did work, but I had this issue: bugs.alpinelinux.org/issues/6963 I was also wondering: https://forum.alpinelinux.org/forum/installation/solved-installation-mate-problems-finding-caja-caja-extensions-and-marco ← this is from januar 2016 but it is still not implemented in the tuto. No problem, I knew about these things, saying on reddit „documentation for Alpine is a mixed bag”. Long story short I messed up my first try beyond repair. This is why I decided to write down the steps, which I did during Christmas holiday. Here they are for a multiboot system and xfce4.

1. First I downloaded the iso and used dd in order to create an Alpine boot usb stick, which was /dev/sdb in my case:

sudo dd if=alpine-standard-3.7.0-x86_64.iso of=/dev/sdb bs=1M status=progress

2. There was a 60 GB ext4 partition on my HDD (sda5), which was intended to use for the Alpine install. So I took the usb stick with Alpine, plugged it in, powered on the machine, got to the boot options list and opted for the usb stick. It booted without issues.

3. At login prompt typed root, pressed enter.

4. Mounted the partition mentioned above intended for Alpine:
mount -t ext4 /dev/sda5 /mnt

5. Used the following commands:
setup-timezone
and
setup-alpine -q

It asked for keyboard layout, hostname, root password, network interface, dhcp, timezone, etc. There was an error message: „Call to clock failed”.

Also used the command:
setup-ntp

but at this point of time did not need setup-sshd

6. So far so good, ready to install the system:
setup-disk -m sys /mnt

7. shutdown

8. As it was a multiboot machine with a separate boot partition on sda3, I had to change on sda3 /grub/grub.cfg which offers the section beggining with: ### BEGIN /etc/grub.d/40_custom ####
This section takes the data from the OS which is used with grub. There is the file: /etc/grub.d/40_custom.

I had to change this file in order to get the proper entry for Alpine Linux. Therefore I checked the UUID for sda5:
sudo blkid /dev/sda5

And pasted the following code in /etc/grub.d/40_custom (notice that the boot partition is on sda3, so therefore it is „set root=(hd0,3)” and there is no /boot/ in front of vmlinuz-hardened and initramfs-hardened as it is a separate boot partition and I got the UUID with the blkid command):

menuentry "Alpine Linux" {
 set root=(hd0,3)
 linux vmlinuz-hardened root=UUID=8de6973a-4a8c-40ed-b710-c4e2b42d6b7a modules=sd-mod,usb-storage,ext4 quiet
 initrd initramfs-hardened
}

I also pasted this code in the ### BEGIN /etc/grub.d/40_custom #### section in /grub/grub.cfg on sda3, so I did not had to update grub.

9. After these changed there was a grub entry for Alpine and booted into the system, login as root with root password went fine.

10. Used again command for basic stuff:
setup-alpine

It sets keyboard-layout, hostname, network-interface, dhcp, root password, timezone. Again: „call to flock failed – Resource temporarily unavailable” .

When choosing a mirror, I think the fastest is a good choice (pressed „f”). There is also to configure ssh, ntp-client, where to store configs and apk-cache.

11. Now the X stuff:
setup-xorg-base

12. For intel graphic card:
apk add xf86-video-intel

13. To enable KMS at boot: Add the i915 and fbcon modules to /etc/modules:
echo i915 >> /etc/modules
echo fbcon >> /etc/modules

Install mkinitfs:
apk add mkinitfs

Enabled the kms feature in the mkinitfs configuration by adding it to the features variable:
vi /etc/mkinitfs/mkinitfs.conf

Its content should be:

features=”keymap cryptsetup kms ata base ide scsi usb virtio ext4”

Side note - For vi to save: Press ESC, press „:” press „w”, press enter. To quit: ESC : q enter.

Run mkinitfs:
mkinitfs

14. Added some more stuff:
apk add xf86-input-synaptics
apk add xf86-input-mouse
apk add xf86-input-keyboard

15. Added xfce4:
apk add xfce4

16: Run:
Xorg -configure
This will create `/root/xorg.conf.new`. You can modify this file to fit your needs. When I finished modifying and testing the above configuration file, I moved it to the folder /etc/X11/ and renamed it to xorg.conf for normal usage.

17. Run:
apk add setxkbmap

When using the following command (choosing a layout), it gave me an error message first:
setxkbmap
Cannot open display "default display"
BUT: After logging in xfce4 something like „setxkbmap gb” did work.

18. Added a user:
adduser -g 'Natanael Copa' ncopa

Also:
apk add sudo  
It is needed for visudo, if that user gets sudo permissions in /etc/sudoers. When doing so, it is important to use the command
visudo /etc/sudoers

To edit the file, use the arrows to navigate to the appropriate line and enter Insert mode by pressing the 'i' key. To save and exit, enter Command mode by pressing the 'Esc' key, then ':w' + 'enter' to save, and finally ':q' + 'enter' to quit.

19. rc-service dbus start
20. rc-update add dbus
21. This is missing in the xfce4 tuto (btw which is better lightdm or slim?):
apk add lxdm

22. Run the following command and logged in with the created user:
rc-service lxdm start

After it started properly, lxdm was made to start up at boot:
rc-update add lxdm

23. The following did NOT work for me: „Change the keymap when logging into X is to use ~/.xinitrc. Aadd this line to the beginning of the file: setxkbmap gb & and also add a second line like exec startxfce4 „ - it simply did NOT change the keyboard layout and I tried it through several reboots.
Be careful when it logs in with different layout (e.g. using vi and finding syntax like „:” or typing the password). In the end this worked:
Add this section to /etc/X11/xorg.conf:

Section „InputClass”
	Identifier „Keyboard Default”
	MatchIsKeyboard	„yes”
	Option	„XkbLayout”  „gb”
EndSection

24. Added user to specific groups:
adduser (username) audio
adduser (username) video
adduser (username) dialout

25. At this step it was the first time that the missing community repo was an issue (as it did not install the icon theme).
vi /etc/apk/repositories
Uncomment community repo.

There are several icon themes to choose from like
apk add faenza-icon-theme
or
apk add paper-gtk-theme paper-icon-theme

Added fonts too:
apk add font-noto

Here are the links that helped me. The first link helped setting-up multiboot:
http://wiki.alpinelinux.org/wiki/Installing_Alpine_on_HDD_dualbooting

This is useful for setting up intel video:
http://wiki.alpinelinux.org/wiki/Intel_Video

This is for xfce4:
http://wiki.alpinelinux.org/wiki/XFCE_Setup

This is for desktop configuration:
https://wiki.alpinelinux.org/wiki/Desktop-notes

It was good that I decided to re-install it without much hesitation and this time everything went smooth. There are some things to add to the wiki sites, but all in all my first impression is positive. Tips for further configuration, corrections, etc. welcome.