From 31eed40cd55774ea3adec059571c10667532a74a Mon Sep 17 00:00:00 2001 From: dtb Date: Thu, 24 Nov 2022 22:04:46 -0500 Subject: [PATCH] touch up alpine bootstrapping process --- wiki/unix/alpine.m4 | 54 +++++++++++++++++++++++++++------------------ wiki/unix/fstab.m4 | 3 +-- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/wiki/unix/alpine.m4 b/wiki/unix/alpine.m4 index 58cbec8..cd65296 100644 --- a/wiki/unix/alpine.m4 +++ b/wiki/unix/alpine.m4 @@ -3,17 +3,44 @@ _header(`Alpine') Alpine Linux is a small Linux distribution based on musl libc. Its main purpose is to serve as a server distribution, however many have found use for it as a desktop distribution.

+ +_subheader(`apk(8)') _bibliography(` +_bentr(`_link(`Alpine Package Keeper', `https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper') (Alpine Wiki)') _bentr(`Alpine repositories content search') ') -_subheader(`_code(`WARNING: Ignoring [_italic(`path')]: UNTRUSTED signature')') +_subsubheader(`Repositories') +

+See _man(`apk-repositories(5)'). +

+

+Most Internet repositories use the URL scheme of _code(`https://[_italic(`server')]/alpine/[_italic(`release branch')]/[_italic(`repository branch')]'). +For example, the _italic(`main') repository branch on the _italic(`edge') release branch on the server _italic(`dl-cdn.alpinelinux.org') is _code(`http://dl-cdn.alpinelinux.org/alpine/edge/main'). +A repositories file could look like the following: +

+
+http://dl-cdn.alpinelinux.org/alpine/edge/main
+http://dl-cdn.alpinelinux.org/alpine/edge/community
+http://dl-cdn.alpinelinux.org/alpine/edge/testing
+
+

+Local directories like _file(`/media/cdrom/apks'), an example from the Alpine Wiki, are valid as well. +

+_subsubheader(`_code(`WARNING: Ignoring [_italic(`path')]: UNTRUSTED signature')') _bibliography(` -_bentr(_link(`ERROR: http://dl-4.alpinelinux.org/alpine/edge/testing: UNTRUSTED signature', `https://stackoverflow.com/questions/73374745/error-http-dl-4-alpinelinux-org-alpine-edge-testing-untrusted-signature')') +_bentr(`_link(`ERROR: http://dl-4.alpinelinux.org/alpine/edge/testing: UNTRUSTED signature', `https://stackoverflow.com/questions/73374745/error-http-dl-4-alpinelinux-org-alpine-edge-testing-untrusted-signature')') ')

If you are absolutely sure what you're doing is fine, _command(`apk [_italic(`command')] _em(`--allow-untrusted')'). This ignores the error and allows the operation to proceed.

+ +_subheader(`Always install manual pages') +

+Alpine doesn't include man pages in program packages to save on space, instead keeping them in _code(`[package]-doc') sibling packages. +To always install doc packages with program packages, _code(`apk add docs'). +

+ _subheader(`Bootstrapping')

Alpine's bootstrapping procedure is quite manual; you should probably use _program(`setup-alpine'). @@ -22,13 +49,7 @@ However, it is possible and quite easy to perform the steps manually.

  1. Copy over the contents of _file(`/etc/apk/keys') to _file(`/mnt/etc/apk/keys')
  2. -Add newline-delimited mirrors to _file(`/mnt/etc/apk/repositories'), such as these if you wish to use the _code(`edge') branch: -
    -http://dl-cdn.alpinelinux.org/alpine/edge/main
    -http://dl-cdn.alpinelinux.org/alpine/edge/community
    -http://dl-cdn.alpinelinux.org/alpine/edge/testing
    -
    -_code(`edge') may be replaced with a stable branch, the latest being _code(`v3.17') as of writing. +Fill out _man(`apk-repositories(5)') on the mount.
  3. Run _command(`apk --root /mnt add --initdb alpine-base'). @@ -36,18 +57,9 @@ This is an ordinary _man(`apk-add(8)') call; you may wish to install necessities

-Alpine does not have a _man(`chroot(1)') helper; you must manually do that with a one-liner such as -_code(`for i in dev proc sys; do mount -o bind "/$i" "/mnt/$i"; done; cp /etc/resolv.conf /mnt/etc/resolv.conf') -which you can chroot into. -

-

-After chrooting in, you must configure basics such as users, passwords, _man(`fstab(5)'), and the bootloader yourself. -

- -_subheader(`Always install manual pages') -

-Alpine doesn't include man pages in program packages to save on space, instead keeping them in _code(`[package]-doc') sibling packages. -To always install doc packages with program packages, _code(`apk add docs'). +Make sure to bind mount (_command(`mount -o bind')) _file(`/dev/'), _file(`/proc/'), and _file(`/sys/') to the corresponding locations on the bootstrap prefix +and copy _file(`/etc/resolv.conf') over before _ref(`#posix#chroot(1)')ing into the bootstrap directory and finalizing setup. +Remember to set up users, _ref(`#fstab(5)'), and the bootloader if necessary.

_subheader(`postmarketOS') diff --git a/wiki/unix/fstab.m4 b/wiki/unix/fstab.m4 index 65d4bc3..104bc4d 100644 --- a/wiki/unix/fstab.m4 +++ b/wiki/unix/fstab.m4 @@ -1,4 +1,3 @@ -_header(`fstab') -

See _man(`fstab(5)').

+_header(`fstab(5)')

postmarketOS requires that the _code(`localmount') OpenRC service be enabled for the system to read _man(`fstab(5)').

Arch and Artix have fstab generators at _man(`genfstab(8)') and _man(`fstabgen(8)') respectively in their installation scripts.