diff --git a/arch.yaml b/arch.yaml index a37d6b9..2648183 100644 --- a/arch.yaml +++ b/arch.yaml @@ -1,103 +1,197 @@ -track: "https://git.ruds.io/rs2009/blendOS-tracks/raw/branch/main/core-arch.yaml" +track: "base" + +modules: + - name: exec + run: | + for cmd in "$@"; do + bash -s <<< "$cmd" + done + + - name: pacman-install + run: | + pacman -Syqu --noconfirm "$@" || pacman -Syqu --noconfirm "$@" + + - name: pacman-remove + run: | + pacman -Rcns --noconfirm "$@" + + - name: systemctl-enable + run: | + systemctl enable "$@" + + - name: systemctl-user-enable + run: | + systemctl --global enable "$@" stages: - module: pacman-install inputs: - - "alsa-utils" - - "amd-ucode" - - "b43-fwcutter" - - "base-devel" - - "grep" - - "gzip" - - "iproute2" - - "iputils" - - "pciutils" - - "procps-ng" - - "psmisc" - - "sed" - - "shadow" - - "tar" - - "util-linux" - - "xz" - - "bash" - - "bash-completion" - - "bind" - - "brltty" - - "broadcom-wl" - - "btrfs-progs" - - "cryptsetup" - - "dhclient" - - "dmidecode" - - "dnsmasq" - - "dosfstools" - - "e2fsprogs" - - "efibootmgr" - - "espeakup" - - "exfatprogs" - - "f2fs-tools" - - "fatresize" - - "gpart" - - "gptfdisk" - - "grub" - - "hdparm" - - "hyperv" - - "intel-ucode" - - "irssi" - - "less" - - "lshw" - - "libfido2" - - "libusb-compat" - - "power-profiles-daemon" - - "fwupd" - - "man-db" - - "man-pages" - - "mc" - - "mdadm" - - "memtest86+" - - "modemmanager" - - "mtools" - - "nano" - - "nbd" - - "ndisc6" - - "nfs-utils" - - "nilfs-utils" - - "ntfs-3g" - - "noto-fonts" - - "noto-fonts-cjk" - - "noto-fonts-emoji" - - "noto-fonts-extra" - - "openconnect" - - "openssh" - - "openvpn" - - "python-pyclip" - - "xclip" - - "xsel" - - "os-prober" - - "parted" - - "partimage" - - "pcsclite" - - "ppp" - - "pptpclient" - - "pv" - - "rsync" - - "smartmontools" - - "sof-firmware" - - "squashfs-tools" + - "jq" + - "git" - "sudo" - - "syslinux" - - "tcpdump" - - "tpm2-tss" - - "udftools" - - "usb_modeswitch" - - "usbmuxd" - - "usbutils" - - "vpnc" - - "wireless-regdb" - - "wireless_tools" - - "wpa_supplicant" - - "wvdial" - - "xfsprogs" - - "xl2tpd" - - "bluez" + - "grub" + - "nano" + - "dracut" + - "skopeo" + - "umoci" + - "pacman-contrib" - "networkmanager" - - "cups" + - "python" + - "python-yaml" + - "python-click" + - "python-requests" + - "python-fasteners" + + - module: systemctl-enable + inputs: + - NetworkManager + + - module: exec + inputs: + - | + if [[ "$BASE_KERNEL" != none ]]; then + pacman -Syqu --noconfirm "$BASE_KERNEL" "$BASE_KERNEL"-headers linux-firmware + fi + + if [[ "$BASE_EXTRAS" == desktop ]]; then + pacman -Syqu --noconfirm cups bluez + systemctl enable --now cups bluetooth + fi + + if [[ "$BASE_USE_IWD" == y ]]; then + pacman -Syqu --noconfirm iwd + mkdir -p /etc/NetworkManager/conf.d + cat <<'EOF' >/etc/NetworkManager/conf.d/wifi_backend.conf + [device] + wifi.backend=iwd + EOF + fi + + if [[ "$BASE_NVIDIA" != 'nvidia-open' ]]; then + pacman -Syqu --noconfirm nvidia-open + fi + + - | + groupadd -r sudo &>/dev/null || : + groupadd -r wheel &>/dev/null || : + mkdir -p /etc/sudoers.d + cat > /etc/sudoers.d/00sudo_wheel </dev/null + cd /usr/lib/modules + kernels=(*) + cp "${kernels[0]}"/vmlinuz /boot/vmlinuz-"${kernels[0]}" + - dracut --force --regenerate-all + +override: + - path: /var/lib/pacman + keep: new + immutable: true + + - path: /etc/pacman.conf + keep: new + immutable: true + + - path: /var/cache/blendOS + keep: old + +needs-update: + - | + [ "$(checkupdates | wc -l)" -gt 0 ] + +auto-update: + enabled: false + +distro-config: + initialise: | + set -e + + mkdir -p /var/cache/blendOS/pacman/pkg + + mkdir -m 0755 -p ./var/{cache/blendOS,lib/pacman,log} ./{dev,run,etc/pacman.d} + mkdir -m 1777 -p ./tmp + mkdir -m 0555 -p ./{sys,proc} + + cat <<'EOF' >./etc/pacman.conf + [options] + HoldPkg = pacman glibc + Architecture = auto + CheckSpace + ParallelDownloads = 5 + CacheDir = /var/cache/blendOS/pacman/pkg/ + SigLevel = Never + LocalFileSigLevel = Never + RemoteFileSigLevel = Never + + EOF + + if [[ "$BASE_ARCH_REPO" != default ]]; then + cat <>./etc/pacman.conf + [core] + Server = $BASE_ARCH_REPO + + [extra] + Server = $BASE_ARCH_REPO + + [multilib] + Server = $BASE_ARCH_REPO + EOF + else + cat <<'EOF' >>./etc/pacman.conf + [core] + Server = https://fastly.mirror.pkgbuild.com/$repo/os/$arch + Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch + Server = https://ftpmirror.infania.net/mirror/archlinux/$repo/os/$arch + Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch + + [extra] + Server = https://fastly.mirror.pkgbuild.com/$repo/os/$arch + Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch + Server = https://ftpmirror.infania.net/mirror/archlinux/$repo/os/$arch + Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch + + [multilib] + Server = https://fastly.mirror.pkgbuild.com/$repo/os/$arch + Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch + Server = https://ftpmirror.infania.net/mirror/archlinux/$repo/os/$arch + Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch + EOF + fi + + mount --bind /var/cache/blendOS ./var/cache/blendOS + + pacman -Sy --config ./etc/pacman.conf --cachedir ./var/cache/blendOS/pacman/pkg -r . --needed --noconfirm base + + ln -sfn usr/lib64 ./lib64 + ln -sfn usr/sbin ./sbin + + cp /etc/locale.gen ./etc + cp /etc/locale.conf ./etc + + finalise: | + umount -l ./var/cache/blendOS || : + +env: + BASE_ARCH_REPO: "default" + BASE_KERNEL: "linux" + BASE_EXTRAS: "desktop" + BASE_USE_IWD: "y" + BASE_NVIDIA: "none" + BASE_AKSHARA_REPO: "https://git.ruds.io/rs2009/akshara" + BASE_AKSHARA_REPO_COMMIT: "f17c272b659b9641f2e921bd4c6523ca3dd1cdb5" diff --git a/core-arch.yaml b/core-arch.yaml deleted file mode 100644 index 7bd793e..0000000 --- a/core-arch.yaml +++ /dev/null @@ -1,127 +0,0 @@ -track: "base" - -modules: - - name: exec - run: | - for cmd in "$@"; do - bash -s <<< "$cmd" - done - - - name: pacman-install - run: | - pacman -Syqu --noconfirm "$@" || pacman -Syqu --noconfirm "$@" - - - name: pacman-remove - run: | - pacman -Rcns --noconfirm "$@" - -stages: - - module: pacman-install - inputs: - - "jq" - - "git" - - "sudo" - - "grub" - - "nano" - - "linux" - - "linux-firmware" - - "dracut" - - "skopeo" - - "umoci" - - "pacman-contrib" - - "python" - - "python-yaml" - - "python-click" - - "python-requests" - - "python-fasteners" - - - module: exec - inputs: - - | - git clone --revision 8579f58f68893c2baaafc21764e9f61d1fb35c45 --depth 1 https://git.ruds.io/rs2009/akshara /akshara - cd /akshara - cp -a usr/lib/akshara /usr/lib/akshara - cp -a usr/lib/dracut/modules.d/10akshara /usr/lib/dracut/modules.d/10akshara - cp usr/bin/akshara /usr/bin/akshara - - rm -rf /akshara - -post-stages: - - module: exec - inputs: - - locale-gen - - | - rm -f /boot/* &>/dev/null - cd /usr/lib/modules - kernels=(*) - cp "${kernels[0]}"/vmlinuz /boot/vmlinuz-"${kernels[0]}" - - dracut --force --regenerate-all - -override: - - path: /var/lib/pacman/ - keep: new - - - path: /etc/pacman.conf - keep: new - - - path: /var/cache/blendOS/ - keep: old - -needs-update: - - | - [ "$(checkupdates | wc -l)" -gt 0 ] - -auto-update: - enabled: false - -distro-config: - initialise: | - set -e - - mkdir -p /var/cache/blendOS/pacman/pkg - - mkdir -m 0755 -p ./var/{cache/blendOS,lib/pacman,log} ./{dev,run,etc/pacman.d} - mkdir -m 1777 -p ./tmp - mkdir -m 0555 -p ./{sys,proc} - - cat <<'EOF' >./etc/pacman.conf - [options] - HoldPkg = pacman glibc - Architecture = auto - CheckSpace - ParallelDownloads = 5 - CacheDir = /var/cache/blendOS/pacman/pkg/ - SigLevel = Never - LocalFileSigLevel = Never - RemoteFileSigLevel = Never - - [core] - Server = https://fastly.mirror.pkgbuild.com/$repo/os/$arch - Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch - Server = https://ftpmirror.infania.net/mirror/archlinux/$repo/os/$arch - Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch - - [extra] - Server = https://fastly.mirror.pkgbuild.com/$repo/os/$arch - Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch - Server = https://ftpmirror.infania.net/mirror/archlinux/$repo/os/$arch - Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch - - [multilib] - Server = https://fastly.mirror.pkgbuild.com/$repo/os/$arch - Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch - Server = https://ftpmirror.infania.net/mirror/archlinux/$repo/os/$arch - Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch - EOF - - mount --bind /var/cache/blendOS ./var/cache/blendOS - - pacman -Sy --config ./etc/pacman.conf --cachedir ./var/cache/blendOS/pacman/pkg -r . --needed --noconfirm base - - ln -sfn usr/lib64 ./lib64 - ln -sfn usr/sbin ./sbin - - cp /etc/locale.gen ./etc - cp /etc/locale.conf ./etc - - finalise: | - umount -l ./var/cache/blendOS || : diff --git a/kubuntu.yaml b/kubuntu.yaml new file mode 100644 index 0000000..ca883d2 --- /dev/null +++ b/kubuntu.yaml @@ -0,0 +1,4 @@ +track: "https://git.ruds.io/rs2009/blendOS-tracks/raw/branch/main/ubuntu.yaml" + +env: + BASE_IMAGE_NAME: docker://ghcr.io/rudraswat/ubuntu-rolling-plasma:main diff --git a/oci.yaml b/oci.yaml index de41d9d..170906f 100644 --- a/oci.yaml +++ b/oci.yaml @@ -54,4 +54,4 @@ distro-config: umount -l ./var/cache/blendOS &>/dev/null || : env: - IMAGE_NAME: "" + BASE_IMAGE_NAME: "" diff --git a/ubuntu.yaml b/ubuntu.yaml index 5345f9b..753dc91 100644 --- a/ubuntu.yaml +++ b/ubuntu.yaml @@ -22,7 +22,7 @@ stages: - module: exec inputs: - | - git clone --revision 8579f58f68893c2baaafc21764e9f61d1fb35c45 --depth 1 https://git.ruds.io/rs2009/akshara /akshara + git clone --revision "$BASE_AKSHARA_REPO_COMMIT" --depth 1 "$BASE_AKSHARA_REPO" /akshara cd /akshara cp -a usr/lib/akshara /usr/lib/akshara cp -a usr/lib/dracut/modules.d/10akshara /usr/lib/dracut/modules.d/10akshara @@ -36,20 +36,25 @@ post-stages: - dracut --force --regenerate-all override: - - path: /var/lib/dpkg/ + - path: /var/lib/dpkg keep: new + immutable: true - - path: /var/lib/apt/ + - path: /var/lib/apt keep: new - path: /etc/apt/sources.list keep: new + immutable: true - - path: /etc/apt/sources.list.d/ + - path: /etc/apt/sources.list.d keep: new + immutable: true - - path: /var/cache/blendOS/ + - path: /var/cache/blendOS keep: old env: - IMAGE_NAME: docker://ghcr.io/rudraswat/ubuntu-rolling-gnome:main + BASE_IMAGE_NAME: docker://ghcr.io/rudraswat/ubuntu-rolling-gnome:main + BASE_AKSHARA_REPO: "https://git.ruds.io/rs2009/akshara" + BASE_AKSHARA_REPO_COMMIT: "f17c272b659b9641f2e921bd4c6523ca3dd1cdb5"