~whynothugo/dotfiles

ref: 38b900dc12ae810eda071e6fd1e4f25db6bb3a2a dotfiles/packages/whynothugo-bootloader/PKGBUILD -rw-r--r-- 2.3 KiB
38b900dc — Hugo Osvaldo Barrera nvim: Add borders to hover float windows 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Hugo Osvaldo Barrera <hugo@whynothugo.nl>

pkgname=whynothugo-bootloader
pkgver=7
pkgrel=1
pkgdesc="Set up bootloader with secureboot."
arch=("x86_64" "aarch64")
depends=("systemd" "sbctl" "systemd-boot-pacman-hook")
source=(
  "gencmdline"
  "70-sign-bootctl.hook"
  "linux.conf"
  "linux.preset"
  "linux-asahi.conf"
  "linux-asahi.preset"
  "arch.conf"
  "loader.conf"
  "bundles.db"
)
sha256sums=(
  "SKIP"
  "30a4057e87fbcc1a8eeef13b1589293ba88df0fbde5ab1ef6c48ae162336d66b"
  "3cd8498b2548b9c33f33e23a648bd7954acf2081f62469a59ad3bb14ef802c25"
  "280950068970b7c25321a8929f5967809bc4bf01c818e405278f30986c669a80"
  "52fa2bbba9ce65770513721726563955deb4497e8f742c7d26033cfb8188042c"
  "fbedf04ccffd60ff060d150d5957e315cb3f87af23f83c1eabe360a2f78d1970"
  "6f7c9738c4bd29d8587b99ec1c53a39adf2b42487eda49462c23c2502120f9b8"
  "b6cf78ec465f5253341f57c702b731a371dd4b4f0ab4c74b4dd462134aeeafb0"
  "3ad0564faf19a99a664947edd34b98393a07a69f77f5bc896d2262c341aa914b"
)
install="whynothugo-bootloader.install"

package() {
  install -dm 0755 "$pkgdir/etc/kernel/cmdline.d/"
  install -Dm 0744 "$srcdir/gencmdline" "$pkgdir/usr/bin/gencmdline"
  install -Dm 0644 "$srcdir/70-sign-bootctl.hook" "$pkgdir/usr/share/libalpm/hooks/70-sign-bootctl.hook"

  if [ $CARCH = "x86_64" ]; then
    install -Dm 0644 "$srcdir/linux.conf" "$pkgdir/etc/mkinitcpio.d/linux.conf"
    install -Dm 0644 "$srcdir/linux.preset" "$pkgdir/etc/mkinitcpio.d/linux.preset"

    # Configure sbctl(8) to generate signed UEFI bundles.
    install -Dm 0644 "$srcdir/bundles.db" "$pkgdir/usr/share/secureboot/bundles.db"
  elif [ $CARCH = "aarch64" ]; then
    install -Dm 0644 "$srcdir/linux-asahi.conf" "$pkgdir/etc/mkinitcpio.d/linux-asahi.conf"
    install -Dm 0644 "$srcdir/linux-asahi.preset" "$pkgdir/etc/mkinitcpio.d/linux-asahi.preset"

    # XXX: Can't get UEFI bundles to work on this architecture yet.
    # The bundle on this platform MUST specify rd.luks.uuid= and root=, but
    # there's something else that makes that process fail. In the meantime, use
    # a config file in the ESP. The bundle is not critical until there's
    # SecureBoot support anyway.
    install -Dm 644 "$srcdir/arch.conf" "$pkgdir/boot/efi/loader/entries/arch.conf"
    install -Dm 644 "$srcdir/loader.conf" "$pkgdir/boot/efi/loader/loader.conf"
  else
    print "Unsupported architecture"
    exit 2
  fi
}