Installation guide

This guide will tell how to install PineCone GNU/Linux on a system with legacy BIOS and MBR partitioning table. The process is similar to Gentoo or Arch Linux — you must be comfortable with the command line.

IMPORTANT WARNING: The following steps will purge all data on the target disk. Make sure you backed up any important data before continuing.

Requirements

Step 1: Prepare the disk (MBR / BIOS)

We will use cfdisk to create an MBR partition table and the following partitions:

Why VFAT for /boot? GRUB works perfectly with FAT32, and it can be useful for compatibility with some firmware. If you prefer ext4, you can use a regular Linux partition instead. :)
  1. Identify your target disk with lsblk and use it instead of /dev/sda in this tutorial. (e.g., /dev/sda).
  2. Run cfdisk /dev/sda.
  3. Select dos (MBR) label type if prompted.
  4. Delete any existing partitions.
  5. Create a new partition of size 1 GiB – set its type to Hidden W95 FAT (type code 1b or 1c).
  6. Create an optional swap partition – size 4 GiB (or equal to your RAM if you plan to hibernate). Set its type to Linux swap.
  7. Create a new partition with the remaining space – type Linux filesystem.
  8. Write the partition table and exit cfdisk.

Step 2: Format the partitions

# Format the boot partition as FAT32
mkfs.vfat -F 32 /dev/sda1

# (Optional) Initialize swap
mkswap /dev/sda2
swapon /dev/sda2

# Format the root partition as ext4
mkfs.ext4 /dev/sda3

Step 3: Mount the partitions and download the rootfs

# Mount the root partition
mount /dev/sda3 /mnt

# Create the /boot directory and mount the boot partition
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

# Download the latest rootfs
cd /mnt
wget https://github.com/PineCone-GNU-Linux/rootfs/releases/download/RootFS-alpha/rootfs.tar.gz

Step 4: Extract the rootfs

tar -xvf rootfs.tar.gz -C /mnt

Step 5: Chroot into the new system

Before chrooting, mount the virtual filesystems:

mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys

Then chroot:

chroot /mnt /bin/bash

Step 6: Compile the kernel

The rootfs already contains the source code of the linux-hardened kernel in /usr/src. Navigate to the kernel source directory:

cd /usr/src/linux-hardened-*

Configure the kernel (you can use the included config or run make menuconfig to adjust settings for your hardware):

make menuconfig

Compile the kernel and modules (use -j$(nproc) to speed up):

make -j$(nproc)

Install the modules and the kernel image:

make modules_install
cp arch/x86/boot/bzImage /boot/vmlinuz
Note: If you are using an initramfs, you need to generate it with mkinitcpio or dracut. The rootfs does not include one by default. For a simple setup, you can skip the initramfs if your root filesystem is not encrypted or on exotic hardware.

Step 7: Install and configure GRUB

# Install GRUB using XBPS (fetches from Void Linux repositories)
xbps-install -S grub

# Install GRUB to the disk's MBR
grub-install --target=i386-pc /dev/sda

# Generate the GRUB configuration
grub-mkconfig -o /boot/grub/grub.cfg

Step 8: Basic system configuration

Create the fstab file to define mount points at boot. Edit /etc/fstab and add the following lines (adjust partition numbers if necessary):

/dev/sda3   /         ext4    defaults        0 1
/dev/sda1   /boot     vfat    defaults        0 2
/dev/sda2   none      swap    sw              0 0

Set the hostname:

echo "pinecone" > /etc/hostname

Set the root password:

passwd

Create a regular user (replace username with your desired name):

useradd -m -G wheel -s /bin/bash username
passwd username

If you want sudo access, install it and edit the sudoers file:

xbps-install -S sudo
visudo

Uncomment the line %wheel ALL=(ALL) ALL to allow members of the wheel group to use sudo.

Step 9: Final steps and reboot

Exit the chroot, unmount all partitions, and reboot:

exit
umount -R /mnt
reboot

After reboot, log in with your user (or root) and enjoy PineCone GNU/Linux!

Alternative: GPT / UEFI installation

If your system supports UEFI and you want to use a GPT partition table, follow this guide instead of the MBR/BIOS one.

IMPORTANT WARNING: These steps will erase all data on the target disk. Back up important files before proceeding.

Step 1: Prepare the disk (GPT / UEFI)

Use cfdisk to create a GPT partition table and the following partitions:

cfdisk /dev/sda

Step 2: Format the partitions

# Format the ESP as FAT32
mkfs.fat -F 32 /dev/sda1

# (Optional) Initialize swap
mkswap /dev/sda2
swapon /dev/sda2

# Format the root partition as ext4
mkfs.ext4 /dev/sda3

Step 3: Mount the partitions and download rootfs

mount /dev/sda3 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi

cd /mnt
wget https://github.com/PineCone-GNU-Linux/rootfs/releases/download/RootFS-alpha/rootfs.tar.gz

Step 4: Extract the rootfs and chroot

tar -xvf rootfs.tar.gz -C /mnt

mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt /bin/bash

Step 5: Compile the kernel

Same as in the MBR/BIOS section (see above).

Step 6: Install and configure GRUB for UEFI

Install GRUB (UEFI version) and the efibootmgr utility:

xbps-install -S grub-x86_64-efi efibootmgr

Install GRUB to the EFI System Partition:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=PineCone

Generate the GRUB configuration:

grub-mkconfig -o /boot/grub/grub.cfg

Step 7: Basic system configuration

Create /etc/fstab with the following content (adjust partition numbers if needed):

/dev/sda3   /         ext4    defaults        0 1
/dev/sda1   /boot/efi vfat    defaults        0 2
/dev/sda2   none      swap    sw              0 0

Set hostname, root password, create a user (same as in MBR/BIOS section).

Step 8: Reboot

exit
umount -R /mnt
reboot

After reboot, your system will boot via UEFI directly into PineCone Linux.

Note: Some firmware may require you to disable Secure Boot or manually add the boot entry. If GRUB does not appear, run efibootmgr -v from the live environment to check entries.

Useful links