Manual install

The manual install performs the same steps as the installer: it creates a GPT disk, an EFI System Partition and a btrfs filesystem with @ and @home, unpacks the stage tarball, and runs scram boot to write the menu.

Run these commands as root. /dev/vda is the disk, and everything on it is erased.

1. Live medium

# ls /sys/firmware/efi
# ip addr
# loadkeys fi

2. Disk

# wipefs -af /dev/vda
# printf 'label: gpt\n,512M,U\n,,L\n' | sfdisk /dev/vda
# mkfs.vfat -F32 -n URANIUMESP /dev/vda1
# mkfs.btrfs -L uranium /dev/vda2

See partitioning notes.

Encrypted root

Run this in place of the mkfs.btrfs command above, and use /dev/mapper/uranium-root where the next block has /dev/vda2.

# cryptsetup luksFormat /dev/vda2
# cryptsetup open /dev/vda2 uranium-root
# mkfs.btrfs -L uranium /dev/mapper/uranium-root

Subvolumes

# mount /dev/vda2 /mnt
# btrfs subvolume create /mnt/@
# btrfs subvolume create /mnt/@home
# umount /mnt
# mount -o noatime,subvol=@ /dev/vda2 /mnt
# mkdir -p /mnt/home /mnt/boot /mnt/run/scram/top
# mount -o noatime,subvol=@home /dev/vda2 /mnt/home
# mount /dev/vda1 /mnt/boot
# mount -o subvolid=5 /dev/vda2 /mnt/run/scram/top

3. Stage

# cd /mnt
# curl -fLO https://github.com/uranium-os/uranium-os.github.io/releases/download/0.1.1/uranium-stage-0.1.1.tar.xz
# curl -fLO https://uranium-os.github.io/downloads/uranium-stage-0.1.1.tar.xz.sha256
# sha256sum -c uranium-stage-0.1.1.tar.xz.sha256
# tar xpf uranium-stage-0.1.1.tar.xz --numeric-owner
# rm uranium-stage-0.1.1.tar.xz*
# cd /

4. Chroot

# mount --rbind /dev /mnt/dev
# mount -t proc proc /mnt/proc
# mount --rbind /sys /mnt/sys
# cp /etc/resolv.conf /mnt/etc/resolv.conf
# chroot /mnt /usr/bin/env -i HOME=/root TERM=$TERM \
      PATH=/rod/bin:/rod/profile/bin:/rod/init/bin /rod/profile/bin/bash -l

5. Configuration

[chroot] # cat > /etc/fstab <<EOF
LABEL=uranium     /      btrfs  noatime,subvol=@      0 0
LABEL=uranium     /home  btrfs  noatime,nodev,nosuid,subvol=@home  0 0
LABEL=URANIUMESP  /boot  vfat   umask=0077,nodev,nosuid,noexec            0 2
EOF
[chroot] # echo box > /etc/hostname
[chroot] # printf '127.0.0.1 localhost box\n::1 localhost\n' > /etc/hosts
[chroot] # ln -sf /rod/profile/share/zoneinfo/Europe/Helsinki /etc/localtime
[chroot] # echo fi > /etc/keymap
[chroot] # passwd root
[chroot] # adduser -D -s /rod/profile/bin/bash -G wheel ann
[chroot] # passwd ann
[chroot] # ln -s /etc/sv/sshd /etc/service/sshd

The last line is optional. The stage enables getty-tty1, getty-ttyS0, dhcp, ntpd, crond and autoframe.

6. Boot menu

The stage ships /etc/cmdline with the hardening arguments slab_nomerge vsyscall=none debugfs=off randomize_kstack_offset=on, and scram boot adds them to every entry. Any extra kernel arguments must be written there first. For an encrypted root, add uranium.luks=UUID= followed by the UUID that blkid /dev/vda2 prints.

[chroot] # scram apply
[chroot] # scram frame -m "fresh install" install
[chroot] # scram boot
[chroot] # ls /boot/EFI/BOOT

By hand

scram boot copies three files and writes one.

[chroot] # mkdir -p /boot/uranium /boot/EFI/BOOT
[chroot] # cp -L /rod/profile/boot/vmlinuz /rod/profile/boot/initrd /boot/uranium/
[chroot] # cp -L /rod/profile/share/limine/BOOTX64.EFI /boot/EFI/BOOT/
[chroot] # cat > /boot/limine.conf <<EOF
timeout: 3
serial: yes

/UraniumOS
    protocol: linux
    path: boot():/uranium/vmlinuz
    module_path: boot():/uranium/initrd
    cmdline: root=LABEL=uranium rw console=tty0 console=ttyS0,115200 slab_nomerge vsyscall=none debugfs=off randomize_kstack_offset=on
EOF

7. Packages

[chroot] # rod +s
[chroot] # rod +i @tools

8. Reboot

[chroot] # exit
# umount -R /mnt/dev /mnt/proc /mnt/sys
# umount -R /mnt
# reboot

Your own kernel

[chroot] # vi /rod/recipes/linux-uranium.config
[chroot] # rod +i linux-uranium

See kernel.

Problems