libvirt-iso-cachyos-bin

LOW
maintainer RubenKelevra 0 votes scanned 2026-09-22 05:36:56.274624
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: @RubenKelevra <rubenkelevra@gmail.com>
2
3_pkgname='cachyos'
4_profile='desktop'
5pkgname="libvirt-iso-${_pkgname}-bin"
6pkgver=260809
7pkgrel=1
8pkgdesc='Official CachyOS desktop installation ISO for libvirt'
9arch=('x86_64')
10url='https://cachyos.org/'
11license=('LicenseRef-Various')
12checkdepends=(
13 'libarchive'
14 'squashfs-tools'
15)
16_iso="${_pkgname}-${_profile}-linux-${pkgver}.iso"
17_base_url='https://cdn77.cachyos.org/ISO'
18source=(
19 "${_iso}::${_base_url}/${_profile}/${pkgver}/${_iso}"
20 "${_iso}.sig::${_base_url}/${_profile}/${pkgver}/${_iso}.sig"
21 'DISTRIBUTION-LICENSE'
22)
23noextract=("${_iso}")
24sha256sums=(
25 '959f6577f45e25ee9fd8c220fd221b08e4ea79412c7315c0f922dd6d86d5e33c'
26 'SKIP'
27 '360daceb5db049402207e21a780c03c0695947a06a02ee9da195afe4ccc258cd'
28)
29validpgpkeys=('882DCFE48E2051D48E2562ABF3B607488DB35A47')
30
31_install_payload() {
32 local root="${1:?missing package root}"
33 local image_dir="${root}/var/lib/libvirt/images"
34
35 install -Dm644 -- "${srcdir}/${_iso}" "${image_dir}/${_iso}"
36 ln -s -- "${_iso}" "${image_dir}/${_pkgname}-${CARCH}.iso"
37 install -Dm644 -- "${srcdir}/DISTRIBUTION-LICENSE" \
38 "${root}/usr/share/licenses/${pkgname}/LICENSE"
39}
40
41_check_payload() {
42 local root="${1:?missing package root}"
43 local check_owner="${2:-false}"
44 local image_path="${root}/var/lib/libvirt/images/${_iso}"
45 local image_link="${root}/var/lib/libvirt/images/${_pkgname}-${CARCH}.iso"
46 local license_path="${root}/usr/share/licenses/${pkgname}/LICENSE"
47 local manifest
48
49 [[ -f "${image_path}" ]] || return 1
50 [[ -L "${image_link}" ]] || return 1
51 [[ "$(readlink -- "${image_link}")" == "${_iso}" ]] || return 1
52 [[ -f "${license_path}" ]] || return 1
53 [[ "$(stat -c '%a' -- "${image_path}")" == '644' ]] || return 1
54 [[ "$(stat -c '%a' -- "${license_path}")" == '644' ]] || return 1
55 [[ -z "$(find "${root}" -name '*.sig' -print -quit)" ]] || return 1
56
57 manifest="$(find "${root}" \( -type f -o -type l \) -printf '%P\n' | sort)"
58 [[ "${manifest}" == "$(printf '%s\n' \
59 "usr/share/licenses/${pkgname}/LICENSE" \
60 "var/lib/libvirt/images/${_iso}" \
61 "var/lib/libvirt/images/${_pkgname}-${CARCH}.iso")" ]] || return 1
62
63 if [[ "${check_owner}" == 'true' ]]; then
64 [[ "$(stat -c '%u:%g' -- "${image_path}")" == '0:0' ]] || return 1
65 [[ "$(stat -c '%u:%g' -- "${license_path}")" == '0:0' ]] || return 1
66 [[ "$(stat -c '%u:%g' -- "${image_link}")" == '0:0' ]] || return 1
67 fi
68}
69
70check() {
71 local iso="${srcdir}/${_iso}"
72 local iso_listing="${srcdir}/check-iso-list"
73 local squashfs="${srcdir}/check-airootfs.sfs"
74 local squashfs_hash_file="${srcdir}/check-airootfs.sha512"
75 local squashfs_root="${srcdir}/check-squashfs-root"
76 local package_root="${srcdir}/check-package-root"
77 local image_size
78 local pvd_type
79 local pvd_magic
80 local pvd_version
81 local volume_sectors
82 local expected_version
83 local actual_version
84 local expected_squashfs_hash
85 local expected_squashfs_name
86 local actual_squashfs_hash
87 local required_path
88
89 printf '%s\n' 'check: ISO size and ISO9660 header'
90 image_size="$(stat -Lc '%s' -- "${iso}")" || return 1
91 (( image_size > 0 && image_size % 2048 == 0 )) || return 1
92
93 pvd_type="$(od -An -tu1 -j $((16 * 2048)) -N1 -- "${iso}" | tr -d ' ')" || return 1
94 pvd_magic="$(dd if="${iso}" bs=1 skip=$((16 * 2048 + 1)) count=5 status=none)" || return 1
95 pvd_version="$(od -An -tu1 -j $((16 * 2048 + 6)) -N1 -- "${iso}" | tr -d ' ')" || return 1
96 volume_sectors="$(od -An -tu4 -j $((16 * 2048 + 80)) -N4 -- "${iso}" | tr -d ' ')" || return 1
97
98 [[ "${pvd_type}" == '1' ]] || return 1
99 [[ "${pvd_magic}" == 'CD001' ]] || return 1
100 [[ "${pvd_version}" == '1' ]] || return 1
101 (( volume_sectors > 0 && volume_sectors * 2048 == image_size )) || return 1
102
103 printf '%s\n' 'check: file(1) ISO and bootability'
104 file -L --brief -- "${iso}" | grep -Fq 'ISO 9660' || return 1
105 file -L --brief -- "${iso}" | grep -Fq 'bootable' || return 1
106
107 printf '%s\n' 'check: ISO directory and required CachyOS files'
108 bsdtar -tf "${iso}" > "${iso_listing}" || return 1
109 for required_path in \
110 "arch/boot/${CARCH}/vmlinuz-linux-cachyos" \
111 "arch/boot/${CARCH}/initramfs-linux-cachyos.img" \
112 "arch/${CARCH}/airootfs.sfs" \
113 "arch/${CARCH}/airootfs.sha512" \
114 'arch/pkglist.x86_64.txt' \
115 'arch/version' \
116 'EFI/BOOT/BOOTx64.EFI'; do
117 grep -Fxq -- "${required_path}" "${iso_listing}" || return 1
118 done
119
120 expected_version="20${pkgver:0:2}.${pkgver:2:2}.${pkgver:4:2}"
121 actual_version="$(bsdtar -xOf "${iso}" arch/version)" || return 1
122 [[ "${actual_version}" == "${expected_version}" ]] || return 1
123
124 printf '%s\n' 'check: full ISO read'
125 bsdtar -xOf "${iso}" > /dev/null || return 1
126
127 printf '%s\n' 'check: SquashFS checksum and full decompression'
128 bsdtar -xOf "${iso}" "arch/${CARCH}/airootfs.sha512" > "${squashfs_hash_file}" || return 1
129 read -r expected_squashfs_hash expected_squashfs_name < "${squashfs_hash_file}" || return 1
130 [[ "${expected_squashfs_hash}" =~ ^[0-9a-f]{128}$ ]] || return 1
131 [[ "${expected_squashfs_name}" == 'airootfs.sfs' ]] || return 1
132
133 bsdtar -xOf "${iso}" "arch/${CARCH}/airootfs.sfs" > "${squashfs}" || return 1
134 actual_squashfs_hash="$(sha512sum -- "${squashfs}" | awk '{print $1}')" || return 1
135 [[ "${actual_squashfs_hash}" == "${expected_squashfs_hash}" ]] || return 1
136
137 rm -rf -- "${squashfs_root}"
138 unsquashfs -no-xattrs -d "${squashfs_root}" "${squashfs}" > /dev/null || return 1
139 [[ -f "${squashfs_root}/usr/lib/os-release" ]] || return 1
140 [[ "$(cat -- "${squashfs_root}/etc/version-tag")" == "${pkgver}" ]] || return 1
141 [[ "$(cat -- "${squashfs_root}/etc/edition-tag")" == "${_profile}" ]] || return 1
142
143 printf '%s\n' 'check: staged package payload'
144 rm -rf -- "${package_root}"
145 _install_payload "${package_root}"
146 _check_payload "${package_root}"
147}
148
149package() {
150 _install_payload "${pkgdir}"
151 _check_payload "${pkgdir}" true
152}
153

Scan history

Scanned at (UTC)SeverityRules
2026-09-22 05:36:56 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion