From ea4c5341d0842ad9d6b2531da3c5af06c14a6309 Mon Sep 17 00:00:00 2001
From: Woodpecker CI Here is a guide to installing Alice Linux on your computer using the chroot method. You can do this from your existing Linux distribution or from a live environment, such as Alice Live or another Linux distribution. Make sure your chosen environment has the necessary partitioning tools, filesystem tools, and extraction tools. Download the Alice rootfs tarball from the release page, along with its Download the Alice rootfs tarball from the release page, along with its Verify the checksum of the Alice rootfs tarball: Make sure it prints:
- Make sure it prints: Prepare the partition and filesystem of your choice. In this guide, I will use ext4 as an example.
- Prepare the partition and filesystem of your choice. In this guide, I will use Mount your created partition somewhere. In this guide, I will use /mnt/alice as the mount point.
- Mount your created partition somewhere. In this guide, I will use Extract the Alice rootfs into the mounted partition.
- Extract the Alice rootfs into the mounted partition. First, chroot into Alice. (Replace /mnt/alice with your chosen mount point.)
- First, chroot into Alice. (Replace Any further commands after this will be executed inside the Alice environment. Fetch the Alice packages repositories somewhere. I'll fetch them inside the /var/lib directory to keep the system clean.
- Once we have the repositories cloned, we need to configure First, we set Once we have the repositories cloned, we need to configure First, we set And use whats in And use whats in Next set Next set I'm also going to set I'm also going to set Next, we need to set the package's build scripts path (I'll call it Alice provides four (4) First, get the absolute path of the NOTE: USE TAB COMPLETION! After we have the path of our Alice provides two (2) I'm gonna use directory NOTE: All repo paths must be declared in the APKG_REPO variable, seperated by a single space. NOTE: All repo paths must be declared in the APKG_REPO variable, separated by a single space.
-After setting up our If the output appears, then we are good to go. Next, we will set up directories for First, create the directories:
- First, create the directories: Then add these paths to Then add these paths to Now run
+After setting up our Lets combine with If the output appears, then we are good to go. On the first install, we should upgrade the system first.
- NOTE: Use uppercase On the first install, we should upgrade the system first. Before we do, install development packages first. NOTE: use upppercase 'i' for solve dependencies, lowecase 'i' without solve dependencies. Now lets upgrade our system. NOTE: Use uppercase If you changed NOTE: Add the Before installing any additional packages, we need to install development packages.
- You can configure your own kernel from kernel.org or use the one provided by Alice.
NOTE: The provided kernel will take a lot of time to compile because many options are enabled. If you want to use Alice's kernel, just run:
- If you want to use Alice's kernel, just run: If your hardware requires firmware, install it using:
- If your hardware requires firmware, install it using: In this guide, I'm going to use In this guide, I'm going to use Then generate grub config:
- Then generate grub config: Change Change Change the partition and filesystem of your choice below:
- Change the partition and filesystem of your choice below: Alice uses busybox's Alice uses busybox's Install Alice
Get Alice rootfs tarball
-sha256sum file.
-sha256sum file.$ curl -O <url>
$ curl -O <url>.sha256sum
-$ sha256sum -c alicelinux-rootfs-20240525.tar.xz.sha256sum
alicelinux-rootfs-20240525.tar.xz: OK
Prepare the partition and filesystem
-ext4 as an example.
-# cfdisk /dev/sdX
# mkfs.ext4 /dev/sdXY
/mnt/alice as the mount point.# mkdir /mnt/alice
# mount /dev/sdXY /mnt/alice
Extract the Alice rootfs tarball
-$ tar xvf alicelinux-rootfs-*.tar.xz -C /mnt/alice
Enter chroot
-/mnt/alice with your chosen mount point)# /mnt/alice/usr/bin/apkg-chroot /mnt/alice
Clone Alice repos
-
-# cd /var/lib
-# git clone --depth=1 https://codeberg.org/emmett1/alicelinux
-apkg. apkg is Alice's package build system (or package manager). By default, Alice does not provide an apkg config file (yes, apkg can work without a config file), but we need to create one. The apkg config file should be located at /etc/apkg.conf by default. Let's create one. Configure apkg.conf
-CFLAGS and CXXFLAGS. Alice base packages are built using -O3 -march=x86-64 -pipe. You can use these settings or change them to your preference.
-apkg. apkg is Alice's package build system (or package manager). By default, Alice does not provide an apkg config file (yes, apkg can work without a config file), but we need to create one. The apkg config file should be located at /etc/apkg.conf by default. Let's create one. CFLAGS and CXXFLAGS. Alice base packages are built using -O3 -march=x86-64 -pipe. You can use these settings or change them to your preference.
-# echo 'export CFLAGS="-O3 -march=x86-64 -pipe"' >> /etc/apkg.conf
CFLAGS for CXXFLAGS.
-CFLAGS for CXXFLAGS.
-# echo 'export CXXFLAGS="$CFLAGS"' >> /etc/apkg.conf
MAKEFLAGS. I will use 6 for my 8 threads machine.
-MAKEFLAGS. I will use 6 for my 8 threads machine.
-# echo 'export MAKEFLAGS="-j6"' >> /etc/apkg.conf
NINJAJOBS here. Without it, ninja will use all threads of your machine when compiling.
-NINJAJOBS here. Without it, ninja will use all threads of your machine when compiling.# echo 'export NINJAJOBS="6"' >> /etc/apkg.conf
package repos) so apkg can find them. The APKG_REPO variable can accept multiple values for multiple package repos.package repos (at the time of this writing): core, extra, xorg and wayland. core contains all base packages, and extra includes other packages beyond the base. xorg and wayland contain packages for gui and their dependencies.package repos where we cloned them. By the way, we are still inside the /var/lib directory where we cloned the repo.
-
-
-# realpath alicelinux/repos/core
-/var/lib/alicelinux/repos/core
-# realpath alicelinux/repos/extra
-/var/lib/alicelinux/repos/extra
-package repos, add it to the APKG_REPO variable in /etc/apkg.conf.
-# echo 'APKG_REPO="/var/lib/alicelinux/repos/core /var/lib/alicelinux/repos/extra"' >> /etc/apkg.conf
+package repos (at the time of this writing): core and extra. core contains all base packages, and extra includes other packages beyond the base./var/lib/repos/core and /var/lib/repos/extra for core and extra repos respectively.
-# echo 'APKG_REPO="/var/lib/repos/core /var/lib/repos/extra"' >> /etc/apkg.conf
-package repos, make sure apkg can find the packages. We can use apkg -s <pattern> to search for packages.
-
-# apkg -s sway
-swayidle
-swaybg
-swaylock
-sway
-packages, sources, and work. By default, these directories are inside the package template, but we will change them to /var/cache/pkg, /var/cache/src, and /var/cache/work respectively. You can change these to any location where you want to store these files.
-# mkdir -p /var/cache/pkg
# mkdir -p /var/cache/src
# mkdir -p /var/cache/work
/etc/apkg.conf.
-/etc/apkg.conf.
+# echo 'APKG_PACKAGE_DIR=/var/cache/pkg' >> /etc/apkg.conf
# echo 'APKG_SOURCE_DIR=/var/cache/src' >> /etc/apkg.conf
# echo 'APKG_WORK_DIR=/var/cache/work' >> /etc/apkg.conf
Configure reposync.conf
+reposync is a tool to sync package templates from git repositories. Add remote repos for core and extra into /etc/reposync.conf. The format of remote repos in reposync.conf is <gitrepo>|<branch>|<localpath>.
+# echo 'https://codeberg.org/emmett1/alicelinux|core|/var/lib/repos/core' >> /etc/reposync.conf
+# echo 'https://codeberg.org/emmett1/alicelinux|extra|/var/lib/repos/extra' >> /etc/reposync.conf
+reposync to sync latest package templates.
+# reposync
+package repos, make sure apkg can find the packages. We can use apkg -s <pattern> to search for packages.
+# apkg -s sway
+swayidle
+swaybg
+swaylock
+sway
+-p flags to show path or package templates.
+# apkg -p $(apkg -s sway)
+/var/lib/repos/extra/sway
+/var/lib/repos/extra/swaylock
+/var/lib/repos/extra/swaybg
+/var/lib/repos/extra/swayidle
+Full system upgrade/rebuild
-U for a system upgrade, and lowercase u to upgrade a specific package of your choice.
+# apkg -I meson cmake pkgconf libtool automake perl
+
+
+# apkg -U
U for a system upgrade, and lowercase u to upgrade a specific package of your choice.CFLAGS and CXXFLAGS to something other than the default, it's a good time to perform a full rebuild first. In this case, you can skip upgrading the system because performing a full rebuild will already use the latest version in package repos.# apkg -u $(apkg -a)
+
--f flag to force rebuild of existing prebuilt package.
NOTE: apkg -a prints all installed packages on the system.
-# apkg -u $(apkg -a)
-Install development packages
-# apkg -I meson cmake pkgconf libtool automake perl
-Install kernel
-# apkg -I linux
Install firmware
-# apkg -I linux-firmware linux-firmware-nvidia
+# apkg -I linux-firmware
Install bootloader
-grub as the bootloader. Install grub:
-grub as the bootloader. Install grub:
-# apkg -I grub
# grub-install /dev/sdX
# grub-mkconfig -o /boot/grub/grub.cfg
Hostname
-alice to the hostname of your choice.
-alice to the hostname of your choice.# echo alice > /etc/hostname
Fstab
-# echo '/dev/sda1 swap swap defaults 0 1' >> /etc/fstab
# echo '/dev/sda2 / ext4 defaults 0 0' >> /etc/fstab
Enable runit services
-runit as its main service manager. Enable the required services:
-runit as its main service manager. Enable the required services:# ln -s /etc/sv/tty1 /var/service
# ln -s /etc/sv/tty2 /var/service
# ln -s /etc/sv/tty3 /var/service
@@ -230,56 +209,45 @@ NOTE: apkg -a prints all installed packages on the system.
/etc/sv/<service> to /var/service to enable it; remove the symlink to disable it.
Add your user: -
+Add your user:
# adduser <user>
-Add your user to the wheel group:
-
Add your user to the wheel group:
# adduser <user> wheel
-You might need to add your user to the input and video groups to start the Wayland compositor later, and the audio group to have working audio:
-
You might need to add your user to the input and video groups to start the Wayland compositor later, and the audio group to have working audio:
# adduser <user> input
# adduser <user> video
# adduser <user> audio
Set the password for the root user:
-
Set the password for the root user:
# passwd
You might want to set up networking before rebooting. Use wpa_supplicant and dhcpcd.
-
You might want to set up networking before rebooting. Use wpa_supplicant and dhcpcd.
# apkg -I wpa_supplicant dhcpcd
-Configure your SSID: -
+Configure your SSID:
# wpa_passphrase <YOUR SSID> <ITS PASSWORD> >> /etc/wpa_supplicant.conf
-Enable the service: -
+Enable the service:
# ln -s /etc/sv/wpa_supplicant /var/service
# ln -s /etc/sv/dhcpcd /var/service
Install tzdata:
-
Install tzdata:
# apkg -I tzdata
-Then create a symlink for your timezone to /etc/localtime:
-
Then create a symlink for your timezone to /etc/localtime:
# ln -s /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
-Alternatively, you can copy it and then uninstall tzdata to keep your installed packages minimal:
-
Alternatively, you can copy it and then uninstall tzdata to keep your installed packages minimal:
# cp /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
# apkg -r tzdata
Exit the chroot environment and unmount the Alice partition, then reboot: -
+Exit the chroot environment and unmount the Alice partition, then reboot:
# exit
# umount /mnt/alice
# reboot
--
cgit v1.2.3