Arch Linux

From Leo's Notes
Last edited on 30 December 2021, at 02:25.

PXE

If you already have a PXE server, create a new entry that boots their iPXE kernel:

cd /tftpboot/images/ArchLinux/
wget https://releng.archlinux.org/pxeboot/ipxe.lkrn

The default config (or the config your computer boots off of) should contain:

LABEL ArchLinux
	MENU LABEL ArchLinux
        kernel /images/ArchLinux/ipxe.lkrn

You can customize the kernel to automate installs.

Installation

The PXE rom that you can download from ArchLinux's website points iPXE to fetch PXE data from a remote HTTP server, http://releng.archlinux.org/pxeboot/boot/cfg/. The PXE configs will then boot the live image from one of the many available mirrors that is selected in the boot menu.

Remastering

Side Note: You may alter the iPXE script to use a different server by recompiling the iPXE kernel and automate the install process by appending to the airoot customize script.

pacman -S archiso
cp -r /usr/share/archiso/configs/releng /root
# edit relang/airootfs/root/custom*
./build.sh -v


mkarchiso -w work/x86_64 -C work/pacman.conf -D arch init
arch-chroot work/x86_64/airootfs mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img
mksquashfs work/airootfs.img work/iso/arch/x86_64/airootfs.sfs -noappend -comp xz -no-progress

Steps

After booting into the live image, you need to:

  1. Read the install.txt file
  2. Create a file system
  3. Mount the file system to /mnt
  4. Run pacstrap /mnt/base
  5. Generate fstab genfstab -p /mnt >> /mnt/etc/fstab
  6. Chroot into the new system arch-chroot /mnt
  7. Set the hostname echo "hostname" >> /etc/hostname
  8. Set the timezone ln -sf /usr/share/zoneinfo/America/Edmonton /etc/localtime
  9. Locales
    • Comment out any locales you want in /etc/locale.gen
    • Run locale-gen
  10. Set the default locale echo LANG=\"en_US.UTF-8\" > /etc/locale.conf
  11. Set up networking configs ??
  12. Console font /etc/vconsole.conf
    • echo KEYMAP=\"us\" > /etc/vconsole.conf
    • echo FONT=\"latarcyrheb-sun16\" >> /etc/vconsole.conf
  13. Rebuild ram disk mkinitcpio -p linux
  14. Set the root password passwd
  15. Install a bootloader
    • pacman -Sy grub
    • grub-install --target=i386-pc --recheck /dev/sda
    • grub-mkconfig -o /boot/grub/grub.cfg


Reboot and hope it works.

Networking

You may use systemd to configure the network

/etc/systemd/network

Create a file named wired.network with:

[Match]
Name=eno1

[Network]
DHCP=v4

You may need to get a list of all network interfaces using:

networkctl list | tail -n+2 | head -n+2 | grep -v loopback | awk '{print $2}'


Building Packages

Install the base-devel package group.

To build packages, create a PKGBUILD script. Run this as a non-root user.

makepkg -p buildscript.pkgbuild

'Converting' RPM to an ArchLinux package

Install the rpmextract package.

Use the spec to pkgbuild script to convert the RPM SPEC files to a packagebuild script.

Creating a repository

Creating a repository is very simple and comprises of making a directory which contains a database file with a bunch of packages.

  1. Create a new directory
  2. Copy all packages to the directory
  3. Run: {{code|repo-add reponame.db.tar.gz *.xz

Use the URL to the directory as the repository location. Make sure that the reponame matches that of the database.

Package List

gnome-desktop nvidia-304xx-libgl 
lightdm lightdm-gtk-greeter 

qt

dmidecode

accountsservices

salt-zmq


Mirroring

rsync -rtlH --delete-after --exclude='*i686*' --delay-updates --copy-links --safe-links --max-delete=1000 --progress rsync://mirror.csclub.uwaterloo.ca/archlinux/community .

See:

Troubleshooting

DNS not resolving

For some stupid reason, Arch Linux has this in nsswitch.conf:

hosts: files mymachines myhostname resolve [!UNAVAIL=return] dns

As a result, nothing resolves right. nslookup works, but when you try pinging or accessing the host, it doesn't resolve. Why is it like this?!

Fix this by setting hosts entry to files dns mymachines