User Tools

Site Tools


os:archlinux:30l3-nosystemd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
os:archlinux:30l3-nosystemd [2021/12/29 20:01] – ↷ Page moved from archlinux:30l3-nosystemd to os:archlinux:30l3-nosystemd warnaudos:archlinux:30l3-nosystemd [2021/12/29 20:01] (current) – ↷ Links adapted because of a move operation warnaud
Line 1: Line 1:
 +====== INTRODUCTION ======
 +After some tests on opnBSD/FreeBSD/TrueOS (the 2 last for zfs usage) I need to have a working laptop with Rolling Release method, simple to tweak and maintain.
 +I will use archlinux-2016.12.01-dual.iso, install with btrfs and switch to openrc instead of systemd
 +Process is painful... an easier way would be to use archbang Linux...
 +
 +====== Hardware ======
 +I enhanced the almighty Thinkpad with a Crucial M4 mSATA Drive of 256GB
 +I intend to put the system on this SSD and home, swap and /var on the spinning 500GB disk :) like so:
 +====== Partition table ======
 +^Disk^Partition^Name^Label^Size^Format^Comment^
 +|SSD|1|sdb1|ARCHROOT|256+GB|BTRF| / for Archlinux |
 +|HD|1|sda1|SWAP|32GB|Linux Swap|swap for Linux|
 +|HD|2|sda2|VAR|50GB|BTRFS|/var for Linux|
 +|HD|3|sda3|HOME|389GB|NTRFS|/home for Linux|
 +
 +Simple :-)
 +====== Base install ======
 +===== References =====
 +  * [[https://wiki.archlinux.org/index.php/Installation_Guide|Installation guide]]
 +  * [[https://wiki.archlinux.org/index.php/ThinkPad_X230|Thinkpad x230]]
 +
 +===== ssh root login =====
 +ssh root login is already allowed
 +grab the ip
 +<code bash>
 +ip addr show
 +</code>
 +Start sshd
 +<code bash>
 +systemctl start sshd
 +</code>
 +change root passwd
 +<code bash>
 +passwd
 +</code>
 +Now you can connect remotely from another host
 +set the partition using cfdisk like displayed in the table above
 +==== Formatting ====
 +Let's format all these partitions in btrfs/swap format with LABELS!!.
 +<code bash>
 +mkfs.btrfs -L ARCHROOT /dev/sdb1
 +mkfs.btrfs -L ARCHVAR /dev/sda2
 +mkfs.btrfs -L ARCHHOME /dev/sda3
 +mkswap -L SWAP /dev/sda1
 +</code>
 +===== Mount partitions=====
 +<code bash>
 +mkdir /mnt/{home,var}
 +mount /dev/sdb1 /mnt
 +mount /dev/sda2 /mnt/var
 +mount /dev/sda3 /mnt/home
 +swapon /dev/sda1
 +</code>
 +
 +Check all is fine:
 +<code bash>
 +mount
 +</code>
 +Thank you systemd for this horrible output....
 +===== Base system =====
 +Then install base packages plus base-devel packages
 +<code bash>
 +pacstrap /mnt base base-devel
 +</code>
 +===== Fstab =====
 +For SSD tweaks and to make it shine: [[https://wiki.archlinux.org/index.php/Solid_State_Drives|SSD]]
 +  * generate fstab
 +<code bash>genfstab -L -p /mnt >> /mnt/etc/fstab
 +</code>
 +Yes I use Labels, UUID sucks
 +  * check fstab for options and label in place (for me it did a good job)
 +
 +===== Bootloader =====
 +I use Syslinux since it does its job well and didn't fall into useless overkill configuration files and tools! [[https://wiki.archlinux.org/index.php/Syslinux|Syslinux]]
 +<code bash>
 +pacstrap /mnt syslinux
 +</code>
 +====== Configuration ======
 +===== Environment =====
 +Let's go to our new system!
 +<code bash>arch-chroot /mnt </code>
 +  * /etc/hostname
 +<code bash> echo 30L3 > /etc/hostname </code>
 +  * /etc/locale.gen
 +I'll use en_US.utf-8/iso8859 so uncomment:
 +<code>
 +en_US.UTF-8 UTF-8
 +en_US ISO-8859-1
 +</code>
 +The generate locales
 +<code bash> locale-gen </code>
 +  * /etc/locale.conf [[https://wiki.archlinux.org/index.php/Locale|Locale]]
 +<code bash>
 +LANG="en_US.UTF-8"
 +
 +# Keep the default sort order (e.g. files starting with a '.'
 +# should appear at the start of a directory listing.)
 +LC_COLLATE="C"
 +</code>
 +  * /etc/vconsole.conf 
 +Default keyboard in console (US variant international ... with a different mapping than on X11! Well done)
 +<code bash>echo "KEYMAP=us-acentos" > /etc/vconsole.conf</code>
 +  * /etc/localtime
 +<code bash>ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime</code>
 +  * /etc/mkinitcpio.conf
 +Double check the content,
 +then just regenerate it in case ...
 +<code bash>mkinitcpio -p linux</code>
 +got scary:
 +<code bash>
 +==> ERROR: file not found: `fsck.btrfs'
 +==> WARNING: No fsck helpers found. fsck will not be run on boot.
 +</code>
 +  * /boot/syslinux/syslinux.cfg 
 +I left it by default (for now ;-) ) WARNING: No fsck helpers found. fsck will not be run on boot.\\
 +:!: Check that Linux start from /dev/sdb1 not sdaX ... 
 +Then the magic:
 +<code bash> /usr/sbin/syslinux-install_update -i -a -m</code>
 +output:
 +<code bash>
 +Syslinux BIOS install successful
 +Attribute Legacy Bios Bootable Set - /dev/sdb1
 +Installed MBR (/usr/lib/syslinux/bios/gptmbr.bin) to /dev/sdb
 +</code>
 +if errors, install gptfdisk package or what's required :)
 +  * root password
 +<code bash>passwd</code>
 +===== Reboot=====
 +==== Umount stuff cleanly ====
 +First use Ctrl+D to escape from the chroot\\
 +then:
 +<code bash>umount /mnt/var /mnt/home /mnt</code>
 +Now is the time to light a candle and type
 +<code bash>reboot</code>
 +
 +===== SSHd =====
 +Access remotely:
 +<code bash> pacman -Sy openssh </code>
 +Enable it at boot
 +===== User =====
 +<code bash>
 +useradd -g users -m -s /bin/bash warnaud
 +passwd warnaud
 +</code>
 +use **visudo** to set appropriate rights for the user
 +===== Install some X=====
 + pacman -S xorg-server xorg-apps xorg-fonts xorg-fonts-100dpi xorg-fonts-75dpi xorg-twm xorg-xclock xorg-xinit xorg-xdm xterm xf86-video-intel xorg-xmessage xorg-xcalc xorg-xfontsel xorg-utils vim
 +We have intel video card so we need to add some modules at boot for KMS
 +<code bash>
 +vi /etc/mkinitcpio.conf
 +</code>
 +<code>
 +...
 +MODULES="i915"
 +...
 +</code>
 +Acceleration method
 +<code>vi /etc/X11/xorg.conf.d/20-intel.conf</code>
 +<code>
 +Section "Device"
 +   Identifier  "Intel Graphics"
 +   Driver      "intel"
 +   Option      "AccelMethod"  "sna"
 +EndSection
 +</code>
 +<code> vi /etc/X11/xorg.conf.d/10-evdev.conf </code>
 +<code bash>
 +Section "InputClass"
 +        Identifier "evdev keyboard catchall"
 +        MatchIsKeyboard "on"
 +        MatchDevicePath "/dev/input/event*"
 +        Driver "evdev"
 +        Option "XkbLayout" "us"
 +        Option "XkbVariant" "intl"
 +EndSection
 +</code> 
 +==== XDM ====
 +Reference: [[https://wiki.archlinux.org/index.php/XDM]]
 +<code bash>pacman -S xorg-xdm</code>
 +Enable systemd service
 +<code bash>systemctl enable xdm.service</code>
 +
 +
 +==== i915 ====
 +Power consumption for Intel Graphics:
 +<code bash>vi /etc/modprobe.d/modprobe.conf</code>
 +<code bash>options i915 i915_enable_rc6=1 i915_enable_fbc=1 lvds_downclock=1</code>
 +Rebuild the kernel:
 +<code bash>mkinitcpio -p linux && mkinitcpio -p linux-ck</code>
 +
 +===== Thinkpad =====
 +==== Wacom ====
 +Reference: [[https://wiki.archlinux.org/index.php/Wacom]]
 +Install the driver:
 +<code bash>pacman -S xf86-input-wacom</code>
 +FIXME la suite ...
 +==== Disable Touchpad ====
 +Deactivate the useless touchpad:
 +<code> vi /etc/X11/xorg.conf.d/10-evdev.conf </code>
 +<code bash>
 +Section "InputClass"
 +        Identifier "evdev touchpad catchall"
 +        MatchIsTouchpad "off"
 +        MatchDevicePath "/dev/input/event*"
 +        Driver "evdev"
 +EndSection
 +</code>
 +
 +FIXME Check alternate solution:[[https://wiki.archlinux.org/index.php/Synaptics_Touchpad]] 
 +==== TrackNav enhancement ====
 +This hack will enable scrolling using the middle button + the TrackPoint™®©
 +<code bash>vi /etc/X11/xorg.conf.d/20-thinkpad.conf</code>
 +<code bash>
 +Section "InputClass"
 +    Identifier "Trackpoint Wheel Emulation"
 +    MatchProduct     "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device"
 +    MatchDevicePath     "/dev/input/event*"
 +    Option     "EmulateWheel"        "true"
 +    Option     "EmulateWheelButton"  "2"
 +    Option     "Emulate3Buttons"   "false"
 +    Option     "XAxisMapping"   "6 7"
 +    Option     "YAxisMapping"        "4 5"
 +EndSection
 +</code>
 +===== Other software =====
 +==== Archlinuxfr repository ====
 +We need yaourt to install a bunch of aur packages for openrc
 +<code bash>vi /etc/pacman.conf</code>
 +<code bash>
 +...
 +[archlinuxfr]
 +SigLevel = Never
 +Server = http://repo.archlinux.fr/$arch
 +</code>
 +\o/ No signature
 +==== Sudo ====
 +<code bash>pacman -S sudo</code>
 +<code bash>visudo</code>
 +<code bash>
 +...
 +root ALL=(ALL) ALL
 +someuser ALL=(ALL) ALL</code>
 +Just add the 'someuser' line and change by the user you need
 +
 +==== Compilation options =====
 +:!: just for fun not really mandatory
 +Reference: [[https://wiki.archlinux.org/index.php/Makepkg.conf]]
 +<code bash>vi /etc/makepkg.conf</code>
 +Modify CFLAGS/CXXFLAGS:
 +<code bash>
 +# -march=native also sets the correct -mtune=
 +CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
 +CXXFLAGS="${CFLAGS}"
 +</code>
 +Modify MAKEFLAGS (4 = output of nproc)
 +<code bash>MAKEFLAGS="-j4"</code>
 +:!::!::!::!::!::!: WORK IN PROGRESS :!::!::!::!::!::!::!::!:
 +==== Switch to openrc =====
 +bye bye systemd!
 +<code bash>
 +yaourt -S openrc-sysvinit
 +</code>
 +This will install sysvinit also.
 +This will conflict with systemd crap, remove it:
 +<code bash>
 +Remove systemd-sysvcompat? [y/N] y
 +
 + yaourt -S openrc
 +</code>
 +use openrc-git to be super bleeding edge :)
 +</code>
 +Next, install some arch services + network service tools
 +<code bash>
 + yaourt -S openrc-arch-services-git net-tools
 +
 +</code>
 +===== openrc & bootloader =====
 +I use syslinux, the trick is to add init=/usr/bin/init-openrc to the kernel parameters of your bootloader configuration file
 +for me on **/boot/syslinux/syslinux.cfg**:
 +<code>
 +LABEL arch-ck
 +        MENU LABEL Arch Linux CK
 +        LINUX ../vmlinuz-linux-ck-ivybridge
 +        APPEND root=/dev/sdb1 ro resume=/dev/sda1 vga=792 init=/usr/bin/init-openrc
 +        INITRD ../initramfs-linux-ck-ivybridge.img quiet vga=current ipv6.disable=1 elevator=bfq pcie_aspm=force acpi_backlight=vendor
 +
 +</code>
 +After a reboot, systemd is gone LOL
 +
 +===== recommended services =====
 +<code bash>
 +rc-update add udev sysinit
 +rc-update add dcron default
 +rc-update add dbus default
 +rc-update add alsa default
 +rc-update add syslog-ng default
 +</code>
 +Then it is safe to reboot ;)
 +
 +Nightmare after reboot, first xdm do not work/start... second network card naming is the same as systemd...
 +
 +====== References ======
 +  * https://wiki.archlinux.org/index.php/OpenRC
 +  * https://blog.notfoss.com/posts/openrc-on-arch-linux/
 +  * https://github.com/throwawaygh/arch-openrc-guide
 +  * [[os:archlinux:30l3|Overview]] my previous install
 +# rc-update add dcron default