Skip to content

Instantly share code, notes, and snippets.

@lnlsn
Forked from vibowit/README.md
Created May 25, 2022 19:57
Show Gist options
  • Select an option

  • Save lnlsn/4ed3afb2dc68b9079251b48e1ee2125f to your computer and use it in GitHub Desktop.

Select an option

Save lnlsn/4ed3afb2dc68b9079251b48e1ee2125f to your computer and use it in GitHub Desktop.

Revisions

  1. @gbrlsnchs gbrlsnchs revised this gist Aug 19, 2019. 1 changed file with 18 additions and 11 deletions.
    29 changes: 18 additions & 11 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -71,6 +71,11 @@ btrfs subvolume create /mnt/srv
    ```

    ### Installing the base system
    #### Using `glibc`
    ```sh
    xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current -r /mnt base-system btrfs-progs cryptsetup grub-x86_64-efi
    ```
    #### Using `musl`
    ```sh
    export XBPS_ARCH=x86_64-musl
    xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current/musl -r /mnt base-system btrfs-progs cryptsetup grub-x86_64-efi
    @@ -119,27 +124,29 @@ KEYMAP="br-abnt2"

    Then run the following commands:
    ```sh
    echo "GRUB_CMDLINE_LINUX=\"rd.luks=1 rd.luks.uuid=${blkid -s UUID -o value /dev/sda3} i915.modeset=1\"" >> /etc/default/grub
    echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    echo 'tmpdir=/tmp' >> /etc/dracut.conf
    dracut --force --hostonly --kver <kernel-version>
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    xbps-install -S void-repo-nonfree
    xbps-install -Su
    xbps-install intel-ucode
    echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    xbps-reconfigure -f linux<kernel-version-major.minor>
    echo 'en_US.UTF-8 UTF-8' > /etc/default/libc-locales
    export GRUB_UUID=$(blkid -s UUID -o value /dev/sda2)
    export UEFI_UUID=$(blkid -s UUID -o value /dev/sda1)
    export ROOT_UUID=$(blkid -s UUID -o value /dev/mapper/cryptoroot)
    export LUKS_UUID=$(blkid -s UUID -o value /dev/sda3)
    cat <<EOF > /etc/fstab
    UUID=$GRUB_UUID /boot ext2 defaults,noatime 0 2
    UUID=$UEFI_UUID /boot/efi vfat defaults,noatime 0 2
    UUID=$ROOT_UUID / btrfs rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvolid=257 0 1
    UUID=$ROOT_UUID /home btrfs rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvolid=258 0 2
    UUID=$ROOT_UUID /.snapshots btrfs rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvolid=259 0 2
    EOF
    echo "GRUB_CMDLINE_LINUX=\"${LUKS_UUID} i915.modeset=1\"" >> /etc/default/grub
    echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    echo 'tmpdir=/tmp' >> /etc/dracut.conf
    dracut --force --hostonly --kver <kernel-version>
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    xbps-install -S void-repo-nonfree
    xbps-install -Su
    xbps-install intel-ucode
    echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    xbps-reconfigure -f linux<kernel-version-major.minor>
    exit
    exit
    umount -R /mnt
  2. @gbrlsnchs gbrlsnchs revised this gist Aug 19, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -119,7 +119,7 @@ KEYMAP="br-abnt2"

    Then run the following commands:
    ```sh
    echo "GRUB_CMDLINE_LINUX=\"rd.luks=1 rd.luks.uuid=${blkid -s UUID -o value /dev/sda3}\"" >> /etc/default/grub
    echo "GRUB_CMDLINE_LINUX=\"rd.luks=1 rd.luks.uuid=${blkid -s UUID -o value /dev/sda3} i915.modeset=1\"" >> /etc/default/grub
    echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    echo 'tmpdir=/tmp' >> /etc/dracut.conf
    dracut --force --hostonly --kver <kernel-version>
  3. @gbrlsnchs gbrlsnchs revised this gist Aug 19, 2019. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -119,7 +119,7 @@ KEYMAP="br-abnt2"

    Then run the following commands:
    ```sh
    echo 'GRUB_CMDLINE_LINUX="rd.luks=1 rd.luks.uuid=<luks-device-uuid>"' >> /etc/default/grub
    echo "GRUB_CMDLINE_LINUX=\"rd.luks=1 rd.luks.uuid=${blkid -s UUID -o value /dev/sda3}\"" >> /etc/default/grub
    echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    echo 'tmpdir=/tmp' >> /etc/dracut.conf
    dracut --force --hostonly --kver <kernel-version>
    @@ -130,6 +130,16 @@ xbps-install -Su
    xbps-install intel-ucode
    echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    xbps-reconfigure -f linux<kernel-version-major.minor>
    export GRUB_UUID=$(blkid -s UUID -o value /dev/sda2)
    export UEFI_UUID=$(blkid -s UUID -o value /dev/sda1)
    export ROOT_UUID=$(blkid -s UUID -o value /dev/mapper/cryptoroot)
    cat <<EOF > /etc/fstab
    UUID=$GRUB_UUID /boot ext2 defaults,noatime 0 2
    UUID=$UEFI_UUID /boot/efi vfat defaults,noatime 0 2
    UUID=$ROOT_UUID / btrfs rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvolid=257 0 1
    UUID=$ROOT_UUID /home btrfs rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvolid=258 0 2
    UUID=$ROOT_UUID /.snapshots btrfs rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvolid=259 0 2
    EOF
    exit
    exit
    umount -R /mnt
  4. @gbrlsnchs gbrlsnchs revised this gist Aug 16, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -150,7 +150,7 @@ visudo
    After running `visudo`, uncomment the line that contains `%wheel`. Log out and log in with the newly created user.

    #### Locking the root account
    :warning: **Important** :warning
    :warning: **Important** :warning:
    Only run this after setting up the main user!
    ```sh
    sudo passwd -dl root
  5. @gbrlsnchs gbrlsnchs revised this gist Aug 16, 2019. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -150,8 +150,7 @@ visudo
    After running `visudo`, uncomment the line that contains `%wheel`. Log out and log in with the newly created user.

    #### Locking the root account
    **Important**

    :warning: **Important** :warning
    Only run this after setting up the main user!
    ```sh
    sudo passwd -dl root
  6. @gbrlsnchs gbrlsnchs revised this gist Aug 16, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -150,7 +150,8 @@ visudo
    After running `visudo`, uncomment the line that contains `%wheel`. Log out and log in with the newly created user.

    #### Locking the root account
    **Important**
    **Important**

    Only run this after setting up the main user!
    ```sh
    sudo passwd -dl root
  7. @gbrlsnchs gbrlsnchs revised this gist Aug 16, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -150,7 +150,7 @@ visudo
    After running `visudo`, uncomment the line that contains `%wheel`. Log out and log in with the newly created user.

    #### Locking the root account
    **Important**
    **Important**
    Only run this after setting up the main user!
    ```sh
    sudo passwd -dl root
  8. @gbrlsnchs gbrlsnchs revised this gist Aug 16, 2019. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -150,7 +150,11 @@ visudo
    After running `visudo`, uncomment the line that contains `%wheel`. Log out and log in with the newly created user.

    #### Locking the root account
    https://wiki.voidlinux.org/Locking_the_root_account_and_using_sudo
    **Important**
    Only run this after setting up the main user!
    ```sh
    sudo passwd -dl root
    ```

    ### Connecting to the internet
    Run the proper `wpa_supplicant` steps to set Wi-Fi or stuff you need. Then, register and start the needed services:
  9. @gbrlsnchs gbrlsnchs revised this gist Aug 16, 2019. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -143,7 +143,7 @@ Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/d
    Log in as root
    ```sh
    xbps-install -S zsh
    usermod -m -G wheel,input,video,audio,docker -s $(which zsh) <username>
    usermod -m -G wheel -s $(which zsh) <username>
    passwd <username>
    visudo
    ```
    @@ -174,5 +174,14 @@ First, check whether [KMS](https://en.wikipedia.org/wiki/Mode_setting#Linux) is
    ```sh
    sudo cat /sys/module/i915/parameters/modeset
    ```
    If it returns `1`, then KMS is enabled.
    If it returns `1`, then KMS is enabled. If not, add `i915.modeset=1` to the kernel parameters.
    Then, ensure `/etc/X11/Xwrapper.config` has `needs_root_rights = no` and add the user to the following groups:
    ```sh
    sudo usermod -aG input,video <username>
    ```

    Finally, to start Xorg, you should run, without sudo:
    ```sh
    startx -- vt1
    ```
    https://wiki.voidlinux.org/Xorg
  10. @gbrlsnchs gbrlsnchs revised this gist Aug 16, 2019. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@
    ### Logging in
    User is `anon` and password is `voidlinux`.
    The root user is `root` and has the same password.
    This document implies you're using the `root` user, so no `sudo` is used until the main user is created and used.

    ### Setting keyboard layout
    ```sh
    @@ -162,11 +163,16 @@ By symlinking the services, runit will pick them up in the next five seconds and
    ### Installing drivers needed by Xorg
    ```sh
    sudo xbps-install -S xorg-minimal xorg-fonts \
    xf86-video-intel xf86-video-ati \
    xf86-input-evdev xf86-video-fbdev \
    xf86-input-synaptics
    xf86-video-intel xf86-video-ati \
    xf86-input-evdev xf86-video-fbdev \
    xf86-input-synaptics
    echo 'exec bspwm' >> ~/.xinitrc
    ```

    #### Rootless Xorg
    First, check whether [KMS](https://en.wikipedia.org/wiki/Mode_setting#Linux) is enabled:
    ```sh
    sudo cat /sys/module/i915/parameters/modeset
    ```
    If it returns `1`, then KMS is enabled.
    https://wiki.voidlinux.org/Xorg
  11. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -142,7 +142,7 @@ Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/d
    Log in as root
    ```sh
    xbps-install -S zsh
    usermod -m -G wheel -s $(which zsh) <username>
    usermod -m -G wheel,input,video,audio,docker -s $(which zsh) <username>
    passwd <username>
    visudo
    ```
  12. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -159,11 +159,14 @@ sudo ln -s /etc/sv/wpa_supplicant /var/service/
    ```
    By symlinking the services, runit will pick them up in the next five seconds and start them!

    ### Installing drivers needed by X11
    ### Installing drivers needed by Xorg
    ```sh
    sudo xbps-install -S xorg-minimal xorg-fonts \
    xf86-video-intel xf86-video-ati \
    xf86-input-evdev xf86-video-fbdev \
    xf86-input-synaptics
    echo 'exec bspwm' >> ~/.xinitrc
    ```
    ```

    #### Rootless Xorg
    https://wiki.voidlinux.org/Xorg
  13. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -165,5 +165,5 @@ sudo xbps-install -S xorg-minimal xorg-fonts \
    xf86-video-intel xf86-video-ati \
    xf86-input-evdev xf86-video-fbdev \
    xf86-input-synaptics
    echo 'exec bspwm' >> ~/.xinit
    echo 'exec bspwm' >> ~/.xinitrc
    ```
  14. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -165,5 +165,5 @@ sudo xbps-install -S xorg-minimal xorg-fonts \
    xf86-video-intel xf86-video-ati \
    xf86-input-evdev xf86-video-fbdev \
    xf86-input-synaptics
    echo 'exec bspwm'
    echo 'exec bspwm' >> ~/.xinit
    ```
  15. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -157,4 +157,13 @@ Run the proper `wpa_supplicant` steps to set Wi-Fi or stuff you need. Then, regi
    sudo ln -s /etc/sv/dhcpcd /var/service/
    sudo ln -s /etc/sv/wpa_supplicant /var/service/
    ```
    By symlinking the services, runit will pick them up in the next five seconds and start them!
    By symlinking the services, runit will pick them up in the next five seconds and start them!

    ### Installing drivers needed by X11
    ```sh
    sudo xbps-install -S xorg-minimal xorg-fonts \
    xf86-video-intel xf86-video-ati \
    xf86-input-evdev xf86-video-fbdev \
    xf86-input-synaptics
    echo 'exec bspwm'
    ```
  16. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 68 additions and 64 deletions.
    132 changes: 68 additions & 64 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -3,24 +3,25 @@
    ## Live image
    ### Logging in
    User is `anon` and password is `voidlinux`.
    The root user is `root` and has the same password.

    ### Setting keyboard layout
    ```sh
    $ loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    ```

    ### Connecting to the internet
    ```sh
    $ cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    $ wpa_passphrase <ssid> <passphrase> | tee -a /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    $ sv restart dhcpcd
    $ ip link set up <interface>
    cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    wpa_passphrase <ssid> <passphrase> | tee -a /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    sv restart dhcpcd
    ip link set up <interface>
    ```

    ### Formatting disk
    Run:
    ```sh
    $ fdisk /dev/sda
    fdisk /dev/sda
    ```
    Then:
    1. Select `g` to generate a GTP table
    @@ -31,62 +32,62 @@ Then:

    ### Creating the filesystems
    ```sh
    $ mkfs.vfat -n boot -F 32 /dev/sda1
    $ mkfs.ext2 -L GRUB /dev/sda2
    $ cryptsetup luksFormat --type=luks -s=512 /dev/sda3
    $ cryptsetup open /dev/sda3 cryptroot
    $ mkfs.btrfs -L void /dev/mapper/cryptroot
    mkfs.vfat -n boot -F 32 /dev/sda1
    mkfs.ext2 -L GRUB /dev/sda2
    cryptsetup luksFormat --type=luks -s=512 /dev/sda3
    cryptsetup open /dev/sda3 cryptroot
    mkfs.btrfs -L void /dev/mapper/cryptroot
    ```

    ### Mounting the `btrfs`partition and creating subvolumes
    ```sh
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120 /dev/mapper/cryptroot /mnt
    $ btrfs subvolume create /mnt/@
    $ btrfs subvolume create /mnt/@home
    $ btrfs subvolume create /mnt/@snapshots
    mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120 /dev/mapper/cryptroot /mnt
    btrfs subvolume create /mnt/@
    btrfs subvolume create /mnt/@home
    btrfs subvolume create /mnt/@snapshots
    ```

    #### Mounting top-level partitions
    ```sh
    $ umount /mnt
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/cryptroot /mnt
    $ mkdir -p /mnt/home
    $ mkdir -p /mnt/.snapshots
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@home /dev/mapper/cryptroot /mnt/home
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@snapshots /dev/mapper/cryptroot /mnt/.snapshots
    $ mkdir /mnt/boot
    $ mount -o rw,noatime /dev/sda2 /mnt/boot
    $ mkdir /mnt/boot/efi
    $ mount -o rw,noatime /dev/sda1 /mnt/boot/efi
    umount /mnt
    mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/cryptroot /mnt
    mkdir -p /mnt/home
    mkdir -p /mnt/.snapshots
    mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@home /dev/mapper/cryptroot /mnt/home
    mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@snapshots /dev/mapper/cryptroot /mnt/.snapshots
    mkdir /mnt/boot
    mount -o rw,noatime /dev/sda2 /mnt/boot
    mkdir /mnt/boot/efi
    mount -o rw,noatime /dev/sda1 /mnt/boot/efi
    ```

    #### Creating nested partitions
    ```sh
    $ mkdir -p /mnt/var/cache
    $ btrfs subvolume create /mnt/var/cache/xbps
    $ btrfs subvolume create /mnt/var/tmp
    $ btrfs subvolume create /mnt/srv
    mkdir -p /mnt/var/cache
    btrfs subvolume create /mnt/var/cache/xbps
    btrfs subvolume create /mnt/var/tmp
    btrfs subvolume create /mnt/srv
    ```

    ### Installing the base system
    ```sh
    $ export XBPS_ARCH=x86_64-musl
    $ xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current/musl -r /mnt base-system btrfs-progs cryptsetup grub-x86_64-efi
    export XBPS_ARCH=x86_64-musl
    xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current/musl -r /mnt base-system btrfs-progs cryptsetup grub-x86_64-efi
    ```

    #### Running `chroot`
    ```sh
    $ mount -t proc proc /mnt/proc
    $ mount -t sysfs sys /mnt/sys
    $ mount -o bind /dev /mnt/dev
    $ mount -t devpts pts /mnt/dev/pts
    $ cp -L /etc/resolv.conf /mnt/etc/
    $ cd /mnt
    $ chroot /mnt /bin/bash
    $ passwd root
    $ chown root:root /
    $ chmod 755 /
    $ echo <hostname> > /etc/hostname
    mount -t proc proc /mnt/proc
    mount -t sysfs sys /mnt/sys
    mount -o bind /dev /mnt/dev
    mount -t devpts pts /mnt/dev/pts
    cp -L /etc/resolv.conf /mnt/etc/
    cd /mnt
    chroot /mnt /bin/bash
    passwd root
    chown root:root /
    chmod 755 /
    echo <hostname> > /etc/hostname
    ```

    Then edit the file `/etc/rc.conf` to contain the following:
    @@ -117,21 +118,21 @@ KEYMAP="br-abnt2"

    Then run the following commands:
    ```sh
    $ echo 'GRUB_CMDLINE_LINUX="rd.luks=1 rd.luks.uuid=<luks-device-uuid>"' >> /etc/default/grub
    $ echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    $ echo 'tmpdir=/tmp' >> /etc/dracut.conf
    $ dracut --force --hostonly --kver <kernel-version>
    $ grub-mkconfig -o /boot/grub/grub.cfg
    $ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    $ xbps-install -S void-repo-nonfree
    $ xbps-install -Su
    $ xbps-install intel-ucode
    $ echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    $ xbps-reconfigure -f linux<kernel-version-major.minor>
    $ exit
    $ exit
    $ umount -R /mnt
    $ reboot
    echo 'GRUB_CMDLINE_LINUX="rd.luks=1 rd.luks.uuid=<luks-device-uuid>"' >> /etc/default/grub
    echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    echo 'tmpdir=/tmp' >> /etc/dracut.conf
    dracut --force --hostonly --kver <kernel-version>
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    xbps-install -S void-repo-nonfree
    xbps-install -Su
    xbps-install intel-ucode
    echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    xbps-reconfigure -f linux<kernel-version-major.minor>
    exit
    exit
    umount -R /mnt
    reboot
    ```

    Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`.
    @@ -140,17 +141,20 @@ Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/d
    ### Creating the main user and adding them to sudoers
    Log in as root
    ```sh
    $ xbps-install -S zsh
    $ usermod -m -G wheel -s $(which zsh) <username>
    $ passwd <username>
    $ visudo
    xbps-install -S zsh
    usermod -m -G wheel -s $(which zsh) <username>
    passwd <username>
    visudo
    ```
    After running `visudo`, uncomment the line that contains `%wheel`.
    After running `visudo`, uncomment the line that contains `%wheel`. Log out and log in with the newly created user.

    #### Locking the root account
    https://wiki.voidlinux.org/Locking_the_root_account_and_using_sudo

    ### Connecting to the internet
    Run the proper `wpa_supplicant` steps to set Wi-Fi or stuff you need. Then, register and start the needed services:
    ```sh
    $ sudo ln -s /etc/sv/dhcpcd /var/service/
    $ sudo ln -s /etc/sv/wpa_supplicant /var/service/
    sudo ln -s /etc/sv/dhcpcd /var/service/
    sudo ln -s /etc/sv/wpa_supplicant /var/service/
    ```
    By symlinking the services, runit will pick them up in the next five seconds and start them!
  17. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -149,7 +149,7 @@ After running `visudo`, uncomment the line that contains `%wheel`.

    ### Connecting to the internet
    Run the proper `wpa_supplicant` steps to set Wi-Fi or stuff you need. Then, register and start the needed services:
    ```terminal
    ```sh
    $ sudo ln -s /etc/sv/dhcpcd /var/service/
    $ sudo ln -s /etc/sv/wpa_supplicant /var/service/
    ```
  18. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -149,7 +149,7 @@ After running `visudo`, uncomment the line that contains `%wheel`.

    ### Connecting to the internet
    Run the proper `wpa_supplicant` steps to set Wi-Fi or stuff you need. Then, register and start the needed services:
    ```sh
    ```terminal
    $ sudo ln -s /etc/sv/dhcpcd /var/service/
    $ sudo ln -s /etc/sv/wpa_supplicant /var/service/
    ```
  19. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 64 additions and 64 deletions.
    128 changes: 64 additions & 64 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,22 +5,22 @@
    User is `anon` and password is `voidlinux`.

    ### Setting keyboard layout
    ```zsh
    % loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    ```sh
    $ loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    ```

    ### Connecting to the internet
    ```sh
    % cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    % wpa_passphrase <ssid> <passphrase> | tee -a /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    % sv restart dhcpcd
    % ip link set up <interface>
    $ cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    $ wpa_passphrase <ssid> <passphrase> | tee -a /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    $ sv restart dhcpcd
    $ ip link set up <interface>
    ```

    ### Formatting disk
    Run:
    ```sh
    # fdisk /dev/sda
    $ fdisk /dev/sda
    ```
    Then:
    1. Select `g` to generate a GTP table
    @@ -31,62 +31,62 @@ Then:

    ### Creating the filesystems
    ```sh
    # mkfs.vfat -n boot -F 32 /dev/sda1
    # mkfs.ext2 -L GRUB /dev/sda2
    # cryptsetup luksFormat --type=luks -s=512 /dev/sda3
    # cryptsetup open /dev/sda3 cryptroot
    # mkfs.btrfs -L void /dev/mapper/cryptroot
    $ mkfs.vfat -n boot -F 32 /dev/sda1
    $ mkfs.ext2 -L GRUB /dev/sda2
    $ cryptsetup luksFormat --type=luks -s=512 /dev/sda3
    $ cryptsetup open /dev/sda3 cryptroot
    $ mkfs.btrfs -L void /dev/mapper/cryptroot
    ```

    ### Mounting the `btrfs`partition and creating subvolumes
    ```sh
    # mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120 /dev/mapper/cryptroot /mnt
    # btrfs subvolume create /mnt/@
    # btrfs subvolume create /mnt/@home
    # btrfs subvolume create /mnt/@snapshots
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120 /dev/mapper/cryptroot /mnt
    $ btrfs subvolume create /mnt/@
    $ btrfs subvolume create /mnt/@home
    $ btrfs subvolume create /mnt/@snapshots
    ```

    #### Mounting top-level partitions
    ```sh
    # umount /mnt
    # mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/cryptroot /mnt
    # mkdir -p /mnt/home
    # mkdir -p /mnt/.snapshots
    # mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@home /dev/mapper/cryptroot /mnt/home
    # mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@snapshots /dev/mapper/cryptroot /mnt/.snapshots
    # mkdir /mnt/boot
    # mount -o rw,noatime /dev/sda2 /mnt/boot
    # mkdir /mnt/boot/efi
    # mount -o rw,noatime /dev/sda1 /mnt/boot/efi
    $ umount /mnt
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/cryptroot /mnt
    $ mkdir -p /mnt/home
    $ mkdir -p /mnt/.snapshots
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@home /dev/mapper/cryptroot /mnt/home
    $ mount -o rw,noatime,ssd,compress=zstd,space_cache,commit=120,subvol=@snapshots /dev/mapper/cryptroot /mnt/.snapshots
    $ mkdir /mnt/boot
    $ mount -o rw,noatime /dev/sda2 /mnt/boot
    $ mkdir /mnt/boot/efi
    $ mount -o rw,noatime /dev/sda1 /mnt/boot/efi
    ```

    #### Creating nested partitions
    ```sh
    # mkdir -p /mnt/var/cache
    # btrfs subvolume create /mnt/var/cache/xbps
    # btrfs subvolume create /mnt/var/tmp
    # btrfs subvolume create /mnt/srv
    $ mkdir -p /mnt/var/cache
    $ btrfs subvolume create /mnt/var/cache/xbps
    $ btrfs subvolume create /mnt/var/tmp
    $ btrfs subvolume create /mnt/srv
    ```

    ### Installing the base system
    ```sh
    # export XBPS_ARCH=x86_64-musl
    # xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current/musl -r /mnt base-system btrfs-progs cryptsetup grub-x86_64-efi
    $ export XBPS_ARCH=x86_64-musl
    $ xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current/musl -r /mnt base-system btrfs-progs cryptsetup grub-x86_64-efi
    ```

    #### Running `chroot`
    ```sh
    # mount -t proc proc /mnt/proc
    # mount -t sysfs sys /mnt/sys
    # mount -o bind /dev /mnt/dev
    # mount -t devpts pts /mnt/dev/pts
    # cp -L /etc/resolv.conf /mnt/etc/
    # cd /mnt
    # chroot /mnt /bin/bash
    # passwd root
    # chown root:root /
    # chmod 755 /
    # echo <hostname> > /etc/hostname
    $ mount -t proc proc /mnt/proc
    $ mount -t sysfs sys /mnt/sys
    $ mount -o bind /dev /mnt/dev
    $ mount -t devpts pts /mnt/dev/pts
    $ cp -L /etc/resolv.conf /mnt/etc/
    $ cd /mnt
    $ chroot /mnt /bin/bash
    $ passwd root
    $ chown root:root /
    $ chmod 755 /
    $ echo <hostname> > /etc/hostname
    ```

    Then edit the file `/etc/rc.conf` to contain the following:
    @@ -117,21 +117,21 @@ KEYMAP="br-abnt2"

    Then run the following commands:
    ```sh
    # echo 'GRUB_CMDLINE_LINUX="rd.luks=1 rd.luks.uuid=<luks-device-uuid>"' >> /etc/default/grub
    # echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    # echo 'tmpdir=/tmp' >> /etc/dracut.conf
    # dracut --force --hostonly --kver <kernel-version>
    # grub-mkconfig -o /boot/grub/grub.cfg
    # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    # xbps-install -S void-repo-nonfree
    # xbps-install -Su
    # xbps-install intel-ucode
    # echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    # xbps-reconfigure -f linux<kernel-version-major.minor>
    # exit
    # exit
    # umount -R /mnt
    # reboot
    $ echo 'GRUB_CMDLINE_LINUX="rd.luks=1 rd.luks.uuid=<luks-device-uuid>"' >> /etc/default/grub
    $ echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    $ echo 'tmpdir=/tmp' >> /etc/dracut.conf
    $ dracut --force --hostonly --kver <kernel-version>
    $ grub-mkconfig -o /boot/grub/grub.cfg
    $ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    $ xbps-install -S void-repo-nonfree
    $ xbps-install -Su
    $ xbps-install intel-ucode
    $ echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    $ xbps-reconfigure -f linux<kernel-version-major.minor>
    $ exit
    $ exit
    $ umount -R /mnt
    $ reboot
    ```

    Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`.
    @@ -140,17 +140,17 @@ Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/d
    ### Creating the main user and adding them to sudoers
    Log in as root
    ```sh
    # xbps-install -S zsh
    # usermod -m -G wheel -s $(which zsh) <username>
    # passwd <username>
    # visudo
    $ xbps-install -S zsh
    $ usermod -m -G wheel -s $(which zsh) <username>
    $ passwd <username>
    $ visudo
    ```
    After running `visudo`, uncomment the line that contains `%wheel`.

    ### Connecting to the internet
    Run the proper `wpa_supplicant` steps to set Wi-Fi or stuff you need. Then, register and start the needed services:
    ```sh
    sudo ln -s /etc/sv/dhcpcd /var/service/
    sudo ln -s /etc/sv/wpa_supplicant /var/service/
    $ sudo ln -s /etc/sv/dhcpcd /var/service/
    $ sudo ln -s /etc/sv/wpa_supplicant /var/service/
    ```
    By symlinking the services, runit will pick them up in the next five seconds and start them!
  20. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -11,10 +11,10 @@ User is `anon` and password is `voidlinux`.

    ### Connecting to the internet
    ```sh
    # cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    # wpa_passphrase <ssid> <passphrase> | tee -a /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    # sv restart dhcpcd
    # ip link set up <interface>
    % cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    % wpa_passphrase <ssid> <passphrase> | tee -a /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
    % sv restart dhcpcd
    % ip link set up <interface>
    ```

    ### Formatting disk
  21. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,8 @@
    User is `anon` and password is `voidlinux`.

    ### Setting keyboard layout
    ```bash
    # loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    ```zsh
    % loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    ```

    ### Connecting to the internet
  22. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    User is `anon` and password is `voidlinux`.

    ### Setting keyboard layout
    ```shell
    ```bash
    # loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    ```

  23. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    User is `anon` and password is `voidlinux`.

    ### Setting keyboard layout
    ```sh
    ```shell
    # loadkeys $(ls /usr/share/kbd/keymaps/i386/**/*.map.gz | grep br-abnt2)
    ```

  24. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 17 additions and 5 deletions.
    22 changes: 17 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -123,6 +123,10 @@ Then run the following commands:
    # dracut --force --hostonly --kver <kernel-version>
    # grub-mkconfig -o /boot/grub/grub.cfg
    # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    # xbps-install -S void-repo-nonfree
    # xbps-install -Su
    # xbps-install intel-ucode
    # echo 'early_microcode="yes"' >> /etc/dracut.conf.d/intel_ucode.conf
    # xbps-reconfigure -f linux<kernel-version-major.minor>
    # exit
    # exit
    @@ -136,9 +140,17 @@ Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/d
    ### Creating the main user and adding them to sudoers
    Log in as root
    ```sh
    xbps-install -S zsh
    usermod -m -G wheel -s $(which zsh) <username>
    passwd <username>
    visudo
    # xbps-install -S zsh
    # usermod -m -G wheel -s $(which zsh) <username>
    # passwd <username>
    # visudo
    ```
    After running `visudo`, uncomment the line that contains `%wheel`.
    After running `visudo`, uncomment the line that contains `%wheel`.

    ### Connecting to the internet
    Run the proper `wpa_supplicant` steps to set Wi-Fi or stuff you need. Then, register and start the needed services:
    ```sh
    sudo ln -s /etc/sv/dhcpcd /var/service/
    sudo ln -s /etc/sv/wpa_supplicant /var/service/
    ```
    By symlinking the services, runit will pick them up in the next five seconds and start them!
  25. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -130,4 +130,15 @@ Then run the following commands:
    # reboot
    ```

    Note: one can also add `quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`.
    Note: one can also add `splash quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`.

    ## Post-installation
    ### Creating the main user and adding them to sudoers
    Log in as root
    ```sh
    xbps-install -S zsh
    usermod -m -G wheel -s $(which zsh) <username>
    passwd <username>
    visudo
    ```
    After running `visudo`, uncomment the line that contains `%wheel`.
  26. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -90,7 +90,7 @@ Then:
    ```

    Then edit the file `/etc/rc.conf` to contain the following:
    ```config
    ```ini
    HOSTNAME="<hostname>"

    # Set RTC to UTC or localtime.
  27. @gbrlsnchs gbrlsnchs revised this gist Aug 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -90,7 +90,7 @@ Then:
    ```

    Then edit the file `/etc/rc.conf` to contain the following:
    ```conf
    ```config
    HOSTNAME="<hostname>"
    # Set RTC to UTC or localtime.
  28. @gbrlsnchs gbrlsnchs revised this gist Aug 12, 2019. 1 changed file with 21 additions and 4 deletions.
    25 changes: 21 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -91,16 +91,16 @@ Then:

    Then edit the file `/etc/rc.conf` to contain the following:
    ```conf
    HOSTNAME="<HOSTNAME>"
    HOSTNAME="<hostname>"
    # Set RTC to UTC or localtime.
    HARDWARECLOCK="UTC"
    # Set timezone, availables timezones at /usr/share/zoneinfo.
    TIMEZONE="America/Los_Angeles"
    TIMEZONE="America/Sao_Paulo"
    # Keymap to load, see loadkeys(8).
    KEYMAP="us"
    KEYMAP="br-abnt2"
    # Console font to load, see setfont(8).
    #FONT="lat9w-16"
    @@ -113,4 +113,21 @@ KEYMAP="us"
    # Kernel modules to load, delimited by blanks.
    #MODULES=""
    ```
    ```

    Then run the following commands:
    ```sh
    # echo 'GRUB_CMDLINE_LINUX="rd.luks=1 rd.luks.uuid=<luks-device-uuid>"' >> /etc/default/grub
    # echo 'add_dracutmodules+="crypt btrfs resume"' >> /etc/dracut.conf
    # echo 'tmpdir=/tmp' >> /etc/dracut.conf
    # dracut --force --hostonly --kver <kernel-version>
    # grub-mkconfig -o /boot/grub/grub.cfg
    # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck --debug
    # xbps-reconfigure -f linux<kernel-version-major.minor>
    # exit
    # exit
    # umount -R /mnt
    # reboot
    ```

    Note: one can also add `quiet` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`.
  29. @gbrlsnchs gbrlsnchs revised this gist Aug 12, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -33,8 +33,8 @@ Then:
    ```sh
    # mkfs.vfat -n boot -F 32 /dev/sda1
    # mkfs.ext2 -L GRUB /dev/sda2
    # cryptsetup luksFormat --type=luks -s=512 /dev/sda2
    # cryptsetup open /dev/sda2 cryptroot
    # cryptsetup luksFormat --type=luks -s=512 /dev/sda3
    # cryptsetup open /dev/sda3 cryptroot
    # mkfs.btrfs -L void /dev/mapper/cryptroot
    ```

  30. @gbrlsnchs gbrlsnchs revised this gist Aug 12, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -82,7 +82,7 @@ Then:
    # mount -t devpts pts /mnt/dev/pts
    # cp -L /etc/resolv.conf /mnt/etc/
    # cd /mnt
    # chroot /mnt
    # chroot /mnt /bin/bash
    # passwd root
    # chown root:root /
    # chmod 755 /