Check out my first novel, midnight's simulacra!

Arch: Difference between revisions

From dankwiki
(Created page with "After fifteen years of exclusively running Debian Linux in its [https://wiki.debian.org/DebianUnstable Unstable] ("sid") rolling configuration on Machines|my mach...")
 
No edit summary
Tags: mobile web edit mobile edit
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
After fifteen years of exclusively running [[Debian|Debian Linux]] in its [https://wiki.debian.org/DebianUnstable Unstable] ("sid") rolling configuration on [[Machines|my machines]], I converted my day-to-day laptop to Arch in March 2019 (my workstation remains Debian Unstable). The [[Lenovo]] T580 started life as "[https://www.youtube.com/watch?v=hCuMWrfXG4E uptowngirl]"; she was renamed "uptowngrimes" for the first pass at running Arch, and finally "[https://www.youtube.com/watch?v=Tv9YoYCKNoE grimes]" once I was ready to give Arch a real go. My primary motivations were the increasingly European and ossified nature of Debian, and the fact that the Arch wiki provided an increasing portion of the best content I was reading each day.
After fifteen years of exclusively running [[Debian|Debian Linux]] in its [https://wiki.debian.org/DebianUnstable Unstable] ("sid") rolling configuration on [[Machines|my machines]], I converted my day-to-day laptop to Arch in March 2019 (my workstation remains Debian Unstable). The [[Lenovo]] T580 started life as "[https://www.youtube.com/watch?v=hCuMWrfXG4E uptowngirl]"; she was renamed "uptowngrimes" for the first pass at running Arch, and finally "[https://www.youtube.com/watch?v=Tv9YoYCKNoE grimes]" once I was ready to give Arch a real go. My primary motivations were the increasingly European and ossified nature of Debian, and the fact that the Arch wiki provided a significant portion of the best content I was reading each day.


I dig it thus far!
I dig it thus far!
==AUR==
The [https://aur.archlinux.org/ Arch User Repository] allows random people to upload Arch packaging.  I maintain a [https://aur.archlinux.org/packages/?SeB=m&K=dankamongmen few packages in the AUR].
==Building custom kernel packages==
The [https://wiki.archlinux.org/index.php/Kernel/Arch_Build_System Arch Build System] page on the Arch Wiki purports to explain how to make custom kernel packages, but I've never found it very clear.
===One-time setup===
* Install the [https://www.archlinux.org/packages/extra/any/asp/ asp] package from the [https://www.archlinux.org/packages/?repo=Extra Extra] repository
* Run <tt>asp update linux</tt> followed by <tt>asp checkout linux</tt>
* You ought now have a directory <tt>linux</tt> with subdirectories <tt>repos</tt> and <tt>trunk</tt>
** in the future, run <tt>asp update</tt> in this directory
* Change the <tt>pkgbase</tt> field in <tt>PKGBUILD</tt>; I use <tt>linux-HOSTNAME</tt> where HOSTNAME is the name of that machine
* We're going to keep our kernel config in the newly-created directory. If you don't have one ready, use the current config:
** Insert the <tt>configs</tt> module if it's not loaded
** Inflate and copy the current config: <tt>zcat /proc/config.gz > config</tt>
* Add the following to <tt>PKGBUILD</tt>:
<pre>
  msg2 "Setting config from ../../../config..."
  cp ../../../config .config
  make oldconfig
  make menuconfig
  diff -ur ../../../config .config is
</pre>
Each time you build a new kernel, the preserved config will be copied into the source directory. <tt>make oldconfig</tt> will give you the opportunity to configure any new options. <tt>make menuconfig</tt> will then allow you to modify the kernel config. If this kernel config ends up different from the preserved config (it always will at least once, due to the version changing), the process will abort. Run <tt>cp src/archlinux-linux/.config ../config</tt> to preserve the new config. Once the config is no longer changing, the process can continue.
If you wish to avoid the lengthy build of documentation (it will otherwise dominate your total build time), remove <tt>$pkgbase-docs</tt> from the <tt>pkgname</tt> array.
===New kernel process===
* Edit <tt>PKGBUILD</tt> and change <tt>_pkgver</tt>, usually to a string of the form <tt>MAJOR.MINOR.PATCH.arch1</tt>
* Clear out any old packages and source: <tt>rm -rf *.xz src pkg</tt>
* Make your packages, updating the kernel config along the way (see above):
** <tt>MAKEFLAGS=-jNN makepkg -s</tt>, where NN is the number of parallel processes
** Remember, <tt>cp src/archlinux-linux/.config ../config</tt> to preserve the new config
* Install the new packages: <tt>pacman -U *.xz</tt>
===GPG keys===
If you're getting errors during verification of [[GPG]] signatures, you can use pacman's trusted keys. Add to your <tt>gpg.conf</tt>:
<tt>keyring /etc/pacman.d/gnupg/pubring.gpg</tt>
and then run (as specified at [https://wiki.archlinux.org/index.php/Pacman/Package_signing Package Signing]):
<pre>
pacman-key --init
pacman-key --populate archlinux
</pre>
If you then need a particular key, try e.g.:
<pre>pacman-key -r A5E9288C4FA415FA</pre>
and mark the key as trusted.

Latest revision as of 13:11, 6 February 2021

After fifteen years of exclusively running Debian Linux in its Unstable ("sid") rolling configuration on my machines, I converted my day-to-day laptop to Arch in March 2019 (my workstation remains Debian Unstable). The Lenovo T580 started life as "uptowngirl"; she was renamed "uptowngrimes" for the first pass at running Arch, and finally "grimes" once I was ready to give Arch a real go. My primary motivations were the increasingly European and ossified nature of Debian, and the fact that the Arch wiki provided a significant portion of the best content I was reading each day.

I dig it thus far!

AUR

The Arch User Repository allows random people to upload Arch packaging. I maintain a few packages in the AUR.

Building custom kernel packages

The Arch Build System page on the Arch Wiki purports to explain how to make custom kernel packages, but I've never found it very clear.

One-time setup

  • Install the asp package from the Extra repository
  • Run asp update linux followed by asp checkout linux
  • You ought now have a directory linux with subdirectories repos and trunk
    • in the future, run asp update in this directory
  • Change the pkgbase field in PKGBUILD; I use linux-HOSTNAME where HOSTNAME is the name of that machine
  • We're going to keep our kernel config in the newly-created directory. If you don't have one ready, use the current config:
    • Insert the configs module if it's not loaded
    • Inflate and copy the current config: zcat /proc/config.gz > config
  • Add the following to PKGBUILD:
  msg2 "Setting config from ../../../config..."
  cp ../../../config .config
  make oldconfig
  make menuconfig
  diff -ur ../../../config .config is 

Each time you build a new kernel, the preserved config will be copied into the source directory. make oldconfig will give you the opportunity to configure any new options. make menuconfig will then allow you to modify the kernel config. If this kernel config ends up different from the preserved config (it always will at least once, due to the version changing), the process will abort. Run cp src/archlinux-linux/.config ../config to preserve the new config. Once the config is no longer changing, the process can continue.

If you wish to avoid the lengthy build of documentation (it will otherwise dominate your total build time), remove $pkgbase-docs from the pkgname array.

New kernel process

  • Edit PKGBUILD and change _pkgver, usually to a string of the form MAJOR.MINOR.PATCH.arch1
  • Clear out any old packages and source: rm -rf *.xz src pkg
  • Make your packages, updating the kernel config along the way (see above):
    • MAKEFLAGS=-jNN makepkg -s, where NN is the number of parallel processes
    • Remember, cp src/archlinux-linux/.config ../config to preserve the new config
  • Install the new packages: pacman -U *.xz

GPG keys

If you're getting errors during verification of GPG signatures, you can use pacman's trusted keys. Add to your gpg.conf:

keyring /etc/pacman.d/gnupg/pubring.gpg

and then run (as specified at Package Signing):

pacman-key --init
pacman-key --populate archlinux

If you then need a particular key, try e.g.:

pacman-key -r A5E9288C4FA415FA

and mark the key as trusted.