diff options
252 files changed, 3066 insertions, 7790 deletions
diff --git a/.editorconfig b/.editorconfig index 7bc540f..6ef3c82 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,6 +16,10 @@ charset = utf-8 indent_style = space indent_size = 4 max_line_length = 120 +# for shfmt +switch_case_indent = true +binary_next_line = true + [*.{yml,yaml}] end_of_line = lf @@ -32,3 +36,6 @@ trim_trailing_whitespace = true charset = utf-8 indent_style = space indent_size = 2 + +[Makefile] +indent_style = tab @@ -3,5 +3,10 @@ parabolaiso-*.tar.gz* work/ out/ *.iso +*.img +*.cer +*.crt +*.key +*.pem user-data meta-data diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..2c099c2 --- /dev/null +++ b/.mailmap @@ -0,0 +1,17 @@ +Aaron Griffin <aaron@archlinux.org> <aaronmgriffin@gmail.com> +Chandan Singh <cks071g2@gmail.com> chandan <cks071g2@gmail.com> +Charles Vejnar <ce@vejnar.org> Charles <ce@vejnar.org> +Christopher Brannon <cmbrannon79@gmail.com> <cmbrannon@cox.net> +David P. <megver83@parabola.nu> <megver83@hyperbola.info> +David Runge <dvzrv@archlinux.org> <dave@sleepmap.de> +Eli Schwartz <eschwartz@archlinux.org> Eli Schwartz via arch-releng <arch-releng@archlinux.org> +Francois Dupoux <fdupoux@users.sourceforge.net> fdupoux <fdupoux@users.sourceforge.net> +Gerardo Exequiel Pozzi <vmlinuz386@gmail.com> <vmlinuz386@yahoo.com.ar> +James Sitegen <jamesm.sitegen@gmail.com> jamesm-sitegen <jamesm.sitegen@gmail.com> +Keshav Amburay <the.ridikulus.rat@gmail.com> Keshav P R <the.ridikulus.rat@gmail.com> +Martin Damian Fernandez <martin.damian.fernandez@gmail.com> martindamianfernandez <martin.damian.fernandez@gmail.com> +Michael Vorburger <mike@vorburger.ch> Michael Vorburger.ch <mike@vorburger.ch> +Sean Enck <enckse@voidedtech.com> Sean Enck via arch-releng <arch-releng@archlinux.org> +Simo Leone <simo@archlinux.org> <leone.simo@gmail.com> +Sven-Hendrik Haase <svenstaro@gmail.com> <sh@lutzhaase.com> +Yu Li-Yu <afg984@gmail.com> Li-Yu Yu via arch-releng <arch-releng@archlinux.org> diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..75aca74 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,11 @@ +# Suggest explicitly using -n in `[ $var ]` +enable=avoid-nullary-conditions + +# Suggest 'command -v' instead of 'which' +enable=deprecate-which + +# Suggest quoting variables without metacharacters +enable=quote-safe-variables + +# Require [[ and warn about [ in Bash/Ksh +enable=require-double-brackets diff --git a/AUTHORS.rst b/AUTHORS.rst index 9dc5520..f3da577 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -2,36 +2,60 @@ Archiso Authors =============== +* 2hexed <2hexed@protonmail.com> * Aaron Griffin <aaron@archlinux.org> * Adam Purkrt <adam@purkrt.net> * Alexander Epaneshnikov <aarnaarn2@gmail.com> +* Alexander Speshilov <speshuric@gmail.com> +* Anton Hvornum <anton@hvornum.se> +* Antonio V <crazysnob@live.it> * Chandan Singh <cks071g2@gmail.com> * Charles Vejnar <ce@vejnar.org> * Christian Hesse <mail@eworm.de> * Christopher Brannon <cmbrannon79@gmail.com> * Dan McGee <dan@archlinux.org> +* Darren Ng <un1gfn@gmail.com> * David Runge <dvzrv@archlinux.org> * David Thurstenson <thurstylark@gmail.com> * Dieter Plaetinck <dieter@plaetinck.be> * Eli Schwartz <eschwartz@archlinux.org> +* Eric Toombs <567-ewtoombs@users.noreply.gitlab.archlinux.org> * Florian Pritz <bluewind@xinu.at> +* Francois Dupoux <fdupoux@users.sourceforge.net> * Gerardo Exequiel Pozzi <vmlinuz386@gmail.com> * Gerhard Brauer <gerbra@archlinux.de> +* Giancarlo Razzolini <grazzolini@archlinux.org> +* Howard Hicks <deimosian@gmail.com> * James Sitegen <jamesm.sitegen@gmail.com> +* Jonathan Liu <net147@gmail.com> +* Jonathon Fernyhough <jonathon@m2x.dev> * Justin Kromlinger <hashworks@archlinux.org> * Keshav Amburay <the.ridikulus.rat@gmail.com> +* Kristian Klausen <kristian@klausen.dk> * Loui Chang <louipc.ist@gmail.com> * Lukas Fleischer <archlinux@cryptocrack.de> * Martin Damian Fernandez <martin.damian.fernandez@gmail.com> +* Michael Gilchrist <michaelgilch@gmail.com> * Michael Vorburger <mike@vorburger.ch> +* Pellegrino Prevete <pellegrinoprevete@gmail.com> * Pierre Schmitz <pierre@archlinux.de> * Sean Enck <enckse@voidedtech.com> * Simo Leone <simo@archlinux.org> +* Simon Wilper <sxw@chronowerks.de> +* Sorin Pânca <sorin.panca@gmail.com> * Steffen Bönigk <boenki@gmx.de> * Sven-Hendrik Haase <svenstaro@gmail.com> * Thomas Bächler <thomas@archlinux.org> +* Tobias Powalowski <tpowa@archlinux.org> +* Tom Yan <tom.ty89@gmail.com> * Yu Li-Yu <afg984@gmail.com> +* Zig Globulin <zig@zigsystem.com> +* hayao <hayao@fascode.net> +* mono wock <aaronleemorrison@protonmail.com> * nl6720 <nl6720@gmail.com> +* plain linen <bcdedit@hotmail.com> +* shivanandvp <shivanandvp.oss@gmail.com> +* weltio weltio <weltio@web.de> * Øyvind Heggstad <heggstad@gmail.com> =================== @@ -39,11 +63,11 @@ Parabolaiso Authors =================== * Andreas Grapentin <andreas@grapentin.org> -* André Fabian Silva Delgado <emulatorman@parabola.nu> +* André Fabian Silva Delgado <emulatorman@hyperbola.info> * David P <megver83@parabola.nu> * Drtan Samos <drtan@lavabit.com> * Esteban Carnevale <alfplayer@mailoo.org> * Jorge Lopez <jorginho@riseup.net> * bill-auger <mr.j.spam.me@gmail.com> * chandan <cks071g2@gmail.com> -* Márcio Alexandre Silva Delgado <coadde@parabola.nu> +* Márcio Alexandre Silva Delgado <coadde@hyperbola.info> diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6b3ae8b..b2f9dc3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,490 @@ Changelog ######### +[XX] - YYYY-MM-DD +================= + +Added +----- + +Changed +------- + +Deprecated +---------- + +Fixed +----- + +Removed +------- + +[74] - 2023-12-21 +================= + +Added +----- + +- Add bcachefs-tools to releng for access to bcachefs userspace tools. +- Add tftp as a valid protocol for downloading automated boot script. + +Changed +------- + +- Set ``RequiredForOnline=routable`` in systemd-networkd configuration files to improve the chances that the network + really is *online* when ``network-online.target`` is reached. + +Fixed +----- + +- Add missing replacement for the UUID variable in systemd-boot configuration files on ISO 9660. + +[73] - 2023-09-29 +================= + +Added +----- + +- Add bolt to releng for authorizing and otherwise managing Thunderbolt and USB4 devices. +- Add ``uefi-ia32.systemd-boot.esp`` and ``uefi-ia32.systemd-boot.eltorito`` boot modes that use systemd-boot for IA32 + UEFI. The boot modes of baseline and releng are not changed. +- Add GRUB configuration file ``/boot/grub/loopback.cfg`` to the releng and baseline profiles. It sets the necessary + boot parameters required for booting the ISO image as a file on a file system. + +Fixed +----- + +- Add ``/etc/localtime`` to the baseline profile to ensure the ISO can be booted successfully without triggering + questions from systemd-firstboot. + +[72] - 2023-08-29 +================= + +Added +----- + +- Add tpm2-tools to releng to allow clearing, creating and reading keys on the TPM. +- Add sequoia-sq and openpgp-card-tools as additional tooling for working with OpenPGP certificates and smartcards. + +Changed +------- + +- Moved custom ``mkinitcpio.conf`` files to ``/etc/mkinitcpio.conf.d/parabolaiso.conf``. +- Mount ``/etc/pacman.d/gnupg`` on tmpfs with option ``noswap`` instead of using ramfs. This ensures there is a limit to + the file system size. +- Enable systemd-networkd's support for IPv6 Privacy Extensions globally instead of per-connection. +- Moved custom ``sshd_config`` files to ``/ssh/sshd_config.d/10-parabolaiso.conf`` +- Use pcsclite for interfacing with smartcards, since both gnupg and opgpcard support it. + +Fixed +----- + +- Sign the root file system image only once. +- Make sure xorriso does not read its configuration files to prevent interference and unintended behavior. + +[71] - 2023-05-28 +================= + +Added +----- + +- Added classes for Memtest86+ and UEFI Shell menuentries. +- Add foot-terminfo and wezterm-terminfo packages to releng to support terminal emulators using them. E.g. when + installing via SSH. +- Add a new ``-r`` option to ``mkparabolaiso`` that deletes the working directly after the build. +- Add support for mDNS announce and resolve. + +Changed +------- + +- Increase EROFS compression for the baseline profile by using an extreme LZMA compression level and enabling the + experimental compressed fragments and data deduplication features. +- Identify the ISO volume via a UUID instead of a file system label in all boot loader configuration files. +- Update ``pacman.conf`` to match the one shipped with pacman 6.0.2-7 (from Arch) which removes the community repository. + +Fixed +----- + +- Wait for ``network-online.target`` to become active before trying to download the script passed via the ``script=`` + boot parameter. +- Subdirectories from ``grub/`` are copied to the ISO. +- Modify the commandline options to a ``cp`` command in ``mkparabolaiso`` so that the entire script does not exit with + failure when a custom ``.bashrc`` file is supplied with the parabolaiso configuration. This fix was needed after + **GNU Coreutils** recently changed the behaviour of the ``-n`` (or ``--no-clobber``) commandline option to the ``cp`` + command. +- Ensure ``SOURCE_DATE_EPOCH`` is read from the ``build_date`` file before ``profiledef.sh`` is sourced to ensure the + variable has a correct value when used inside ``profiledef.sh``. + + +[70] - 2023-02-27 +================= + +Added +----- + +- Support *file system transposition* to simplify boot medium preparation for UEFI boot via extracting the ISO image + contents to a drive. ``grub.cfg`` does not hardcode the ISO volume label anymore, instead GRUB will search for volume + with a ``/boot/grub/YYYY-mm-dd-HH-MM-SS-00.uuid`` file on it. +- Preload GRUB's NTFS modules for UEFI that allegedly have native NTFS support. GRUB's exFAT and UDF modules are also + preloaded in case someone finds them useful. + +Changed +------- + +- Identify the ISO volume via a UUID instead of a file system label to avoid collisions of multiple ISOs created in the + same month. +- Honor ``SOURCE_DATE_EPOCH`` in the ``date`` command used by ``profiledef.sh`` of the shipped profiles. +- Do not duplicate ``grub.cfg`` in both ISO 9660 and the EFI system partition / El Torito image. GRUB will search for + the ISO volume and load the ``grub.cfg`` from there. +- Moved GRUB files on ISO 9660 from ``/EFI/BOOT/`` to a boot-platform neutral place ``/boot/grub/``. This does not apply + to the EFI binaries that remain in the default/fallback boot path. +- Move ``grubenv`` to ``/boot/grub/grubenv`` on ISO 9660 so that it is together with the rest of GRUB-specific files. + Additionally write more variables in it. The previous ``/${install_dir}/grubenv`` (``/parabola/grubenv`` for releng) + is deprecated and a future parabolaiso release will not create this file anymore. +- Moved syslinux directory from ``/syslinux/`` to ``/boot/syslinux/`` to keep most boot loader files in ``/boot/``. +- Update ``README.transfer`` documentation and convert it to reStructuredText. +- Use ``console`` as grub's ``terminal_output``, as ``gfxterm`` leads to a blank screen on some hardware. + +Removed +------- + +- Do not place memtest86+ in netboot artifacts. + +[69] - 2022-12-24 +================= + +Added +----- + +- Add Memtest86+ to x86_64 UEFI GRUB boot menu. + +Changed +------- + +- Check if the GPG public key file was successfully placed in the work directory before trying to use it. +- Open the file descriptors for code signing certificates and GPG public key as read only. Nothing from the within the + ``pacstrap`` invoked chroot should ever be allowed to write outside of it. +- Error out early if any of the code signing certificate files passed with option ``-c`` do not exist. +- Use LZMA compressed EROFS image for the baseline profile. Now that xz 5.4 is out and erofs-utils is built with LZMA + support, using a higher compression is possible. +- Add ``/etc/machine-id`` with special value ``uninitialized``. The final id is generated at boot time, and systemd's + first-boot mechanim (see ``First Boot Semantics`` in ``machine-id(5)``) applies. No functional change unless that + ``ConditionFirstBoot=yes`` is true and passive unit ``first-boot-complete.target`` activates for ordering. + +[68] - 2022-10-30 +================= + +Changed +------- + +- Do not explicitly enable ``qemu-guest-agent.service`` as it will be started by a udev rule. +- Remove existing signature (``.sig``) files and do not sign them when signing netboot artifacts. This is mostly + applicable when re-running ``mkparabolaiso`` after a failure. +- Replace ``parabolaiso_kms`` with ``kms`` in ``mkinitcpio.conf``. The hook is available in mkinitcpio since version 32. + +[67] - 2022-09-25 +================= + +Added +----- + +- The ability to generate rootfs signatures using openssl CMS module if ``-c`` is given. + +Changed +------- + +- Order ``pacman-init.service`` before ``archlinux-keyring-wkd-sync.service`` since + ``archlinux-keyring-wkd-sync.service`` needs an initialized pacman keyring. +- Order ``pacman-init.service`` after ``time-sync.target`` since ``pacman-init.service`` may otherwise create local + signatures that are not valid on target systems after installation. + +[66] - 2022-08-28 +================= + +Added +----- + +- Add ``efibootimg`` to ``mkarchiso`` to abstract the FAT image path. +- Unset ``LANGUAGE`` since ``LC_ALL=C.UTF-8``, unlike ``LC_ALL=C``, does not override ``LANGUAGE``. +- Copy all files from the ``grub`` directory to ISO9660 and the FAT image, not just only ``grub.cfg``. +- Touching ``/usr/lib/clock-epoch`` to to help ``systemd`` with screwed or broken RTC. + +Changed +------- + +- Disable GRUB's shim_lock verifier and preload more modules. This allows reusing the GRUB EFI binaries when repacking + the ISO to support Secure Boot with custom signatures. + +[65] - 2022-06-30 +================= + +Added +----- + +- Configure the locale for the baseline profile to ``C.UTF-8`` so that a UTF-8 locale is used. +- Add ``uefi-x64.grub.esp`` and ``uefi-x64.grub.eltorito`` boot mode to support x86_64 UEFI boot on x86_64 machines. +- Use ``mkfs.erofs``'s ``ztailpacking`` option in the baseline profile to reduce the image size. + +Changed +------- + +- Change the releng profile's locale from ``en_US.UTF-8`` to ``C.UTF-8``. +- Set ``LC_ALL`` to ``C.UTF-8`` instead of ``C`` in mkparabolaiso since it is now available and non-UTF-8 locales should be + avoided. + +Removed +------- + +- Remove the custom pacman hook that ran ``locale-gen`` on glibc install from the releng profile. The used locale now + ships with the glibc package itself. +- Remove "Copy to RAM" boot entries since the ``parabolaiso`` mkinitcpio hook enables it automatically when there is enough + free RAM. +- Drop parabolaiso rEFInd support in favor of upstream archiso GRUB EFI bootmode. + +[64] - 2022-05-30 +================= + +Added +----- + +- Add ``uefi-ia32.grub.esp`` boot mode to support IA32 UEFI boot on x86_64 machines. +- Add GRUB configuration files to profiles. +- Add accessible ``copytoram`` entry. +- Enable beeps in systemd-boot menu. + +Changed +------- + +- Fix systemd-boot menu entry sorting by using the ``sort-key`` option. + +[63] - 2022-04-30 +================= + +Added +----- + +- Add dmidecode to the list of packages in the releng profile. +- Add open-iscsi to the list of packages in the releng profile to allow installing Parabola on an iSCSI target. +- Add hyperv to the list of packages and enable its services to provide better integration with the + Hyper-V hypervisor. + +Changed +------- + +- Mount /etc/pacman.d/gnupg on ramfs instead of tmpfs to ensure its contents never land in swap. +- Configure reflector to return only mirrors that support both IPv4 and IPv6. + +[62.1] - 2022-04-05 +=================== + +Removed +------- + +- Easter egg + +[62] - 2022-03-31 +================= + +Changed +------- + +- Fix the PXE support. PXELINUX was having trouble finding the kernel and initrds. Now, archiso forces syslinux to + interpret all TFTP paths as absolute. That seems to have solved the issue. +- Disable systemd-gpt-auto-generator, which we do not need, in both baseline and releng profiles. It avoids the error + message about it failing during boot. +- Register qemu-arm-static if it is not already, rather than suggesting installing an extra package. + +[61] - 2022-01-31 +================= + +Added +----- + +- Add documentation to systemd-networkd configuration files +- Add information about the use of changelog and merge requests to the contributing guidelines + +Changed +------- + +- Fix an issue where mkparabolaiso is failing to raise an error when the ``mmd`` and ``mcopy`` commands are not found +- Fix an issue where the architecture detection in mkparabolaiso fails due to an unset ``arch`` variable in the profile + +Removed +------- + +[60] - 2021-12-28 +================= + +Added +----- + +Changed +------- + +- Show a more descriptive message when no code signing certificate is used + +Removed +------- + +- Remove unused parabolaiso_shutdown hook from the releng profile's mkinitcpio config + +[59] - 2021-11-30 +================= + +Added +----- + +- Add mailmap file for easier author integration with git +- Add grub and refind to the package list of the releng profile + +Changed +------- + +- Replace use of date with printf +- Silence command output more efficiently when using --quiet +- Modify curl call to retry up to ten times before giving up on downloading an automated script + +Removed +------- + +- Remove requirement on setting a Boot mode when building a netboot image + +[58] - 2021-08-25 +================= + +Added +----- + +- Add support for ``gpg``'s ``--sender`` option +- Add armv7h support for bootstrap buildmode + +Changed +------- + +- Change the way ``mkarchiso`` uses ext4 images to copying files to it directly instead of mounting (this action now + does not require elevated privileges anymore) +- Add version files when using ``netboot`` buildmode as well +- Update the sshd configuration to be compatible with openssh 8.7p1 +- Overhaul the used ``gpg`` options +- Fix use of potentially unbound variables +- Refactor the validation functions to have fewer large functions and less code duplication +- Borrow some code from librechroot to correctly validate binfmt +- Do not check if qemu-user-static is installed, just check for qemu-user-static-binfmt as it will pull it as dependency + +Removed +------- + +- Remove all files related to ``mkinitcpio`` integration, as they now live in + https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio-archiso + +[57] - 2021-07-30 +================= + +Added +----- + +- Add a missing line in the systemd-networkd-wait-online.service in the baseline profile + +Changed +------- + +- Adapt systemd-networkd configuration to systemd ≥ 249 +- Improve documentation in ``mkparabolaiso`` and systemd-networkd related configuration files +- Fix an issue that may prevent continuing an aborted build of the ``netboot`` or ``iso`` buildmode + +Removed +------- + +- Remove SPDX license identifier from files that are not eligible for copyright (e.g. configuration files) + +[56.1] - 2021-07-11 +=================== + +Added +----- + +Changed +------- + +- Fix an issue with the unsetting of environment variables before using pacstrap/arch-chroot +- Remove termite-terminfo from the releng profile's list of packages (it is not in the official repositories nymore) +- Set LC_ALL instead of LANG + +[56] - 2021-07-01 +================= + +Added +----- + +- Add pacman >= 6 compatible configuration +- Add documentation for the `script` boot parameter + +Changed +------- + +- Clear environment variables before working in chroot +- Update Arch Wiki URLs +- Pass SOURCE_DATE_EPOCH to chroot +- Enable parallel downloads in profile pacman configurations + +[55] - 2021-06-01 +================= + +Added +----- + +- Add integration for pv when using the copytoram boot parameter so that progress on copying the image to RAM is shown +- Add experimental support for EROFS by using it for the rootfs image in the baseline profile + +Changed +------- + +- Change information on IRC channel, as Parabola GNU/Linux-libre moved to Libera Chat +- Fix a regression, that would prevent network interfaces to be configured under certain circumstances +- Update releases maintainer information + +[54] - 2021-05-13 +================= + +Added +----- + +- Add the concept of buildmodes to mkparabolaiso, which allows for building more than the default .iso artifact + (sequentially) +- Add support to mkparabolaiso and both baseline and releng profiles for building a bootstrap image (a compressed + bootstrapped Parabola GNU/Linux-libre environment), by using the new buildmode `bootstrap` +- Add support to mkparabolaiso and both baseline and releng profiles for building artifacts required for netboot with iPXE + (optionally allowing codesigning on the artifacts), by using the new buildmode `netboot` +- Add qemu-guest-agent to the releng profile and enable their services by default to allow interaction between hypervisor + and virtual machine if the installation medium is booted in a virtualized environment + +Changed +------- + +- Always use the .sig file extension when signing the rootfs image, as that is how mkinitcpio-parabolaiso expects it +- Fix for run_parabolaiso scripts to be compatible with QEMU >= 6.0 +- Install all implicitly installed packages explicitly for the releng profile +- Install keyrings more generically when using pacman-init.service + +[53] - 2021-05-01 +================= + +Added +----- + +- Add ISO name to grubenv +- Add IMAGE_ID and IMAGE_VERSION to /etc/os-release + +Changed +------- + +- Revert to an invalid GPT for greater hardware compatibility +- Fix initcpio script to comply with stricter shellcheck +- Fix an issue where writing to /etc/machine-id might override a file outside of the build directory +- Change gzip flags, so that compressed files are created reproducibly +- Increase default serial baud rate to 115200 +- Remove deprecated documentation and format existing documentation + [52] - 2021-04-01 ================= diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 53ee73a..9ad94ad 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -19,6 +19,28 @@ All ash and bash scripts are linted using shellcheck: make lint +Changelog +========= + +When adding, changing or removing something in a merge request, add a sentence to the `CHANGELOG.rst <CHANGELOG.rst>`_ +explaining it. +The changelog entry needs to be added to the unreleased section at the top, as that section is used for the next +release. + +Merge requests and signed commits +================================= + +Merge requests are not required to contain signed commits (using ``git commit -S`` - see `man 1 git-commit +<https://man.archlinux.org/man/git-commit.1>`_). +The project maintainers may rebase a given merge request branch at their discretion (if possible), which may remove +signed commits. + +The tip of the project's default branch is required to be a signed commit by the project maintainers. +For external contributors this means, that their merge request will be merged using ``--no-ff`` (see `man 1 git-merge +<https://man.archlinux.org/man/git-merge.1>`_) in a signed merge commit, while contributions by the project maintainers +may be merged using ``--ff`` when the top-most commit of the source branch is signed by a valid PGP key of the given +maintainer. + Testing ======= @@ -1,65 +1,33 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -INSTALL_FILES=$(wildcard parabolaiso/initcpio/install/*) -HOOKS_FILES=$(wildcard parabolaiso/initcpio/hooks/*) -SCRIPT_FILES=$(wildcard parabolaiso/initcpio/script/*) - -INSTALL_DIR=$(DESTDIR)/usr/lib/initcpio/install -HOOKS_DIR=$(DESTDIR)/usr/lib/initcpio/hooks -SCRIPT_DIR=$(DESTDIR)/usr/lib/initcpio +PREFIX ?= /usr/local +BIN_DIR=$(DESTDIR)$(PREFIX)/bin +DOC_DIR=$(DESTDIR)$(PREFIX)/share/doc/parabolaiso +PROFILE_DIR=$(DESTDIR)$(PREFIX)/share/parabolaiso DOC_FILES=$(wildcard docs/*) $(wildcard *.rst) - -DOC_DIR=$(DESTDIR)/usr/share/doc/parabolaiso - +SCRIPT_FILES=$(wildcard parabolaiso/*) $(wildcard scripts/*.sh) \ + $(wildcard configs/*/profiledef.sh) $(wildcard configs/*/airootfs/usr/local/bin/*) all: -check: lint - -lint: - shellcheck -s bash parabolaiso/mkparabolaiso \ - $(wildcard scripts/*.sh) \ - $(INSTALL_FILES) \ - $(wildcard configs/*/build.sh) \ - $(wildcard configs/*/profiledef.sh) \ - configs/releng/airootfs/root/.automated_script.sh \ - configs/releng/airootfs/usr/local/bin/choose-mirror \ - configs/releng/airootfs/usr/local/bin/livecd-sound \ - configs/releng-openrc/airootfs/root/.automated_script.sh \ - configs/releng-openrc/airootfs/etc/local.d/pacman-init.start \ - configs/releng-openrc/airootfs/etc/local.d/choose-mirror.start \ - configs/releng-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start \ - configs/releng-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector \ - configs/releng-openrc/airootfs/usr/local/bin/choose-mirror \ - configs/lxde-openrc/airootfs/root/.automated_script.sh \ - configs/lxde-openrc/airootfs/root/.keymap.sh \ - configs/lxde-openrc/airootfs/root/.language.sh \ - configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start \ - configs/lxde-openrc/airootfs/etc/local.d/choose-mirror.start \ - configs/lxde-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start \ - configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector \ - configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror - shellcheck -s dash $(HOOKS_FILES) $(SCRIPT_FILES) +check: shellcheck -install: install-program install-examples install-doc +shellcheck: + shellcheck -s bash $(SCRIPT_FILES) -install-program: - install -vDm 755 parabolaiso/mkparabolaiso -t "$(DESTDIR)/usr/bin/" - install -vDm 755 scripts/run_parabolaiso.sh "$(DESTDIR)/usr/bin/run_parabolaiso" +install: install-scripts install-profiles install-doc -install-initcpio: - install -d $(SCRIPT_DIR) $(HOOKS_DIR) $(INSTALL_DIR) - install -m 755 -t $(SCRIPT_DIR) $(SCRIPT_FILES) - install -m 644 -t $(HOOKS_DIR) $(HOOKS_FILES) - install -m 644 -t $(INSTALL_DIR) $(INSTALL_FILES) +install-scripts: + install -vDm 755 parabolaiso/mkparabolaiso -t "$(BIN_DIR)/" + install -vDm 755 scripts/run_parabolaiso.sh "$(BIN_DIR)/run_parabolaiso" -install-examples: - install -d -m 755 $(DESTDIR)/usr/share/parabolaiso/ - cp -a --no-preserve=ownership configs $(DESTDIR)/usr/share/parabolaiso/ +install-profiles: + install -d -m 755 $(PROFILE_DIR) + cp -a --no-preserve=ownership configs $(PROFILE_DIR)/ install-doc: install -vDm 644 $(DOC_FILES) -t $(DOC_DIR) -.PHONY: check install install-program install-initcpio install-examples install-doc lint +.PHONY: check install install-doc install-profiles install-scripts shellcheck diff --git a/README.profile.rst b/README.profile.rst deleted file mode 100644 index f6cce5d..0000000 --- a/README.profile.rst +++ /dev/null @@ -1,150 +0,0 @@ -======= -profile -======= - -A parabolaiso profile consists of several configuration files and a directory for files to be added to the resulting image. - - .. code:: bash - - profile - |- airootfs/ - |- efiboot/ - |- syslinux/ - |- packages.arch - |- pacman.conf - \- profiledef.sh - -The required files and directories are explained in the following sections. - -profiledef.sh -============= - -This file describes several attributes of the resulting image and is a place for customization to the general behavior -of the image. - -The image file is constructed from some of the variables in **profiledef.sh**: `<iso_name>-<iso_version>-<arch>.iso` -(e.g. `parabola-202010-x86_64.iso`). - -* `iso_name`: The first part of the name of the resulting image (defaults to `mkparabolaiso`) -* `iso_label`: The ISO's volume label (defaults to `MKPARABOLAISO`) -* `iso_publisher`: A free-form string that states the publisher of the resulting image (defaults to `mkparabolaiso`) -* `iso_application`: A free-form string that states the application (i.e. its use-case) of the resulting image (defaults - to `mkparabolaiso iso`) -* `iso_version`: A string that states the version of the resulting image (defaults to `""`) -* `install_dir`: A string (maximum eight characters long, which **must** consist of `[a-z0-9]`) that states the - directory on the resulting image into which all files will be installed (defaults to `mkparabolaiso`) -* `bootmodes`: A list of strings, that state the supported boot modes of the resulting image. Only the following are - understood: - - - `bios.syslinux.mbr`: Syslinux for x86 BIOS booting from a disk - - `bios.syslinux.eltorito`: Syslinux for x86 BIOS booting from an optical disc - - `uefi-x64.systemd-boot.esp`: Systemd-boot for x86_64 UEFI booting from a disk - - `uefi-x64.systemd-boot.eltorito`: Systemd-boot for x86_64 UEFI booting from an optical disc - - `uefi-x64.refind.esp`: rEFInd for x86_64 UEFI booting from a disk - - `uefi-x64.refind.eltorito`: rEFInd for x86_64 UEFI booting from an optical disc - Note that BIOS El Torito boot mode must always be listed before UEFI El Torito boot mode. -* `arch`: The architecture (e.g. `x86_64`) to build the image for. This is also used to resolve the name of the packages - file (e.g. `packages.x86_64`) -* `pacman_conf`: The `pacman.conf` to use to install packages to the work directory when creating the image (defaults to - the host's `/etc/pacman.conf`) -* `airootfs_image_type`: The image type to create. The following options are understood (defaults to `squashfs`): - - - `squashfs`: Create a squashfs image directly from the airootfs work directory - - `ext4+squashfs`: Create an ext4 partition, copy the airootfs work directory to it and create a squashfs image from it - - `erofs`: Create an EROFS image for the airootfs work directory -* `airootfs_image_tool_options`: An array of options to pass to the tool to create the airootfs image. `mksquashfs` and - `mkfs.erofs` are supported. See `mksquashfs --help` or `mkfs.erofs --help` for all possible options. -* `file_permissions`: An associative array that lists files and/or directories who need specific ownership or - permissions. The array's keys contain the path and the value is a colon separated list of owner UID, owner GID and - access mode. E.g. `file_permissions=(["/etc/shadow"]="0:0:400")`. When directories are listed with a trailing backslash ("/") **all** files and directories contained within the listed directory will have the same owner UID, owner GID, and access mode applied recursively. - -packages.arch -============= - -All packages to be installed into the environment of the image have to be listed in an architecture specific file (e.g. -`packages.x86_64`), which resides top-level in the profile. - -Packages have to be listed one per line. Lines starting with a `#` and blank lines are ignored. - - .. note:: - - The **mkinitcpio** and **mkinitcpio-parabolaiso** packages are mandatory (see `#30 - <https://gitlab.archlinux.org/archlinux/archiso/-/issues/30>`_). - - -pacman.conf -=========== - -A configuration for pacman is required per profile. - -Some configuration options will not be used or will be modified: - -* `CacheDir`: the profile's option is **only** used if it is not the default (i.e. `/var/cache/pacman/pkg`) and if it is - not the same as the system's option. In all other cases the system's pacman cache is used. -* `HookDir`: it is **always** set to the `/etc/pacman.d/hooks` directory in the work directory's airootfs to allow - modification via the profile and ensure interoparability with hosts using dracut (see `#73 - <https://gitlab.archlinux.org/archlinux/archiso/-/issues/73>`_) -* `RootDir`: it is **always** removed, as setting it explicitely otherwise refers to the host's root filesystem (see - `man 8 pacman` for further information on the `-r` option used by `pacstrap`) -* `LogFile`: it is **always** removed, as setting it explicitely otherwise refers to the host's pacman log file (see - `man 8 pacman` for further information on the `-r` option used by `pacstrap`) -* `DBPath`: it is **always** removed, as setting it explicitely otherwise refers to the host's pacman database (see - `man 8 pacman` for further information on the `-r` option used by `pacstrap`) - -airootfs -======== - -This - optional - directory may contain files and directories that will be copied to the work directory of the resulting -image's root filesystem. -The files are copied before packages are being installed to work directory location. -Ownership and permissions of files and directories from the profile's `airootfs` directory are not preserved. The mode -will be `644` for files and `755` for directories, all of them will be owned by root. To set custom ownership and/or -permissions, use `file_permissions` in **profiledef.sh**. - -With this overlay structure it is possible to e.g. create users and set passwords for them, by providing -`airootfs/etc/passwd`, `airootfs/etc/shadow`, `airootfs/etc/gshadow` (see `man 5 passwd`, `man 5 shadow` and `man 5 -gshadow` respectively). -If user home directories exist in the profile's `airootfs`, their ownership and (and top-level) permissions will be -altered according to the provided information in the password file. - -Boot loader configuration -========================= - -A profile may contain configuration for several boot loaders. These reside in specific top-level directories, which are -explained in the following subsections. - -The following *custom template identifiers* are understood and will be replaced according to the assignments of the -respective variables in **profiledef.sh**: - -* `%PARABOLAISO_LABEL%`: Set this using the `iso_label` variable in **profiledef.sh** -* `%INSTALL_DIR%`: Set this using the `iso_label` variable in **profiledef.sh** -* `%ARCH%`: Set this using the `arch` variable in **profiledef.sh** - - -efiboot -------- - -This directory is mandatory when the `uefi-x64.systemd-boot.esp` or `uefi-x64.systemd-boot.eltorito` bootmodes are -selected in **profiledef.sh**. It contains configuration for `systemd-boot -<https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`_. - - .. note:: - - The directory is a top-level representation of the systemd-boot configuration directories and files found in the - root of an EFI system partition. - -The *custom template identifiers* are **only** understood in the boot loader entry `.conf` files (i.e. **not** in -`loader.conf`). - -The same happens when the `uefi-x64.refind.esp` or `uefi-x64.refind.eltorito` bootmodes are selected. - -syslinux --------- - -This directory is mandatory when the `bios.syslinux.mbr` or the `bios.syslinux.eltorito` bootmodes are selected in -**profiledef.sh**. -It contains configuration files for `syslinux <https://wiki.syslinux.org/wiki/index.php?title=SYSLINUX>`_ or `isolinux -<https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX>`_ , or `pxelinux -<https://wiki.syslinux.org/wiki/index.php?title=PXELINUX>`_ used in the resuling image. - -The *custom template identifiers* are understood in all `.cfg` files in this directory. @@ -13,10 +13,19 @@ Requirements The following packages need to be installed to be able to create an image with the included scripts: * arch-install-scripts +* awk * dosfstools * e2fsprogs +* erofs-utils (optional) +* findutils +* grub +* gzip +* libarchive * libisoburn * mtools +* openssl +* pacman +* sed * squashfs-tools For running the images in a virtualized test environment the following packages are required: @@ -34,9 +43,9 @@ Profiles parabolaiso comes with the following profiles: **baseline**, **releng**, **releng-openrc**, **lxde-openrc** and **talkingparabola**. They can be found below `configs/baseline/ <configs/baseline/>`_, `configs/releng/ <configs/releng/>`_, `configs/releng-openrc/ <configs/releng-openrc/>`_, `configs/lxde-openrc/ <configs/lxde-openrc/>`_, `configs/talkingparabola/ <configs/talkingparabola/>`_ -(respectively). Profiles are defined by files to be placed into overlays (e.g. *airootfs* -> *the image's /*). +(respectively). Profiles are defined by files to be placed into overlays (e.g. airootfs → the image's ``/``). -Read `README.profile.rst <README.profile.rst>`_ to learn more about how to create profiles. +Read `README.profile.rst <docs/README.profile.rst>`_ to learn more about how to create profiles. Create images ============= @@ -48,32 +57,32 @@ As filesystems are created and various mount actions have to be done when creati the scripts. When parabolaiso is installed system-wide and the modification of a profile is desired, it is necessary to copy it to a -writeable location, as */usr/share/parabolaiso* is tracked by the package manager and only writeable by root (changes will +writeable location, as ``/usr/share/parabolaiso`` is tracked by the package manager and only writeable by root (changes will be lost on update). The examples below will assume an unmodified profile in a system location (unless noted otherwise). It is advised to consult the help output of **mkparabolaiso**: - .. code:: bash +.. code:: sh - mkparabolaiso -h + mkparabolaiso -h Create images with packaged parabolaiso --------------------------------------- - .. code:: bash +.. code:: sh - mkparabolaiso -w path/to/work_dir -o path/to/out_dir path/to/profile + mkparabolaiso -w path/to/work_dir -o path/to/out_dir path/to/profile Create images with local clone ------------------------------ Clone this repository and run: - .. code:: bash +.. code:: sh - ./parabolaiso/mkparabolaiso -w path/to/work_dir -o path/to/out_dir path/to/profile + ./parabolaiso/mkparabolaiso -w path/to/work_dir -o path/to/out_dir path/to/profile Testing ======= @@ -81,90 +90,91 @@ Testing The convenience script **run_parabolaiso** is provided to boot into the medium using qemu. It is advised to read its help information: - .. code:: bash +.. code:: sh - run_parabolaiso -h + run_parabolaiso -h Run the following to boot the iso using BIOS: - .. code:: bash +.. code:: sh - run_parabolaiso -i path/to/a/parabola.iso + run_parabolaiso -i path/to/a/parabola.iso Run the following to boot the iso using UEFI: - .. code:: bash +.. code:: sh - run_parabolaiso -u -i path/to/a/parabola.iso + run_parabolaiso -u -i path/to/a/parabola.iso The script can of course also be executed from this repository: - .. code:: bash +.. code:: sh - ./scripts/run_parabolaiso.sh -i path/to/a/parabola.iso + ./scripts/run_parabolaiso.sh -i path/to/a/parabola.iso Installation ============ -To install parabolaiso system-wide use the included **Makefile**: +To install parabolaiso system-wide use the included ``Makefile``: - .. code:: bash +.. code:: sh - make install + make install -Optionally install parabolaiso's mkinitcpio hooks: +Optional features - .. code:: bash +The iso image contains a GRUB environment block holding the iso name and version. This allows to +boot the iso image from GRUB with a version specific cow directory to mitigate overlay clashes. - make install-initcpio +.. code:: sh -Optional Features -================= - -The iso image contains a grub environment block holding the iso version. This allows to boot the iso image from grub -with a version specific cow directory to mitigate overlay clashes. - - .. code:: grub - loopback loop parabola.iso - load_env -f (loop)/parabola/grubenv - linux (loop)/parabola/boot/x86_64/vmlinuz-linux-libre ... \ - cow_directory=parabola/${VERSION} ... - initrd (loop)/parabola/boot/x86_64/initramfs-linux-libre-lts.img + loopback loop parabola.iso + load_env -f (loop)/boot/grub/grubenv + linux (loop)/parabola/boot/x86_64/vmlinuz-linux-libre ... \ + cow_directory=parabola/${VERSION} ... + initrd (loop)/parabola/boot/x86_64/initramfs-linux-libre-lts.img Contribute ========== -Development of parabolaiso takes place on Parabola GNU/Linux-libre' Git: https://git.parabola.nu/parabolaiso.git +Development of parabolaiso takes place on Parabola GNU/Linux-libre' Git: https://git.parabola.nu/parabolaiso.git. Read our `contributing guide <CONTRIBUTING.rst>`_ to learn more about how to provide fixes or improvements for the code base. Discussion around parabolaiso takes place on the `dev mailing list <https://lists.parabola.nu/listinfo/dev>`_ and in `#parabola -<ircs://chat.freenode.net/parabola>`_ on `freenode.net <https://freenode.net/>`_. +<ircs://irc.libera.chat/parabola>`_ on `freenode.net <ircs://irc.libera.chat/>`_. All past and present authors of parabolaiso are listed in `AUTHORS <AUTHORS.rst>`_. Releases ======== -`Releases of parabolaiso <https://gitlab.com/Megver83/parabolaiso/-/tags>`_ are created by its current maintainer -`David P <https://gitlab.com/Megver83>`_. Tags are signed using the PGP key with the ID -`6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78`. +`Releases of parabolaiso <https://git.parabola.nu/parabolaiso.git/refs/tags>`_ are created by their current maintainers + +- `David P <https://www.parabola.nu/people/hackers/#megver83>`_ (``6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78``) + +Tags are signed using respective PGP keys. + +To verify a tag, first import the relevant PGP key(s): + +.. code:: sh -To verify a tag, first import the relevant PGP key: + gpg --auto-key-locate wkd --search-keys megver83@parabola.nu - .. code:: bash +or - gpg --auto-key-locate wkd --search-keys megver83@parabola.nu +.. code:: sh + gpg --auto-key-locate keyserver --recv-keys 6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78 Afterwards a tag can be verified from a clone of this repository: - .. code:: bash +.. code:: sh - git verify-tag <tag> + git verify-tag <tag> License ======= diff --git a/configs/baseline/airootfs/etc/locale.conf b/configs/baseline/airootfs/etc/locale.conf new file mode 100644 index 0000000..f9c983c --- /dev/null +++ b/configs/baseline/airootfs/etc/locale.conf @@ -0,0 +1 @@ +LANG=C.UTF-8 diff --git a/configs/baseline/airootfs/etc/localtime b/configs/baseline/airootfs/etc/localtime Binary files differnew file mode 100644 index 0000000..91558be --- /dev/null +++ b/configs/baseline/airootfs/etc/localtime diff --git a/configs/baseline/airootfs/etc/mkinitcpio.conf b/configs/baseline/airootfs/etc/mkinitcpio.conf deleted file mode 100644 index 237fb0d..0000000 --- a/configs/baseline/airootfs/etc/mkinitcpio.conf +++ /dev/null @@ -1,70 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# vim:set ft=sh -# MODULES -# The following modules are loaded before any boot hooks are -# run. Advanced users may wish to specify all system modules -# in this array. For instance: -# MODULES=(piix ide_disk reiserfs) -MODULES=() - -# BINARIES -# This setting includes any additional binaries a given user may -# wish into the CPIO image. This is run last, so it may be used to -# override the actual binaries included by a given hook -# BINARIES are dependency parsed, so you may safely ignore libraries -BINARIES=() - -# FILES -# This setting is similar to BINARIES above, however, files are added -# as-is and are not parsed in any way. This is useful for config files. -FILES=() - -# HOOKS -# This is the most important setting in this file. The HOOKS control the -# modules and scripts added to the image, and what happens at boot time. -# Order is important, and it is recommended that you do not change the -# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for -# help on a given hook. -# 'base' is _required_ unless you know precisely what you are doing. -# 'udev' is _required_ in order to automatically load modules -# 'filesystems' is _required_ unless you specify your fs modules in MODULES -# Examples: -## This setup specifies all modules in the MODULES setting above. -## No raid, lvm2, or encrypted root is needed. -# HOOKS=(base) -# -## This setup will autodetect all modules for your system and should -## work as a sane default -# HOOKS=(base udev autodetect block filesystems) -# -## This setup will generate a 'full' image which supports most systems. -## No autodetection is done. -# HOOKS=(base udev block filesystems) -# -## This setup assembles a pata mdadm array with an encrypted root FS. -## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. -# HOOKS=(base udev block mdadm encrypt filesystems) -# -## This setup loads an lvm2 volume group on a usb device. -# HOOKS=(base udev block lvm2 filesystems) -# -## NOTE: If you have /usr on a separate partition, you MUST include the -# usr, fsck and shutdown hooks. -HOOKS=(base udev modconf parabolaiso block filesystems) - -# COMPRESSION -# Use this to compress the initramfs image. By default, gzip compression -# is used. Use 'cat' to create an uncompressed image. -#COMPRESSION="gzip" -#COMPRESSION="bzip2" -#COMPRESSION="lzma" -#COMPRESSION="xz" -#COMPRESSION="lzop" -#COMPRESSION="lz4" -#COMPRESSION="zstd" - -# COMPRESSION_OPTIONS -# Additional options for the compressor -#COMPRESSION_OPTIONS=() diff --git a/configs/baseline/airootfs/etc/mkinitcpio.conf.d/parabolaiso.conf b/configs/baseline/airootfs/etc/mkinitcpio.conf.d/parabolaiso.conf new file mode 100644 index 0000000..9d4877e --- /dev/null +++ b/configs/baseline/airootfs/etc/mkinitcpio.conf.d/parabolaiso.conf @@ -0,0 +1 @@ +HOOKS=(base udev modconf parabolaiso block filesystems) diff --git a/configs/baseline/airootfs/etc/mkinitcpio.d/linux-libre.preset b/configs/baseline/airootfs/etc/mkinitcpio.d/linux-libre.preset index db31d05..282bcde 100644 --- a/configs/baseline/airootfs/etc/mkinitcpio.d/linux-libre.preset +++ b/configs/baseline/airootfs/etc/mkinitcpio.d/linux-libre.preset @@ -1,11 +1,8 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - # mkinitcpio preset file for the 'linux-libre' package on parabolaiso PRESETS=('parabolaiso') ALL_kver='/boot/vmlinuz-linux-libre' -ALL_config='/etc/mkinitcpio.conf' +parabolaiso_config='/etc/mkinitcpio.conf.d/parabolaiso.conf' parabolaiso_image="/boot/initramfs-linux-libre.img" diff --git a/configs/baseline/airootfs/etc/ssh/sshd_config b/configs/baseline/airootfs/etc/ssh/sshd_config deleted file mode 100644 index 8ef1758..0000000 --- a/configs/baseline/airootfs/etc/ssh/sshd_config +++ /dev/null @@ -1,116 +0,0 @@ -# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $ - -# This is the sshd server system-wide configuration file. See -# sshd_config(5) for more information. - -# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/bin - -# The strategy used for options in the default sshd_config shipped with -# OpenSSH is to specify options with their default value where -# possible, but leave them commented. Uncommented options override the -# default value. - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: - -#HostKey /etc/ssh/ssh_host_rsa_key -#HostKey /etc/ssh/ssh_host_ecdsa_key -#HostKey /etc/ssh/ssh_host_ed25519_key - -# Ciphers and keying -#RekeyLimit default none - -# Logging -#SyslogFacility AUTH -#LogLevel INFO - -# Authentication: - -#LoginGraceTime 2m -PermitRootLogin yes -#StrictModes yes -#MaxAuthTries 6 -#MaxSessions 10 - -#PubkeyAuthentication yes - -# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 -# but this is overridden so installations will only check .ssh/authorized_keys -AuthorizedKeysFile .ssh/authorized_keys - -#AuthorizedPrincipalsFile none - -#AuthorizedKeysCommand none -#AuthorizedKeysCommandUser nobody - -# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts -#HostbasedAuthentication no -# Change to yes if you don't trust ~/.ssh/known_hosts for -# HostbasedAuthentication -#IgnoreUserKnownHosts no -# Don't read the user's ~/.rhosts and ~/.shosts files -#IgnoreRhosts yes - -# To disable tunneled clear text passwords, change to no here! -#PasswordAuthentication yes -#PermitEmptyPasswords no - -# Change to no to disable s/key passwords -ChallengeResponseAuthentication no - -# Kerberos options -#KerberosAuthentication no -#KerberosOrLocalPasswd yes -#KerberosTicketCleanup yes -#KerberosGetAFSToken no - -# GSSAPI options -#GSSAPIAuthentication no -#GSSAPICleanupCredentials yes - -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will -# be allowed through the ChallengeResponseAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via ChallengeResponseAuthentication may bypass -# the setting of "PermitRootLogin without-password". -# If you just want the PAM account and session checks to run without -# PAM authentication, then enable this but set PasswordAuthentication -# and ChallengeResponseAuthentication to 'no'. -UsePAM yes - -#AllowAgentForwarding yes -#AllowTcpForwarding yes -#GatewayPorts no -#X11Forwarding no -#X11DisplayOffset 10 -#X11UseLocalhost yes -#PermitTTY yes -PrintMotd no # pam does that -#PrintLastLog yes -#TCPKeepAlive yes -#PermitUserEnvironment no -#Compression delayed -#ClientAliveInterval 0 -#ClientAliveCountMax 3 -#UseDNS no -#PidFile /run/sshd.pid -#MaxStartups 10:30:100 -#PermitTunnel no -#ChrootDirectory none -#VersionAddendum none - -# no default banner path -#Banner none - -# override default of no subsystems -Subsystem sftp /usr/lib/ssh/sftp-server - -# Example of overriding settings on a per-user basis -#Match User anoncvs -# X11Forwarding no -# AllowTcpForwarding no -# PermitTTY no -# ForceCommand cvs server diff --git a/configs/baseline/airootfs/etc/ssh/sshd_config.d/10-parabolaiso.conf b/configs/baseline/airootfs/etc/ssh/sshd_config.d/10-parabolaiso.conf new file mode 100644 index 0000000..6ea7b41 --- /dev/null +++ b/configs/baseline/airootfs/etc/ssh/sshd_config.d/10-parabolaiso.conf @@ -0,0 +1,3 @@ +# Allow root login using password authentication +PasswordAuthentication yes +PermitRootLogin yes diff --git a/configs/baseline/airootfs/etc/systemd/network.conf.d/ipv6-privacy-extensions.conf b/configs/baseline/airootfs/etc/systemd/network.conf.d/ipv6-privacy-extensions.conf new file mode 100644 index 0000000..0e9ceb4 --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/network.conf.d/ipv6-privacy-extensions.conf @@ -0,0 +1,2 @@ +[Network] +IPv6PrivacyExtensions=yes diff --git a/configs/baseline/airootfs/etc/systemd/network/20-ethernet.network b/configs/baseline/airootfs/etc/systemd/network/20-ethernet.network index efa309c..0e4287b 100644 --- a/configs/baseline/airootfs/etc/systemd/network/20-ethernet.network +++ b/configs/baseline/airootfs/etc/systemd/network/20-ethernet.network @@ -1,13 +1,13 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Match] +# Matching with "Type=ether" causes issues with containers because it also matches virtual Ethernet interfaces (veth*). +# See https://bugs.archlinux.org/task/70892 +# Instead match by globbing the network interface name. Name=en* Name=eth* +[Link] +RequiredForOnline=routable + [Network] DHCP=yes -IPv6PrivacyExtensions=yes - -[DHCP] -RouteMetric=512 +MulticastDNS=yes diff --git a/configs/baseline/airootfs/etc/systemd/resolved.conf.d/parabolaiso.conf b/configs/baseline/airootfs/etc/systemd/resolved.conf.d/parabolaiso.conf new file mode 100644 index 0000000..5d64185 --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/resolved.conf.d/parabolaiso.conf @@ -0,0 +1,4 @@ +# Default systemd-resolved configuration for parabolaiso + +[Resolve] +MulticastDNS=yes diff --git a/configs/baseline/airootfs/etc/systemd/system-generators/systemd-gpt-auto-generator b/configs/baseline/airootfs/etc/systemd/system-generators/systemd-gpt-auto-generator new file mode 120000 index 0000000..dc1dc0c --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/system-generators/systemd-gpt-auto-generator @@ -0,0 +1 @@ +/dev/null
\ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_fcopy_daemon.service b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_fcopy_daemon.service new file mode 120000 index 0000000..20ac7b2 --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_fcopy_daemon.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/hv_fcopy_daemon.service
\ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_kvp_daemon.service b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_kvp_daemon.service new file mode 120000 index 0000000..a7eac4a --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_kvp_daemon.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/hv_kvp_daemon.service
\ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_vss_daemon.service b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_vss_daemon.service new file mode 120000 index 0000000..eae19ef --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_vss_daemon.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/hv_vss_daemon.service
\ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/vboxservice.service b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/vboxservice.service new file mode 120000 index 0000000..cb2d560 --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/vboxservice.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/vboxservice.service
\ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf b/configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf index a4d7442..c9f9bce 100644 --- a/configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf +++ b/configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf @@ -1,5 +1,6 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - +# Allow systemd-networkd-wait-online to succeed with one interface, otherwise, if multiple network interfaces exist, +# network-online.target gets needlessly delayed. +# See https://wiki.archlinux.org/title/systemd-networkd#systemd-networkd-wait-online [Service] +ExecStart= ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any diff --git a/configs/baseline/bootstrap_packages.x86_64 b/configs/baseline/bootstrap_packages.x86_64 new file mode 100644 index 0000000..64966d0 --- /dev/null +++ b/configs/baseline/bootstrap_packages.x86_64 @@ -0,0 +1,2 @@ +arch-install-scripts +base diff --git a/configs/baseline/efiboot/loader/entries/parabolaiso-x86_64-linux-libre.conf b/configs/baseline/efiboot/loader/entries/01-parabolaiso-x86_64-linux-libre.conf index 99bc0be..dcfa3a9 100644 --- a/configs/baseline/efiboot/loader/entries/parabolaiso-x86_64-linux-libre.conf +++ b/configs/baseline/efiboot/loader/entries/01-parabolaiso-x86_64-linux-libre.conf @@ -1,7 +1,4 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - title Parabola GNU/Linux-libre (x86_64, UEFI) linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -options parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% +options parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% diff --git a/configs/baseline/efiboot/loader/loader.conf b/configs/baseline/efiboot/loader/loader.conf index 99b52a9..d25e496 100644 --- a/configs/baseline/efiboot/loader/loader.conf +++ b/configs/baseline/efiboot/loader/loader.conf @@ -1,5 +1,2 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - timeout 3 -default parabolaiso-x86_64-linux-libre.conf +default 01-parabolaiso-x86_64-linux-libre.conf diff --git a/configs/baseline/grub/grub.cfg b/configs/baseline/grub/grub.cfg new file mode 100644 index 0000000..540ba68 --- /dev/null +++ b/configs/baseline/grub/grub.cfg @@ -0,0 +1,104 @@ +# Load partition table and file system modules +insmod part_gpt +insmod part_msdos +insmod fat +insmod iso9660 +insmod ntfs +insmod ntfscomp +insmod exfat +insmod udf + +# Use graphics-mode output +if loadfont "${prefix}/fonts/unicode.pf2" ; then + insmod all_video + set gfxmode="auto" + terminal_input console + terminal_output console +fi + +# Enable serial console +insmod serial +insmod usbserial_common +insmod usbserial_ftdi +insmod usbserial_pl2303 +insmod usbserial_usbdebug +if serial --unit=0 --speed=115200; then + terminal_input --append serial + terminal_output --append serial +fi + +# Search for the ISO volume +if [ -z "${PARABOLAISO_UUID}" ]; then + if [ -z "${PARABOLAISO_HINT}" ]; then + regexp --set=1:PARABOLAISO_HINT '^\(([^)]+)\)' "${cmdpath}" + fi + search --no-floppy --set=root --file '%PARABOLAISO_SEARCH_FILENAME%' --hint "${PARABOLAISO_HINT}" + probe --set PARABOLAISO_UUID --fs-uuid "${root}" +fi + +# Get a human readable platform identifier +if [ "${grub_platform}" == 'efi' ]; then + parabolaiso_platform='UEFI' + if [ "${grub_cpu}" == 'x86_64' ]; then + parabolaiso_platform="x64 ${parabolaiso_platform}" + elif [ "${grub_cpu}" == 'i386' ]; then + parabolaiso_platform="IA32 ${parabolaiso_platform}" + else + parabolaiso_platform="${grub_cpu} ${parabolaiso_platform}" + fi +elif [ "${grub_platform}" == 'pc' ]; then + parabolaiso_platform='BIOS' +else + parabolaiso_platform="${grub_cpu} ${grub_platform}" +fi + +# Set default menu entry +default=parabola +timeout=15 +timeout_style=menu + +# Menu entries + +menuentry "Parabola GNU/Linux-libre (%ARCH%, ${parabolaiso_platform})" --class arch --class gnu-linux --class gnu --class os --id 'parabola' { + set gfxpayload=keep + linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-libre parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=${PARABOLAISO_UUID} + initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-libre.img +} + +if [ "${grub_platform}" == 'efi' -a "${grub_cpu}" == 'x86_64' -a -f '/boot/memtest86+/memtest.efi' ]; then + menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool { + set gfxpayload=800x600,1024x768 + linux /boot/memtest86+/memtest.efi + } +fi +if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then + menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool { + set gfxpayload=800x600,1024x768 + linux /boot/memtest86+/memtest + } +fi +if [ "${grub_platform}" == 'efi' ]; then + if [ "${grub_cpu}" == 'x86_64' -a -f '/shellx64.efi' ]; then + menuentry 'UEFI Shell' { + chainloader /shellx64.efi + } + elif [ "${grub_cpu}" == "i386" -a -f '/shellia32.efi' ]; then + menuentry 'UEFI Shell' { + chainloader /shellia32.efi + } + fi + + menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' { + fwsetup + } +fi + +menuentry 'System shutdown' --class shutdown --class poweroff { + echo 'System shutting down...' + halt +} + +menuentry 'System restart' --class reboot --class restart { + echo 'System rebooting...' + reboot +} diff --git a/configs/baseline/grub/loopback.cfg b/configs/baseline/grub/loopback.cfg new file mode 100644 index 0000000..149c879 --- /dev/null +++ b/configs/baseline/grub/loopback.cfg @@ -0,0 +1,73 @@ +# https://www.supergrubdisk.org/wiki/Loopback.cfg + +# Search for the ISO volume +search --no-floppy --set=parabolaiso_img_dev --file "${iso_path}" +probe --set parabolaiso_img_dev_uuid --fs-uuid "${parabolaiso_img_dev}" + +# Get a human readable platform identifier +if [ "${grub_platform}" == 'efi' ]; then + parabolaiso_platform='UEFI' + if [ "${grub_cpu}" == 'x86_64' ]; then + parabolaiso_platform="x64 ${parabolaiso_platform}" + elif [ "${grub_cpu}" == 'i386' ]; then + parabolaiso_platform="IA32 ${parabolaiso_platform}" + else + parabolaiso_platform="${grub_cpu} ${parabolaiso_platform}" + fi +elif [ "${grub_platform}" == 'pc' ]; then + parabolaiso_platform='BIOS' +else + parabolaiso_platform="${grub_cpu} ${grub_platform}" +fi + +# Set default menu entry +default=parabola +timeout=15 +timeout_style=menu + + +# Menu entries + +menuentry "Parabola GNU/Linux-libre (%ARCH%, ${parabolaiso_platform})" --class arch --class gnu-linux --class gnu --class os --id 'parabola' { + set gfxpayload=keep + linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-libre parabolaisobasedir=%INSTALL_DIR% img_dev=UUID=${parabolaiso_img_dev_uuid} img_loop="${iso_path}" + initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-libre.img +} + +if [ "${grub_platform}" == 'efi' -a "${grub_cpu}" == 'x86_64' -a -f '/boot/memtest86+/memtest.efi' ]; then + menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool { + set gfxpayload=800x600,1024x768 + linux /boot/memtest86+/memtest.efi + } +fi +if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then + menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool { + set gfxpayload=800x600,1024x768 + linux /boot/memtest86+/memtest + } +fi +if [ "${grub_platform}" == 'efi' ]; then + if [ "${grub_cpu}" == 'x86_64' -a -f '/shellx64.efi' ]; then + menuentry 'UEFI Shell' { + chainloader /shellx64.efi + } + elif [ "${grub_cpu}" == "i386" -a -f '/shellia32.efi' ]; then + menuentry 'UEFI Shell' { + chainloader /shellia32.efi + } + fi + + menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' { + fwsetup + } +fi + +menuentry 'System shutdown' --class shutdown --class poweroff { + echo 'System shutting down...' + halt +} + +menuentry 'System restart' --class reboot --class restart { + echo 'System rebooting...' + reboot +} diff --git a/configs/baseline/packages.x86_64 b/configs/baseline/packages.x86_64 index 560143f..23eb008 100644 --- a/configs/baseline/packages.x86_64 +++ b/configs/baseline/packages.x86_64 @@ -1,9 +1,10 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later base cloud-init +hyperv linux-libre mkinitcpio mkinitcpio-parabolaiso openssh +pv +qemu-guest-agent syslinux diff --git a/configs/baseline/pacman.conf b/configs/baseline/pacman.conf index 2de1d4f..59821bc 100644 --- a/configs/baseline/pacman.conf +++ b/configs/baseline/pacman.conf @@ -32,10 +32,11 @@ Architecture = auto # Misc options #UseSyslog #Color -#TotalDownload +#NoProgressBar # We cannot check disk space from within a chroot environment #CheckSpace #VerbosePkgLists +ParallelDownloads = 5 # By default, pacman accepts packages signed by keys that its local keyring # trusts (see pacman-key and its man page), as well as unsigned packages. @@ -76,21 +77,12 @@ LocalFileSigLevel = Optional [libre] Include = /etc/pacman.d/mirrorlist -#[testing] -#Include = /etc/pacman.d/mirrorlist - [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - #[pcr-testing] #Include = /etc/pacman.d/mirrorlist diff --git a/configs/baseline/profiledef.sh b/configs/baseline/profiledef.sh index b715404..7c35814 100644 --- a/configs/baseline/profiledef.sh +++ b/configs/baseline/profiledef.sh @@ -2,16 +2,19 @@ # shellcheck disable=SC2034 iso_name="parabola-baseline" -iso_label="PARA_$(date +%Y%m)" +iso_label="PARA_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)" iso_publisher="Parabola GNU/Linux-libre <https://parabola.nu>" iso_application="Parabola GNU/Linux-libre baseline" -iso_version="$(date +%Y.%m.%d)" +iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)" install_dir="parabola" -bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' 'uefi-x64.systemd-boot.esp' 'uefi-x64.systemd-boot.eltorito') +buildmodes=('iso') +bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' + 'uefi-ia32.grub.esp' 'uefi-x64.systemd-boot.esp' + 'uefi-ia32.grub.eltorito' 'uefi-x64.systemd-boot.eltorito') arch="x86_64" pacman_conf="pacman.conf" -airootfs_image_type="squashfs" -airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M') +airootfs_image_type="erofs" +airootfs_image_tool_options=('-zlzma,109' -E 'ztailpacking,fragments,dedupe') file_permissions=( ["/etc/shadow"]="0:0:400" ) diff --git a/configs/baseline/syslinux/syslinux-linux-libre.cfg b/configs/baseline/syslinux/syslinux-linux-libre.cfg index 056be58..458bfe4 100644 --- a/configs/baseline/syslinux/syslinux-linux-libre.cfg +++ b/configs/baseline/syslinux/syslinux-linux-libre.cfg @@ -1,8 +1,5 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - LABEL parabola MENU LABEL Parabola GNU/Linux-libre (x86_64, BIOS) LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-libre INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% diff --git a/configs/baseline/syslinux/syslinux.cfg b/configs/baseline/syslinux/syslinux.cfg index e965abb..8e419f6 100644 --- a/configs/baseline/syslinux/syslinux.cfg +++ b/configs/baseline/syslinux/syslinux.cfg @@ -1,6 +1,4 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - +SERIAL 0 115200 UI menu.c32 MENU TITLE Parabola GNU/Linux-libre MENU CLEAR diff --git a/configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector b/configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector deleted file mode 100755 index 7287520..0000000 --- a/configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -if [ "$2" == up ] && ! grep -qoP 'mirror=\K\S+' /proc/cmdline; then - reflector \ - --save /etc/pacman.d/mirrorlist \ - --protocol https \ - --latest 20 \ - --sort rate -fi diff --git a/configs/lxde-openrc/airootfs/etc/X11/Xwrapper.config b/configs/lxde-openrc/airootfs/etc/X11/Xwrapper.config deleted file mode 100644 index 017105e..0000000 --- a/configs/lxde-openrc/airootfs/etc/X11/Xwrapper.config +++ /dev/null @@ -1 +0,0 @@ -needs_root_rights = yes diff --git a/configs/lxde-openrc/airootfs/etc/conf.d/agetty.tty1 b/configs/lxde-openrc/airootfs/etc/conf.d/agetty.tty1 deleted file mode 100644 index c2b62f5..0000000 --- a/configs/lxde-openrc/airootfs/etc/conf.d/agetty.tty1 +++ /dev/null @@ -1,6 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -baud="38400" -term_type="linux" -agetty_options="--autologin root --noclear" diff --git a/configs/lxde-openrc/airootfs/etc/conf.d/hostname b/configs/lxde-openrc/airootfs/etc/conf.d/hostname deleted file mode 100644 index 6d381fc..0000000 --- a/configs/lxde-openrc/airootfs/etc/conf.d/hostname +++ /dev/null @@ -1,4 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -hostname="parabolaiso" diff --git a/configs/lxde-openrc/airootfs/etc/elogind/logind.conf.d/do-not-suspend.conf b/configs/lxde-openrc/airootfs/etc/elogind/logind.conf.d/do-not-suspend.conf deleted file mode 100644 index c6b17a4..0000000 --- a/configs/lxde-openrc/airootfs/etc/elogind/logind.conf.d/do-not-suspend.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -[Login] -HandleSuspendKey=ignore -HandleHibernateKey=ignore -HandleLidSwitch=ignore diff --git a/configs/lxde-openrc/airootfs/etc/fstab b/configs/lxde-openrc/airootfs/etc/fstab deleted file mode 100644 index e69de29..0000000 --- a/configs/lxde-openrc/airootfs/etc/fstab +++ /dev/null diff --git a/configs/lxde-openrc/airootfs/etc/local.d/choose-mirror.start b/configs/lxde-openrc/airootfs/etc/local.d/choose-mirror.start deleted file mode 100755 index fea21b8..0000000 --- a/configs/lxde-openrc/airootfs/etc/local.d/choose-mirror.start +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Choose mirror from the kernel command line -grep -qoP 'mirror=\K\S+' /proc/cmdline && /usr/local/bin/choose-mirror diff --git a/configs/lxde-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start b/configs/lxde-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start deleted file mode 100755 index f705ece..0000000 --- a/configs/lxde-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Temporary /etc/pacman.d/gnupg directory -fstype="$(findmnt /etc/pacman.d/gnupg -o FSTYPE -Un)" - -test -d /etc/pacman.d/gnupg || mkdir /etc/pacman.d/gnupg -if ! [[ "$fstype" == tmpfs ]]; then - mount -o mode=0755 -t tmpfs tmpfs /etc/pacman.d/gnupg -fi diff --git a/configs/lxde-openrc/airootfs/etc/local.d/livecd-talk.start b/configs/lxde-openrc/airootfs/etc/local.d/livecd-talk.start deleted file mode 100755 index f826cdd..0000000 --- a/configs/lxde-openrc/airootfs/etc/local.d/livecd-talk.start +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -if grep -qo 'accessibility=on' /proc/cmdline; then - livecd-sound -u - chvt 13 - livecd-sound -p - chvt 1 - rc-service espeakup start -fi diff --git a/configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start b/configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start deleted file mode 100755 index 41c6166..0000000 --- a/configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Initializes Pacman keyring -if ! find /etc/pacman.d/gnupg -mindepth 1 2>/dev/null | read -r; then - pacman-key --init - pacman-key --populate archlinux archlinux32 parabola -fi diff --git a/configs/lxde-openrc/airootfs/etc/locale.conf b/configs/lxde-openrc/airootfs/etc/locale.conf deleted file mode 100644 index 9bf7aef..0000000 --- a/configs/lxde-openrc/airootfs/etc/locale.conf +++ /dev/null @@ -1,4 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LANG=en_US.UTF-8 diff --git a/configs/lxde-openrc/airootfs/etc/localtime b/configs/lxde-openrc/airootfs/etc/localtime deleted file mode 120000 index 0e35b57..0000000 --- a/configs/lxde-openrc/airootfs/etc/localtime +++ /dev/null @@ -1 +0,0 @@ -/usr/share/zoneinfo/UTC
\ No newline at end of file diff --git a/configs/lxde-openrc/airootfs/etc/mkinitcpio.conf b/configs/lxde-openrc/airootfs/etc/mkinitcpio.conf deleted file mode 100644 index 02795f8..0000000 --- a/configs/lxde-openrc/airootfs/etc/mkinitcpio.conf +++ /dev/null @@ -1,70 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# vim:set ft=sh -# MODULES -# The following modules are loaded before any boot hooks are -# run. Advanced users may wish to specify all system modules -# in this array. For instance: -# MODULES=(piix ide_disk reiserfs) -MODULES=(loop) - -# BINARIES -# This setting includes any additional binaries a given user may -# wish into the CPIO image. This is run last, so it may be used to -# override the actual binaries included by a given hook -# BINARIES are dependency parsed, so you may safely ignore libraries -BINARIES=() - -# FILES -# This setting is similar to BINARIES above, however, files are added -# as-is and are not parsed in any way. This is useful for config files. -FILES=() - -# HOOKS -# This is the most important setting in this file. The HOOKS control the -# modules and scripts added to the image, and what happens at boot time. -# Order is important, and it is recommended that you do not change the -# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for -# help on a given hook. -# 'base' is _required_ unless you know precisely what you are doing. -# 'udev' is _required_ in order to automatically load modules -# 'filesystems' is _required_ unless you specify your fs modules in MODULES -# Examples: -## This setup specifies all modules in the MODULES setting above. -## No raid, lvm2, or encrypted root is needed. -# HOOKS=(base) -# -## This setup will autodetect all modules for your system and should -## work as a sane default -# HOOKS=(base udev autodetect block filesystems) -# -## This setup will generate a 'full' image which supports most systems. -## No autodetection is done. -# HOOKS=(base udev block filesystems) -# -## This setup assembles a pata mdadm array with an encrypted root FS. -## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. -# HOOKS=(base udev block mdadm encrypt filesystems) -# -## This setup loads an lvm2 volume group on a usb device. -# HOOKS=(base udev block lvm2 filesystems) -# -## NOTE: If you have /usr on a separate partition, you MUST include the -# usr, fsck and shutdown hooks. -HOOKS=(base udev modconf memdisk parabolaiso_shutdown parabolaiso parabolaiso_loop_mnt parabolaiso_pxe_common parabolaiso_pxe_nbd parabolaiso_pxe_http parabolaiso_pxe_nfs parabolaiso_kms block filesystems keyboard) - -# COMPRESSION -# Use this to compress the initramfs image. By default, gzip compression -# is used. Use 'cat' to create an uncompressed image. -#COMPRESSION="gzip" -#COMPRESSION="bzip2" -#COMPRESSION="lzma" -COMPRESSION="xz" -#COMPRESSION="lzop" -#COMPRESSION="lz4" -#COMPRESSION="zstd" - -# COMPRESSION_OPTIONS -# Additional options for the compressor -#COMPRESSION_OPTIONS=() diff --git a/configs/lxde-openrc/airootfs/etc/mkinitcpio.d/linux-libre.preset b/configs/lxde-openrc/airootfs/etc/mkinitcpio.d/linux-libre.preset deleted file mode 100644 index db31d05..0000000 --- a/configs/lxde-openrc/airootfs/etc/mkinitcpio.d/linux-libre.preset +++ /dev/null @@ -1,11 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# mkinitcpio preset file for the 'linux-libre' package on parabolaiso - -PRESETS=('parabolaiso') - -ALL_kver='/boot/vmlinuz-linux-libre' -ALL_config='/etc/mkinitcpio.conf' - -parabolaiso_image="/boot/initramfs-linux-libre.img" diff --git a/configs/lxde-openrc/airootfs/etc/motd b/configs/lxde-openrc/airootfs/etc/motd deleted file mode 100644 index e3d2947..0000000 --- a/configs/lxde-openrc/airootfs/etc/motd +++ /dev/null @@ -1,9 +0,0 @@ -To install [35mParabola GNU/Linux-libre[0m follow the installation guide: -https://wiki.parabola.nu/Installation_Guide - -For Wi-Fi, authenticate to the wireless network using the [35mnmtui-connect[0m utility. -Ethernet and Wi-Fi connections using NetworkManager should work automatically. - -After connecting to the internet, the installation guide can be accessed -via the convenience script [35mInstallation_guide[0m. - diff --git a/configs/lxde-openrc/airootfs/etc/pacman.conf b/configs/lxde-openrc/airootfs/etc/pacman.conf deleted file mode 100644 index 5cb2234..0000000 --- a/configs/lxde-openrc/airootfs/etc/pacman.conf +++ /dev/null @@ -1,184 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -#TotalDownload -CheckSpace -#VerbosePkgLists - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all trusted packagers with: -# `pacman-key --populate archlinux archlinux32 archlinuxarm parabola`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# un-commented to enable the repo. -# -# Some repositories are disabled by default. To enable them, un-comment the -# repo name header (e.g. '[nonprism]') and the following 'Include' line. -# You can add preferred servers for each repo between the header and "Include" line, -# according to the format in /etc/pacman.d/mirrorlist, -# and those will be preferred over the standard mirrors for that repo. -# -# The order in which these entries appear in this file is critical. -# Much of the Parabola magic that supports advanced features such as -# multiple init-systems and multiple layers of freedom and privacy, -# depends on the order in which these repos are defined. -# Moving or adding repos out of the expected order can make your system insane. - -# Notes on special repositories: -# -# Non-prism is a repository for enhanced privacy, beyond the FSDG requirements. -# It contains specially patched versions of certain software from the standard repos, -# that are known to include privacy-sensative features that some people may want to use, -# but that others may consider to be undesirable anti-features. -# For more info see: https://wiki.parabola.nu/Nonprism -# -# The non-systemd repository contains packages that are important and relevant only to -# Parabola systems using an init-system other than systemd. -# Parabola systems using systemd SHOULD NOT have this enabled;. -# while Parabola systems using any other init-system SHOULD have this enabled. -# -# The kernels repository contains additional special kernels for particular use-cases, -# such as maximal security hardening and real-time systems. -# -# The PCR (Parabola Community Repository) contains additional packages, -# most often requested by Parabola users, that are not considered to be -# part of the standard Parabola/Arch system, but are nonetheless useful or fun. -# -# Multi-lib repositories allow 32-bit applications to run on x86_64 systems. -# -# The Parabola system also supports custom, user-defined, repositories; -# but be aware that the Parabola team can not recommend nor support their use. -# The Parabola team can only support the use of software that is published by Parabola. -# The use of third-party software is discouraged with a "use at your own risk" warning. -# These may be community-maintained or maintained privately by the local user or sysadmin. -# They may be hosted on the internet, on the local network, or only on the local computer. -# An example of a custom package repository is given below -# in the "User-defined repos" section -# See the pacman manpage for details on creating your own repositories. - - -########################### -# Parabola standard repos # -########################### - -#[nonprism-testing] -#Include = /etc/pacman.d/mirrorlist - -#[nonprism] -#Include = /etc/pacman.d/mirrorlist - -#[nonsystemd-testing] -#Include = /etc/pacman.d/mirrorlist - -[nonsystemd] -Include = /etc/pacman.d/mirrorlist - -#[libre-testing] -#Include = /etc/pacman.d/mirrorlist - -[libre] -Include = /etc/pacman.d/mirrorlist - -#[kernels-testing] -#Include = /etc/pacman.d/mirrorlist - -#[kernels] -#Include = /etc/pacman.d/mirrorlist - - -####################### -# Arch standard repos # -####################### - -#[testing] -#Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - - -###################### -# Supplemental repos # -###################### - -#[pcr-testing] -#Include = /etc/pacman.d/mirrorlist - -[pcr] -Include = /etc/pacman.d/mirrorlist - - -###################### -# User-defined repos # -###################### - -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs - - -############## -# Over-rides # -############## - -Include = /etc/pacman.d/*.conf diff --git a/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/40-locale-gen.hook b/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/40-locale-gen.hook deleted file mode 100644 index 82dd199..0000000 --- a/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/40-locale-gen.hook +++ /dev/null @@ -1,13 +0,0 @@ -# remove from airootfs! -[Trigger] -Operation = Install -Type = Package -Target = glibc - -[Action] -Description = Uncommenting en_US.UTF-8 locale and running locale-gen... -When = PostTransaction -Depends = glibc -Depends = sed -Depends = sh -Exec = /bin/sh -c "sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen && locale-gen" diff --git a/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook b/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook deleted file mode 100644 index ad0b5ba..0000000 --- a/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook +++ /dev/null @@ -1,12 +0,0 @@ -[Trigger] -Operation = Install -Operation = Upgrade -Type = Package -Target = pacman-mirrorlist - -[Action] -Description = Uncommenting all mirrors in /etc/pacman.d/mirrorlist... -When = PostTransaction -Depends = pacman-mirrorlist -Depends = sed -Exec = /usr/bin/sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist diff --git a/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook b/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook deleted file mode 100644 index 8dfb943..0000000 --- a/configs/lxde-openrc/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook +++ /dev/null @@ -1,18 +0,0 @@ -# remove from airootfs! -# As a workaround for https://bugs.archlinux.org/task/49347 , remove pacman hooks specific to the ISO build process. -# If not, they would be used when pacstrap is run in the live environment. - -[Trigger] -Operation = Install -Operation = Upgrade -Operation = Remove -Type = Package -Target = * - -[Action] -Description = Work around FS#49347 by removing custom pacman hooks that are only required during ISO build... -When = PostTransaction -Depends = sh -Depends = coreutils -Depends = grep -Exec = /bin/sh -c "rm -- $(grep -Frl 'remove from airootfs' /etc/pacman.d/hooks/)" diff --git a/configs/lxde-openrc/airootfs/etc/passwd b/configs/lxde-openrc/airootfs/etc/passwd deleted file mode 100644 index 2807d5d..0000000 --- a/configs/lxde-openrc/airootfs/etc/passwd +++ /dev/null @@ -1 +0,0 @@ -root:x:0:0:root:/root:/usr/bin/zsh diff --git a/configs/lxde-openrc/airootfs/etc/runlevels/default/NetworkManager b/configs/lxde-openrc/airootfs/etc/runlevels/default/NetworkManager deleted file mode 120000 index fc68d44..0000000 --- a/configs/lxde-openrc/airootfs/etc/runlevels/default/NetworkManager +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/NetworkManager
\ No newline at end of file diff --git a/configs/lxde-openrc/airootfs/etc/runlevels/default/haveged b/configs/lxde-openrc/airootfs/etc/runlevels/default/haveged deleted file mode 120000 index 0ec5343..0000000 --- a/configs/lxde-openrc/airootfs/etc/runlevels/default/haveged +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/haveged
\ No newline at end of file diff --git a/configs/lxde-openrc/airootfs/etc/shadow b/configs/lxde-openrc/airootfs/etc/shadow deleted file mode 100644 index 7edfd69..0000000 --- a/configs/lxde-openrc/airootfs/etc/shadow +++ /dev/null @@ -1 +0,0 @@ -root::14871:::::: diff --git a/configs/lxde-openrc/airootfs/etc/skel/.config/lxsession/LXDE/desktop.conf b/configs/lxde-openrc/airootfs/etc/skel/.config/lxsession/LXDE/desktop.conf deleted file mode 100644 index c50f484..0000000 --- a/configs/lxde-openrc/airootfs/etc/skel/.config/lxsession/LXDE/desktop.conf +++ /dev/null @@ -1,48 +0,0 @@ -[Session] -window_manager=openbox-lxde -disable_autostart=no -polkit/command=sleep 5s && lxpolkit -clipboard/command=lxclipboard -xsettings_manager/command=build-in -proxy_manager/command=build-in -keyring/command=ssh-agent -quit_manager/command=lxsession-logout -lock_manager/command=lxlock -terminal_manager/command=lxterminal - -[GTK] -sNet/ThemeName=Adwaita -sNet/IconThemeName=nuoveXT2 -sGtk/FontName=Sans 10 -iGtk/ToolbarStyle=3 -iGtk/ButtonImages=1 -iGtk/MenuImages=1 -iGtk/CursorThemeSize=18 -iXft/Antialias=1 -iXft/Hinting=1 -sXft/HintStyle=hintslight -sXft/RGBA=rgb -iNet/EnableEventSounds=1 -iNet/EnableInputFeedbackSounds=1 -sGtk/ColorScheme= -iGtk/ToolbarIconSize=3 -sGtk/CursorThemeName=DMZ-White - -[Mouse] -AccFactor=20 -AccThreshold=10 -LeftHanded=0 - -[Keyboard] -Delay=500 -Interval=30 -Beep=1 - -[State] -guess_default=true - -[Dbus] -lxde=true - -[Environment] -menu_prefix=lxde- diff --git a/configs/lxde-openrc/airootfs/etc/skel/.config/pcmanfm/LXDE/desktop-items-0.conf b/configs/lxde-openrc/airootfs/etc/skel/.config/pcmanfm/LXDE/desktop-items-0.conf deleted file mode 100644 index 6186fce..0000000 --- a/configs/lxde-openrc/airootfs/etc/skel/.config/pcmanfm/LXDE/desktop-items-0.conf +++ /dev/null @@ -1,14 +0,0 @@ -[*] -wallpaper_mode=crop -wallpaper_common=1 -wallpaper=/etc/wallpaper.png -desktop_bg=#000000 -desktop_fg=#ffffff -desktop_shadow=#000000 -desktop_font=Sans 12 -show_wm_menu=0 -sort=mtime;ascending; -show_documents=0 -show_trash=1 -show_mounts=1 - diff --git a/configs/lxde-openrc/airootfs/etc/ssh/sshd_config b/configs/lxde-openrc/airootfs/etc/ssh/sshd_config deleted file mode 100644 index 8ef1758..0000000 --- a/configs/lxde-openrc/airootfs/etc/ssh/sshd_config +++ /dev/null @@ -1,116 +0,0 @@ -# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $ - -# This is the sshd server system-wide configuration file. See -# sshd_config(5) for more information. - -# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/bin - -# The strategy used for options in the default sshd_config shipped with -# OpenSSH is to specify options with their default value where -# possible, but leave them commented. Uncommented options override the -# default value. - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: - -#HostKey /etc/ssh/ssh_host_rsa_key -#HostKey /etc/ssh/ssh_host_ecdsa_key -#HostKey /etc/ssh/ssh_host_ed25519_key - -# Ciphers and keying -#RekeyLimit default none - -# Logging -#SyslogFacility AUTH -#LogLevel INFO - -# Authentication: - -#LoginGraceTime 2m -PermitRootLogin yes -#StrictModes yes -#MaxAuthTries 6 -#MaxSessions 10 - -#PubkeyAuthentication yes - -# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 -# but this is overridden so installations will only check .ssh/authorized_keys -AuthorizedKeysFile .ssh/authorized_keys - -#AuthorizedPrincipalsFile none - -#AuthorizedKeysCommand none -#AuthorizedKeysCommandUser nobody - -# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts -#HostbasedAuthentication no -# Change to yes if you don't trust ~/.ssh/known_hosts for -# HostbasedAuthentication -#IgnoreUserKnownHosts no -# Don't read the user's ~/.rhosts and ~/.shosts files -#IgnoreRhosts yes - -# To disable tunneled clear text passwords, change to no here! -#PasswordAuthentication yes -#PermitEmptyPasswords no - -# Change to no to disable s/key passwords -ChallengeResponseAuthentication no - -# Kerberos options -#KerberosAuthentication no -#KerberosOrLocalPasswd yes -#KerberosTicketCleanup yes -#KerberosGetAFSToken no - -# GSSAPI options -#GSSAPIAuthentication no -#GSSAPICleanupCredentials yes - -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will -# be allowed through the ChallengeResponseAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via ChallengeResponseAuthentication may bypass -# the setting of "PermitRootLogin without-password". -# If you just want the PAM account and session checks to run without -# PAM authentication, then enable this but set PasswordAuthentication -# and ChallengeResponseAuthentication to 'no'. -UsePAM yes - -#AllowAgentForwarding yes -#AllowTcpForwarding yes -#GatewayPorts no -#X11Forwarding no -#X11DisplayOffset 10 -#X11UseLocalhost yes -#PermitTTY yes -PrintMotd no # pam does that -#PrintLastLog yes -#TCPKeepAlive yes -#PermitUserEnvironment no -#Compression delayed -#ClientAliveInterval 0 -#ClientAliveCountMax 3 -#UseDNS no -#PidFile /run/sshd.pid -#MaxStartups 10:30:100 -#PermitTunnel no -#ChrootDirectory none -#VersionAddendum none - -# no default banner path -#Banner none - -# override default of no subsystems -Subsystem sftp /usr/lib/ssh/sftp-server - -# Example of overriding settings on a per-user basis -#Match User anoncvs -# X11Forwarding no -# AllowTcpForwarding no -# PermitTTY no -# ForceCommand cvs server diff --git a/configs/lxde-openrc/airootfs/etc/wallpaper.png b/configs/lxde-openrc/airootfs/etc/wallpaper.png Binary files differdeleted file mode 100644 index d2a3927..0000000 --- a/configs/lxde-openrc/airootfs/etc/wallpaper.png +++ /dev/null diff --git a/configs/lxde-openrc/airootfs/root/.automated_script.sh b/configs/lxde-openrc/airootfs/root/.automated_script.sh deleted file mode 100755 index 5c0c316..0000000 --- a/configs/lxde-openrc/airootfs/root/.automated_script.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -script_cmdline () -{ - local param - for param in $(< /proc/cmdline); do - case "${param}" in - script=*) echo "${param#*=}" ; return 0 ;; - esac - done -} - -automated_script () -{ - local script rt - script="$(script_cmdline)" - if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then - if [[ "${script}" =~ ^((http|https|ftp)://) ]]; then - curl "${script}" --location --retry-connrefused -s -o /tmp/startup_script >/dev/null - rt=$? - else - cp "${script}" /tmp/startup_script - rt=$? - fi - if [[ ${rt} -eq 0 ]]; then - chmod +x /tmp/startup_script - /tmp/startup_script - fi - fi -} - -if [[ $(tty) == "/dev/tty1" ]]; then - automated_script -fi diff --git a/configs/lxde-openrc/airootfs/root/.codecheck b/configs/lxde-openrc/airootfs/root/.codecheck deleted file mode 100644 index 8b10d0c..0000000 --- a/configs/lxde-openrc/airootfs/root/.codecheck +++ /dev/null @@ -1,2 +0,0 @@ -LANG=0 -XKBMAP=0 diff --git a/configs/lxde-openrc/airootfs/root/.config/dconf/user b/configs/lxde-openrc/airootfs/root/.config/dconf/user Binary files differdeleted file mode 100644 index dab7f59..0000000 --- a/configs/lxde-openrc/airootfs/root/.config/dconf/user +++ /dev/null diff --git a/configs/lxde-openrc/airootfs/root/.config/gtk-2.0/gtkfilechooser.ini b/configs/lxde-openrc/airootfs/root/.config/gtk-2.0/gtkfilechooser.ini deleted file mode 100644 index c6b458d..0000000 --- a/configs/lxde-openrc/airootfs/root/.config/gtk-2.0/gtkfilechooser.ini +++ /dev/null @@ -1,11 +0,0 @@ -[Filechooser Settings] -LocationMode=path-bar -ShowHidden=true -ShowSizeColumn=true -GeometryX=52 -GeometryY=86 -GeometryWidth=920 -GeometryHeight=585 -SortColumn=name -SortOrder=ascending -StartupMode=recent diff --git a/configs/lxde-openrc/airootfs/root/.config/lxsession/LXDE/autostart b/configs/lxde-openrc/airootfs/root/.config/lxsession/LXDE/autostart deleted file mode 100644 index 3942b5a..0000000 --- a/configs/lxde-openrc/airootfs/root/.config/lxsession/LXDE/autostart +++ /dev/null @@ -1,4 +0,0 @@ -@lxpanel --profile LXDE -@pcmanfm --desktop --profile LXDE -@xscreensaver -no-splash -@/root/.keymap.sh diff --git a/configs/lxde-openrc/airootfs/root/.config/volumeicon/volumeicon b/configs/lxde-openrc/airootfs/root/.config/volumeicon/volumeicon deleted file mode 100644 index 588b9dd..0000000 --- a/configs/lxde-openrc/airootfs/root/.config/volumeicon/volumeicon +++ /dev/null @@ -1,25 +0,0 @@ -[Alsa] -card=default - -[Notification] -show_notification=true -notification_type=0 - -[StatusIcon] -stepsize=5 -onclick=xterm -e 'alsamixer' -theme=Default -use_panel_specific_icons=false -lmb_slider=false -mmb_mute=false -use_horizontal_slider=false -show_sound_level=false -use_transparent_background=false - -[Hotkeys] -up_enabled=false -down_enabled=false -mute_enabled=false -up=XF86AudioRaiseVolume -down=XF86AudioLowerVolume -mute=XF86AudioMute diff --git a/configs/lxde-openrc/airootfs/root/.keymap.sh b/configs/lxde-openrc/airootfs/root/.keymap.sh deleted file mode 100755 index 3b1516b..0000000 --- a/configs/lxde-openrc/airootfs/root/.keymap.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -#Comprobe if X11 keymap was selected -code="$(grep XKBMAP= .codecheck | cut -d '=' -f 2)" -keymaps_list="$(sed -e '/! layout/,/^$/!d;/! layout/d;s/ /_/g;s/__/ /g;s/ _//' /usr/share/X11/xkb/rules/evdev.lst | sort)" - -if [[ $code = "0" ]]; then - # shellcheck disable=SC2086 - keymap="$(zenity --list --title='Select your keymap' --column='Code Name' --column='Keymap' --hide-column=1 $keymaps_list)" - setxkbmap "$keymap" - - #Save XKBMAP in .codecheck to use in other time. For example if you install X11 with scripts - sed -i '/XKBMAP=./d' ~/.codecheck - echo "XKBMAP=$keymap" >> ~/.codecheck -fi diff --git a/configs/lxde-openrc/airootfs/root/.language.sh b/configs/lxde-openrc/airootfs/root/.language.sh deleted file mode 100755 index cc4558f..0000000 --- a/configs/lxde-openrc/airootfs/root/.language.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -#Comprobe if language was selected -code=$(grep LANG= ~/.codecheck | tail --bytes 2) -if [ "$code" = "0" ]; then - lang=$(dialog --stdout --backtitle "System language selection" --menu "Choose your language:" 15 40 10 \ - "en_US.UTF-8" "English" \ - "gl_ES.UTF-8" "Galego" \ - "es_ES.UTF-8" "Spanish" \ - "pt_BR.UTF-8" "Brazilian Portuguese" \ - "pl_PL.UTF-8" "Polish" \ - "it_IT.UTF-8" "Italian" \ - "fr_FR.UTF-8" "French" \ - "eo" "Esperanto") - - #Copy locale in locale.conf - [ -z "$lang" ] || echo "LANG=$lang" > /etc/locale.conf - - #Put a new line confirm that language was selected - sed -i '/LANG=./d' ~/.codecheck - echo "LANG=1" >> ~/.codecheck - - #Copy scripts to install in that language - case ${lang/_*/} in - en|gl|es|pt) cp -a ~/.scriptsInstallation/language/"${lang/_*/}"/* ~/.scriptsInstallation/ - cp ~/.scriptsInstallation/install.sh ~/ - ;; - *) cp -a ~/.scriptsInstallation/language/en/* ~/.scriptsInstallation/ - cp ~/.scriptsInstallation/install.sh ~/ - ;; - esac - - #Clear the dialog menu - clear -fi diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/install.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/install.sh deleted file mode 100755 index 7c27afc..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/install.sh +++ /dev/null @@ -1,231 +0,0 @@ -#!/bin/bash -#Temporal is a file that contains parameters to use when access to chroot - -keys=(parabola archlinux) -if [ $(uname -m) = i686 ]; then - keys+=(archlinux32) -fi - -if [ ! -f ~/.scriptsInstallation/.pacman ]; then - pacman -Sy ${keys[@]/%/-keyring} --noconfirm - pacman-key --populate ${keys[@]} - pacman-key --refresh-keys - case $? in - 0) touch ~/.scriptsInstallation/.pacman - ;; - *) false - ;; - esac -fi - -partition(){ - - #Search and show the Hard Disks to select - aux=$(ls /dev/sd?) - index=0 - for i in $aux; do - hdds[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - hdd=$(dialog --stdout --radiolist "Select Hard Disk" 20 70 50 ${hdds[@]}) - - #If exist the line delete - if (cat ~/.scriptsInstallation/temporal | grep "hdd=") &>/dev/null - then - sed -i -e '/hdd=*/d' ~/.scriptsInstallation/temporal - fi - - #And add the new line with new parameter - echo "hdd=$hdd" >> ~/.scriptsInstallation/temporal - - selection=$(dialog --stdout --menu "Partitioning method" 20 70 50 \ - 1 "Use all disk with swap (1GB) and /" \ - 2 "Use gparted to customize" ) - - case $selection in - 1) - umount /mnt &> /dev/null - #Create msdos partition table - parted -s $hdd -- mklabel msdos - - #Create partition swap and / - parted -s $hdd -- mkpart primary 1MiB 1000MiB mkpart primary 1000MiB -1s - - #Boot option partition / - parted -s $hdd -- set 2 boot on - - #Format and partitions and mount / - (echo t; echo 1; echo 82; echo w) | fdisk $hdd - mkswap ${hdd}1 - mkfs.ext4 ${hdd}2 - mount ${hdd}2 /mnt - ;; - 2) - gparted $hdd - - #Search and show the partitions that select before. - aux=$(ls $hdd?) - index=0; - for i in $aux; do - partitions[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - partition=$(dialog --stdout --radiolist "Mount / Partition" 20 70 50 ${partitions[@]}) - - #Mount partition / - umount /mnt &> /dev/null - mount $partition /mnt - - #Ask if you want mount other partitions - other=0 - while [ $other != 3 ]; do - other=$(dialog --stdout --menu "Mount other partition?" 20 70 50 1 "/home" 2 "/boot" 3 "No") - - case $other in - 1) - umount /mnt/home &> /dev/null - mkdir /mnt/home &> /dev/null - mount $(dialog --stdout --radiolist "Mount /home Partition" 20 70 50 ${partitions[@]}) /mnt/home - ;; - 2) - umount /mnt/boot &> /dev/null - mkdir /mnt/boot &> /dev/null - mount $(dialog --stdout --radiolist "Mount /boot Partition" 20 70 50 ${partitions[@]}) /mnt/boot - ;; - *) - other=3 - ;; - esac - done - ;; - esac -} - - -option=0 -while [ option != 7 ]; do - option=$(dialog --stdout --menu "Parabola Installation CLI" 20 70 50 \ - 1 "Format and Mount Partitions" \ - 2 "Install Base System" \ - 3 "Install GRUB" \ - 4 "System Configure" \ - 5 "Create User Account" \ - 6 "(Optional) Install Live DVD Desktop/Applications" \ - 7 "Exit" ) - - case $option in - 1) - partition - ;; - 2) - #Install base system - pacstrap /mnt base-openrc - pacstrap /mnt dialog - ;; - 3) - #Install grub - pacstrap /mnt grub - ;; - 4) - #Generate fstab and acces to chroot to do System Config - genfstab -p /mnt >> /mnt/etc/fstab - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/systemConfig.sh /mnt - chmod +x /mnt/systemConfig.sh - arch-chroot /mnt /systemConfig.sh - rm -r /mnt/systemConfig.sh - ;; - 5) - #Create a new username and save in temporal, to use after - if (cat ~/.scriptsInstallation/temporal | grep "userName=") &>/dev/null - then - sed -i -e '/userName=*/d' ~/.scriptsInstallation/temporal - fi - - echo "userName=$(dialog --stdout --inputbox "Enter an User Name" 8 40)" >> ~/.scriptsInstallation/temporal - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/userAccount.sh /mnt - chmod +x /mnt/userAccount.sh - arch-chroot /mnt /userAccount.sh - rm -r /mnt/userAccount.sh - ;; - 6) - #Packages to the X11 live - packages=( "xorg-server" - "xf86-input-evdev" - "xf86-input-synaptics" - "xf86-video-ati" - "xf86-video-dummy" - "xf86-video-fbdev" - "xf86-video-intel" - "xf86-video-nouveau" - "xf86-video-openchrome" - "xf86-video-sisusb" - "xf86-video-vesa" - "xf86-video-vmware" - "xf86-video-voodoo" - "xf86-video-qxl" - "xorg-xinit" - "gst-plugins-good" - "gst-libav" - "lxde" - "volumeicon" - "zenity" - "octopi" - "pulseaudio-alsa" - "alsa-utils" - "networkmanager-elogind" - "network-manager-applet" - "iceweasel" - "icedove" - "pidgin" - "gparted" - "smplayer" - "epdfview" - "gpicview" - "abiword" - "gnumeric" - "leafpad" - "galculator-gtk2" - "xarchiver" - "openrc-desktop" - "polkit-elogind" - "gvfs-mtp" - "gphoto2" - "xdg-user-dirs" - "gnome-screenshot" - ) - - #Install packages - pacstrap /mnt ${packages[@]} - user=$(cat ~/.scriptsInstallation/temporal | grep "userName" ) - - #Copy skel in the new system and desktop's background - cp -a /etc/skel/ /mnt/etc/ - cp -a /etc/wallpaper.png /mnt/etc/wallpaper.png - - #Puts the XKBMAP, start X11 automatically and icewm desktop - echo "setxkbmap $(cat ~/.codecheck | grep XKBMAP= | cut -d '=' -f 2)" > /mnt/etc/skel/.xinitrc - echo "exec startlxde" >> /mnt/etc/skel/.xinitrc - echo "startx" >> /mnt/etc/skel/.bash_profile - chmod +x /mnt/etc/skel/.xinitrc - cp -a /mnt/etc/skel/.[a-z]* /mnt/home/${user#*=}/ - cp -a ~/.scriptsInstallation/x11.sh /mnt - - #Enable services with OpenRC and configure other stuff - chmod +x /mnt/x11.sh - arch-chroot /mnt /x11.sh - rm /mnt/x11.sh - ;; - *) - #Delete temporal file and umount partitions - rm -r /mnt/temporal - umount /mnt/boot &> /dev/null - umount /mnt/home &> /dev/null - umount /mnt &> /dev/null - exit - ;; - esac -done diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/systemConfig.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/systemConfig.sh deleted file mode 100755 index d5195fb..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/systemConfig.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/bash - -HOSTNAME=$(dialog --stdout --inputbox "Enter Hostname:" 8 40) -sed 's|localhost|'"${HOSTNAME}"'|' -i /etc/conf.d/hostname - -ln -s /usr/share/zoneinfo/$(dialog --stdout --inputbox "Enter your Zone Time:\nFor example: Europe/Athens" 8 40) /etc/localtime - -keymaps=( - "ANSI-dvorak ANSI-dvorak off" - "amiga-de amiga-de off" - "amiga-us amiga-us off" - "applkey applkey off" - "atari-de atari-de off" - "atari-se atari-se off" - "atari-uk-falcon atari-uk-falcon off" - "atari-us atari-us off" - "azerty azerty off" - "backspace backspace off" - "bashkir bashkir off" - "be-latin1 be-latin1 off" - "bg-cp1251 bg-cp1251 off" - "bg-cp855 bg-cp855 off" - "bg_bds-cp1251 bg_bds-cp1251 off" - "bg_bds-utf8 bg_bds-utf8 off" - "bg_pho-cp1251 bg_pho-cp1251 off" - "bg_pho-utf8 bg_pho-utf8 off" - "br-abnt br-abnt off" - "br-abnt2 br-abnt2 off" - "br-latin1-abnt2 br-latin1-abnt2 off" - "br-latin1-us br-latin1-us off" - "by by off" - "by-cp1251 by-cp1251 off" - "bywin-cp1251 bywin-cp1251 off" - "cf cf off" - "colemak colemak off" - "croat croat off" - "ctrl ctrl off" - "cz cz off" - "cz-cp1250 cz-cp1250 off" - "cz-lat2 cz-lat2 off" - "cz-lat2-prog cz-lat2-prog off" - "cz-qwertz cz-qwertz off" - "cz-us-qwertz cz-us-qwertz off" - "de de off" - "de-latin1 de-latin1 off" - "de-latin1-nodeadkeys de-latin1-nodeadkeys off" - "de-mobii de-mobii off" - "de_CH-latin1 de_CH-latin1 off" - "de_alt_UTF-8 de_alt_UTF-8 off" - "defkeymap defkeymap off" - "defkeymap_V1.0 defkeymap_V1.0 off" - "dk dk off" - "dk-latin1 dk-latin1 off" - "dvorak dvorak off" - "dvorak-ca-fr dvorak-ca-fr off" - "dvorak-es dvorak-es off" - "dvorak-fr dvorak-fr off" - "dvorak-l dvorak-l off" - "dvorak-r dvorak-r off" - "dvorak-ru dvorak-ru off" - "dvorak-sv-a1 dvorak-sv-a1 off" - "dvorak-sv-a5 dvorak-sv-a5 off" - "dvorak-uk dvorak-uk off" - "emacs emacs off" - "emacs2 emacs2 off" - "es es off" - "es-cp850 es-cp850 off" - "es-olpc es-olpc off" - "et et off" - "et-nodeadkeys et-nodeadkeys off" - "euro euro off" - "euro1 euro1 off" - "euro2 euro2 off" - "fi fi off" - "fr fr off" - "fr-bepo fr-bepo off" - "fr-bepo-latin9 fr-bepo-latin9 off" - "fr-latin1 fr-latin1 off" - "fr-latin9 fr-latin9 off" - "fr-pc fr-pc off" - "fr_CH fr_CH off" - "fr_CH-latin1 fr_CH-latin1 off" - "gr gr off" - "gr-pc gr-pc off" - "hu hu off" - "hu101 hu101 off" - "il il off" - "il-heb il-heb off" - "il-phonetic il-phonetic off" - "is-latin1 is-latin1 off" - "is-latin1-us is-latin1-us off" - "it it off" - "it-ibm it-ibm off" - "it2 it2 off" - "jp106 jp106 off" - "kazakh kazakh off" - "keypad keypad off" - "ky_alt_sh-UTF-8 ky_alt_sh-UTF-8 off" - "kyrgyz kyrgyz off" - "la-latin1 la-latin1 off" - "lt lt off" - "lt.baltic lt.baltic off" - "lt.l4 lt.l4 off" - "lv lv off" - "lv-tilde lv-tilde off" - "mac-be mac-be off" - "mac-de-latin1 mac-de-latin1 off" - "mac-de-latin1-nodeadkeys mac-de-latin1-nodeadkeys off" - "mac-de_CH mac-de_CH off" - "mac-dk-latin1 mac-dk-latin1 off" - "mac-dvorak mac-dvorak off" - "mac-es mac-es off" - "mac-euro mac-euro off" - "mac-euro2 mac-euro2 off" - "mac-fi-latin1 mac-fi-latin1 off" - "mac-fr mac-fr off" - "mac-fr_CH-latin1 mac-fr_CH-latin1 off" - "mac-it mac-it off" - "mac-pl mac-pl off" - "mac-pt-latin1 mac-pt-latin1 off" - "mac-se mac-se off" - "mac-template mac-template off" - "mac-uk mac-uk off" - "mac-us mac-us off" - "mk mk off" - "mk-cp1251 mk-cp1251 off" - "mk-utf mk-utf off" - "mk0 mk0 off" - "nl nl off" - "nl2 nl2 off" - "no no off" - "no-dvorak no-dvorak off" - "no-latin1 no-latin1 off" - "pc110 pc110 off" - "pl pl off" - "pl1 pl1 off" - "pl2 pl2 off" - "pl3 pl3 off" - "pl4 pl4 off" - "pt-latin1 pt-latin1 off" - "pt-latin9 pt-latin9 off" - "pt-olpc pt-olpc off" - "ro ro off" - "ro_std ro_std off" - "ro_win ro_win off" - "ru ru off" - "ru-cp1251 ru-cp1251 off" - "ru-ms ru-ms off" - "ru-yawerty ru-yawerty off" - "ru1 ru1 off" - "ru2 ru2 off" - "ru3 ru3 off" - "ru4 ru4 off" - "ru_win ru_win off" - "ruwin_alt-CP1251 ruwin_alt-CP1251 off" - "ruwin_alt-KOI8-R ruwin_alt-KOI8-R off" - "ruwin_alt-UTF-8 ruwin_alt-UTF-8 off" - "ruwin_alt_sh-UTF-8 ruwin_alt_sh-UTF-8 off" - "ruwin_cplk-CP1251 ruwin_cplk-CP1251 off" - "ruwin_cplk-KOI8-R ruwin_cplk-KOI8-R off" - "ruwin_cplk-UTF-8 ruwin_cplk-UTF-8 off" - "ruwin_ct_sh-CP1251 ruwin_ct_sh-CP1251 off" - "ruwin_ct_sh-KOI8-R ruwin_ct_sh-KOI8-R off" - "ruwin_ct_sh-UTF-8 ruwin_ct_sh-UTF-8 off" - "ruwin_ctrl-CP1251 ruwin_ctrl-CP1251 off" - "ruwin_ctrl-KOI8-R ruwin_ctrl-KOI8-R off" - "ruwin_ctrl-UTF-8 ruwin_ctrl-UTF-8 off" - "se-fi-ir209 se-fi-ir209 off" - "se-fi-lat6 se-fi-lat6 off" - "se-ir209 se-ir209 off" - "se-lat6 se-lat6 off" - "sg sg off" - "sg-latin1 sg-latin1 off" - "sg-latin1-lk450 sg-latin1-lk450 off" - "sk-prog-qwerty sk-prog-qwerty off" - "sk-prog-qwertz sk-prog-qwertz off" - "sk-qwerty sk-qwerty off" - "sk-qwertz sk-qwertz off" - "slovene slovene off" - "sr-cy sr-cy off" - "sun-pl sun-pl off" - "sun-pl-altgraph sun-pl-altgraph off" - "sundvorak sundvorak off" - "sunkeymap sunkeymap off" - "sunt4-es sunt4-es off" - "sunt4-fi-latin1 sunt4-fi-latin1 off" - "sunt4-no-latin1 sunt4-no-latin1 off" - "sunt5-cz-us sunt5-cz-us off" - "sunt5-de-latin1 sunt5-de-latin1 off" - "sunt5-es sunt5-es off" - "sunt5-fi-latin1 sunt5-fi-latin1 off" - "sunt5-fr-latin1 sunt5-fr-latin1 off" - "sunt5-ru sunt5-ru off" - "sunt5-uk sunt5-uk off" - "sunt5-us-cz sunt5-us-cz off" - "sunt6-uk sunt6-uk off" - "sv-latin1 sv-latin1 off" - "tj_alt-UTF8 tj_alt-UTF8 off" - "tr_f-latin5 tr_f-latin5 off" - "tr_q-latin5 tr_q-latin5 off" - "tralt tralt off" - "trf trf off" - "trf-fgGIod trf-fgGIod off" - "trq trq off" - "ttwin_alt-UTF-8 ttwin_alt-UTF-8 off" - "ttwin_cplk-UTF-8 ttwin_cplk-UTF-8 off" - "ttwin_ct_sh-UTF-8 ttwin_ct_sh-UTF-8 off" - "ttwin_ctrl-UTF-8 ttwin_ctrl-UTF-8 off" - "ua ua off" - "ua-cp1251 ua-cp1251 off" - "ua-utf ua-utf off" - "ua-utf-ws ua-utf-ws off" - "ua-ws ua-ws off" - "uk uk off" - "unicode unicode off" - "us us on" - "us-acentos us-acentos off" - "wangbe wangbe off" - "wangbe2 wangbe2 off" - "windowkeys windowkeys off" -) - -echo "KEYMAP=$(dialog --stdout --radiolist "Select Keymap" 20 70 50 ${keymaps[@]})" > /etc/vconsole.conf - -aux=$(sed -e '1,23d' -e 's/#//g' -e 's/ /#/g' -e 's/..$//' /etc/locale.gen) -index=0 -for i in $aux; do - i=$(echo $i | sed -e 's/#/ /g') - locales+=("$i" "$i" off) - if [[ $i == "en_US.UTF-8 UTF-8" || $i == "en_US ISO-8859-1" ]]; then - locales[$index]="$i" - locales[$((index+1))]="$i" - locales[$((index+2))]="on" - fi - index=$((index+3)) -done - -locale=$(dialog --stdout --checklist "Select Locales" 20 70 50 "${locales[@]}") -locale=$(echo ${locale} | sed -e 's/" "/\n/g' -e 's/ /#/g' -e 's/"//g') - -for i in ${locale[@]}; do - i=$(echo $i | sed -e 's/#/ /g') - sed -i -e "s/#$i/$i/g" /etc/locale.gen -done - -locale-gen - -aux=$(locale -a) -index=0 -for i in $aux; do - langs+=("$i" "$i" on) - index=$((index+1)) -done - -echo "LANG=$(dialog --stdout --radiolist "Select your language" 20 70 50 ${langs[@]})" > /etc/locale.conf - -mkinitcpio -p linux-libre - -hdd=$(cat /temporal | grep 'hdd=') -grub-install ${hdd#*=} -grub-mkconfig -o /boot/grub/grub.cfg - -password=$(dialog --stdout --passwordbox "Insert root password" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Repeat root password" 8 40) -done - -usermod -p $(openssl passwd ${password}) root - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/userAccount.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/userAccount.sh deleted file mode 100755 index a9551d8..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/en/userAccount.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -user=$(cat /temporal | grep "userName") - -password=$(dialog --stdout --passwordbox "Insert ${user#*=} password" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Reply password" 8 40) -done - -useradd -m -g users -G "wheel" -s /bin/bash -p $(openssl passwd $password) ${user#*=} - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/install.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/install.sh deleted file mode 100755 index 32d2a47..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/install.sh +++ /dev/null @@ -1,231 +0,0 @@ -#!/bin/bash -#Temporal is a file that contains parameters to use when access to chroot - -keys=(parabola archlinux) -if [ $(uname -m) = i686 ]; then - keys+=(archlinux32) -fi - -if [ ! -f ~/.scriptsInstallation/.pacman ]; then - pacman -Sy ${keys[@]/%/-keyring} --noconfirm - pacman-key --populate ${keys[@]} - pacman-key --refresh-keys - case $? in - 0) touch ~/.scriptsInstallation/.pacman - ;; - *) false - ;; - esac -fi - -partition(){ - - #Search and show the Hard Disks to select - aux=$(ls /dev/sd?) - index=0 - for i in $aux; do - hdds[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - hdd=$(dialog --stdout --radiolist "Selecciona Disco Duro" 20 70 50 ${hdds[@]}) - - #If exist the line delete - if (cat ~/.scriptsInstallation/temporal | grep "hdd=") &>/dev/null - then - sed -i -e '/hdd=*/d' ~/.scriptsInstallation/temporal - fi - - #And add the new line with new parameter - echo "hdd=$hdd" >> ~/.scriptsInstallation/temporal - - selection=$(dialog --stdout --menu "Metodo de Particionado" 20 70 50 \ - 1 "Usar todo el disco con swap (1GB) y /" \ - 2 "Usar gparted para personalizar" ) - - case $selection in - 1) - umount /mnt &> /dev/null - #Create msdos partition table - parted -s $hdd -- mklabel msdos - - #Create partition swap and / - parted -s $hdd -- mkpart primary 1MiB 1000MiB mkpart primary 1000MiB -1s - - #Boot option partition / - parted -s $hdd -- set 2 boot on - - #Format and partitions and mount / - (echo t; echo 1; echo 82; echo w) | fdisk $hdd - mkswap ${hdd}1 - mkfs.ext4 ${hdd}2 - mount ${hdd}2 /mnt - ;; - 2) - gparted $hdd - - #Search and show the partitions that select before. - aux=$(ls $hdd?) - index=0; - for i in $aux; do - partitions[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - partition=$(dialog --stdout --radiolist "Montar particion /" 20 70 50 ${partitions[@]}) - - #Mount partition / - umount /mnt &> /dev/null - mount $partition /mnt - - #Ask if you want mount other partitions - other=0 - while [ $other != 3 ]; do - other=$(dialog --stdout --menu "¿Montar otra particion?" 20 70 50 1 "/home" 2 "/boot" 3 "No") - - case $other in - 1) - umount /mnt/home &> /dev/null - mkdir /mnt/home &> /dev/null - mount $(dialog --stdout --radiolist "Montar particion /home" 20 70 50 ${partitions[@]}) /mnt/home - ;; - 2) - umount /mnt/boot &> /dev/null - mkdir /mnt/boot &> /dev/null - mount $(dialog --stdout --radiolist "Mount particion /boot" 20 70 50 ${partitions[@]}) /mnt/boot - ;; - *) - other=3 - ;; - esac - done - ;; - esac -} - - -option=0 -while [ option != 7 ]; do - option=$(dialog --stdout --menu "Instalación CLI de Parabola" 20 70 50 \ - 1 "Formatear y Montar Particiones" \ - 2 "Instalar Sistema Base" \ - 3 "Instalar GRUB" \ - 4 "Configuración del Sistema" \ - 5 "Crear Cuenta de Usuario" \ - 6 "(Opcional) Instalar Escritorio/Aplicaciones del Live DVD" \ - 7 "Salir" ) - - case $option in - 1) - partition - ;; - 2) - #Install base system - pacstrap /mnt base-openrc - pacstrap /mnt dialog - ;; - 3) - #Install grub - pacstrap /mnt grub - ;; - 4) - #Generate fstab and acces to chroot to do System Config - genfstab -p /mnt >> /mnt/etc/fstab - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/systemConfig.sh /mnt - chmod +x /mnt/systemConfig.sh - arch-chroot /mnt /systemConfig.sh - rm -r /mnt/systemConfig.sh - ;; - 5) - #Create a new username and save in temporal, to use after - if (cat ~/.scriptsInstallation/temporal | grep "userName=") &>/dev/null - then - sed -i -e '/userName=*/d' ~/.scriptsInstallation/temporal - fi - - echo "userName=$(dialog --stdout --inputbox "Introduce nombre de usuario" 8 40)" >> ~/.scriptsInstallation/temporal - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/userAccount.sh /mnt - chmod +x /mnt/userAccount.sh - arch-chroot /mnt /userAccount.sh - rm -r /mnt/userAccount.sh - ;; - 6) - #Packages to the X11 live - packages=( "xorg-server" - "xf86-input-evdev" - "xf86-input-synaptics" - "xf86-video-ati" - "xf86-video-dummy" - "xf86-video-fbdev" - "xf86-video-intel" - "xf86-video-nouveau" - "xf86-video-openchrome" - "xf86-video-sisusb" - "xf86-video-vesa" - "xf86-video-vmware" - "xf86-video-voodoo" - "xf86-video-qxl" - "xorg-xinit" - "gst-plugins-good" - "gst-libav" - "lxde" - "volumeicon" - "zenity" - "octopi" - "pulseaudio-alsa" - "alsa-utils" - "networkmanager-elogind" - "network-manager-applet" - "iceweasel" - "icedove" - "pidgin" - "gparted" - "smplayer" - "epdfview" - "gpicview" - "abiword" - "gnumeric" - "leafpad" - "galculator-gtk2" - "xarchiver" - "openrc-desktop" - "polkit-elogind" - "gvfs-mtp" - "gphoto2" - "xdg-user-dirs" - "gnome-screenshot" - ) - - #Install packages - pacstrap /mnt ${packages[@]} - user=$(cat ~/.scriptsInstallation/temporal | grep "userName" ) - - #Copy skel in the new system and desktop's background - cp -a /etc/skel/ /mnt/etc/ - cp -a /etc/wallpaper.png /mnt/etc/wallpaper.png - - #Puts the XKBMAP, start X11 automatically and icewm desktop - echo "setxkbmap $(cat ~/.codecheck | grep XKBMAP= | cut -d '=' -f 2)" > /mnt/etc/skel/.xinitrc - echo "exec startlxde" >> /mnt/etc/skel/.xinitrc - echo "startx" >> /mnt/etc/skel/.bash_profile - chmod +x /mnt/etc/skel/.xinitrc - cp -a /mnt/etc/skel/.[a-z]* /mnt/home/${user#*=}/ - cp -a ~/.scriptsInstallation/x11.sh /mnt - - #Enable services with OpenRC and configure other stuff - chmod +x /mnt/x11.sh - arch-chroot /mnt /x11.sh - rm /mnt/x11.sh - ;; - *) - #Delete temporal file and umount partitions - rm -r /mnt/temporal - umount /mnt/boot &> /dev/null - umount /mnt/home &> /dev/null - umount /mnt &> /dev/null - exit - ;; - esac -done diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/systemConfig.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/systemConfig.sh deleted file mode 100755 index 773d10c..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/systemConfig.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/bash - -HOSTNAME=$(dialog --stdout --inputbox "Introduce el nombre del sistema:" 8 40) -sed 's|localhost|'"${HOSTNAME}"'|' -i /etc/conf.d/hostname - -ln -s /usr/share/zoneinfo/$(dialog --stdout --inputbox "Introduce la Zona Horaria:\nPor ejemplo: Europe/Athens" 8 40) /etc/localtime - -keymaps=( - "ANSI-dvorak ANSI-dvorak off" - "amiga-de amiga-de off" - "amiga-us amiga-us off" - "applkey applkey off" - "atari-de atari-de off" - "atari-se atari-se off" - "atari-uk-falcon atari-uk-falcon off" - "atari-us atari-us off" - "azerty azerty off" - "backspace backspace off" - "bashkir bashkir off" - "be-latin1 be-latin1 off" - "bg-cp1251 bg-cp1251 off" - "bg-cp855 bg-cp855 off" - "bg_bds-cp1251 bg_bds-cp1251 off" - "bg_bds-utf8 bg_bds-utf8 off" - "bg_pho-cp1251 bg_pho-cp1251 off" - "bg_pho-utf8 bg_pho-utf8 off" - "br-abnt br-abnt off" - "br-abnt2 br-abnt2 off" - "br-latin1-abnt2 br-latin1-abnt2 off" - "br-latin1-us br-latin1-us off" - "by by off" - "by-cp1251 by-cp1251 off" - "bywin-cp1251 bywin-cp1251 off" - "cf cf off" - "colemak colemak off" - "croat croat off" - "ctrl ctrl off" - "cz cz off" - "cz-cp1250 cz-cp1250 off" - "cz-lat2 cz-lat2 off" - "cz-lat2-prog cz-lat2-prog off" - "cz-qwertz cz-qwertz off" - "cz-us-qwertz cz-us-qwertz off" - "de de off" - "de-latin1 de-latin1 off" - "de-latin1-nodeadkeys de-latin1-nodeadkeys off" - "de-mobii de-mobii off" - "de_CH-latin1 de_CH-latin1 off" - "de_alt_UTF-8 de_alt_UTF-8 off" - "defkeymap defkeymap off" - "defkeymap_V1.0 defkeymap_V1.0 off" - "dk dk off" - "dk-latin1 dk-latin1 off" - "dvorak dvorak off" - "dvorak-ca-fr dvorak-ca-fr off" - "dvorak-es dvorak-es off" - "dvorak-fr dvorak-fr off" - "dvorak-l dvorak-l off" - "dvorak-r dvorak-r off" - "dvorak-ru dvorak-ru off" - "dvorak-sv-a1 dvorak-sv-a1 off" - "dvorak-sv-a5 dvorak-sv-a5 off" - "dvorak-uk dvorak-uk off" - "emacs emacs off" - "emacs2 emacs2 off" - "es es off" - "es-cp850 es-cp850 off" - "es-olpc es-olpc off" - "et et off" - "et-nodeadkeys et-nodeadkeys off" - "euro euro off" - "euro1 euro1 off" - "euro2 euro2 off" - "fi fi off" - "fr fr off" - "fr-bepo fr-bepo off" - "fr-bepo-latin9 fr-bepo-latin9 off" - "fr-latin1 fr-latin1 off" - "fr-latin9 fr-latin9 off" - "fr-pc fr-pc off" - "fr_CH fr_CH off" - "fr_CH-latin1 fr_CH-latin1 off" - "gr gr off" - "gr-pc gr-pc off" - "hu hu off" - "hu101 hu101 off" - "il il off" - "il-heb il-heb off" - "il-phonetic il-phonetic off" - "is-latin1 is-latin1 off" - "is-latin1-us is-latin1-us off" - "it it off" - "it-ibm it-ibm off" - "it2 it2 off" - "jp106 jp106 off" - "kazakh kazakh off" - "keypad keypad off" - "ky_alt_sh-UTF-8 ky_alt_sh-UTF-8 off" - "kyrgyz kyrgyz off" - "la-latin1 la-latin1 off" - "lt lt off" - "lt.baltic lt.baltic off" - "lt.l4 lt.l4 off" - "lv lv off" - "lv-tilde lv-tilde off" - "mac-be mac-be off" - "mac-de-latin1 mac-de-latin1 off" - "mac-de-latin1-nodeadkeys mac-de-latin1-nodeadkeys off" - "mac-de_CH mac-de_CH off" - "mac-dk-latin1 mac-dk-latin1 off" - "mac-dvorak mac-dvorak off" - "mac-es mac-es off" - "mac-euro mac-euro off" - "mac-euro2 mac-euro2 off" - "mac-fi-latin1 mac-fi-latin1 off" - "mac-fr mac-fr off" - "mac-fr_CH-latin1 mac-fr_CH-latin1 off" - "mac-it mac-it off" - "mac-pl mac-pl off" - "mac-pt-latin1 mac-pt-latin1 off" - "mac-se mac-se off" - "mac-template mac-template off" - "mac-uk mac-uk off" - "mac-us mac-us off" - "mk mk off" - "mk-cp1251 mk-cp1251 off" - "mk-utf mk-utf off" - "mk0 mk0 off" - "nl nl off" - "nl2 nl2 off" - "no no off" - "no-dvorak no-dvorak off" - "no-latin1 no-latin1 off" - "pc110 pc110 off" - "pl pl off" - "pl1 pl1 off" - "pl2 pl2 off" - "pl3 pl3 off" - "pl4 pl4 off" - "pt-latin1 pt-latin1 off" - "pt-latin9 pt-latin9 off" - "pt-olpc pt-olpc off" - "ro ro off" - "ro_std ro_std off" - "ro_win ro_win off" - "ru ru off" - "ru-cp1251 ru-cp1251 off" - "ru-ms ru-ms off" - "ru-yawerty ru-yawerty off" - "ru1 ru1 off" - "ru2 ru2 off" - "ru3 ru3 off" - "ru4 ru4 off" - "ru_win ru_win off" - "ruwin_alt-CP1251 ruwin_alt-CP1251 off" - "ruwin_alt-KOI8-R ruwin_alt-KOI8-R off" - "ruwin_alt-UTF-8 ruwin_alt-UTF-8 off" - "ruwin_alt_sh-UTF-8 ruwin_alt_sh-UTF-8 off" - "ruwin_cplk-CP1251 ruwin_cplk-CP1251 off" - "ruwin_cplk-KOI8-R ruwin_cplk-KOI8-R off" - "ruwin_cplk-UTF-8 ruwin_cplk-UTF-8 off" - "ruwin_ct_sh-CP1251 ruwin_ct_sh-CP1251 off" - "ruwin_ct_sh-KOI8-R ruwin_ct_sh-KOI8-R off" - "ruwin_ct_sh-UTF-8 ruwin_ct_sh-UTF-8 off" - "ruwin_ctrl-CP1251 ruwin_ctrl-CP1251 off" - "ruwin_ctrl-KOI8-R ruwin_ctrl-KOI8-R off" - "ruwin_ctrl-UTF-8 ruwin_ctrl-UTF-8 off" - "se-fi-ir209 se-fi-ir209 off" - "se-fi-lat6 se-fi-lat6 off" - "se-ir209 se-ir209 off" - "se-lat6 se-lat6 off" - "sg sg off" - "sg-latin1 sg-latin1 off" - "sg-latin1-lk450 sg-latin1-lk450 off" - "sk-prog-qwerty sk-prog-qwerty off" - "sk-prog-qwertz sk-prog-qwertz off" - "sk-qwerty sk-qwerty off" - "sk-qwertz sk-qwertz off" - "slovene slovene off" - "sr-cy sr-cy off" - "sun-pl sun-pl off" - "sun-pl-altgraph sun-pl-altgraph off" - "sundvorak sundvorak off" - "sunkeymap sunkeymap off" - "sunt4-es sunt4-es off" - "sunt4-fi-latin1 sunt4-fi-latin1 off" - "sunt4-no-latin1 sunt4-no-latin1 off" - "sunt5-cz-us sunt5-cz-us off" - "sunt5-de-latin1 sunt5-de-latin1 off" - "sunt5-es sunt5-es off" - "sunt5-fi-latin1 sunt5-fi-latin1 off" - "sunt5-fr-latin1 sunt5-fr-latin1 off" - "sunt5-ru sunt5-ru off" - "sunt5-uk sunt5-uk off" - "sunt5-us-cz sunt5-us-cz off" - "sunt6-uk sunt6-uk off" - "sv-latin1 sv-latin1 off" - "tj_alt-UTF8 tj_alt-UTF8 off" - "tr_f-latin5 tr_f-latin5 off" - "tr_q-latin5 tr_q-latin5 off" - "tralt tralt off" - "trf trf off" - "trf-fgGIod trf-fgGIod off" - "trq trq off" - "ttwin_alt-UTF-8 ttwin_alt-UTF-8 off" - "ttwin_cplk-UTF-8 ttwin_cplk-UTF-8 off" - "ttwin_ct_sh-UTF-8 ttwin_ct_sh-UTF-8 off" - "ttwin_ctrl-UTF-8 ttwin_ctrl-UTF-8 off" - "ua ua off" - "ua-cp1251 ua-cp1251 off" - "ua-utf ua-utf off" - "ua-utf-ws ua-utf-ws off" - "ua-ws ua-ws off" - "uk uk off" - "unicode unicode off" - "us us on" - "us-acentos us-acentos off" - "wangbe wangbe off" - "wangbe2 wangbe2 off" - "windowkeys windowkeys off" -) - -echo "KEYMAP=$(dialog --stdout --radiolist "Selecciona la distribucion del teclado" 20 70 50 ${keymaps[@]})" > /etc/vconsole.conf - -aux=$(sed -e '1,23d' -e 's/#//g' -e 's/ /#/g' -e 's/..$//' /etc/locale.gen) -index=0 -for i in $aux; do - i=$(echo $i | sed -e 's/#/ /g') - locales+=("$i" "$i" off) - if [[ $i == "en_US.UTF-8 UTF-8" || $i == "en_US ISO-8859-1" ]]; then - locales[$index]="$i" - locales[$((index+1))]="$i" - locales[$((index+2))]="on" - fi - index=$((index+3)) -done - -locale=$(dialog --stdout --checklist "Selecciona las Localizaciones" 20 70 50 "${locales[@]}") -locale=$(echo ${locale} | sed -e 's/" "/\n/g' -e 's/ /#/g' -e 's/"//g') - -for i in ${locale[@]}; do - i=$(echo $i | sed -e 's/#/ /g') - sed -i -e "s/#$i/$i/g" /etc/locale.gen -done - -locale-gen - -aux=$(locale -a) -index=0 -for i in $aux; do - langs+=("$i" "$i" on) - index=$((index+1)) -done - -echo "LANG=$(dialog --stdout --radiolist "Selecciona tu idioma" 20 70 50 ${langs[@]})" > /etc/locale.conf - -mkinitcpio -p linux-libre - -hdd=$(cat /temporal | grep 'hdd=') -grub-install ${hdd#*=} -grub-mkconfig -o /boot/grub/grub.cfg - -password=$(dialog --stdout --passwordbox "Inserta la contraseña para el administrador" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Repite la contraseña para el administrador" 8 40) -done - -usermod -p $(openssl passwd ${password}) root - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/userAccount.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/userAccount.sh deleted file mode 100755 index 4ed7437..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/es/userAccount.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -user=$(cat /temporal | grep "userName") - -password=$(dialog --stdout --passwordbox "Introduce la contraseñara para el usuario ${user#*=}" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Repite la contraseña" 8 40) -done - -useradd -m -g users -G "wheel" -s /bin/bash -p $(openssl passwd $password) ${user#*=} - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/install.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/install.sh deleted file mode 100755 index 57abe22..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/install.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash -#Temporal is a file that contains parameters to use when access to chroot - -keys=(parabola archlinux) -if [ $(uname -m) = i686 ]; then - keys+=(archlinux32) -fi - -if [ ! -f ~/.scriptsInstallation/.pacman ]; then - pacman -Sy ${keys[@]/%/-keyring} --noconfirm - pacman-key --populate ${keys[@]} - pacman-key --refresh-keys - case $? in - 0) touch ~/.scriptsInstallation/.pacman - ;; - *) false - ;; - esac -fi - -partition(){ - - #Search and show the Hard Disks to select - aux=$(ls /dev/sd?) - index=0 - for i in $aux; do - hdds[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - hdd=$(dialog --stdout --radiolist "Selecciona Disco Duro" 20 70 50 ${hdds[@]}) - - #If exist the line delete - if (cat ~/.scriptsInstallation/temporal | grep "hdd=") &>/dev/null - then - sed -i -e '/hdd=*/d' ~/.scriptsInstallation/temporal - fi - - #And add the new line with new parameter - echo "hdd=$hdd" >> ~/.scriptsInstallation/temporal - selection=$(dialog --stdout --menu "Metodo de Particionado" 20 70 50 \ - 1 "Usar todo o disco con swap (1GB) and /" \ - 2 "Usar gparted para personalizar" ) - - case $selection in - 1) - umount /mnt &> /dev/null - #Create msdos partition table - parted -s $hdd -- mklabel msdos - - #Create partition swap and / - parted -s $hdd -- mkpart primary 1MiB 1000MiB mkpart primary 1000MiB -1s - - #Boot option partition / - parted -s $hdd -- set 2 boot on - - #Format and partitions and mount / - (echo t; echo 1; echo 82; echo w) | fdisk $hdd - mkswap ${hdd}1 - mkfs.ext4 ${hdd}2 - mount ${hdd}2 /mnt - ;; - 2) - gparted $hdd - - #Search and show the partitions that select before. - aux=$(ls $hdd?) - index=0; - for i in $aux; do - partitions[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - partition=$(dialog --stdout --radiolist "Montar particion /" 20 70 50 ${partitions[@]}) - - #Mount partition / - umount /mnt &> /dev/null - mount $partition /mnt - - #Ask if you want mount other partitions - other=0 - while [ $other != 3 ]; do - other=$(dialog --stdout --menu "¿Montar outra particion?" 20 70 50 1 "/home" 2 "/boot" 3 "No") - - case $other in - 1) - umount /mnt/home &> /dev/null - mkdir /mnt/home &> /dev/null - mount $(dialog --stdout --radiolist "Montar particion /home" 20 70 50 ${partitions[@]}) /mnt/home - ;; - 2) - umount /mnt/boot &> /dev/null - mkdir /mnt/boot &> /dev/null - mount $(dialog --stdout --radiolist "Mount particion /boot" 20 70 50 ${partitions[@]}) /mnt/boot - ;; - *) - other=3 - ;; - esac - done - ;; - esac -} - - -option=0 -while [ option != 7 ]; do - option=$(dialog --stdout --menu "Instalación CLI de Parabola" 20 70 50 \ - 1 "Formatear e Montar Particiones" \ - 2 "Instalar Sistema Base" \ - 3 "Instalar GRUB" \ - 4 "Configuración do Sistema" \ - 5 "Crear Conta de Usuario" \ - 6 "(Opcional) Instalar Escritorio/Aplicaciones de Live DVD" \ - 7 "Salir" ) - - case $option in - 1) - partition - ;; - 2) - #Install base system - pacstrap /mnt base-openrc - pacstrap /mnt dialog - ;; - 3) - #Install grub - pacstrap /mnt grub - ;; - 4) - #Generate fstab and acces to chroot to do System Config - genfstab -p /mnt >> /mnt/etc/fstab - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/systemConfig.sh /mnt - chmod +x /mnt/systemConfig.sh - arch-chroot /mnt /systemConfig.sh - rm -r /mnt/systemConfig.sh - ;; - 5) - #Create a new username and save in temporal, to use after - if (cat ~/.scriptsInstallation/temporal | grep "userName=") &>/dev/null - then - sed -i -e '/userName=*/d' ~/.scriptsInstallation/temporal - fi - - echo "userName=$(dialog --stdout --inputbox "Introduce un nome de usuario" 8 40)" >> ~/.scriptsInstallation/temporal - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/userAccount.sh /mnt - chmod +x /mnt/userAccount.sh - arch-chroot /mnt /userAccount.sh - rm -r /mnt/userAccount.sh - ;; - 6) - #Packages to the X11 live - packages=( "xorg-server" - "xf86-input-evdev" - "xf86-input-synaptics" - "xf86-video-ati" - "xf86-video-dummy" - "xf86-video-fbdev" - "xf86-video-intel" - "xf86-video-nouveau" - "xf86-video-openchrome" - "xf86-video-sisusb" - "xf86-video-vesa" - "xf86-video-vmware" - "xf86-video-voodoo" - "xf86-video-qxl" - "xorg-xinit" - "gst-plugins-good" - "gst-libav" - "lxde" - "volumeicon" - "zenity" - "octopi" - "pulseaudio-alsa" - "alsa-utils" - "networkmanager-elogind" - "network-manager-applet" - "iceweasel" - "icedove" - "pidgin" - "gparted" - "smplayer" - "epdfview" - "gpicview" - "abiword" - "gnumeric" - "leafpad" - "galculator-gtk2" - "xarchiver" - "openrc-desktop" - "polkit-elogind" - "gvfs-mtp" - "gphoto2" - "xdg-user-dirs" - "gnome-screenshot" - ) - - #Install packages - pacstrap /mnt ${packages[@]} - user=$(cat ~/.scriptsInstallation/temporal | grep "userName" ) - - #Copy skel in the new system and desktop's background - cp -a /etc/skel/ /mnt/etc/ - cp -a /etc/wallpaper.png /mnt/etc/wallpaper.png - - #Puts the XKBMAP, start X11 automatically and icewm desktop - echo "setxkbmap $(cat ~/.codecheck | grep XKBMAP= | cut -d '=' -f 2)" > /mnt/etc/skel/.xinitrc - echo "exec startlxde" >> /mnt/etc/skel/.xinitrc - echo "startx" >> /mnt/etc/skel/.bash_profile - chmod +x /mnt/etc/skel/.xinitrc - cp -a /mnt/etc/skel/.[a-z]* /mnt/home/${user#*=}/ - cp -a ~/.scriptsInstallation/x11.sh /mnt - - #Enable services with OpenRC and configure other stuff - chmod +x /mnt/x11.sh - arch-chroot /mnt /x11.sh - rm /mnt/x11.sh - ;; - *) - #Delete temporal file and umount partitions - rm -r /mnt/temporal - umount /mnt/boot &> /dev/null - umount /mnt/home &> /dev/null - umount /mnt &> /dev/null - exit - ;; - esac -done diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/systemConfig.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/systemConfig.sh deleted file mode 100755 index 0fe3c68..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/systemConfig.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/bash - -HOSTNAME=$(dialog --stdout --inputbox "Introduce o nome do sistema:" 8 40) -sed 's|localhost|'"${HOSTNAME}"'|' -i /etc/conf.d/hostname - -ln -s /usr/share/zoneinfo/$(dialog --stdout --inputbox "Introduce a Zona Horaria:\nPor ejemplo: Europe/Athens" 8 40) /etc/localtime - -keymaps=( - "ANSI-dvorak ANSI-dvorak off" - "amiga-de amiga-de off" - "amiga-us amiga-us off" - "applkey applkey off" - "atari-de atari-de off" - "atari-se atari-se off" - "atari-uk-falcon atari-uk-falcon off" - "atari-us atari-us off" - "azerty azerty off" - "backspace backspace off" - "bashkir bashkir off" - "be-latin1 be-latin1 off" - "bg-cp1251 bg-cp1251 off" - "bg-cp855 bg-cp855 off" - "bg_bds-cp1251 bg_bds-cp1251 off" - "bg_bds-utf8 bg_bds-utf8 off" - "bg_pho-cp1251 bg_pho-cp1251 off" - "bg_pho-utf8 bg_pho-utf8 off" - "br-abnt br-abnt off" - "br-abnt2 br-abnt2 off" - "br-latin1-abnt2 br-latin1-abnt2 off" - "br-latin1-us br-latin1-us off" - "by by off" - "by-cp1251 by-cp1251 off" - "bywin-cp1251 bywin-cp1251 off" - "cf cf off" - "colemak colemak off" - "croat croat off" - "ctrl ctrl off" - "cz cz off" - "cz-cp1250 cz-cp1250 off" - "cz-lat2 cz-lat2 off" - "cz-lat2-prog cz-lat2-prog off" - "cz-qwertz cz-qwertz off" - "cz-us-qwertz cz-us-qwertz off" - "de de off" - "de-latin1 de-latin1 off" - "de-latin1-nodeadkeys de-latin1-nodeadkeys off" - "de-mobii de-mobii off" - "de_CH-latin1 de_CH-latin1 off" - "de_alt_UTF-8 de_alt_UTF-8 off" - "defkeymap defkeymap off" - "defkeymap_V1.0 defkeymap_V1.0 off" - "dk dk off" - "dk-latin1 dk-latin1 off" - "dvorak dvorak off" - "dvorak-ca-fr dvorak-ca-fr off" - "dvorak-es dvorak-es off" - "dvorak-fr dvorak-fr off" - "dvorak-l dvorak-l off" - "dvorak-r dvorak-r off" - "dvorak-ru dvorak-ru off" - "dvorak-sv-a1 dvorak-sv-a1 off" - "dvorak-sv-a5 dvorak-sv-a5 off" - "dvorak-uk dvorak-uk off" - "emacs emacs off" - "emacs2 emacs2 off" - "es es off" - "es-cp850 es-cp850 off" - "es-olpc es-olpc off" - "et et off" - "et-nodeadkeys et-nodeadkeys off" - "euro euro off" - "euro1 euro1 off" - "euro2 euro2 off" - "fi fi off" - "fr fr off" - "fr-bepo fr-bepo off" - "fr-bepo-latin9 fr-bepo-latin9 off" - "fr-latin1 fr-latin1 off" - "fr-latin9 fr-latin9 off" - "fr-pc fr-pc off" - "fr_CH fr_CH off" - "fr_CH-latin1 fr_CH-latin1 off" - "gr gr off" - "gr-pc gr-pc off" - "hu hu off" - "hu101 hu101 off" - "il il off" - "il-heb il-heb off" - "il-phonetic il-phonetic off" - "is-latin1 is-latin1 off" - "is-latin1-us is-latin1-us off" - "it it off" - "it-ibm it-ibm off" - "it2 it2 off" - "jp106 jp106 off" - "kazakh kazakh off" - "keypad keypad off" - "ky_alt_sh-UTF-8 ky_alt_sh-UTF-8 off" - "kyrgyz kyrgyz off" - "la-latin1 la-latin1 off" - "lt lt off" - "lt.baltic lt.baltic off" - "lt.l4 lt.l4 off" - "lv lv off" - "lv-tilde lv-tilde off" - "mac-be mac-be off" - "mac-de-latin1 mac-de-latin1 off" - "mac-de-latin1-nodeadkeys mac-de-latin1-nodeadkeys off" - "mac-de_CH mac-de_CH off" - "mac-dk-latin1 mac-dk-latin1 off" - "mac-dvorak mac-dvorak off" - "mac-es mac-es off" - "mac-euro mac-euro off" - "mac-euro2 mac-euro2 off" - "mac-fi-latin1 mac-fi-latin1 off" - "mac-fr mac-fr off" - "mac-fr_CH-latin1 mac-fr_CH-latin1 off" - "mac-it mac-it off" - "mac-pl mac-pl off" - "mac-pt-latin1 mac-pt-latin1 off" - "mac-se mac-se off" - "mac-template mac-template off" - "mac-uk mac-uk off" - "mac-us mac-us off" - "mk mk off" - "mk-cp1251 mk-cp1251 off" - "mk-utf mk-utf off" - "mk0 mk0 off" - "nl nl off" - "nl2 nl2 off" - "no no off" - "no-dvorak no-dvorak off" - "no-latin1 no-latin1 off" - "pc110 pc110 off" - "pl pl off" - "pl1 pl1 off" - "pl2 pl2 off" - "pl3 pl3 off" - "pl4 pl4 off" - "pt-latin1 pt-latin1 off" - "pt-latin9 pt-latin9 off" - "pt-olpc pt-olpc off" - "ro ro off" - "ro_std ro_std off" - "ro_win ro_win off" - "ru ru off" - "ru-cp1251 ru-cp1251 off" - "ru-ms ru-ms off" - "ru-yawerty ru-yawerty off" - "ru1 ru1 off" - "ru2 ru2 off" - "ru3 ru3 off" - "ru4 ru4 off" - "ru_win ru_win off" - "ruwin_alt-CP1251 ruwin_alt-CP1251 off" - "ruwin_alt-KOI8-R ruwin_alt-KOI8-R off" - "ruwin_alt-UTF-8 ruwin_alt-UTF-8 off" - "ruwin_alt_sh-UTF-8 ruwin_alt_sh-UTF-8 off" - "ruwin_cplk-CP1251 ruwin_cplk-CP1251 off" - "ruwin_cplk-KOI8-R ruwin_cplk-KOI8-R off" - "ruwin_cplk-UTF-8 ruwin_cplk-UTF-8 off" - "ruwin_ct_sh-CP1251 ruwin_ct_sh-CP1251 off" - "ruwin_ct_sh-KOI8-R ruwin_ct_sh-KOI8-R off" - "ruwin_ct_sh-UTF-8 ruwin_ct_sh-UTF-8 off" - "ruwin_ctrl-CP1251 ruwin_ctrl-CP1251 off" - "ruwin_ctrl-KOI8-R ruwin_ctrl-KOI8-R off" - "ruwin_ctrl-UTF-8 ruwin_ctrl-UTF-8 off" - "se-fi-ir209 se-fi-ir209 off" - "se-fi-lat6 se-fi-lat6 off" - "se-ir209 se-ir209 off" - "se-lat6 se-lat6 off" - "sg sg off" - "sg-latin1 sg-latin1 off" - "sg-latin1-lk450 sg-latin1-lk450 off" - "sk-prog-qwerty sk-prog-qwerty off" - "sk-prog-qwertz sk-prog-qwertz off" - "sk-qwerty sk-qwerty off" - "sk-qwertz sk-qwertz off" - "slovene slovene off" - "sr-cy sr-cy off" - "sun-pl sun-pl off" - "sun-pl-altgraph sun-pl-altgraph off" - "sundvorak sundvorak off" - "sunkeymap sunkeymap off" - "sunt4-es sunt4-es off" - "sunt4-fi-latin1 sunt4-fi-latin1 off" - "sunt4-no-latin1 sunt4-no-latin1 off" - "sunt5-cz-us sunt5-cz-us off" - "sunt5-de-latin1 sunt5-de-latin1 off" - "sunt5-es sunt5-es off" - "sunt5-fi-latin1 sunt5-fi-latin1 off" - "sunt5-fr-latin1 sunt5-fr-latin1 off" - "sunt5-ru sunt5-ru off" - "sunt5-uk sunt5-uk off" - "sunt5-us-cz sunt5-us-cz off" - "sunt6-uk sunt6-uk off" - "sv-latin1 sv-latin1 off" - "tj_alt-UTF8 tj_alt-UTF8 off" - "tr_f-latin5 tr_f-latin5 off" - "tr_q-latin5 tr_q-latin5 off" - "tralt tralt off" - "trf trf off" - "trf-fgGIod trf-fgGIod off" - "trq trq off" - "ttwin_alt-UTF-8 ttwin_alt-UTF-8 off" - "ttwin_cplk-UTF-8 ttwin_cplk-UTF-8 off" - "ttwin_ct_sh-UTF-8 ttwin_ct_sh-UTF-8 off" - "ttwin_ctrl-UTF-8 ttwin_ctrl-UTF-8 off" - "ua ua off" - "ua-cp1251 ua-cp1251 off" - "ua-utf ua-utf off" - "ua-utf-ws ua-utf-ws off" - "ua-ws ua-ws off" - "uk uk off" - "unicode unicode off" - "us us on" - "us-acentos us-acentos off" - "wangbe wangbe off" - "wangbe2 wangbe2 off" - "windowkeys windowkeys off" -) - -echo "KEYMAP=$(dialog --stdout --radiolist "Selecciona a distribucion do teclado" 20 70 50 ${keymaps[@]})" > /etc/vconsole.conf - -aux=$(sed -e '1,23d' -e 's/#//g' -e 's/ /#/g' -e 's/..$//' /etc/locale.gen) -index=0 -for i in $aux; do - i=$(echo $i | sed -e 's/#/ /g') - locales+=("$i" "$i" off) - if [[ $i == "en_US.UTF-8 UTF-8" || $i == "en_US ISO-8859-1" ]]; then - locales[$index]="$i" - locales[$((index+1))]="$i" - locales[$((index+2))]="on" - fi - index=$((index+3)) -done - -locale=$(dialog --stdout --checklist "Selecciona as Localizacions" 20 70 50 "${locales[@]}") -locale=$(echo ${locale} | sed -e 's/" "/\n/g' -e 's/ /#/g' -e 's/"//g') - -for i in ${locale[@]}; do - i=$(echo $i | sed -e 's/#/ /g') - sed -i -e "s/#$i/$i/g" /etc/locale.gen -done - -locale-gen - -aux=$(locale -a) -index=0 -for i in $aux; do - langs+=("$i" "$i" on) - index=$((index+1)) -done - -echo "LANG=$(dialog --stdout --radiolist "Selecciona o teu idioma" 20 70 50 ${langs[@]})" > /etc/locale.conf - -mkinitcpio -p linux-libre - -hdd=$(cat /temporal | grep 'hdd=') -grub-install ${hdd#*=} -grub-mkconfig -o /boot/grub/grub.cfg - -password=$(dialog --stdout --passwordbox "Insire o contrasinal para o administrador" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Repite o contrasinal para o administrador" 8 40) -done - -usermod -p $(openssl passwd ${password}) root - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/userAccount.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/userAccount.sh deleted file mode 100755 index aa1d33a..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/gl/userAccount.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -user=$(cat /temporal | grep "userName") - -password=$(dialog --stdout --passwordbox "Introduce o contrasinal para o usuario ${user#*=}" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Repite o contrasinal" 8 40) -done - -useradd -m -g users -G "wheel" -s /bin/bash -p $(openssl passwd $password) ${user#*=} - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/install.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/install.sh deleted file mode 100755 index c47cd6d..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/install.sh +++ /dev/null @@ -1,231 +0,0 @@ -#!/bin/bash -#Temporal is a file that contains parameters to use when access to chroot - -keys=(parabola archlinux) -if [ $(uname -m) = i686 ]; then - keys+=(archlinux32) -fi - -if [ ! -f ~/.scriptsInstallation/.pacman ]; then - pacman -Sy ${keys[@]/%/-keyring} --noconfirm - pacman-key --populate ${keys[@]} - pacman-key --refresh-keys - case $? in - 0) touch ~/.scriptsInstallation/.pacman - ;; - *) false - ;; - esac -fi - -partition(){ - - #Search and show the Hard Disks to select - aux=$(ls /dev/sd?) - index=0 - for i in $aux; do - hdds[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - hdd=$(dialog --stdout --radiolist "Escolha o Disco" 20 70 50 ${hdds[@]}) - - #If exist the line delete - if (cat ~/.scriptsInstallation/temporal | grep "hdd=") &>/dev/null - then - sed -i -e '/hdd=*/d' ~/.scriptsInstallation/temporal - fi - - #And add the new line with new parameter - echo "hdd=$hdd" >> ~/.scriptsInstallation/temporal - - selection=$(dialog --stdout --menu "Método de Particionamento" 20 70 50 \ - 1 "Usar todo o disco com o swap (1GB) e /" \ - 2 "Usar o gparted para personalizar" ) - - case $selection in - 1) - umount /mnt &> /dev/null - #Create msdos partition table - parted -s $hdd -- mklabel msdos - - #Create partition swap and / - parted -s $hdd -- mkpart primary 1MiB 1000MiB mkpart primary 1000MiB -1s - - #Boot option partition / - parted -s $hdd -- set 2 boot on - - #Format and partitions and mount / - (echo t; echo 1; echo 82; echo w) | fdisk $hdd - mkswap ${hdd}1 - mkfs.ext4 ${hdd}2 - mount ${hdd}2 /mnt - ;; - 2) - gparted $hdd - - #Search and show the partitions that select before. - aux=$(ls $hdd?) - index=0; - for i in $aux; do - partitions[$index]="${i} ${i#/*/} off" - index=$((index+1)) - done - - partition=$(dialog --stdout --radiolist "Montar a partição /" 20 70 50 ${partitions[@]}) - - #Mount partition / - umount /mnt &> /dev/null - mount $partition /mnt - - #Ask if you want mount other partitions - other=0 - while [ $other != 3 ]; do - other=$(dialog --stdout --menu "Quer montar outra partição?" 20 70 50 1 "/home" 2 "/boot" 3 "Não") - - case $other in - 1) - umount /mnt/home &> /dev/null - mkdir /mnt/home &> /dev/null - mount $(dialog --stdout --radiolist "Montar a partição /home" 20 70 50 ${partitions[@]}) /mnt/home - ;; - 2) - umount /mnt/boot &> /dev/null - mkdir /mnt/boot &> /dev/null - mount $(dialog --stdout --radiolist "Montar a partição /boot" 20 70 50 ${partitions[@]}) /mnt/boot - ;; - *) - other=3 - ;; - esac - done - ;; - esac -} - - -option=0 -while [ option != 7 ]; do - option=$(dialog --stdout --menu "Instalação CLI da Parabola" 20 70 50 \ - 1 "Formatar e Montar as Partições" \ - 2 "Instalar o Sistema Base" \ - 3 "Instalar o GRUB" \ - 4 "Configuração do Sistema" \ - 5 "Adicionar uma Conta de Usuário" \ - 6 "(Opcional) Instalar Ambiente Gráfico/Aplicativos da Live DVD" \ - 7 "Sair" ) - - case $option in - 1) - partition - ;; - 2) - #Install base system - pacstrap /mnt base-openrc - pacstrap /mnt dialog - ;; - 3) - #Install grub - pacstrap /mnt grub - ;; - 4) - #Generate fstab and acces to chroot to do System Config - genfstab -p /mnt >> /mnt/etc/fstab - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/systemConfig.sh /mnt - chmod +x /mnt/systemConfig.sh - arch-chroot /mnt /systemConfig.sh - rm -r /mnt/systemConfig.sh - ;; - 5) - #Create a new username and save in temporal, to use after - if (cat ~/.scriptsInstallation/temporal | grep "userName=") &>/dev/null - then - sed -i -e '/userName=*/d' ~/.scriptsInstallation/temporal - fi - - echo "userName=$(dialog --stdout --inputbox "Insira o nome do usuário" 8 40)" >> ~/.scriptsInstallation/temporal - cp ~/.scriptsInstallation/temporal /mnt - cp ~/.scriptsInstallation/userAccount.sh /mnt - chmod +x /mnt/userAccount.sh - arch-chroot /mnt /userAccount.sh - rm -r /mnt/userAccount.sh - ;; - 6) - #Packages to the X11 live - packages=( "xorg-server" - "xf86-input-evdev" - "xf86-input-synaptics" - "xf86-video-ati" - "xf86-video-dummy" - "xf86-video-fbdev" - "xf86-video-intel" - "xf86-video-nouveau" - "xf86-video-openchrome" - "xf86-video-sisusb" - "xf86-video-vesa" - "xf86-video-vmware" - "xf86-video-voodoo" - "xf86-video-qxl" - "xorg-xinit" - "gst-plugins-good" - "gst-libav" - "lxde" - "volumeicon" - "zenity" - "octopi" - "pulseaudio-alsa" - "alsa-utils" - "networkmanager-elogind" - "network-manager-applet" - "iceweasel" - "icedove" - "pidgin" - "gparted" - "smplayer" - "epdfview" - "gpicview" - "abiword" - "gnumeric" - "leafpad" - "galculator-gtk2" - "xarchiver" - "openrc-desktop" - "polkit-elogind" - "gvfs-mtp" - "gphoto2" - "xdg-user-dirs" - "gnome-screenshot" - ) - - #Install packages - pacstrap /mnt ${packages[@]} - user=$(cat ~/.scriptsInstallation/temporal | grep "userName" ) - - #Copy skel in the new system and desktop's background - cp -a /etc/skel/ /mnt/etc/ - cp -a /etc/wallpaper.png /mnt/etc/wallpaper.png - - #Puts the XKBMAP, start X11 automatically and icewm desktop - echo "setxkbmap $(cat ~/.codecheck | grep XKBMAP= | cut -d '=' -f 2)" > /mnt/etc/skel/.xinitrc - echo "exec startlxde" >> /mnt/etc/skel/.xinitrc - echo "startx" >> /mnt/etc/skel/.bash_profile - chmod +x /mnt/etc/skel/.xinitrc - cp -a /mnt/etc/skel/.[a-z]* /mnt/home/${user#*=}/ - cp -a ~/.scriptsInstallation/x11.sh /mnt - - #Enable services with OpenRC and configure other stuff - chmod +x /mnt/x11.sh - arch-chroot /mnt /x11.sh - rm /mnt/x11.sh - ;; - *) - #Delete temporal file and umount partitions - rm -r /mnt/temporal - umount /mnt/boot &> /dev/null - umount /mnt/home &> /dev/null - umount /mnt &> /dev/null - exit - ;; - esac -done diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/systemConfig.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/systemConfig.sh deleted file mode 100755 index 983d0ba..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/systemConfig.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/bash - -HOSTNAME=$(dialog --stdout --inputbox "Adicione o nome do sistema:" 8 40) -sed 's|localhost|'"${HOSTNAME}"'|' -i /etc/conf.d/hostname - -ln -s /usr/share/zoneinfo/$(dialog --stdout --inputbox "Adicione o Fuso Horário:\nPor exemplo: America/Sao_Paulo" 8 40) /etc/localtime - -keymaps=( - "ANSI-dvorak ANSI-dvorak off" - "amiga-de amiga-de off" - "amiga-us amiga-us off" - "applkey applkey off" - "atari-de atari-de off" - "atari-se atari-se off" - "atari-uk-falcon atari-uk-falcon off" - "atari-us atari-us off" - "azerty azerty off" - "backspace backspace off" - "bashkir bashkir off" - "be-latin1 be-latin1 off" - "bg-cp1251 bg-cp1251 off" - "bg-cp855 bg-cp855 off" - "bg_bds-cp1251 bg_bds-cp1251 off" - "bg_bds-utf8 bg_bds-utf8 off" - "bg_pho-cp1251 bg_pho-cp1251 off" - "bg_pho-utf8 bg_pho-utf8 off" - "br-abnt br-abnt off" - "br-abnt2 br-abnt2 off" - "br-latin1-abnt2 br-latin1-abnt2 off" - "br-latin1-us br-latin1-us off" - "by by off" - "by-cp1251 by-cp1251 off" - "bywin-cp1251 bywin-cp1251 off" - "cf cf off" - "colemak colemak off" - "croat croat off" - "ctrl ctrl off" - "cz cz off" - "cz-cp1250 cz-cp1250 off" - "cz-lat2 cz-lat2 off" - "cz-lat2-prog cz-lat2-prog off" - "cz-qwertz cz-qwertz off" - "cz-us-qwertz cz-us-qwertz off" - "de de off" - "de-latin1 de-latin1 off" - "de-latin1-nodeadkeys de-latin1-nodeadkeys off" - "de-mobii de-mobii off" - "de_CH-latin1 de_CH-latin1 off" - "de_alt_UTF-8 de_alt_UTF-8 off" - "defkeymap defkeymap off" - "defkeymap_V1.0 defkeymap_V1.0 off" - "dk dk off" - "dk-latin1 dk-latin1 off" - "dvorak dvorak off" - "dvorak-ca-fr dvorak-ca-fr off" - "dvorak-es dvorak-es off" - "dvorak-fr dvorak-fr off" - "dvorak-l dvorak-l off" - "dvorak-r dvorak-r off" - "dvorak-ru dvorak-ru off" - "dvorak-sv-a1 dvorak-sv-a1 off" - "dvorak-sv-a5 dvorak-sv-a5 off" - "dvorak-uk dvorak-uk off" - "emacs emacs off" - "emacs2 emacs2 off" - "es es off" - "es-cp850 es-cp850 off" - "es-olpc es-olpc off" - "et et off" - "et-nodeadkeys et-nodeadkeys off" - "euro euro off" - "euro1 euro1 off" - "euro2 euro2 off" - "fi fi off" - "fr fr off" - "fr-bepo fr-bepo off" - "fr-bepo-latin9 fr-bepo-latin9 off" - "fr-latin1 fr-latin1 off" - "fr-latin9 fr-latin9 off" - "fr-pc fr-pc off" - "fr_CH fr_CH off" - "fr_CH-latin1 fr_CH-latin1 off" - "gr gr off" - "gr-pc gr-pc off" - "hu hu off" - "hu101 hu101 off" - "il il off" - "il-heb il-heb off" - "il-phonetic il-phonetic off" - "is-latin1 is-latin1 off" - "is-latin1-us is-latin1-us off" - "it it off" - "it-ibm it-ibm off" - "it2 it2 off" - "jp106 jp106 off" - "kazakh kazakh off" - "keypad keypad off" - "ky_alt_sh-UTF-8 ky_alt_sh-UTF-8 off" - "kyrgyz kyrgyz off" - "la-latin1 la-latin1 off" - "lt lt off" - "lt.baltic lt.baltic off" - "lt.l4 lt.l4 off" - "lv lv off" - "lv-tilde lv-tilde off" - "mac-be mac-be off" - "mac-de-latin1 mac-de-latin1 off" - "mac-de-latin1-nodeadkeys mac-de-latin1-nodeadkeys off" - "mac-de_CH mac-de_CH off" - "mac-dk-latin1 mac-dk-latin1 off" - "mac-dvorak mac-dvorak off" - "mac-es mac-es off" - "mac-euro mac-euro off" - "mac-euro2 mac-euro2 off" - "mac-fi-latin1 mac-fi-latin1 off" - "mac-fr mac-fr off" - "mac-fr_CH-latin1 mac-fr_CH-latin1 off" - "mac-it mac-it off" - "mac-pl mac-pl off" - "mac-pt-latin1 mac-pt-latin1 off" - "mac-se mac-se off" - "mac-template mac-template off" - "mac-uk mac-uk off" - "mac-us mac-us off" - "mk mk off" - "mk-cp1251 mk-cp1251 off" - "mk-utf mk-utf off" - "mk0 mk0 off" - "nl nl off" - "nl2 nl2 off" - "no no off" - "no-dvorak no-dvorak off" - "no-latin1 no-latin1 off" - "pc110 pc110 off" - "pl pl off" - "pl1 pl1 off" - "pl2 pl2 off" - "pl3 pl3 off" - "pl4 pl4 off" - "pt-latin1 pt-latin1 off" - "pt-latin9 pt-latin9 off" - "pt-olpc pt-olpc off" - "ro ro off" - "ro_std ro_std off" - "ro_win ro_win off" - "ru ru off" - "ru-cp1251 ru-cp1251 off" - "ru-ms ru-ms off" - "ru-yawerty ru-yawerty off" - "ru1 ru1 off" - "ru2 ru2 off" - "ru3 ru3 off" - "ru4 ru4 off" - "ru_win ru_win off" - "ruwin_alt-CP1251 ruwin_alt-CP1251 off" - "ruwin_alt-KOI8-R ruwin_alt-KOI8-R off" - "ruwin_alt-UTF-8 ruwin_alt-UTF-8 off" - "ruwin_alt_sh-UTF-8 ruwin_alt_sh-UTF-8 off" - "ruwin_cplk-CP1251 ruwin_cplk-CP1251 off" - "ruwin_cplk-KOI8-R ruwin_cplk-KOI8-R off" - "ruwin_cplk-UTF-8 ruwin_cplk-UTF-8 off" - "ruwin_ct_sh-CP1251 ruwin_ct_sh-CP1251 off" - "ruwin_ct_sh-KOI8-R ruwin_ct_sh-KOI8-R off" - "ruwin_ct_sh-UTF-8 ruwin_ct_sh-UTF-8 off" - "ruwin_ctrl-CP1251 ruwin_ctrl-CP1251 off" - "ruwin_ctrl-KOI8-R ruwin_ctrl-KOI8-R off" - "ruwin_ctrl-UTF-8 ruwin_ctrl-UTF-8 off" - "se-fi-ir209 se-fi-ir209 off" - "se-fi-lat6 se-fi-lat6 off" - "se-ir209 se-ir209 off" - "se-lat6 se-lat6 off" - "sg sg off" - "sg-latin1 sg-latin1 off" - "sg-latin1-lk450 sg-latin1-lk450 off" - "sk-prog-qwerty sk-prog-qwerty off" - "sk-prog-qwertz sk-prog-qwertz off" - "sk-qwerty sk-qwerty off" - "sk-qwertz sk-qwertz off" - "slovene slovene off" - "sr-cy sr-cy off" - "sun-pl sun-pl off" - "sun-pl-altgraph sun-pl-altgraph off" - "sundvorak sundvorak off" - "sunkeymap sunkeymap off" - "sunt4-es sunt4-es off" - "sunt4-fi-latin1 sunt4-fi-latin1 off" - "sunt4-no-latin1 sunt4-no-latin1 off" - "sunt5-cz-us sunt5-cz-us off" - "sunt5-de-latin1 sunt5-de-latin1 off" - "sunt5-es sunt5-es off" - "sunt5-fi-latin1 sunt5-fi-latin1 off" - "sunt5-fr-latin1 sunt5-fr-latin1 off" - "sunt5-ru sunt5-ru off" - "sunt5-uk sunt5-uk off" - "sunt5-us-cz sunt5-us-cz off" - "sunt6-uk sunt6-uk off" - "sv-latin1 sv-latin1 off" - "tj_alt-UTF8 tj_alt-UTF8 off" - "tr_f-latin5 tr_f-latin5 off" - "tr_q-latin5 tr_q-latin5 off" - "tralt tralt off" - "trf trf off" - "trf-fgGIod trf-fgGIod off" - "trq trq off" - "ttwin_alt-UTF-8 ttwin_alt-UTF-8 off" - "ttwin_cplk-UTF-8 ttwin_cplk-UTF-8 off" - "ttwin_ct_sh-UTF-8 ttwin_ct_sh-UTF-8 off" - "ttwin_ctrl-UTF-8 ttwin_ctrl-UTF-8 off" - "ua ua off" - "ua-cp1251 ua-cp1251 off" - "ua-utf ua-utf off" - "ua-utf-ws ua-utf-ws off" - "ua-ws ua-ws off" - "uk uk off" - "unicode unicode off" - "us us on" - "us-acentos us-acentos off" - "wangbe wangbe off" - "wangbe2 wangbe2 off" - "windowkeys windowkeys off" -) - -echo "KEYMAP=$(dialog --stdout --radiolist "Escolha a distribuição do teclado" 20 70 50 ${keymaps[@]})" > /etc/vconsole.conf - -aux=$(sed -e '1,23d' -e 's/#//g' -e 's/ /#/g' -e 's/..$//' /etc/locale.gen) -index=0 -for i in $aux; do - i=$(echo $i | sed -e 's/#/ /g') - locales+=("$i" "$i" off) - if [[ $i == "en_US.UTF-8 UTF-8" || $i == "en_US ISO-8859-1" ]]; then - locales[$index]="$i" - locales[$((index+1))]="$i" - locales[$((index+2))]="on" - fi - index=$((index+3)) -done - -locale=$(dialog --stdout --checklist "Escolha as Localizações" 20 70 50 "${locales[@]}") -locale=$(echo ${locale} | sed -e 's/" "/\n/g' -e 's/ /#/g' -e 's/"//g') - -for i in ${locale[@]}; do - i=$(echo $i | sed -e 's/#/ /g') - sed -i -e "s/#$i/$i/g" /etc/locale.gen -done - -locale-gen - -aux=$(locale -a) -index=0 -for i in $aux; do - langs+=("$i" "$i" on) - index=$((index+1)) -done - -echo "LANG=$(dialog --stdout --radiolist "Escolha a sua língua" 20 70 50 ${langs[@]})" > /etc/locale.conf - -mkinitcpio -p linux-libre - -hdd=$(cat /temporal | grep 'hdd=') -grub-install ${hdd#*=} -grub-mkconfig -o /boot/grub/grub.cfg - -password=$(dialog --stdout --passwordbox "Insira a senha para o root" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Repita a senha para o root" 8 40) -done - -usermod -p $(openssl passwd ${password}) root - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/userAccount.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/userAccount.sh deleted file mode 100755 index 408beba..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/language/pt/userAccount.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -user=$(cat /temporal | grep "userName") - -password=$(dialog --stdout --passwordbox "Insira a senha para o usuário ${user#*=}" 8 40) - -while [[ $password != $password2 ]]; do - password2=$(dialog --stdout --passwordbox "Repita a senha" 8 40) -done - -useradd -m -g users -G "wheel" -s /bin/bash -p $(openssl passwd $password) ${user#*=} - -exit diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/parabolaicon.png b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/parabolaicon.png Binary files differdeleted file mode 100644 index aed32d7..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/parabolaicon.png +++ /dev/null diff --git a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/x11.sh b/configs/lxde-openrc/airootfs/root/.scriptsInstallation/x11.sh deleted file mode 100755 index 47035c5..0000000 --- a/configs/lxde-openrc/airootfs/root/.scriptsInstallation/x11.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -check_dbus() { - grep dbus /etc/$1 -} - -# Create the dbus user if it doesn't exist -[[ $(check_dbus group) = "" ]] && groupadd -g 81 dbus -[[ $(check_dbus passwd) = "" ]] && useradd -r -s /sbin/nologin -g 81 -u 81 dbus - -# Enable services with OpenRC -rc-update add NetworkManager default -rc-update add dbus default -rc-update add alsasound default diff --git a/configs/lxde-openrc/airootfs/root/.themes/Parabola/index.theme b/configs/lxde-openrc/airootfs/root/.themes/Parabola/index.theme deleted file mode 100644 index d6b2393..0000000 --- a/configs/lxde-openrc/airootfs/root/.themes/Parabola/index.theme +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Name=Parabola -Type=X-GNOME-Metatheme -Comment= - -[X-GNOME-Metatheme] -GtkTheme=Radiance-Purple -MetacityTheme=Radiance-Purple -IconTheme=RAVE-X-Dark-Purple -GtkColorScheme=base_color:#ffffff,fg_color:#4c4c4c,tooltip_fg_color:#ffffff,selected_bg_color:#7E5BC5,selected_fg_color:#FFFFFF,text_color:#3C3C3C,bg_color:#F6F6F6,tooltip_bg_color:#000000,link_color:#9D7EDA -CursorTheme=mate -CursorSize=18 -BackgroundImage=/etc/wallpaper.png diff --git a/configs/lxde-openrc/airootfs/root/.xinitrc b/configs/lxde-openrc/airootfs/root/.xinitrc deleted file mode 100644 index 09e419c..0000000 --- a/configs/lxde-openrc/airootfs/root/.xinitrc +++ /dev/null @@ -1,7 +0,0 @@ -code=$(cat ~/.codecheck | grep XKBMAP= | cut -d '=' -f 2) -[ "$code" = "0" ] && code='us' -setxkbmap $code -service NetworkManager start -service dbus start -service alsasound start -exec startlxde diff --git a/configs/lxde-openrc/airootfs/root/.zlogin b/configs/lxde-openrc/airootfs/root/.zlogin deleted file mode 100644 index 3c75da7..0000000 --- a/configs/lxde-openrc/airootfs/root/.zlogin +++ /dev/null @@ -1,10 +0,0 @@ -# fix for screen readers -if grep -Fq 'accessibility=' /proc/cmdline &> /dev/null; then - setopt SINGLE_LINE_ZLE -fi - -~/.automated_script.sh -~/.language.sh -. /etc/locale.conf -export LANG -startx diff --git a/configs/lxde-openrc/airootfs/root/Desktop/Parabola Installation CLI.desktop b/configs/lxde-openrc/airootfs/root/Desktop/Parabola Installation CLI.desktop deleted file mode 100755 index 9a2d871..0000000 --- a/configs/lxde-openrc/airootfs/root/Desktop/Parabola Installation CLI.desktop +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Application -Terminal=true -Name[es_ES]=Instalador CLI de Parabola -Name[gl_ES]=Instalador CLI de Parabola -Name[pt_BR]=Instalador CLI da Parabola -Exec=/root/.scriptsInstallation/install.sh -Name=Parabola Installation CLI -Comment=Parabola Installation Scripts -Icon=/root/.scriptsInstallation/parabolaicon.png diff --git a/configs/lxde-openrc/airootfs/usr/local/bin/Installation_guide b/configs/lxde-openrc/airootfs/usr/local/bin/Installation_guide deleted file mode 100755 index 876fbd2..0000000 --- a/configs/lxde-openrc/airootfs/usr/local/bin/Installation_guide +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# -# SPDX-License-Identifier: GPL-3.0-or-later - -exec lynx 'https://wiki.parabola.nu/Installation_Guide' diff --git a/configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror b/configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror deleted file mode 100755 index e8f8254..0000000 --- a/configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -get_cmdline() { - local param - for param in $(< /proc/cmdline); do - case "${param}" in - $1=*) echo "${param##*=}"; - return 0 - ;; - esac - done -} - -mirror=$(get_cmdline mirror) -[[ $mirror = auto ]] && mirror=$(get_cmdline parabolaiso_http_srv) -[[ $mirror ]] || exit 0 - -mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig -cat >/etc/pacman.d/mirrorlist << EOF -# -# Parabola GNU/Linux-libre repository mirrorlist -# Generated by parabolaiso -# - -Server = ${mirror%%/}/\$repo/os/\$arch -EOF diff --git a/configs/lxde-openrc/airootfs/usr/local/bin/livecd-sound b/configs/lxde-openrc/airootfs/usr/local/bin/livecd-sound deleted file mode 100755 index 3ead720..0000000 --- a/configs/lxde-openrc/airootfs/usr/local/bin/livecd-sound +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -usage() { - cat <<- _EOF_ - live cd sound helper script. - Usage: livecdsound [OPTION] - OPTIONS - -u, --unmute unmute all sound cards - -p, --pick select a card for speetch output - -h, --help Show this usage message - -_EOF_ -} - -bugout () { - printf "/usr/local/bin/livecdsound: programming error" - stat_fail -} - -echo_card_indices() -{ - if [ -f /proc/asound/cards ] ; then - sed -n -e's/^[[:space:]]*\([0-7]\)[[:space:]].*/\1/p' /proc/asound/cards - fi -} - -# The following functions try to set many controls. -# No card has all the controls and so some of the attempts are bound to fail. -# Because of this, the functions can't return useful status values. - -# $1 <card id> -# $2 <control> -# $3 <level> -unmute_and_set_level(){ - { [ "$3" ] &&[ "$2" ] && [ "$1" ] ; } || bugout - printf "Setting: %s on card: %s to %s\n" "$2" "$1" "$3" - amixer -c "$1" set "$2" "$3" unmute - return 0 -} - -# $1 <card id> -# $2 <control> -mute_and_zero_level() -{ - { [ "$1" ] && [ "$2" ] ; } || bugout - printf "Muting control: %s on card: %s\n" "$2" "$1" - amixer -c "$1" set "$2" "0%" mute - return 0 -} - -# $1 <card ID> -# $2 <control> -# $3 "on" | "off" -switch_control() -{ - { [ "$3" ] && [ "$1" ] ; } || bugout - printf "Switching control: %s on card: %s to %s\n" "$2" "$1" "$3" - amixer -c "$1" set "$2" "$3" - return 0 -} - -# $1 <card ID> -sanify_levels_on_card() -{ - unmute_and_set_level "$1" "Front" "80%" - unmute_and_set_level "$1" "Master" "80%" - unmute_and_set_level "$1" "Master Mono" "80%" - unmute_and_set_level "$1" "Master Digital" "80%" # E.g., cs4237B - unmute_and_set_level "$1" "Playback" "80%" - unmute_and_set_level "$1" "Headphone" "100%" - unmute_and_set_level "$1" "PCM" "80%" - unmute_and_set_level "$1" "PCM,1" "80%" # E.g., ess1969 - unmute_and_set_level "$1" "DAC" "80%" # E.g., envy24, cs46xx - unmute_and_set_level "$1" "DAC,0" "80%" # E.g., envy24 - unmute_and_set_level "$1" "DAC,1" "80%" # E.g., envy24 - unmute_and_set_level "$1" "Synth" "80%" - unmute_and_set_level "$1" "CD" "80%" - unmute_and_set_level "$1" "PC Speaker" "100%" - - mute_and_zero_level "$1" "Mic" - mute_and_zero_level "$1" "IEC958" # Ubuntu #19648 - - # Intel P4P800-MX - switch_control "$1" "Master Playback Switch" on - switch_control "$1" "Master Surround" on - - # Trident/YMFPCI/emu10k1: - unmute_and_set_level "$1" "Wave" "80%" - unmute_and_set_level "$1" "Music" "80%" - unmute_and_set_level "$1" "AC97" "80%" - - # DRC: - unmute_and_set_level "$1" "Dynamic Range Compression" "80%" - - # Required for HDA Intel (hda-intel): - unmute_and_set_level "$1" "Front" "80%" - - # Required for SB Live 7.1/24-bit (ca0106): - unmute_and_set_level "$1" "Analog Front" "80%" - - # Required at least for Via 823x hardware on DFI K8M800-MLVF Motherboard - switch_control "$1" "IEC958 Capture Monitor" off - - # Required for hardware allowing toggles for AC97 through IEC958, - # valid values are 0, 1, 2, 3. Needs to be set to 0 for PCM1. - unmute_and_set_level "$1" "IEC958 Playback AC97-SPSA" "0" - - # Required for newer Via hardware - unmute_and_set_level "$1" "VIA DXS,0" "80%" - unmute_and_set_level "$1" "VIA DXS,1" "80%" - unmute_and_set_level "$1" "VIA DXS,2" "80%" - unmute_and_set_level "$1" "VIA DXS,3" "80%" - - # Required on some notebooks with ICH4: - switch_control "$1" "Headphone Jack Sense" off - switch_control "$1" "Line Jack Sense" off - - # Some machines need one or more of these to be on; - # others need one or more of these to be off: - - switch_control "$1" "Audigy Analog/Digital Output Jack" on - switch_control "$1" "SB Live Analog/Digital Output Jack" on - - # D1984 -- Thinkpad T61/X61 - switch_control "$1" "Speaker" on - switch_control "$1" "Headphone" on - - # HDA-Intel w/ "Digital" capture mixer (See Ubuntu #193823) - unmute_and_set_level "$1" "Digital" "80%" - - return 0 -} - -# $1 <card ID> | "all" -sanify_levels() -{ - local ttsdml_returnstatus=0 - local card - case "$1" in - all) - for card in $(echo_card_indices) ; do - sanify_levels_on_card "$card" || ttsdml_returnstatus=1 - done - ;; - *) - sanify_levels_on_card "$1" || ttsdml_returnstatus=1 - ;; - esac - return $ttsdml_returnstatus -} - -# List all cards that *should* be usable for PCM audio. In my experience, -# the console speaker (handled by the pcsp driver) isn't a suitable playback -# device, so we'll exclude it. -list_non_pcsp_cards() -{ - for card in $(echo_card_indices); do - local cardfile="/proc/asound/card${card}/id" - if [ -r "$cardfile" ] && [ -f "$cardfile" ] && \ - [ "$(cat "$cardfile")" != pcsp ]; then - echo "$card" - fi - done -} - -# Properly initialize the sound card so that we have audio at boot. -unmute_all_cards() -{ - sanify_levels all -} - -is_numeric() { - local str=$1 - [[ "$str" =~ ^[0-9]+$ ]] -} - -set_default_card() { - local card=$1 - sed -e "s/%card%/$card/g" < /usr/local/share/livecd-sound/asound.conf.in \ - > /etc/asound.conf -} - -play_on_card() { - local card=$1 file=$2 - aplay -q "-Dplughw:$card,0" "$file" -} - -# If there are multiple usable sound cards, prompt the user to choose one, -# using auditory feedback. -pick_a_card() -{ - set -f - usable_cards="$(list_non_pcsp_cards)" - num_usable_cards="$(wc -w <<< "$usable_cards")" - - if [ "$num_usable_cards" -eq 1 ]; then - printf "Only one sound card is detected\n" - exit 0 - fi - printf "multiple sound cards detected\n" - for card in $usable_cards; do - if ! is_numeric "$card"; then - continue - fi - play_on_card "$card" /usr/share/livecd-sounds/pick-a-card.wav& - done - wait - sleep 1 - for card in $usable_cards; do - if ! is_numeric "$card"; then - continue - fi - play_on_card "$card" /usr/share/livecd-sounds/beep.wav - if read -r -t 10; then - printf "Selecting %s sound card as default\n" "$card" - set_default_card "$card" - break - fi -done -} - -if [[ $# -eq 0 ]]; then - echo "error: No argument passed." - exit 1 -fi -while [[ "${1}" != "" ]]; do - case ${1} in - -h|--help) - usage - exit - ;; - -u|--unmute) - printf "Unmuting all cards" - unmute_all_cards - ;; - -p|--pick) - pick_a_card - ;; - *) - echo "error: Unsupported argument" - usage - exit 1 - ;; - esac - shift -done diff --git a/configs/lxde-openrc/airootfs/usr/local/share/livecd-sound/asound.conf.in b/configs/lxde-openrc/airootfs/usr/local/share/livecd-sound/asound.conf.in deleted file mode 100644 index 3f9c7aa..0000000 --- a/configs/lxde-openrc/airootfs/usr/local/share/livecd-sound/asound.conf.in +++ /dev/null @@ -1,3 +0,0 @@ -Defaults node -defaults.ctl.card %card%; -defaults.pcm.card %card%; diff --git a/configs/lxde-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-linux-libre.conf b/configs/lxde-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-linux-libre.conf deleted file mode 100644 index b49dd6e..0000000 --- a/configs/lxde-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-linux-libre.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -menuentry "Parabola GNU/Linux-libre install medium (x86_64, UEFI)" { - loader /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre - initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img - options "parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL%" -} diff --git a/configs/lxde-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-speech-linux-libre.conf b/configs/lxde-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-speech-linux-libre.conf deleted file mode 100644 index 62167e7..0000000 --- a/configs/lxde-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-speech-linux-libre.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -menuentry "Parabola GNU/Linux-libre install medium (x86_64, UEFI) with speech" { - loader /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre - initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img - options "parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on" -} diff --git a/configs/lxde-openrc/efiboot/EFI/BOOT/refind.conf b/configs/lxde-openrc/efiboot/EFI/BOOT/refind.conf deleted file mode 100644 index 075bf3f..0000000 --- a/configs/lxde-openrc/efiboot/EFI/BOOT/refind.conf +++ /dev/null @@ -1,10 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -scanfor manual -showtools shell firmware reboot shutdown - -timeout 15 -include entries/parabolaiso-x86_64-linux-libre.conf -include entries/parabolaiso-x86_64-speech-linux-libre.conf -default_selection entries/parabolaiso-x86_64-linux-libre.conf diff --git a/configs/lxde-openrc/packages.both b/configs/lxde-openrc/packages.both deleted file mode 100644 index cdd04e1..0000000 --- a/configs/lxde-openrc/packages.both +++ /dev/null @@ -1,166 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later -#Base -alsa-utils-openrc -archinstall -arch-install-scripts -base -bind-tools -brltty-openrc -btrfs-progs -cloud-init -crda -darkhttpd -ddrescue -dhclient -dhcpcd-openrc -diffutils -dmraid -dnsmasq -dosfstools -efibootmgr -espeakup-openrc -elogind -ethtool -exfatprogs -f2fs-tools -fatresize -fsarchiver -gnu-netcat -gpart -gpm-openrc -gptfdisk -grml-zsh-config -hdparm-openrc -irssi -iwd -jfsutils -kitty-terminfo -lftp -linux-atm -linux-libre -linux-libre-firmware -livecd-sounds -lsscsi -lvm2-openrc -lynx -man-db -man-pages -mc -mdadm-openrc -memtest86+ -mkinitcpio -mkinitcpio-parabolaiso -mkinitcpio-nfs-utils -modemmanager -mtools -nano -nbd -ndisc6 -networkmanager-openrc -nfs-utils-openrc -nilfs-utils -nmap -ntfs-3g -nvme-cli -openconnect -openrc-init -openssh-openrc -openvpn-openrc -partclone -parted -partimage -ppp -pptpclient -reflector -reiserfsprogs -rp-pppoe -rsync-openrc -rxvt-unicode-terminfo -sdparm -sg3_utils -smartmontools -sof-firmware -squashfs-tools -sudo -syslinux -tcpdump -terminus-font -termite-terminfo -testdisk -tmux -udev-init-scripts -udftools -usb_modeswitch -usbmuxd -usbutils -vim -vpnc -wireless-regdb -wireless_tools -wpa_supplicant-openrc -wvdial -xfsprogs -xl2tpd -zsh - -#X11 -xorg -xorg-drivers -xorg-xinit -pygtk - -#Plugins -gst-plugins-base -gst-plugins-good -gst-libav - -#Window Manager -obconf -ambiance-radiance-colors-suite -gvfs-mtp -gvfs-gphoto2 -xdg-user-dirs -gnome-screenshot -lxde-gtk3 - -#Sound -pulseaudio-alsa -alsa-utils - -#Network -network-manager-applet -gnome-keyring - -#Programs -octopi -knotifications -midori -evolution -pidgin -qtox -gparted -smplayer -epdfview -abiword -gnumeric -leafpad -galculator -xarchiver -dmidecode -xscreensaver -zenity -xterm -dialog - -#Compressor/archiver -p7zip -unarchiver -unzip -zip - -#Fonts -ttf-dejavu - -#OpenRC -openrc-desktop diff --git a/configs/lxde-openrc/packages.x86_64 b/configs/lxde-openrc/packages.x86_64 deleted file mode 100644 index ff68c5c..0000000 --- a/configs/lxde-openrc/packages.x86_64 +++ /dev/null @@ -1,4 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later -edk2-shell -refind diff --git a/configs/lxde-openrc/pacman.conf b/configs/lxde-openrc/pacman.conf deleted file mode 100644 index bf99e24..0000000 --- a/configs/lxde-openrc/pacman.conf +++ /dev/null @@ -1,129 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -IgnorePkg = systemd systemd-libsystemd systemd-libs systemd-udev systemd-libudev -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -#TotalDownload -# We cannot check disk space from within a chroot environment -#CheckSpace -#VerbosePkgLists - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all Arch/Parabola packagers -# with `pacman-key --populate archlinux` and `pacman-key --populate parabola`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# - -# The testing repositories are disabled by default. To enable, uncomment the -# repo name header and Include lines. You can add preferred servers immediately -# after the header, and they will be used before the default mirrors. - -[nonsystemd] -Include = /etc/pacman.d/mirrorlist - -#[libre-testing] -#Include = /etc/pacman.d/mirrorlist - -[libre] -Include = /etc/pacman.d/mirrorlist - -#[testing] -#Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - -#[pcr-testing] -#Include = /etc/pacman.d/mirrorlist - -[pcr] -Include = /etc/pacman.d/mirrorlist - -# If you want to run 32 bit applications on your x86_64 system, -# enable the libre-multilib, multilib and pcr-multilib repositories as required here. - -#[libre-multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[libre-multilib] -#Include = /etc/pacman.d/mirrorlist - -#[multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[multilib] -#Include = /etc/pacman.d/mirrorlist - -#[pcr-multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[pcr-multilib] -#Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs diff --git a/configs/lxde-openrc/profiledef.sh b/configs/lxde-openrc/profiledef.sh deleted file mode 100644 index 31a505c..0000000 --- a/configs/lxde-openrc/profiledef.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# shellcheck disable=SC2034 - -# TODO: -# * replace the old installation scripts with Zen Installer -# * get braille support to actually work, even for desktop - -iso_name="parabola-openrc-lxde" -iso_label="PARA_$(date +%Y%m)" -iso_publisher="Parabola GNU/Linux-libre <https://parabola.nu>" -iso_application="Parabola GNU/Linux-libre Live/Rescue CD" -iso_version="$(date +%Y.%m.%d)" -install_dir="parabola" -bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' 'uefi-x64.refind.esp' 'uefi-x64.refind.eltorito') -arch="dual" -pacman_conf="pacman.conf" -airootfs_image_type="squashfs" -airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M') -file_permissions=( - ["/etc/local.d/choose-mirror.start"]="0:0:755" - ["/etc/local.d/etc-pacman.d-gnupg.start"]="0:0:755" - ["/etc/local.d/livecd-talk.start"]="0:0:755" - ["/etc/local.d/pacman-init.start"]="0:0:755" - ["/etc/NetworkManager/dispatcher.d/reflector"]="0:0:755" - ["/etc/shadow"]="0:0:400" - ["/root"]="0:0:750" - ["/root/.automated_script.sh"]="0:0:755" - ["/root/.keymap.sh"]="0:0:755" - ["/root/.language.sh"]="0:0:755" - ["/root/Desktop/Parabola Installation CLI.desktop"]="0:0:755" - ["/root/.scriptsInstallation/language/en/install.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/en/systemConfig.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/en/systemConfig.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/es/install.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/es/systemConfig.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/es/systemConfig.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/gl/install.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/gl/systemConfig.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/gl/systemConfig.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/pt/install.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/pt/systemConfig.sh"]="0:0:755" - ["/root/.scriptsInstallation/language/pt/systemConfig.sh"]="0:0:755" - ["/usr/local/bin/choose-mirror"]="0:0:755" - ["/usr/local/bin/Installation_guide"]="0:0:755" - ["/usr/local/bin/livecd-sound"]="0:0:755" -) diff --git a/configs/lxde-openrc/syslinux/parabolaiso_head.cfg b/configs/lxde-openrc/syslinux/parabolaiso_head.cfg deleted file mode 100644 index 17b77e9..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_head.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -SERIAL 0 38400 -UI vesamenu.c32 -MENU TITLE Parabola GNU/Linux-libre -MENU BACKGROUND splash.png - -MENU WIDTH 78 -MENU MARGIN 4 -MENU ROWS 7 -MENU VSHIFT 10 -MENU TABMSGROW 14 -MENU CMDLINEROW 14 -MENU HELPMSGROW 16 -MENU HELPMSGENDROW 29 - -# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu - -MENU COLOR border 35;40 #ff777caa #a0000000 std -MENU COLOR title 1;35;40 #ff777caa #a0000000 std -MENU COLOR sel 7;35;47 #e0ffffff #20777caa all -MENU COLOR unsel 35;40 #ff777caa #a0000000 std -MENU COLOR help 35;40 #c0b2b2b2 #a0000000 std -MENU COLOR timeout_msg 35;40 #ff777caa #00000000 std -MENU COLOR timeout 1;35;40 #ff777caa #00000000 std -MENU COLOR msg07 35;40 #ff777caa #a0000000 std -MENU COLOR tabmsg 35;40 #ff777caa #00000000 std - -MENU CLEAR -MENU IMMEDIATE diff --git a/configs/lxde-openrc/syslinux/parabolaiso_pxe32-linux-libre.cfg b/configs/lxde-openrc/syslinux/parabolaiso_pxe32-linux-libre.cfg deleted file mode 100644 index 8f1a5ac..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_pxe32-linux-libre.cfg +++ /dev/null @@ -1,35 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL parabola32_nbd -TEXT HELP -Boot the Parabola GNU/Linux-libre (i686) live medium (Using NBD). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (i686) (NBD) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% parabolaiso_nbd_srv=${pxeserver} checksum verify -SYSAPPEND 3 - -LABEL parabola32_nfs -TEXT HELP -Boot the Parabola GNU/Linux-libre (i686) live medium (Using NFS). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (i686) (NFS) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt checksum verify -SYSAPPEND 3 - -LABEL parabola32_http -TEXT HELP -Boot the Parabola GNU/Linux-libre (i686) live medium (Using HTTP). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (i686) (HTTP) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ checksum verify -SYSAPPEND 3 diff --git a/configs/lxde-openrc/syslinux/parabolaiso_pxe64-linux-libre.cfg b/configs/lxde-openrc/syslinux/parabolaiso_pxe64-linux-libre.cfg deleted file mode 100644 index 3e46234..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_pxe64-linux-libre.cfg +++ /dev/null @@ -1,35 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL parabola64_nbd -TEXT HELP -Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using NBD). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (NBD) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% parabolaiso_nbd_srv=${pxeserver} checksum verify -SYSAPPEND 3 - -LABEL parabola64_nfs -TEXT HELP -Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using NFS). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (NFS) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt checksum verify -SYSAPPEND 3 - -LABEL parabola64_http -TEXT HELP -Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using HTTP). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (HTTP) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ checksum verify -SYSAPPEND 3 diff --git a/configs/lxde-openrc/syslinux/parabolaiso_pxe_32_inc.cfg b/configs/lxde-openrc/syslinux/parabolaiso_pxe_32_inc.cfg deleted file mode 100644 index 6b0cd85..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_pxe_32_inc.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg -INCLUDE parabolaiso_pxe32.cfg -INCLUDE parabolaiso_tail.cfg diff --git a/configs/lxde-openrc/syslinux/parabolaiso_pxe_both_inc.cfg b/configs/lxde-openrc/syslinux/parabolaiso_pxe_both_inc.cfg deleted file mode 100644 index ed898b5..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_pxe_both_inc.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg -INCLUDE parabolaiso_pxe64-linux-libre.cfg -INCLUDE parabolaiso_pxe32-linux-libre.cfg -INCLUDE parabolaiso_tail.cfg diff --git a/configs/lxde-openrc/syslinux/parabolaiso_pxe_choose.cfg b/configs/lxde-openrc/syslinux/parabolaiso_pxe_choose.cfg deleted file mode 100644 index ad5a822..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_pxe_choose.cfg +++ /dev/null @@ -1,14 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -DEFAULT choose - -LABEL choose -COM32 ifcpu64.c32 -APPEND have64 -- nohave64 - -LABEL have64 -CONFIG parabolaiso_pxe_both_inc.cfg - -LABEL nohave64 -CONFIG parabolaiso_pxe_32_inc.cfg diff --git a/configs/lxde-openrc/syslinux/parabolaiso_sys32-linux-libre.cfg b/configs/lxde-openrc/syslinux/parabolaiso_sys32-linux-libre.cfg deleted file mode 100644 index b2c943c..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_sys32-linux-libre.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -TIMEOUT 150 - -LABEL parabola32 -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (i686, BIOS) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% - -# Accessibility boot option -LABEL parabola32speech -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS with speakup screen reader. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance with speech feedback. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (i686, BIOS) with ^speech -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on diff --git a/configs/lxde-openrc/syslinux/parabolaiso_sys64-linux-libre.cfg b/configs/lxde-openrc/syslinux/parabolaiso_sys64-linux-libre.cfg deleted file mode 100644 index b173f93..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_sys64-linux-libre.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL parabola64 -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (x86_64, BIOS) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% - -# Accessibility boot option -LABEL parabola64speech -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS with speakup screen reader. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance with speech feedback. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (x86_64, BIOS) with ^speech -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on diff --git a/configs/lxde-openrc/syslinux/parabolaiso_sys_32_inc.cfg b/configs/lxde-openrc/syslinux/parabolaiso_sys_32_inc.cfg deleted file mode 100644 index b9306ed..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_sys_32_inc.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg - -DEFAULT parabola32 -TIMEOUT 150 - -INCLUDE parabolaiso_sys32-linux-libre.cfg - -INCLUDE parabolaiso_tail.cfg diff --git a/configs/lxde-openrc/syslinux/parabolaiso_sys_both_inc.cfg b/configs/lxde-openrc/syslinux/parabolaiso_sys_both_inc.cfg deleted file mode 100644 index afb027d..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_sys_both_inc.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg - -DEFAULT parabola64 -TIMEOUT 150 - -INCLUDE parabolaiso_sys64-linux-libre.cfg - -INCLUDE parabolaiso_sys32-linux-libre.cfg - -INCLUDE parabolaiso_tail.cfg diff --git a/configs/lxde-openrc/syslinux/parabolaiso_sys_choose.cfg b/configs/lxde-openrc/syslinux/parabolaiso_sys_choose.cfg deleted file mode 100644 index cf814d9..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_sys_choose.cfg +++ /dev/null @@ -1,14 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -DEFAULT choose - -LABEL choose -COM32 ifcpu64.c32 -APPEND have64 -- nohave64 - -LABEL have64 -CONFIG parabolaiso_sys_both_inc.cfg - -LABEL nohave64 -CONFIG parabolaiso_sys_32_inc.cfg diff --git a/configs/lxde-openrc/syslinux/parabolaiso_tail.cfg b/configs/lxde-openrc/syslinux/parabolaiso_tail.cfg deleted file mode 100644 index af172c0..0000000 --- a/configs/lxde-openrc/syslinux/parabolaiso_tail.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL existing -TEXT HELP -Boot an existing operating system. -Press TAB to edit the disk and partition number to boot. -ENDTEXT -MENU LABEL Boot existing OS -COM32 chain.c32 -APPEND hd0 0 - -# http://www.memtest.org/ -LABEL memtest -MENU LABEL Run Memtest86+ (RAM test) -LINUX /%INSTALL_DIR%/boot/memtest - -# http://hdt-project.org/ -LABEL hdt -MENU LABEL Hardware Information (HDT) -COM32 hdt.c32 -APPEND modules_alias=hdt/modalias.gz pciids=hdt/pciids.gz - -LABEL reboot -TEXT HELP -Reboot computer. -The computer's firmware must support APM. -ENDTEXT -MENU LABEL Reboot -COM32 reboot.c32 - -LABEL poweroff -TEXT HELP -Power off computer. -The computer's firmware must support APM. -ENDTEXT -MENU LABEL Power Off -COM32 poweroff.c32 diff --git a/configs/lxde-openrc/syslinux/splash.png b/configs/lxde-openrc/syslinux/splash.png Binary files differdeleted file mode 100644 index ff1342f..0000000 --- a/configs/lxde-openrc/syslinux/splash.png +++ /dev/null diff --git a/configs/lxde-openrc/syslinux/syslinux.cfg b/configs/lxde-openrc/syslinux/syslinux.cfg deleted file mode 100644 index 187eea5..0000000 --- a/configs/lxde-openrc/syslinux/syslinux.cfg +++ /dev/null @@ -1,15 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -DEFAULT select - -LABEL select -COM32 whichsys.c32 -APPEND -pxe- pxe -sys- sys -iso- sys - -LABEL pxe -CONFIG parabolaiso_pxe_choose.cfg - -LABEL sys -CONFIG parabolaiso_sys_choose.cfg - diff --git a/configs/releng-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector b/configs/releng-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector deleted file mode 100755 index 7287520..0000000 --- a/configs/releng-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -if [ "$2" == up ] && ! grep -qoP 'mirror=\K\S+' /proc/cmdline; then - reflector \ - --save /etc/pacman.d/mirrorlist \ - --protocol https \ - --latest 20 \ - --sort rate -fi diff --git a/configs/releng-openrc/airootfs/etc/conf.d/agetty.tty1 b/configs/releng-openrc/airootfs/etc/conf.d/agetty.tty1 deleted file mode 100644 index c2b62f5..0000000 --- a/configs/releng-openrc/airootfs/etc/conf.d/agetty.tty1 +++ /dev/null @@ -1,6 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -baud="38400" -term_type="linux" -agetty_options="--autologin root --noclear" diff --git a/configs/releng-openrc/airootfs/etc/conf.d/hostname b/configs/releng-openrc/airootfs/etc/conf.d/hostname deleted file mode 100644 index 6d381fc..0000000 --- a/configs/releng-openrc/airootfs/etc/conf.d/hostname +++ /dev/null @@ -1,4 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -hostname="parabolaiso" diff --git a/configs/releng-openrc/airootfs/etc/elogind/logind.conf.d/do-not-suspend.conf b/configs/releng-openrc/airootfs/etc/elogind/logind.conf.d/do-not-suspend.conf deleted file mode 100644 index c6b17a4..0000000 --- a/configs/releng-openrc/airootfs/etc/elogind/logind.conf.d/do-not-suspend.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -[Login] -HandleSuspendKey=ignore -HandleHibernateKey=ignore -HandleLidSwitch=ignore diff --git a/configs/releng-openrc/airootfs/etc/fstab b/configs/releng-openrc/airootfs/etc/fstab deleted file mode 100644 index e69de29..0000000 --- a/configs/releng-openrc/airootfs/etc/fstab +++ /dev/null diff --git a/configs/releng-openrc/airootfs/etc/local.d/choose-mirror.start b/configs/releng-openrc/airootfs/etc/local.d/choose-mirror.start deleted file mode 100755 index fea21b8..0000000 --- a/configs/releng-openrc/airootfs/etc/local.d/choose-mirror.start +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Choose mirror from the kernel command line -grep -qoP 'mirror=\K\S+' /proc/cmdline && /usr/local/bin/choose-mirror diff --git a/configs/releng-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start b/configs/releng-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start deleted file mode 100755 index f705ece..0000000 --- a/configs/releng-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Temporary /etc/pacman.d/gnupg directory -fstype="$(findmnt /etc/pacman.d/gnupg -o FSTYPE -Un)" - -test -d /etc/pacman.d/gnupg || mkdir /etc/pacman.d/gnupg -if ! [[ "$fstype" == tmpfs ]]; then - mount -o mode=0755 -t tmpfs tmpfs /etc/pacman.d/gnupg -fi diff --git a/configs/releng-openrc/airootfs/etc/local.d/livecd-talk.start b/configs/releng-openrc/airootfs/etc/local.d/livecd-talk.start deleted file mode 100755 index f826cdd..0000000 --- a/configs/releng-openrc/airootfs/etc/local.d/livecd-talk.start +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -if grep -qo 'accessibility=on' /proc/cmdline; then - livecd-sound -u - chvt 13 - livecd-sound -p - chvt 1 - rc-service espeakup start -fi diff --git a/configs/releng-openrc/airootfs/etc/local.d/pacman-init.start b/configs/releng-openrc/airootfs/etc/local.d/pacman-init.start deleted file mode 100755 index 41c6166..0000000 --- a/configs/releng-openrc/airootfs/etc/local.d/pacman-init.start +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Initializes Pacman keyring -if ! find /etc/pacman.d/gnupg -mindepth 1 2>/dev/null | read -r; then - pacman-key --init - pacman-key --populate archlinux archlinux32 parabola -fi diff --git a/configs/releng-openrc/airootfs/etc/locale.conf b/configs/releng-openrc/airootfs/etc/locale.conf deleted file mode 100644 index 9bf7aef..0000000 --- a/configs/releng-openrc/airootfs/etc/locale.conf +++ /dev/null @@ -1,4 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LANG=en_US.UTF-8 diff --git a/configs/releng-openrc/airootfs/etc/localtime b/configs/releng-openrc/airootfs/etc/localtime deleted file mode 120000 index 0e35b57..0000000 --- a/configs/releng-openrc/airootfs/etc/localtime +++ /dev/null @@ -1 +0,0 @@ -/usr/share/zoneinfo/UTC
\ No newline at end of file diff --git a/configs/releng-openrc/airootfs/etc/mkinitcpio.conf b/configs/releng-openrc/airootfs/etc/mkinitcpio.conf deleted file mode 100644 index 02795f8..0000000 --- a/configs/releng-openrc/airootfs/etc/mkinitcpio.conf +++ /dev/null @@ -1,70 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# vim:set ft=sh -# MODULES -# The following modules are loaded before any boot hooks are -# run. Advanced users may wish to specify all system modules -# in this array. For instance: -# MODULES=(piix ide_disk reiserfs) -MODULES=(loop) - -# BINARIES -# This setting includes any additional binaries a given user may -# wish into the CPIO image. This is run last, so it may be used to -# override the actual binaries included by a given hook -# BINARIES are dependency parsed, so you may safely ignore libraries -BINARIES=() - -# FILES -# This setting is similar to BINARIES above, however, files are added -# as-is and are not parsed in any way. This is useful for config files. -FILES=() - -# HOOKS -# This is the most important setting in this file. The HOOKS control the -# modules and scripts added to the image, and what happens at boot time. -# Order is important, and it is recommended that you do not change the -# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for -# help on a given hook. -# 'base' is _required_ unless you know precisely what you are doing. -# 'udev' is _required_ in order to automatically load modules -# 'filesystems' is _required_ unless you specify your fs modules in MODULES -# Examples: -## This setup specifies all modules in the MODULES setting above. -## No raid, lvm2, or encrypted root is needed. -# HOOKS=(base) -# -## This setup will autodetect all modules for your system and should -## work as a sane default -# HOOKS=(base udev autodetect block filesystems) -# -## This setup will generate a 'full' image which supports most systems. -## No autodetection is done. -# HOOKS=(base udev block filesystems) -# -## This setup assembles a pata mdadm array with an encrypted root FS. -## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. -# HOOKS=(base udev block mdadm encrypt filesystems) -# -## This setup loads an lvm2 volume group on a usb device. -# HOOKS=(base udev block lvm2 filesystems) -# -## NOTE: If you have /usr on a separate partition, you MUST include the -# usr, fsck and shutdown hooks. -HOOKS=(base udev modconf memdisk parabolaiso_shutdown parabolaiso parabolaiso_loop_mnt parabolaiso_pxe_common parabolaiso_pxe_nbd parabolaiso_pxe_http parabolaiso_pxe_nfs parabolaiso_kms block filesystems keyboard) - -# COMPRESSION -# Use this to compress the initramfs image. By default, gzip compression -# is used. Use 'cat' to create an uncompressed image. -#COMPRESSION="gzip" -#COMPRESSION="bzip2" -#COMPRESSION="lzma" -COMPRESSION="xz" -#COMPRESSION="lzop" -#COMPRESSION="lz4" -#COMPRESSION="zstd" - -# COMPRESSION_OPTIONS -# Additional options for the compressor -#COMPRESSION_OPTIONS=() diff --git a/configs/releng-openrc/airootfs/etc/mkinitcpio.d/linux-libre.preset b/configs/releng-openrc/airootfs/etc/mkinitcpio.d/linux-libre.preset deleted file mode 100644 index db31d05..0000000 --- a/configs/releng-openrc/airootfs/etc/mkinitcpio.d/linux-libre.preset +++ /dev/null @@ -1,11 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# mkinitcpio preset file for the 'linux-libre' package on parabolaiso - -PRESETS=('parabolaiso') - -ALL_kver='/boot/vmlinuz-linux-libre' -ALL_config='/etc/mkinitcpio.conf' - -parabolaiso_image="/boot/initramfs-linux-libre.img" diff --git a/configs/releng-openrc/airootfs/etc/motd b/configs/releng-openrc/airootfs/etc/motd deleted file mode 100644 index ee664e2..0000000 --- a/configs/releng-openrc/airootfs/etc/motd +++ /dev/null @@ -1,9 +0,0 @@ -To install [35mParabola GNU/Linux-libre[0m follow the installation guide: -https://wiki.parabola.nu/Installation_Guide - -For Wi-Fi, authenticate to the wireless network using the [35mnmtui-connect[0m utility. -For mobile broadband (WWAN) modems, connect with the [35mmmcli[0m utility. -Ethernet, WLAN and WWAN interfaces using DHCP should work automatically. - -After connecting to the internet, the installation guide can be accessed -via the convenience script [35mInstallation_guide[0m. diff --git a/configs/releng-openrc/airootfs/etc/pacman.conf b/configs/releng-openrc/airootfs/etc/pacman.conf deleted file mode 100644 index 5cb2234..0000000 --- a/configs/releng-openrc/airootfs/etc/pacman.conf +++ /dev/null @@ -1,184 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -#TotalDownload -CheckSpace -#VerbosePkgLists - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all trusted packagers with: -# `pacman-key --populate archlinux archlinux32 archlinuxarm parabola`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# un-commented to enable the repo. -# -# Some repositories are disabled by default. To enable them, un-comment the -# repo name header (e.g. '[nonprism]') and the following 'Include' line. -# You can add preferred servers for each repo between the header and "Include" line, -# according to the format in /etc/pacman.d/mirrorlist, -# and those will be preferred over the standard mirrors for that repo. -# -# The order in which these entries appear in this file is critical. -# Much of the Parabola magic that supports advanced features such as -# multiple init-systems and multiple layers of freedom and privacy, -# depends on the order in which these repos are defined. -# Moving or adding repos out of the expected order can make your system insane. - -# Notes on special repositories: -# -# Non-prism is a repository for enhanced privacy, beyond the FSDG requirements. -# It contains specially patched versions of certain software from the standard repos, -# that are known to include privacy-sensative features that some people may want to use, -# but that others may consider to be undesirable anti-features. -# For more info see: https://wiki.parabola.nu/Nonprism -# -# The non-systemd repository contains packages that are important and relevant only to -# Parabola systems using an init-system other than systemd. -# Parabola systems using systemd SHOULD NOT have this enabled;. -# while Parabola systems using any other init-system SHOULD have this enabled. -# -# The kernels repository contains additional special kernels for particular use-cases, -# such as maximal security hardening and real-time systems. -# -# The PCR (Parabola Community Repository) contains additional packages, -# most often requested by Parabola users, that are not considered to be -# part of the standard Parabola/Arch system, but are nonetheless useful or fun. -# -# Multi-lib repositories allow 32-bit applications to run on x86_64 systems. -# -# The Parabola system also supports custom, user-defined, repositories; -# but be aware that the Parabola team can not recommend nor support their use. -# The Parabola team can only support the use of software that is published by Parabola. -# The use of third-party software is discouraged with a "use at your own risk" warning. -# These may be community-maintained or maintained privately by the local user or sysadmin. -# They may be hosted on the internet, on the local network, or only on the local computer. -# An example of a custom package repository is given below -# in the "User-defined repos" section -# See the pacman manpage for details on creating your own repositories. - - -########################### -# Parabola standard repos # -########################### - -#[nonprism-testing] -#Include = /etc/pacman.d/mirrorlist - -#[nonprism] -#Include = /etc/pacman.d/mirrorlist - -#[nonsystemd-testing] -#Include = /etc/pacman.d/mirrorlist - -[nonsystemd] -Include = /etc/pacman.d/mirrorlist - -#[libre-testing] -#Include = /etc/pacman.d/mirrorlist - -[libre] -Include = /etc/pacman.d/mirrorlist - -#[kernels-testing] -#Include = /etc/pacman.d/mirrorlist - -#[kernels] -#Include = /etc/pacman.d/mirrorlist - - -####################### -# Arch standard repos # -####################### - -#[testing] -#Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - - -###################### -# Supplemental repos # -###################### - -#[pcr-testing] -#Include = /etc/pacman.d/mirrorlist - -[pcr] -Include = /etc/pacman.d/mirrorlist - - -###################### -# User-defined repos # -###################### - -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs - - -############## -# Over-rides # -############## - -Include = /etc/pacman.d/*.conf diff --git a/configs/releng-openrc/airootfs/etc/pacman.d/hooks/40-locale-gen.hook b/configs/releng-openrc/airootfs/etc/pacman.d/hooks/40-locale-gen.hook deleted file mode 100644 index 82dd199..0000000 --- a/configs/releng-openrc/airootfs/etc/pacman.d/hooks/40-locale-gen.hook +++ /dev/null @@ -1,13 +0,0 @@ -# remove from airootfs! -[Trigger] -Operation = Install -Type = Package -Target = glibc - -[Action] -Description = Uncommenting en_US.UTF-8 locale and running locale-gen... -When = PostTransaction -Depends = glibc -Depends = sed -Depends = sh -Exec = /bin/sh -c "sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen && locale-gen" diff --git a/configs/releng-openrc/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook b/configs/releng-openrc/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook deleted file mode 100644 index ad0b5ba..0000000 --- a/configs/releng-openrc/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook +++ /dev/null @@ -1,12 +0,0 @@ -[Trigger] -Operation = Install -Operation = Upgrade -Type = Package -Target = pacman-mirrorlist - -[Action] -Description = Uncommenting all mirrors in /etc/pacman.d/mirrorlist... -When = PostTransaction -Depends = pacman-mirrorlist -Depends = sed -Exec = /usr/bin/sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist diff --git a/configs/releng-openrc/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook b/configs/releng-openrc/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook deleted file mode 100644 index 8dfb943..0000000 --- a/configs/releng-openrc/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook +++ /dev/null @@ -1,18 +0,0 @@ -# remove from airootfs! -# As a workaround for https://bugs.archlinux.org/task/49347 , remove pacman hooks specific to the ISO build process. -# If not, they would be used when pacstrap is run in the live environment. - -[Trigger] -Operation = Install -Operation = Upgrade -Operation = Remove -Type = Package -Target = * - -[Action] -Description = Work around FS#49347 by removing custom pacman hooks that are only required during ISO build... -When = PostTransaction -Depends = sh -Depends = coreutils -Depends = grep -Exec = /bin/sh -c "rm -- $(grep -Frl 'remove from airootfs' /etc/pacman.d/hooks/)" diff --git a/configs/releng-openrc/airootfs/etc/passwd b/configs/releng-openrc/airootfs/etc/passwd deleted file mode 100644 index 2807d5d..0000000 --- a/configs/releng-openrc/airootfs/etc/passwd +++ /dev/null @@ -1 +0,0 @@ -root:x:0:0:root:/root:/usr/bin/zsh diff --git a/configs/releng-openrc/airootfs/etc/runlevels/default/NetworkManager b/configs/releng-openrc/airootfs/etc/runlevels/default/NetworkManager deleted file mode 120000 index fc68d44..0000000 --- a/configs/releng-openrc/airootfs/etc/runlevels/default/NetworkManager +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/NetworkManager
\ No newline at end of file diff --git a/configs/releng-openrc/airootfs/etc/runlevels/default/haveged b/configs/releng-openrc/airootfs/etc/runlevels/default/haveged deleted file mode 120000 index 0ec5343..0000000 --- a/configs/releng-openrc/airootfs/etc/runlevels/default/haveged +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/haveged
\ No newline at end of file diff --git a/configs/releng-openrc/airootfs/etc/shadow b/configs/releng-openrc/airootfs/etc/shadow deleted file mode 100644 index 7edfd69..0000000 --- a/configs/releng-openrc/airootfs/etc/shadow +++ /dev/null @@ -1 +0,0 @@ -root::14871:::::: diff --git a/configs/releng-openrc/airootfs/etc/ssh/sshd_config b/configs/releng-openrc/airootfs/etc/ssh/sshd_config deleted file mode 100644 index 8ef1758..0000000 --- a/configs/releng-openrc/airootfs/etc/ssh/sshd_config +++ /dev/null @@ -1,116 +0,0 @@ -# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $ - -# This is the sshd server system-wide configuration file. See -# sshd_config(5) for more information. - -# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/bin - -# The strategy used for options in the default sshd_config shipped with -# OpenSSH is to specify options with their default value where -# possible, but leave them commented. Uncommented options override the -# default value. - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: - -#HostKey /etc/ssh/ssh_host_rsa_key -#HostKey /etc/ssh/ssh_host_ecdsa_key -#HostKey /etc/ssh/ssh_host_ed25519_key - -# Ciphers and keying -#RekeyLimit default none - -# Logging -#SyslogFacility AUTH -#LogLevel INFO - -# Authentication: - -#LoginGraceTime 2m -PermitRootLogin yes -#StrictModes yes -#MaxAuthTries 6 -#MaxSessions 10 - -#PubkeyAuthentication yes - -# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 -# but this is overridden so installations will only check .ssh/authorized_keys -AuthorizedKeysFile .ssh/authorized_keys - -#AuthorizedPrincipalsFile none - -#AuthorizedKeysCommand none -#AuthorizedKeysCommandUser nobody - -# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts -#HostbasedAuthentication no -# Change to yes if you don't trust ~/.ssh/known_hosts for -# HostbasedAuthentication -#IgnoreUserKnownHosts no -# Don't read the user's ~/.rhosts and ~/.shosts files -#IgnoreRhosts yes - -# To disable tunneled clear text passwords, change to no here! -#PasswordAuthentication yes -#PermitEmptyPasswords no - -# Change to no to disable s/key passwords -ChallengeResponseAuthentication no - -# Kerberos options -#KerberosAuthentication no -#KerberosOrLocalPasswd yes -#KerberosTicketCleanup yes -#KerberosGetAFSToken no - -# GSSAPI options -#GSSAPIAuthentication no -#GSSAPICleanupCredentials yes - -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will -# be allowed through the ChallengeResponseAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via ChallengeResponseAuthentication may bypass -# the setting of "PermitRootLogin without-password". -# If you just want the PAM account and session checks to run without -# PAM authentication, then enable this but set PasswordAuthentication -# and ChallengeResponseAuthentication to 'no'. -UsePAM yes - -#AllowAgentForwarding yes -#AllowTcpForwarding yes -#GatewayPorts no -#X11Forwarding no -#X11DisplayOffset 10 -#X11UseLocalhost yes -#PermitTTY yes -PrintMotd no # pam does that -#PrintLastLog yes -#TCPKeepAlive yes -#PermitUserEnvironment no -#Compression delayed -#ClientAliveInterval 0 -#ClientAliveCountMax 3 -#UseDNS no -#PidFile /run/sshd.pid -#MaxStartups 10:30:100 -#PermitTunnel no -#ChrootDirectory none -#VersionAddendum none - -# no default banner path -#Banner none - -# override default of no subsystems -Subsystem sftp /usr/lib/ssh/sftp-server - -# Example of overriding settings on a per-user basis -#Match User anoncvs -# X11Forwarding no -# AllowTcpForwarding no -# PermitTTY no -# ForceCommand cvs server diff --git a/configs/releng-openrc/airootfs/root/.automated_script.sh b/configs/releng-openrc/airootfs/root/.automated_script.sh deleted file mode 100755 index 5c0c316..0000000 --- a/configs/releng-openrc/airootfs/root/.automated_script.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -script_cmdline () -{ - local param - for param in $(< /proc/cmdline); do - case "${param}" in - script=*) echo "${param#*=}" ; return 0 ;; - esac - done -} - -automated_script () -{ - local script rt - script="$(script_cmdline)" - if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then - if [[ "${script}" =~ ^((http|https|ftp)://) ]]; then - curl "${script}" --location --retry-connrefused -s -o /tmp/startup_script >/dev/null - rt=$? - else - cp "${script}" /tmp/startup_script - rt=$? - fi - if [[ ${rt} -eq 0 ]]; then - chmod +x /tmp/startup_script - /tmp/startup_script - fi - fi -} - -if [[ $(tty) == "/dev/tty1" ]]; then - automated_script -fi diff --git a/configs/releng-openrc/airootfs/root/.zlogin b/configs/releng-openrc/airootfs/root/.zlogin deleted file mode 100644 index 0fb119d..0000000 --- a/configs/releng-openrc/airootfs/root/.zlogin +++ /dev/null @@ -1,6 +0,0 @@ -# fix for screen readers -if grep -Fq 'accessibility=' /proc/cmdline &> /dev/null; then - setopt SINGLE_LINE_ZLE -fi - -~/.automated_script.sh diff --git a/configs/releng-openrc/airootfs/usr/local/bin/Installation_guide b/configs/releng-openrc/airootfs/usr/local/bin/Installation_guide deleted file mode 100755 index 876fbd2..0000000 --- a/configs/releng-openrc/airootfs/usr/local/bin/Installation_guide +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# -# SPDX-License-Identifier: GPL-3.0-or-later - -exec lynx 'https://wiki.parabola.nu/Installation_Guide' diff --git a/configs/releng-openrc/airootfs/usr/local/bin/choose-mirror b/configs/releng-openrc/airootfs/usr/local/bin/choose-mirror deleted file mode 100755 index e8f8254..0000000 --- a/configs/releng-openrc/airootfs/usr/local/bin/choose-mirror +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -get_cmdline() { - local param - for param in $(< /proc/cmdline); do - case "${param}" in - $1=*) echo "${param##*=}"; - return 0 - ;; - esac - done -} - -mirror=$(get_cmdline mirror) -[[ $mirror = auto ]] && mirror=$(get_cmdline parabolaiso_http_srv) -[[ $mirror ]] || exit 0 - -mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig -cat >/etc/pacman.d/mirrorlist << EOF -# -# Parabola GNU/Linux-libre repository mirrorlist -# Generated by parabolaiso -# - -Server = ${mirror%%/}/\$repo/os/\$arch -EOF diff --git a/configs/releng-openrc/airootfs/usr/local/bin/livecd-sound b/configs/releng-openrc/airootfs/usr/local/bin/livecd-sound deleted file mode 100755 index 3ead720..0000000 --- a/configs/releng-openrc/airootfs/usr/local/bin/livecd-sound +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -usage() { - cat <<- _EOF_ - live cd sound helper script. - Usage: livecdsound [OPTION] - OPTIONS - -u, --unmute unmute all sound cards - -p, --pick select a card for speetch output - -h, --help Show this usage message - -_EOF_ -} - -bugout () { - printf "/usr/local/bin/livecdsound: programming error" - stat_fail -} - -echo_card_indices() -{ - if [ -f /proc/asound/cards ] ; then - sed -n -e's/^[[:space:]]*\([0-7]\)[[:space:]].*/\1/p' /proc/asound/cards - fi -} - -# The following functions try to set many controls. -# No card has all the controls and so some of the attempts are bound to fail. -# Because of this, the functions can't return useful status values. - -# $1 <card id> -# $2 <control> -# $3 <level> -unmute_and_set_level(){ - { [ "$3" ] &&[ "$2" ] && [ "$1" ] ; } || bugout - printf "Setting: %s on card: %s to %s\n" "$2" "$1" "$3" - amixer -c "$1" set "$2" "$3" unmute - return 0 -} - -# $1 <card id> -# $2 <control> -mute_and_zero_level() -{ - { [ "$1" ] && [ "$2" ] ; } || bugout - printf "Muting control: %s on card: %s\n" "$2" "$1" - amixer -c "$1" set "$2" "0%" mute - return 0 -} - -# $1 <card ID> -# $2 <control> -# $3 "on" | "off" -switch_control() -{ - { [ "$3" ] && [ "$1" ] ; } || bugout - printf "Switching control: %s on card: %s to %s\n" "$2" "$1" "$3" - amixer -c "$1" set "$2" "$3" - return 0 -} - -# $1 <card ID> -sanify_levels_on_card() -{ - unmute_and_set_level "$1" "Front" "80%" - unmute_and_set_level "$1" "Master" "80%" - unmute_and_set_level "$1" "Master Mono" "80%" - unmute_and_set_level "$1" "Master Digital" "80%" # E.g., cs4237B - unmute_and_set_level "$1" "Playback" "80%" - unmute_and_set_level "$1" "Headphone" "100%" - unmute_and_set_level "$1" "PCM" "80%" - unmute_and_set_level "$1" "PCM,1" "80%" # E.g., ess1969 - unmute_and_set_level "$1" "DAC" "80%" # E.g., envy24, cs46xx - unmute_and_set_level "$1" "DAC,0" "80%" # E.g., envy24 - unmute_and_set_level "$1" "DAC,1" "80%" # E.g., envy24 - unmute_and_set_level "$1" "Synth" "80%" - unmute_and_set_level "$1" "CD" "80%" - unmute_and_set_level "$1" "PC Speaker" "100%" - - mute_and_zero_level "$1" "Mic" - mute_and_zero_level "$1" "IEC958" # Ubuntu #19648 - - # Intel P4P800-MX - switch_control "$1" "Master Playback Switch" on - switch_control "$1" "Master Surround" on - - # Trident/YMFPCI/emu10k1: - unmute_and_set_level "$1" "Wave" "80%" - unmute_and_set_level "$1" "Music" "80%" - unmute_and_set_level "$1" "AC97" "80%" - - # DRC: - unmute_and_set_level "$1" "Dynamic Range Compression" "80%" - - # Required for HDA Intel (hda-intel): - unmute_and_set_level "$1" "Front" "80%" - - # Required for SB Live 7.1/24-bit (ca0106): - unmute_and_set_level "$1" "Analog Front" "80%" - - # Required at least for Via 823x hardware on DFI K8M800-MLVF Motherboard - switch_control "$1" "IEC958 Capture Monitor" off - - # Required for hardware allowing toggles for AC97 through IEC958, - # valid values are 0, 1, 2, 3. Needs to be set to 0 for PCM1. - unmute_and_set_level "$1" "IEC958 Playback AC97-SPSA" "0" - - # Required for newer Via hardware - unmute_and_set_level "$1" "VIA DXS,0" "80%" - unmute_and_set_level "$1" "VIA DXS,1" "80%" - unmute_and_set_level "$1" "VIA DXS,2" "80%" - unmute_and_set_level "$1" "VIA DXS,3" "80%" - - # Required on some notebooks with ICH4: - switch_control "$1" "Headphone Jack Sense" off - switch_control "$1" "Line Jack Sense" off - - # Some machines need one or more of these to be on; - # others need one or more of these to be off: - - switch_control "$1" "Audigy Analog/Digital Output Jack" on - switch_control "$1" "SB Live Analog/Digital Output Jack" on - - # D1984 -- Thinkpad T61/X61 - switch_control "$1" "Speaker" on - switch_control "$1" "Headphone" on - - # HDA-Intel w/ "Digital" capture mixer (See Ubuntu #193823) - unmute_and_set_level "$1" "Digital" "80%" - - return 0 -} - -# $1 <card ID> | "all" -sanify_levels() -{ - local ttsdml_returnstatus=0 - local card - case "$1" in - all) - for card in $(echo_card_indices) ; do - sanify_levels_on_card "$card" || ttsdml_returnstatus=1 - done - ;; - *) - sanify_levels_on_card "$1" || ttsdml_returnstatus=1 - ;; - esac - return $ttsdml_returnstatus -} - -# List all cards that *should* be usable for PCM audio. In my experience, -# the console speaker (handled by the pcsp driver) isn't a suitable playback -# device, so we'll exclude it. -list_non_pcsp_cards() -{ - for card in $(echo_card_indices); do - local cardfile="/proc/asound/card${card}/id" - if [ -r "$cardfile" ] && [ -f "$cardfile" ] && \ - [ "$(cat "$cardfile")" != pcsp ]; then - echo "$card" - fi - done -} - -# Properly initialize the sound card so that we have audio at boot. -unmute_all_cards() -{ - sanify_levels all -} - -is_numeric() { - local str=$1 - [[ "$str" =~ ^[0-9]+$ ]] -} - -set_default_card() { - local card=$1 - sed -e "s/%card%/$card/g" < /usr/local/share/livecd-sound/asound.conf.in \ - > /etc/asound.conf -} - -play_on_card() { - local card=$1 file=$2 - aplay -q "-Dplughw:$card,0" "$file" -} - -# If there are multiple usable sound cards, prompt the user to choose one, -# using auditory feedback. -pick_a_card() -{ - set -f - usable_cards="$(list_non_pcsp_cards)" - num_usable_cards="$(wc -w <<< "$usable_cards")" - - if [ "$num_usable_cards" -eq 1 ]; then - printf "Only one sound card is detected\n" - exit 0 - fi - printf "multiple sound cards detected\n" - for card in $usable_cards; do - if ! is_numeric "$card"; then - continue - fi - play_on_card "$card" /usr/share/livecd-sounds/pick-a-card.wav& - done - wait - sleep 1 - for card in $usable_cards; do - if ! is_numeric "$card"; then - continue - fi - play_on_card "$card" /usr/share/livecd-sounds/beep.wav - if read -r -t 10; then - printf "Selecting %s sound card as default\n" "$card" - set_default_card "$card" - break - fi -done -} - -if [[ $# -eq 0 ]]; then - echo "error: No argument passed." - exit 1 -fi -while [[ "${1}" != "" ]]; do - case ${1} in - -h|--help) - usage - exit - ;; - -u|--unmute) - printf "Unmuting all cards" - unmute_all_cards - ;; - -p|--pick) - pick_a_card - ;; - *) - echo "error: Unsupported argument" - usage - exit 1 - ;; - esac - shift -done diff --git a/configs/releng-openrc/airootfs/usr/local/share/livecd-sound/asound.conf.in b/configs/releng-openrc/airootfs/usr/local/share/livecd-sound/asound.conf.in deleted file mode 100644 index 3f9c7aa..0000000 --- a/configs/releng-openrc/airootfs/usr/local/share/livecd-sound/asound.conf.in +++ /dev/null @@ -1,3 +0,0 @@ -Defaults node -defaults.ctl.card %card%; -defaults.pcm.card %card%; diff --git a/configs/releng-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-linux-libre.conf b/configs/releng-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-linux-libre.conf deleted file mode 100644 index b49dd6e..0000000 --- a/configs/releng-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-linux-libre.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -menuentry "Parabola GNU/Linux-libre install medium (x86_64, UEFI)" { - loader /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre - initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img - options "parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL%" -} diff --git a/configs/releng-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-speech-linux-libre.conf b/configs/releng-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-speech-linux-libre.conf deleted file mode 100644 index 62167e7..0000000 --- a/configs/releng-openrc/efiboot/EFI/BOOT/entries/parabolaiso-x86_64-speech-linux-libre.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -menuentry "Parabola GNU/Linux-libre install medium (x86_64, UEFI) with speech" { - loader /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre - initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img - options "parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on" -} diff --git a/configs/releng-openrc/efiboot/EFI/BOOT/refind.conf b/configs/releng-openrc/efiboot/EFI/BOOT/refind.conf deleted file mode 100644 index 075bf3f..0000000 --- a/configs/releng-openrc/efiboot/EFI/BOOT/refind.conf +++ /dev/null @@ -1,10 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -scanfor manual -showtools shell firmware reboot shutdown - -timeout 15 -include entries/parabolaiso-x86_64-linux-libre.conf -include entries/parabolaiso-x86_64-speech-linux-libre.conf -default_selection entries/parabolaiso-x86_64-linux-libre.conf diff --git a/configs/releng-openrc/packages.both b/configs/releng-openrc/packages.both deleted file mode 100644 index cdd7a3d..0000000 --- a/configs/releng-openrc/packages.both +++ /dev/null @@ -1,104 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later -alsa-utils-openrc -archinstall -arch-install-scripts -base -bind-tools -brltty-openrc -btrfs-progs -cloud-init -crda -darkhttpd -ddrescue -dhclient -dhcpcd-openrc -diffutils -dmraid -dnsmasq -dosfstools -efibootmgr -espeakup-openrc -elogind -ethtool -exfatprogs -f2fs-tools -fatresize -fsarchiver -gnu-netcat -gpart -gpm-openrc -gptfdisk -grml-zsh-config -hdparm-openrc -irssi -iwd -jfsutils -kitty-terminfo -lftp -linux-atm -linux-libre -linux-libre-firmware -livecd-sounds -lsscsi -lvm2-openrc -lynx -man-db -man-pages -mc -mdadm-openrc -memtest86+ -mkinitcpio -mkinitcpio-parabolaiso -mkinitcpio-nfs-utils -modemmanager -mtools -nano -nbd -ndisc6 -networkmanager-openrc -nfs-utils-openrc -nilfs-utils -nmap -ntfs-3g -nvme-cli -openconnect -openrc-init -openssh-openrc -openvpn-openrc -partclone -parted -partimage -ppp -pptpclient -reflector -reiserfsprogs -rp-pppoe -rsync-openrc -rxvt-unicode-terminfo -sdparm -sg3_utils -smartmontools -sof-firmware -squashfs-tools -sudo -syslinux -tcpdump -terminus-font -termite-terminfo -testdisk -tmux -udev-init-scripts -udftools -usb_modeswitch -usbmuxd -usbutils -vim -vpnc -wireless-regdb -wireless_tools -wpa_supplicant-openrc -wvdial -xfsprogs -xl2tpd -zsh diff --git a/configs/releng-openrc/packages.x86_64 b/configs/releng-openrc/packages.x86_64 deleted file mode 100644 index ff68c5c..0000000 --- a/configs/releng-openrc/packages.x86_64 +++ /dev/null @@ -1,4 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later -edk2-shell -refind diff --git a/configs/releng-openrc/pacman.conf b/configs/releng-openrc/pacman.conf deleted file mode 100644 index bf99e24..0000000 --- a/configs/releng-openrc/pacman.conf +++ /dev/null @@ -1,129 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -IgnorePkg = systemd systemd-libsystemd systemd-libs systemd-udev systemd-libudev -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -#TotalDownload -# We cannot check disk space from within a chroot environment -#CheckSpace -#VerbosePkgLists - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all Arch/Parabola packagers -# with `pacman-key --populate archlinux` and `pacman-key --populate parabola`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# - -# The testing repositories are disabled by default. To enable, uncomment the -# repo name header and Include lines. You can add preferred servers immediately -# after the header, and they will be used before the default mirrors. - -[nonsystemd] -Include = /etc/pacman.d/mirrorlist - -#[libre-testing] -#Include = /etc/pacman.d/mirrorlist - -[libre] -Include = /etc/pacman.d/mirrorlist - -#[testing] -#Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - -#[pcr-testing] -#Include = /etc/pacman.d/mirrorlist - -[pcr] -Include = /etc/pacman.d/mirrorlist - -# If you want to run 32 bit applications on your x86_64 system, -# enable the libre-multilib, multilib and pcr-multilib repositories as required here. - -#[libre-multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[libre-multilib] -#Include = /etc/pacman.d/mirrorlist - -#[multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[multilib] -#Include = /etc/pacman.d/mirrorlist - -#[pcr-multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[pcr-multilib] -#Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs diff --git a/configs/releng-openrc/profiledef.sh b/configs/releng-openrc/profiledef.sh deleted file mode 100644 index 1d01d56..0000000 --- a/configs/releng-openrc/profiledef.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# shellcheck disable=SC2034 - -iso_name="parabola-openrc" -iso_label="PARA_$(date +%Y%m)" -iso_publisher="Parabola GNU/Linux-libre <https://parabola.nu>" -iso_application="Parabola GNU/Linux-libre Live/Rescue CD" -iso_version="$(date +%Y.%m.%d)" -install_dir="parabola" -bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' 'uefi-x64.refind.esp' 'uefi-x64.refind.eltorito') -arch="dual" -pacman_conf="pacman.conf" -airootfs_image_type="squashfs" -airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M') -file_permissions=( - ["/etc/local.d/choose-mirror.start"]="0:0:755" - ["/etc/local.d/etc-pacman.d-gnupg.start"]="0:0:755" - ["/etc/local.d/livecd-talk.start"]="0:0:755" - ["/etc/local.d/pacman-init.start"]="0:0:755" - ["/etc/NetworkManager/dispatcher.d/reflector"]="0:0:755" - ["/etc/shadow"]="0:0:400" - ["/root"]="0:0:750" - ["/root/.automated_script.sh"]="0:0:755" - ["/usr/local/bin/choose-mirror"]="0:0:755" - ["/usr/local/bin/Installation_guide"]="0:0:755" - ["/usr/local/bin/livecd-sound"]="0:0:755" -) diff --git a/configs/releng-openrc/syslinux/parabolaiso_head.cfg b/configs/releng-openrc/syslinux/parabolaiso_head.cfg deleted file mode 100644 index 17b77e9..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_head.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -SERIAL 0 38400 -UI vesamenu.c32 -MENU TITLE Parabola GNU/Linux-libre -MENU BACKGROUND splash.png - -MENU WIDTH 78 -MENU MARGIN 4 -MENU ROWS 7 -MENU VSHIFT 10 -MENU TABMSGROW 14 -MENU CMDLINEROW 14 -MENU HELPMSGROW 16 -MENU HELPMSGENDROW 29 - -# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu - -MENU COLOR border 35;40 #ff777caa #a0000000 std -MENU COLOR title 1;35;40 #ff777caa #a0000000 std -MENU COLOR sel 7;35;47 #e0ffffff #20777caa all -MENU COLOR unsel 35;40 #ff777caa #a0000000 std -MENU COLOR help 35;40 #c0b2b2b2 #a0000000 std -MENU COLOR timeout_msg 35;40 #ff777caa #00000000 std -MENU COLOR timeout 1;35;40 #ff777caa #00000000 std -MENU COLOR msg07 35;40 #ff777caa #a0000000 std -MENU COLOR tabmsg 35;40 #ff777caa #00000000 std - -MENU CLEAR -MENU IMMEDIATE diff --git a/configs/releng-openrc/syslinux/parabolaiso_pxe32-linux-libre.cfg b/configs/releng-openrc/syslinux/parabolaiso_pxe32-linux-libre.cfg deleted file mode 100644 index 8f1a5ac..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_pxe32-linux-libre.cfg +++ /dev/null @@ -1,35 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL parabola32_nbd -TEXT HELP -Boot the Parabola GNU/Linux-libre (i686) live medium (Using NBD). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (i686) (NBD) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% parabolaiso_nbd_srv=${pxeserver} checksum verify -SYSAPPEND 3 - -LABEL parabola32_nfs -TEXT HELP -Boot the Parabola GNU/Linux-libre (i686) live medium (Using NFS). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (i686) (NFS) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt checksum verify -SYSAPPEND 3 - -LABEL parabola32_http -TEXT HELP -Boot the Parabola GNU/Linux-libre (i686) live medium (Using HTTP). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (i686) (HTTP) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ checksum verify -SYSAPPEND 3 diff --git a/configs/releng-openrc/syslinux/parabolaiso_pxe64-linux-libre.cfg b/configs/releng-openrc/syslinux/parabolaiso_pxe64-linux-libre.cfg deleted file mode 100644 index 3e46234..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_pxe64-linux-libre.cfg +++ /dev/null @@ -1,35 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL parabola64_nbd -TEXT HELP -Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using NBD). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (NBD) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% parabolaiso_nbd_srv=${pxeserver} checksum verify -SYSAPPEND 3 - -LABEL parabola64_nfs -TEXT HELP -Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using NFS). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (NFS) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt checksum verify -SYSAPPEND 3 - -LABEL parabola64_http -TEXT HELP -Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using HTTP). -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (HTTP) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ checksum verify -SYSAPPEND 3 diff --git a/configs/releng-openrc/syslinux/parabolaiso_pxe_32_inc.cfg b/configs/releng-openrc/syslinux/parabolaiso_pxe_32_inc.cfg deleted file mode 100644 index 6b0cd85..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_pxe_32_inc.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg -INCLUDE parabolaiso_pxe32.cfg -INCLUDE parabolaiso_tail.cfg diff --git a/configs/releng-openrc/syslinux/parabolaiso_pxe_both_inc.cfg b/configs/releng-openrc/syslinux/parabolaiso_pxe_both_inc.cfg deleted file mode 100644 index ed898b5..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_pxe_both_inc.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg -INCLUDE parabolaiso_pxe64-linux-libre.cfg -INCLUDE parabolaiso_pxe32-linux-libre.cfg -INCLUDE parabolaiso_tail.cfg diff --git a/configs/releng-openrc/syslinux/parabolaiso_pxe_choose.cfg b/configs/releng-openrc/syslinux/parabolaiso_pxe_choose.cfg deleted file mode 100644 index ad5a822..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_pxe_choose.cfg +++ /dev/null @@ -1,14 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -DEFAULT choose - -LABEL choose -COM32 ifcpu64.c32 -APPEND have64 -- nohave64 - -LABEL have64 -CONFIG parabolaiso_pxe_both_inc.cfg - -LABEL nohave64 -CONFIG parabolaiso_pxe_32_inc.cfg diff --git a/configs/releng-openrc/syslinux/parabolaiso_sys32-linux-libre.cfg b/configs/releng-openrc/syslinux/parabolaiso_sys32-linux-libre.cfg deleted file mode 100644 index b2c943c..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_sys32-linux-libre.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -TIMEOUT 150 - -LABEL parabola32 -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (i686, BIOS) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% - -# Accessibility boot option -LABEL parabola32speech -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS with speakup screen reader. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance with speech feedback. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (i686, BIOS) with ^speech -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on diff --git a/configs/releng-openrc/syslinux/parabolaiso_sys64-linux-libre.cfg b/configs/releng-openrc/syslinux/parabolaiso_sys64-linux-libre.cfg deleted file mode 100644 index b173f93..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_sys64-linux-libre.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL parabola64 -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (x86_64, BIOS) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% - -# Accessibility boot option -LABEL parabola64speech -TEXT HELP -Boot the Parabola GNU/Linux-libre install medium on BIOS with speakup screen reader. -It allows you to install Parabola GNU/Linux-libre or perform system maintenance with speech feedback. -ENDTEXT -MENU LABEL Parabola GNU/Linux-libre install medium (x86_64, BIOS) with ^speech -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on diff --git a/configs/releng-openrc/syslinux/parabolaiso_sys_32_inc.cfg b/configs/releng-openrc/syslinux/parabolaiso_sys_32_inc.cfg deleted file mode 100644 index b9306ed..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_sys_32_inc.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg - -DEFAULT parabola32 -TIMEOUT 150 - -INCLUDE parabolaiso_sys32-linux-libre.cfg - -INCLUDE parabolaiso_tail.cfg diff --git a/configs/releng-openrc/syslinux/parabolaiso_sys_both_inc.cfg b/configs/releng-openrc/syslinux/parabolaiso_sys_both_inc.cfg deleted file mode 100644 index afb027d..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_sys_both_inc.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -INCLUDE parabolaiso_head.cfg - -DEFAULT parabola64 -TIMEOUT 150 - -INCLUDE parabolaiso_sys64-linux-libre.cfg - -INCLUDE parabolaiso_sys32-linux-libre.cfg - -INCLUDE parabolaiso_tail.cfg diff --git a/configs/releng-openrc/syslinux/parabolaiso_sys_choose.cfg b/configs/releng-openrc/syslinux/parabolaiso_sys_choose.cfg deleted file mode 100644 index cf814d9..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_sys_choose.cfg +++ /dev/null @@ -1,14 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -DEFAULT choose - -LABEL choose -COM32 ifcpu64.c32 -APPEND have64 -- nohave64 - -LABEL have64 -CONFIG parabolaiso_sys_both_inc.cfg - -LABEL nohave64 -CONFIG parabolaiso_sys_32_inc.cfg diff --git a/configs/releng-openrc/syslinux/parabolaiso_tail.cfg b/configs/releng-openrc/syslinux/parabolaiso_tail.cfg deleted file mode 100644 index af172c0..0000000 --- a/configs/releng-openrc/syslinux/parabolaiso_tail.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LABEL existing -TEXT HELP -Boot an existing operating system. -Press TAB to edit the disk and partition number to boot. -ENDTEXT -MENU LABEL Boot existing OS -COM32 chain.c32 -APPEND hd0 0 - -# http://www.memtest.org/ -LABEL memtest -MENU LABEL Run Memtest86+ (RAM test) -LINUX /%INSTALL_DIR%/boot/memtest - -# http://hdt-project.org/ -LABEL hdt -MENU LABEL Hardware Information (HDT) -COM32 hdt.c32 -APPEND modules_alias=hdt/modalias.gz pciids=hdt/pciids.gz - -LABEL reboot -TEXT HELP -Reboot computer. -The computer's firmware must support APM. -ENDTEXT -MENU LABEL Reboot -COM32 reboot.c32 - -LABEL poweroff -TEXT HELP -Power off computer. -The computer's firmware must support APM. -ENDTEXT -MENU LABEL Power Off -COM32 poweroff.c32 diff --git a/configs/releng-openrc/syslinux/splash.png b/configs/releng-openrc/syslinux/splash.png Binary files differdeleted file mode 100644 index ff1342f..0000000 --- a/configs/releng-openrc/syslinux/splash.png +++ /dev/null diff --git a/configs/releng-openrc/syslinux/syslinux.cfg b/configs/releng-openrc/syslinux/syslinux.cfg deleted file mode 100644 index 187eea5..0000000 --- a/configs/releng-openrc/syslinux/syslinux.cfg +++ /dev/null @@ -1,15 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -DEFAULT select - -LABEL select -COM32 whichsys.c32 -APPEND -pxe- pxe -sys- sys -iso- sys - -LABEL pxe -CONFIG parabolaiso_pxe_choose.cfg - -LABEL sys -CONFIG parabolaiso_sys_choose.cfg - diff --git a/configs/releng/airootfs/etc/hostname b/configs/releng/airootfs/etc/hostname index 5178d59..8aaf41b 100644 --- a/configs/releng/airootfs/etc/hostname +++ b/configs/releng/airootfs/etc/hostname @@ -1,3 +1 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later parabolaiso diff --git a/configs/releng/airootfs/etc/locale.conf b/configs/releng/airootfs/etc/locale.conf index 9bf7aef..f9c983c 100644 --- a/configs/releng/airootfs/etc/locale.conf +++ b/configs/releng/airootfs/etc/locale.conf @@ -1,4 +1 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -LANG=en_US.UTF-8 +LANG=C.UTF-8 diff --git a/configs/releng/airootfs/etc/mkinitcpio.conf b/configs/releng/airootfs/etc/mkinitcpio.conf deleted file mode 100644 index 35ec2ae..0000000 --- a/configs/releng/airootfs/etc/mkinitcpio.conf +++ /dev/null @@ -1,70 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# vim:set ft=sh -# MODULES -# The following modules are loaded before any boot hooks are -# run. Advanced users may wish to specify all system modules -# in this array. For instance: -# MODULES=(piix ide_disk reiserfs) -MODULES=() - -# BINARIES -# This setting includes any additional binaries a given user may -# wish into the CPIO image. This is run last, so it may be used to -# override the actual binaries included by a given hook -# BINARIES are dependency parsed, so you may safely ignore libraries -BINARIES=() - -# FILES -# This setting is similar to BINARIES above, however, files are added -# as-is and are not parsed in any way. This is useful for config files. -FILES=() - -# HOOKS -# This is the most important setting in this file. The HOOKS control the -# modules and scripts added to the image, and what happens at boot time. -# Order is important, and it is recommended that you do not change the -# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for -# help on a given hook. -# 'base' is _required_ unless you know precisely what you are doing. -# 'udev' is _required_ in order to automatically load modules -# 'filesystems' is _required_ unless you specify your fs modules in MODULES -# Examples: -## This setup specifies all modules in the MODULES setting above. -## No raid, lvm2, or encrypted root is needed. -# HOOKS=(base) -# -## This setup will autodetect all modules for your system and should -## work as a sane default -# HOOKS=(base udev autodetect block filesystems) -# -## This setup will generate a 'full' image which supports most systems. -## No autodetection is done. -# HOOKS=(base udev block filesystems) -# -## This setup assembles a pata mdadm array with an encrypted root FS. -## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. -# HOOKS=(base udev block mdadm encrypt filesystems) -# -## This setup loads an lvm2 volume group on a usb device. -# HOOKS=(base udev block lvm2 filesystems) -# -## NOTE: If you have /usr on a separate partition, you MUST include the -# usr, fsck and shutdown hooks. -HOOKS=(base udev modconf memdisk parabolaiso_shutdown parabolaiso parabolaiso_loop_mnt parabolaiso_pxe_common parabolaiso_pxe_nbd parabolaiso_pxe_http parabolaiso_pxe_nfs parabolaiso_kms block filesystems keyboard) - -# COMPRESSION -# Use this to compress the initramfs image. By default, gzip compression -# is used. Use 'cat' to create an uncompressed image. -#COMPRESSION="gzip" -#COMPRESSION="bzip2" -#COMPRESSION="lzma" -COMPRESSION="xz" -#COMPRESSION="lzop" -#COMPRESSION="lz4" -#COMPRESSION="zstd" - -# COMPRESSION_OPTIONS -# Additional options for the compressor -#COMPRESSION_OPTIONS=() diff --git a/configs/releng/airootfs/etc/mkinitcpio.conf.d/parabolaiso.conf b/configs/releng/airootfs/etc/mkinitcpio.conf.d/parabolaiso.conf new file mode 100644 index 0000000..26c74ea --- /dev/null +++ b/configs/releng/airootfs/etc/mkinitcpio.conf.d/parabolaiso.conf @@ -0,0 +1,2 @@ +HOOKS=(base udev modconf kms memdisk parabolaiso parabolaiso_loop_mnt parabolaiso_pxe_common parabolaiso_pxe_nbd parabolaiso_pxe_http parabolaiso_pxe_nfs block filesystems keyboard) +COMPRESSION="xz" diff --git a/configs/releng/airootfs/etc/mkinitcpio.d/linux-libre.preset b/configs/releng/airootfs/etc/mkinitcpio.d/linux-libre.preset index db31d05..282bcde 100644 --- a/configs/releng/airootfs/etc/mkinitcpio.d/linux-libre.preset +++ b/configs/releng/airootfs/etc/mkinitcpio.d/linux-libre.preset @@ -1,11 +1,8 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - # mkinitcpio preset file for the 'linux-libre' package on parabolaiso PRESETS=('parabolaiso') ALL_kver='/boot/vmlinuz-linux-libre' -ALL_config='/etc/mkinitcpio.conf' +parabolaiso_config='/etc/mkinitcpio.conf.d/parabolaiso.conf' parabolaiso_image="/boot/initramfs-linux-libre.img" diff --git a/configs/releng/airootfs/etc/motd b/configs/releng/airootfs/etc/motd index e94c5c5..fdd42e0 100644 --- a/configs/releng/airootfs/etc/motd +++ b/configs/releng/airootfs/etc/motd @@ -7,3 +7,5 @@ Ethernet, WLAN and WWAN interfaces using DHCP should work automatically. After connecting to the internet, the installation guide can be accessed via the convenience script [35mInstallation_guide[0m. + +[41m [41m [41m [40m [44m [40m [41m [46m [45m [41m [46m [43m [41m [44m [45m [40m [44m [40m [41m [44m [41m [41m [46m [42m [41m [44m [43m [41m [45m [40m [40m [44m [40m [41m [44m [42m [41m [46m [44m [41m [46m [47m [0m diff --git a/configs/releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook b/configs/releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook deleted file mode 100644 index 82dd199..0000000 --- a/configs/releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook +++ /dev/null @@ -1,13 +0,0 @@ -# remove from airootfs! -[Trigger] -Operation = Install -Type = Package -Target = glibc - -[Action] -Description = Uncommenting en_US.UTF-8 locale and running locale-gen... -When = PostTransaction -Depends = glibc -Depends = sed -Depends = sh -Exec = /bin/sh -c "sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen && locale-gen" diff --git a/configs/releng/airootfs/etc/ssh/sshd_config b/configs/releng/airootfs/etc/ssh/sshd_config deleted file mode 100644 index 8ef1758..0000000 --- a/configs/releng/airootfs/etc/ssh/sshd_config +++ /dev/null @@ -1,116 +0,0 @@ -# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $ - -# This is the sshd server system-wide configuration file. See -# sshd_config(5) for more information. - -# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/bin - -# The strategy used for options in the default sshd_config shipped with -# OpenSSH is to specify options with their default value where -# possible, but leave them commented. Uncommented options override the -# default value. - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: - -#HostKey /etc/ssh/ssh_host_rsa_key -#HostKey /etc/ssh/ssh_host_ecdsa_key -#HostKey /etc/ssh/ssh_host_ed25519_key - -# Ciphers and keying -#RekeyLimit default none - -# Logging -#SyslogFacility AUTH -#LogLevel INFO - -# Authentication: - -#LoginGraceTime 2m -PermitRootLogin yes -#StrictModes yes -#MaxAuthTries 6 -#MaxSessions 10 - -#PubkeyAuthentication yes - -# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 -# but this is overridden so installations will only check .ssh/authorized_keys -AuthorizedKeysFile .ssh/authorized_keys - -#AuthorizedPrincipalsFile none - -#AuthorizedKeysCommand none -#AuthorizedKeysCommandUser nobody - -# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts -#HostbasedAuthentication no -# Change to yes if you don't trust ~/.ssh/known_hosts for -# HostbasedAuthentication -#IgnoreUserKnownHosts no -# Don't read the user's ~/.rhosts and ~/.shosts files -#IgnoreRhosts yes - -# To disable tunneled clear text passwords, change to no here! -#PasswordAuthentication yes -#PermitEmptyPasswords no - -# Change to no to disable s/key passwords -ChallengeResponseAuthentication no - -# Kerberos options -#KerberosAuthentication no -#KerberosOrLocalPasswd yes -#KerberosTicketCleanup yes -#KerberosGetAFSToken no - -# GSSAPI options -#GSSAPIAuthentication no -#GSSAPICleanupCredentials yes - -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will -# be allowed through the ChallengeResponseAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via ChallengeResponseAuthentication may bypass -# the setting of "PermitRootLogin without-password". -# If you just want the PAM account and session checks to run without -# PAM authentication, then enable this but set PasswordAuthentication -# and ChallengeResponseAuthentication to 'no'. -UsePAM yes - -#AllowAgentForwarding yes -#AllowTcpForwarding yes -#GatewayPorts no -#X11Forwarding no -#X11DisplayOffset 10 -#X11UseLocalhost yes -#PermitTTY yes -PrintMotd no # pam does that -#PrintLastLog yes -#TCPKeepAlive yes -#PermitUserEnvironment no -#Compression delayed -#ClientAliveInterval 0 -#ClientAliveCountMax 3 -#UseDNS no -#PidFile /run/sshd.pid -#MaxStartups 10:30:100 -#PermitTunnel no -#ChrootDirectory none -#VersionAddendum none - -# no default banner path -#Banner none - -# override default of no subsystems -Subsystem sftp /usr/lib/ssh/sftp-server - -# Example of overriding settings on a per-user basis -#Match User anoncvs -# X11Forwarding no -# AllowTcpForwarding no -# PermitTTY no -# ForceCommand cvs server diff --git a/configs/releng/airootfs/etc/ssh/sshd_config.d/10-parabolaiso.conf b/configs/releng/airootfs/etc/ssh/sshd_config.d/10-parabolaiso.conf new file mode 100644 index 0000000..6ea7b41 --- /dev/null +++ b/configs/releng/airootfs/etc/ssh/sshd_config.d/10-parabolaiso.conf @@ -0,0 +1,3 @@ +# Allow root login using password authentication +PasswordAuthentication yes +PermitRootLogin yes diff --git a/configs/releng/airootfs/etc/systemd/journald.conf.d/volatile-storage.conf b/configs/releng/airootfs/etc/systemd/journald.conf.d/volatile-storage.conf index 3104779..b69850d 100644 --- a/configs/releng/airootfs/etc/systemd/journald.conf.d/volatile-storage.conf +++ b/configs/releng/airootfs/etc/systemd/journald.conf.d/volatile-storage.conf @@ -1,5 +1,2 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Journal] Storage=volatile diff --git a/configs/releng/airootfs/etc/systemd/logind.conf.d/do-not-suspend.conf b/configs/releng/airootfs/etc/systemd/logind.conf.d/do-not-suspend.conf index c6b17a4..f3ecb39 100644 --- a/configs/releng/airootfs/etc/systemd/logind.conf.d/do-not-suspend.conf +++ b/configs/releng/airootfs/etc/systemd/logind.conf.d/do-not-suspend.conf @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Login] HandleSuspendKey=ignore HandleHibernateKey=ignore diff --git a/configs/releng/airootfs/etc/systemd/network.conf.d/ipv6-privacy-extensions.conf b/configs/releng/airootfs/etc/systemd/network.conf.d/ipv6-privacy-extensions.conf new file mode 100644 index 0000000..0e9ceb4 --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/network.conf.d/ipv6-privacy-extensions.conf @@ -0,0 +1,2 @@ +[Network] +IPv6PrivacyExtensions=yes diff --git a/configs/releng/airootfs/etc/systemd/network/20-ethernet.network b/configs/releng/airootfs/etc/systemd/network/20-ethernet.network index 4fce10c..d3a3271 100644 --- a/configs/releng/airootfs/etc/systemd/network/20-ethernet.network +++ b/configs/releng/airootfs/etc/systemd/network/20-ethernet.network @@ -1,15 +1,24 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Match] -Type=ether +# Matching with "Type=ether" causes issues with containers because it also matches virtual Ethernet interfaces (veth*). +# See https://bugs.archlinux.org/task/70892 +# Instead match by globbing the network interface name. +Name=en* +Name=eth* + +[Link] +RequiredForOnline=routable [Network] DHCP=yes -IPv6PrivacyExtensions=yes +MulticastDNS=yes +# systemd-networkd does not set per-interface-type default route metrics +# https://github.com/systemd/systemd/issues/17698 +# Explicitly set route metric, so that Ethernet is preferred over Wi-Fi and Wi-Fi is preferred over mobile broadband. +# Use values from NetworkManager. From nm_device_get_route_metric_default in +# https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/src/core/devices/nm-device.c [DHCPv4] -RouteMetric=512 +RouteMetric=100 -[DHCPv6] -RouteMetric=512 +[IPv6AcceptRA] +RouteMetric=100 diff --git a/configs/releng/airootfs/etc/systemd/network/20-wireless.network b/configs/releng/airootfs/etc/systemd/network/20-wireless.network deleted file mode 100644 index 73a6bbd..0000000 --- a/configs/releng/airootfs/etc/systemd/network/20-wireless.network +++ /dev/null @@ -1,15 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -[Match] -Type=wlan - -[Network] -DHCP=yes -IPv6PrivacyExtensions=yes - -[DHCPv4] -RouteMetric=1024 - -[DHCPv6] -RouteMetric=1024 diff --git a/configs/releng/airootfs/etc/systemd/network/20-wlan.network b/configs/releng/airootfs/etc/systemd/network/20-wlan.network new file mode 100644 index 0000000..8b70a95 --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/network/20-wlan.network @@ -0,0 +1,20 @@ +[Match] +Name=wl* + +[Link] +RequiredForOnline=routable + +[Network] +DHCP=yes +MulticastDNS=yes + +# systemd-networkd does not set per-interface-type default route metrics +# https://github.com/systemd/systemd/issues/17698 +# Explicitly set route metric, so that Ethernet is preferred over Wi-Fi and Wi-Fi is preferred over mobile broadband. +# Use values from NetworkManager. From nm_device_get_route_metric_default in +# https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/src/core/devices/nm-device.c +[DHCPv4] +RouteMetric=600 + +[IPv6AcceptRA] +RouteMetric=600 diff --git a/configs/releng/airootfs/etc/systemd/network/20-wwan.network b/configs/releng/airootfs/etc/systemd/network/20-wwan.network index cc946fe..6e1c8dd 100644 --- a/configs/releng/airootfs/etc/systemd/network/20-wwan.network +++ b/configs/releng/airootfs/etc/systemd/network/20-wwan.network @@ -1,15 +1,19 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Match] -Type=wwan +Name=ww* + +[Link] +RequiredForOnline=routable [Network] DHCP=yes -IPv6PrivacyExtensions=yes +# systemd-networkd does not set per-interface-type default route metrics +# https://github.com/systemd/systemd/issues/17698 +# Explicitly set route metric, so that Ethernet is preferred over Wi-Fi and Wi-Fi is preferred over mobile broadband. +# Use values from NetworkManager. From nm_device_get_route_metric_default in +# https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/src/core/devices/nm-device.c [DHCPv4] -RouteMetric=2048 +RouteMetric=700 -[DHCPv6] -RouteMetric=2048 +[IPv6AcceptRA] +RouteMetric=700 diff --git a/configs/releng/airootfs/etc/systemd/resolved.conf.d/parabolaiso.conf b/configs/releng/airootfs/etc/systemd/resolved.conf.d/parabolaiso.conf new file mode 100644 index 0000000..5d64185 --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/resolved.conf.d/parabolaiso.conf @@ -0,0 +1,4 @@ +# Default systemd-resolved configuration for parabolaiso + +[Resolve] +MulticastDNS=yes diff --git a/configs/releng/airootfs/etc/systemd/system-generators/systemd-gpt-auto-generator b/configs/releng/airootfs/etc/systemd/system-generators/systemd-gpt-auto-generator new file mode 120000 index 0000000..dc1dc0c --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system-generators/systemd-gpt-auto-generator @@ -0,0 +1 @@ +/dev/null
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/choose-mirror.service b/configs/releng/airootfs/etc/systemd/system/choose-mirror.service index b3e4847..b6a3562 100644 --- a/configs/releng/airootfs/etc/systemd/system/choose-mirror.service +++ b/configs/releng/airootfs/etc/systemd/system/choose-mirror.service @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Unit] Description=Choose mirror from the kernel command line ConditionKernelCommandLine=mirror diff --git a/configs/releng/airootfs/etc/systemd/system/dbus-org.freedesktop.timesync1.service b/configs/releng/airootfs/etc/systemd/system/dbus-org.freedesktop.timesync1.service new file mode 120000 index 0000000..cd00411 --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system/dbus-org.freedesktop.timesync1.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/systemd-timesyncd.service
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount b/configs/releng/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount index f86a91d..038961e 100644 --- a/configs/releng/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount +++ b/configs/releng/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Unit] Description=Temporary /etc/pacman.d/gnupg directory @@ -8,4 +5,4 @@ Description=Temporary /etc/pacman.d/gnupg directory What=tmpfs Where=/etc/pacman.d/gnupg Type=tmpfs -Options=mode=0755 +Options=mode=0755,noswap diff --git a/configs/releng/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf b/configs/releng/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf index 370735f..b9d22eb 100644 --- a/configs/releng/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf +++ b/configs/releng/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Service] ExecStart= -ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux +ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root - $TERM diff --git a/configs/releng/airootfs/etc/systemd/system/livecd-alsa-unmuter.service b/configs/releng/airootfs/etc/systemd/system/livecd-alsa-unmuter.service index 8c5317d..03db4b9 100644 --- a/configs/releng/airootfs/etc/systemd/system/livecd-alsa-unmuter.service +++ b/configs/releng/airootfs/etc/systemd/system/livecd-alsa-unmuter.service @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Unit] Description=Unmute All Sound Card Controls For Use With The Live Arch Environment # This needs to run after the audio device becomes available. diff --git a/configs/releng/airootfs/etc/systemd/system/livecd-talk.service b/configs/releng/airootfs/etc/systemd/system/livecd-talk.service index d959ab3..b38df22 100644 --- a/configs/releng/airootfs/etc/systemd/system/livecd-talk.service +++ b/configs/releng/airootfs/etc/systemd/system/livecd-talk.service @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Unit] Description=Screen reader service After=livecd-alsa-unmuter.service diff --git a/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_fcopy_daemon.service b/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_fcopy_daemon.service new file mode 120000 index 0000000..20ac7b2 --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_fcopy_daemon.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/hv_fcopy_daemon.service
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_kvp_daemon.service b/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_kvp_daemon.service new file mode 120000 index 0000000..a7eac4a --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_kvp_daemon.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/hv_kvp_daemon.service
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_vss_daemon.service b/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_vss_daemon.service new file mode 120000 index 0000000..eae19ef --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/hv_vss_daemon.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/hv_vss_daemon.service
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/pacman-init.service b/configs/releng/airootfs/etc/systemd/system/pacman-init.service index 28d4398..b824884 100644 --- a/configs/releng/airootfs/etc/systemd/system/pacman-init.service +++ b/configs/releng/airootfs/etc/systemd/system/pacman-init.service @@ -1,16 +1,15 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Unit] Description=Initializes Pacman keyring Requires=etc-pacman.d-gnupg.mount -After=etc-pacman.d-gnupg.mount +After=etc-pacman.d-gnupg.mount time-sync.target +BindsTo=etc-pacman.d-gnupg.mount +Before=archlinux-keyring-wkd-sync.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/pacman-key --init -ExecStart=/usr/bin/pacman-key --populate parabola archlinux archlinux32 +ExecStart=/usr/bin/pacman-key --populate [Install] WantedBy=multi-user.target diff --git a/configs/releng/airootfs/etc/systemd/system/sockets.target.wants/pcscd.socket b/configs/releng/airootfs/etc/systemd/system/sockets.target.wants/pcscd.socket new file mode 120000 index 0000000..3897c63 --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system/sockets.target.wants/pcscd.socket @@ -0,0 +1 @@ +/usr/lib/systemd/system/pcscd.socket
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service b/configs/releng/airootfs/etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service new file mode 120000 index 0000000..cabf28b --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/systemd-time-wait-sync.service
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service b/configs/releng/airootfs/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service new file mode 120000 index 0000000..cd00411 --- /dev/null +++ b/configs/releng/airootfs/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/systemd-timesyncd.service
\ No newline at end of file diff --git a/configs/releng/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf b/configs/releng/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf index 1b4c091..c875311 100644 --- a/configs/releng/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf +++ b/configs/releng/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - [Service] ExecStart= ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any diff --git a/configs/releng/airootfs/etc/xdg/reflector/reflector.conf b/configs/releng/airootfs/etc/xdg/reflector/reflector.conf index 9a72b0d..7c830d2 100644 --- a/configs/releng/airootfs/etc/xdg/reflector/reflector.conf +++ b/configs/releng/airootfs/etc/xdg/reflector/reflector.conf @@ -1,6 +1,8 @@ # Reflector configuration file for the systemd service. --save /etc/pacman.d/mirrorlist +--ipv4 +--ipv6 --protocol https --latest 20 --sort rate diff --git a/configs/releng/airootfs/root/.automated_script.sh b/configs/releng/airootfs/root/.automated_script.sh index 5c0c316..0d95012 100755 --- a/configs/releng/airootfs/root/.automated_script.sh +++ b/configs/releng/airootfs/root/.automated_script.sh @@ -1,22 +1,29 @@ #!/usr/bin/env bash -script_cmdline () -{ +script_cmdline() { local param - for param in $(< /proc/cmdline); do + for param in $(</proc/cmdline); do case "${param}" in - script=*) echo "${param#*=}" ; return 0 ;; + script=*) + echo "${param#*=}" + return 0 + ;; esac done } -automated_script () -{ +automated_script() { local script rt script="$(script_cmdline)" if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then - if [[ "${script}" =~ ^((http|https|ftp)://) ]]; then - curl "${script}" --location --retry-connrefused -s -o /tmp/startup_script >/dev/null + if [[ "${script}" =~ ^((http|https|ftp|tftp)://) ]]; then + # there's no synchronization for network availability before executing this script + printf '%s: waiting for network-online.target\n' "$0" + until systemctl --quiet is-active network-online.target; do + sleep 1 + done + printf '%s: downloading %s\n' "$0" "${script}" + curl "${script}" --location --retry-connrefused --retry 10 -s -o /tmp/startup_script rt=$? else cp "${script}" /tmp/startup_script @@ -24,6 +31,9 @@ automated_script () fi if [[ ${rt} -eq 0 ]]; then chmod +x /tmp/startup_script + printf '%s: executing automated script\n' "$0" + # note that script is executed when other services (like pacman-init) may be still in progress, please + # synchronize to "systemctl is-system-running --wait" when your script depends on other services /tmp/startup_script fi fi diff --git a/configs/releng/airootfs/root/.gnupg/scdaemon.conf b/configs/releng/airootfs/root/.gnupg/scdaemon.conf new file mode 100644 index 0000000..e1f3d1f --- /dev/null +++ b/configs/releng/airootfs/root/.gnupg/scdaemon.conf @@ -0,0 +1,4 @@ +disable-ccid +disable-pinpad +pcsc-driver /usr/lib/libpcsclite.so +pcsc-shared diff --git a/configs/releng/airootfs/root/.zlogin b/configs/releng/airootfs/root/.zlogin index 0fb119d..bf6bc8f 100644 --- a/configs/releng/airootfs/root/.zlogin +++ b/configs/releng/airootfs/root/.zlogin @@ -1,5 +1,5 @@ # fix for screen readers -if grep -Fq 'accessibility=' /proc/cmdline &> /dev/null; then +if grep -Fqa 'accessibility=' /proc/cmdline &> /dev/null; then setopt SINGLE_LINE_ZLE fi diff --git a/configs/releng/airootfs/usr/local/bin/choose-mirror b/configs/releng/airootfs/usr/local/bin/choose-mirror index e8f8254..2f881e4 100755 --- a/configs/releng/airootfs/usr/local/bin/choose-mirror +++ b/configs/releng/airootfs/usr/local/bin/choose-mirror @@ -4,21 +4,22 @@ get_cmdline() { local param - for param in $(< /proc/cmdline); do + for param in $(</proc/cmdline); do case "${param}" in - $1=*) echo "${param##*=}"; - return 0 - ;; + "${1}="*) + echo "${param##*=}" + return 0 + ;; esac done } -mirror=$(get_cmdline mirror) -[[ $mirror = auto ]] && mirror=$(get_cmdline parabolaiso_http_srv) -[[ $mirror ]] || exit 0 +mirror="$(get_cmdline mirror)" +[[ "$mirror" == 'auto' ]] && mirror="$(get_cmdline parabolaiso_http_srv)" +[[ -n "$mirror" ]] || exit 0 mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig -cat >/etc/pacman.d/mirrorlist << EOF +cat >/etc/pacman.d/mirrorlist <<EOF # # Parabola GNU/Linux-libre repository mirrorlist # Generated by parabolaiso diff --git a/configs/releng/airootfs/usr/local/bin/livecd-sound b/configs/releng/airootfs/usr/local/bin/livecd-sound index baae0d2..b92fcf2 100755 --- a/configs/releng/airootfs/usr/local/bin/livecd-sound +++ b/configs/releng/airootfs/usr/local/bin/livecd-sound @@ -3,7 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later usage() { - cat <<- _EOF_ + cat <<-_EOF_ live cd sound helper script. Usage: livecdsound [OPTION] OPTIONS @@ -14,14 +14,13 @@ usage() { _EOF_ } -bugout () { +bugout() { printf "/usr/local/bin/livecdsound: programming error" stat_fail } -echo_card_indices() -{ - if [ -f /proc/asound/cards ] ; then +echo_card_indices() { + if [[ -f /proc/asound/cards ]]; then sed -n -e's/^[[:space:]]*\([0-7]\)[[:space:]].*/\1/p' /proc/asound/cards fi } @@ -33,8 +32,8 @@ echo_card_indices() # $1 <card id> # $2 <control> # $3 <level> -unmute_and_set_level(){ - { [ "$3" ] &&[ "$2" ] && [ "$1" ] ; } || bugout +unmute_and_set_level() { + [[ -n "$3" && -n "$2" && -n "$1" ]] || bugout systemd-cat -t "livecdsound" printf "Setting: %s on card: %s to %s\n" "$2" "$1" "$3" systemd-cat -t "livecdsound" amixer -c "$1" set "$2" "$3" unmute return 0 @@ -42,9 +41,8 @@ unmute_and_set_level(){ # $1 <card id> # $2 <control> -mute_and_zero_level() -{ - { [ "$1" ] && [ "$2" ] ; } || bugout +mute_and_zero_level() { + [[ -n "$1" && -n "$2" ]] || bugout systemd-cat -t "livecdsound" printf "Muting control: %s on card: %s\n" "$2" "$1" systemd-cat -t "livecdsound" amixer -c "$1" set "$2" "0%" mute return 0 @@ -53,17 +51,15 @@ mute_and_zero_level() # $1 <card ID> # $2 <control> # $3 "on" | "off" -switch_control() -{ - { [ "$3" ] && [ "$1" ] ; } || bugout +switch_control() { + [[ -n "$3" && -n "$1" ]] || bugout systemd-cat -t "livecdsound" printf "Switching control: %s on card: %s to %s\n" "$2" "$1" "$3" systemd-cat -t "livecdsound" amixer -c "$1" set "$2" "$3" return 0 } # $1 <card ID> -sanify_levels_on_card() -{ +sanify_levels_on_card() { unmute_and_set_level "$1" "Front" "80%" unmute_and_set_level "$1" "Master" "80%" unmute_and_set_level "$1" "Master Mono" "80%" @@ -134,94 +130,89 @@ sanify_levels_on_card() } # $1 <card ID> | "all" -sanify_levels() -{ +sanify_levels() { local ttsdml_returnstatus=0 local card case "$1" in - all) - for card in $(echo_card_indices) ; do - sanify_levels_on_card "$card" || ttsdml_returnstatus=1 - done - ;; - *) - sanify_levels_on_card "$1" || ttsdml_returnstatus=1 - ;; + all) + for card in $(echo_card_indices); do + sanify_levels_on_card "$card" || ttsdml_returnstatus=1 + done + ;; + *) + sanify_levels_on_card "$1" || ttsdml_returnstatus=1 + ;; esac - return $ttsdml_returnstatus + return "$ttsdml_returnstatus" } # List all cards that *should* be usable for PCM audio. In my experience, # the console speaker (handled by the pcsp driver) isn't a suitable playback # device, so we'll exclude it. -list_non_pcsp_cards() -{ +list_non_pcsp_cards() { for card in $(echo_card_indices); do local cardfile="/proc/asound/card${card}/id" - if [ -r "$cardfile" ] && [ -f "$cardfile" ] && \ - [ "$(cat "$cardfile")" != pcsp ]; then + if [[ -r "$cardfile" && -f "$cardfile" && "$(cat "$cardfile")" != pcsp ]]; then echo "$card" fi done } # Properly initialize the sound card so that we have audio at boot. -unmute_all_cards() -{ +unmute_all_cards() { sanify_levels all } is_numeric() { - local str=$1 + local str="$1" [[ "$str" =~ ^[0-9]+$ ]] } set_default_card() { - local card=$1 - sed -e "s/%card%/$card/g" < /usr/local/share/livecd-sound/asound.conf.in \ - > /etc/asound.conf + local card="$1" + sed -e "s/%card%/$card/g" </usr/local/share/livecd-sound/asound.conf.in \ + >/etc/asound.conf } play_on_card() { - local card=$1 file=$2 + local card="$1" file="$2" aplay -q "-Dplughw:$card,0" "$file" } # If there are multiple usable sound cards, prompt the user to choose one, # using auditory feedback. -pick_a_card() -{ +pick_a_card() { set -f usable_cards="$(list_non_pcsp_cards)" - num_usable_cards="$(wc -w <<< "$usable_cards")" + num_usable_cards="$(wc -w <<<"$usable_cards")" - if [ "$num_usable_cards" -eq 1 ]; then + if (( num_usable_cards == 1 )); then systemd-cat -t "livecdsound" printf "Only one sound card is detected\n" exit 0 fi systemd-cat -t "livecdsound" printf "multiple sound cards detected\n" - for card in $usable_cards; do + for card in "${usable_cards[@]}"; do if ! is_numeric "$card"; then continue fi - play_on_card "$card" /usr/share/livecd-sounds/pick-a-card.wav& + play_on_card "$card" /usr/share/livecd-sounds/pick-a-card.wav & done wait sleep 1 - for card in $usable_cards; do + for card in "${usable_cards[@]}"; do if ! is_numeric "$card"; then continue - fi - play_on_card "$card" /usr/share/livecd-sounds/beep.wav - if read -r -t 10; then - systemd-cat -t "livecdsound" printf "Selecting %s sound card as default\n" "$card" - set_default_card "$card" - break - fi -done + fi + play_on_card "$card" /usr/share/livecd-sounds/beep.wav + if read -r -t 10; then + systemd-cat -t "livecdsound" printf "Selecting %s sound card as default\n" "$card" + set_default_card "$card" + break + fi + done } -if [[ $# -eq 0 ]]; then +if (( $# == 0 )); then echo "error: No argument passed." exit 1 fi diff --git a/configs/releng/bootstrap_packages.both b/configs/releng/bootstrap_packages.both new file mode 100644 index 0000000..64966d0 --- /dev/null +++ b/configs/releng/bootstrap_packages.both @@ -0,0 +1,2 @@ +arch-install-scripts +base diff --git a/configs/releng/efiboot/loader/entries/01-parabolaiso-x86_64-linux-libre.conf b/configs/releng/efiboot/loader/entries/01-parabolaiso-x86_64-linux-libre.conf new file mode 100644 index 0000000..1af7867 --- /dev/null +++ b/configs/releng/efiboot/loader/entries/01-parabolaiso-x86_64-linux-libre.conf @@ -0,0 +1,5 @@ +title Parabola GNU/Linux-libre install medium (x86_64, UEFI) +sort-key 01 +linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre +initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img +options parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% diff --git a/configs/releng/efiboot/loader/entries/02-parabolaiso-x86_64-speech-linux-libre.conf b/configs/releng/efiboot/loader/entries/02-parabolaiso-x86_64-speech-linux-libre.conf new file mode 100644 index 0000000..3bb7725 --- /dev/null +++ b/configs/releng/efiboot/loader/entries/02-parabolaiso-x86_64-speech-linux-libre.conf @@ -0,0 +1,5 @@ +title Parabola GNU/Linux-libre install medium (x86_64, UEFI) with speech +sort-key 02 +linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre +initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img +options parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% accessibility=on diff --git a/configs/releng/efiboot/loader/entries/parabolaiso-x86_64-linux-libre.conf b/configs/releng/efiboot/loader/entries/parabolaiso-x86_64-linux-libre.conf deleted file mode 100644 index 5f15e97..0000000 --- a/configs/releng/efiboot/loader/entries/parabolaiso-x86_64-linux-libre.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -title Parabola GNU/Linux-libre install medium (x86_64, UEFI) -linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -options parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% diff --git a/configs/releng/efiboot/loader/entries/parabolaiso-x86_64-speech-linux-libre.conf b/configs/releng/efiboot/loader/entries/parabolaiso-x86_64-speech-linux-libre.conf deleted file mode 100644 index ac42de8..0000000 --- a/configs/releng/efiboot/loader/entries/parabolaiso-x86_64-speech-linux-libre.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -title Parabola GNU/Linux-libre install medium (x86_64, UEFI) with speech -linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -options parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on diff --git a/configs/releng/efiboot/loader/loader.conf b/configs/releng/efiboot/loader/loader.conf index 3f878d9..8e31f03 100644 --- a/configs/releng/efiboot/loader/loader.conf +++ b/configs/releng/efiboot/loader/loader.conf @@ -1,5 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - timeout 15 -default parabolaiso-x86_64-linux-libre.conf +default 01-parabolaiso-x86_64-linux-libre.conf +beep on diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg new file mode 100644 index 0000000..4266ef3 --- /dev/null +++ b/configs/releng/grub/grub.cfg @@ -0,0 +1,87 @@ +# Load partition table and file system modules +insmod part_gpt +insmod part_msdos +insmod fat +insmod iso9660 +insmod ntfs +insmod ntfscomp +insmod exfat +insmod udf + +# Use graphics-mode output +insmod all_video +insmod font +if loadfont "${prefix}/fonts/unicode.pf2" ; then + set gfxmode="auto" + terminal_input console + terminal_output console +fi + +# Enable serial console +if serial --unit=0 --speed=115200; then + terminal_input --append serial + terminal_output --append serial +fi + +# Search for the ISO volume +if [ -z "${PARABOLAISO_UUID}" ]; then + if [ -z "${PARABOLAISO_HINT}" ]; then + regexp --set=1:PARABOLAISO_HINT '^\(([^)]+)\)' "${cmdpath}" + fi + search --no-floppy --set=root --file '%PARABOLAISO_SEARCH_FILENAME%' --hint "${PARABOLAISO_HINT}" + probe --set PARABOLAISO_UUID --fs-uuid "${root}" +fi + +# Set default menu entry +default=parabola +timeout=15 +timeout_style=menu + +# GRUB init tune for accessibility +play 600 988 1 1319 4 + +# Menu entries + +menuentry "Parabola GNU/Linux-libre install medium (x86_64, UEFI)" --class arch --class gnu-linux --class gnu --class os --id 'parabola' { + set gfxpayload=keep + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=${PARABOLAISO_UUID} + initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img +} + +menuentry "Parabola GNU/Linux-libre install medium with speakup screen reader (x86_64, UEFI)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'parabola-accessibility' { + set gfxpayload=keep + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=${PARABOLAISO_UUID} accessibility=on + initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img +} + +if [ "${grub_platform}" == "efi" ]; then + if [ "${grub_cpu}" == "x86_64" ]; then + menuentry "Run Memtest86+ (RAM test)" --class memtest86 --class memtest --class gnu --class tool { + set gfxpayload=800x600,1024x768 + linux /boot/memtest86+/memtest.efi + } + menuentry "UEFI Shell" --class efi { + insmod chain + chainloader /shellx64.efi + } + elif [ "${grub_cpu}" == "i386" ]; then + menuentry "UEFI Shell" --class efi { + insmod chain + chainloader /shellia32.efi + } + fi + + menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' { + fwsetup + } +fi + +menuentry "System shutdown" --class shutdown --class poweroff { + echo "System shutting down..." + halt +} + +menuentry "System restart" --class reboot --class restart { + echo "System rebooting..." + reboot +} diff --git a/configs/releng/grub/loopback.cfg b/configs/releng/grub/loopback.cfg new file mode 100644 index 0000000..6ac328c --- /dev/null +++ b/configs/releng/grub/loopback.cfg @@ -0,0 +1,80 @@ +# https://www.supergrubdisk.org/wiki/Loopback.cfg + +# Search for the ISO volume +search --no-floppy --set=parabolaiso_img_dev --file "${iso_path}" +probe --set parabolaiso_img_dev_uuid --fs-uuid "${parabolaiso_img_dev}" + +# Get a human readable platform identifier +if [ "${grub_platform}" == 'efi' ]; then + parabolaiso_platform='UEFI' + if [ "${grub_cpu}" == 'x86_64' ]; then + parabolaiso_platform="x64 ${parabolaiso_platform}" + elif [ "${grub_cpu}" == 'i386' ]; then + parabolaiso_platform="IA32 ${parabolaiso_platform}" + else + parabolaiso_platform="${grub_cpu} ${parabolaiso_platform}" + fi +elif [ "${grub_platform}" == 'pc' ]; then + parabolaiso_platform='BIOS' +else + parabolaiso_platform="${grub_cpu} ${grub_platform}" +fi + +# Set default menu entry +default=parabola +timeout=15 +timeout_style=menu + + +# Menu entries + +menuentry "Parabola GNU/Linux-libre install medium (%ARCH%, ${parabolaiso_platform})" --class arch --class gnu-linux --class gnu --class os --id 'parabola' { + set gfxpayload=keep + linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-libre parabolaisobasedir=%INSTALL_DIR% img_dev=UUID=${parabolaiso_img_dev_uuid} img_loop="${iso_path}" + initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-libre.img +} + +menuentry "Parabola GNU/Linux-libre install medium with speakup screen reader (%ARCH%, ${parabolaiso_platform})" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'parabola-accessibility' { + set gfxpayload=keep + linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-libre parabolaisobasedir=%INSTALL_DIR% img_dev=UUID=${parabolaiso_img_dev_uuid} img_loop="${iso_path}" accessibility=on + initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-libre.img +} + + +if [ "${grub_platform}" == 'efi' -a "${grub_cpu}" == 'x86_64' -a -f '/boot/memtest86+/memtest.efi' ]; then + menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class memtest --class gnu --class tool { + set gfxpayload=800x600,1024x768 + linux /boot/memtest86+/memtest.efi + } +fi +if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then + menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class memtest --class gnu --class tool { + set gfxpayload=800x600,1024x768 + linux /boot/memtest86+/memtest + } +fi +if [ "${grub_platform}" == 'efi' ]; then + if [ "${grub_cpu}" == 'x86_64' -a -f '/shellx64.efi' ]; then + menuentry 'UEFI Shell' --class efi { + chainloader /shellx64.efi + } + elif [ "${grub_cpu}" == "i386" -a -f '/shellia32.efi' ]; then + menuentry 'UEFI Shell' --class efi { + chainloader /shellia32.efi + } + fi + + menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' { + fwsetup + } +fi + +menuentry 'System shutdown' --class shutdown --class poweroff { + echo 'System shutting down...' + halt +} + +menuentry 'System restart' --class reboot --class restart { + echo 'System rebooting...' + reboot +} diff --git a/configs/releng/packages.both b/configs/releng/packages.both index 087d37d..9828871 100644 --- a/configs/releng/packages.both +++ b/configs/releng/packages.both @@ -1,40 +1,49 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later alsa-utils -archinstall arch-install-scripts base -bind-tools +bcachefs-tools +bind +bolt brltty btrfs-progs cloud-init -crda +cryptsetup darkhttpd ddrescue dhclient dhcpcd diffutils +dmidecode dmraid dnsmasq dosfstools +e2fsprogs +edk2-shell efibootmgr espeakup ethtool exfatprogs f2fs-tools fatresize +foot-terminfo fsarchiver gnu-netcat gpart gpm gptfdisk grml-zsh-config +grub hdparm +hyperv irssi +iw iwd jfsutils kitty-terminfo +less lftp +libfido2 +libusb-compat linux-atm linux-libre linux-libre-firmware @@ -47,6 +56,7 @@ man-pages mc mdadm memtest86+ +memtest86+-efi mkinitcpio mkinitcpio-parabolaiso mkinitcpio-nfs-utils @@ -57,41 +67,49 @@ nbd ndisc6 nfs-utils nilfs-utils -nmap ntfs-3g nvme-cli +open-iscsi openconnect +openpgp-card-tools openssh openvpn partclone parted partimage +pcsclite ppp pptpclient +pv +qemu-guest-agent +refind reflector reiserfsprogs rp-pppoe rsync rxvt-unicode-terminfo +screen +sequoia-sq sdparm sg3_utils smartmontools -sof-firmware squashfs-tools sudo syslinux systemd-resolvconf tcpdump terminus-font -termite-terminfo testdisk tmux +tpm2-tools +tpm2-tss udftools usb_modeswitch usbmuxd usbutils vim vpnc +wezterm-terminfo wireless-regdb wireless_tools wpa_supplicant diff --git a/configs/releng/packages.x86_64 b/configs/releng/packages.x86_64 deleted file mode 100644 index e76d794..0000000 --- a/configs/releng/packages.x86_64 +++ /dev/null @@ -1,3 +0,0 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later -edk2-shell diff --git a/configs/releng/pacman.conf b/configs/releng/pacman.conf index 51188ca..4469abc 100644 --- a/configs/releng/pacman.conf +++ b/configs/releng/pacman.conf @@ -2,8 +2,6 @@ # /etc/pacman.conf # # See the pacman.conf(5) manpage for option and repository directives -# -# SPDX-License-Identifier: GPL-3.0-or-later # # GENERAL OPTIONS @@ -33,10 +31,11 @@ Architecture = auto # Misc options #UseSyslog #Color -#TotalDownload +#NoProgressBar # We cannot check disk space from within a chroot environment #CheckSpace #VerbosePkgLists +ParallelDownloads = 5 # By default, pacman accepts packages signed by keys that its local keyring # trusts (see pacman-key and its man page), as well as unsigned packages. @@ -77,21 +76,12 @@ LocalFileSigLevel = Optional [libre] Include = /etc/pacman.d/mirrorlist -#[testing] -#Include = /etc/pacman.d/mirrorlist - [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - #[pcr-testing] #Include = /etc/pacman.d/mirrorlist diff --git a/configs/releng/profiledef.sh b/configs/releng/profiledef.sh index 5ad616e..5ac639e 100644 --- a/configs/releng/profiledef.sh +++ b/configs/releng/profiledef.sh @@ -2,12 +2,15 @@ # shellcheck disable=SC2034 iso_name="parabola" -iso_label="PARA_$(date +%Y%m)" +iso_label="PARA_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)" iso_publisher="Parabola GNU/Linux-libre <https://parabola.nu>" iso_application="Parabola GNU/Linux-libre Live/Rescue CD" -iso_version="$(date +%Y.%m.%d)" +iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)" install_dir="parabola" -bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' 'uefi-x64.systemd-boot.esp' 'uefi-x64.systemd-boot.eltorito') +buildmodes=('iso') +bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' + 'uefi-ia32.grub.esp' 'uefi-x64.systemd-boot.esp' + 'uefi-ia32.grub.eltorito' 'uefi-x64.systemd-boot.eltorito') arch="dual" pacman_conf="pacman.conf" airootfs_image_type="squashfs" @@ -16,6 +19,7 @@ file_permissions=( ["/etc/shadow"]="0:0:400" ["/root"]="0:0:750" ["/root/.automated_script.sh"]="0:0:755" + ["/root/.gnupg"]="0:0:700" ["/usr/local/bin/choose-mirror"]="0:0:755" ["/usr/local/bin/Installation_guide"]="0:0:755" ["/usr/local/bin/livecd-sound"]="0:0:755" diff --git a/configs/releng/syslinux/parabolaiso_head.cfg b/configs/releng/syslinux/parabolaiso_head.cfg index 17b77e9..4f56858 100644 --- a/configs/releng/syslinux/parabolaiso_head.cfg +++ b/configs/releng/syslinux/parabolaiso_head.cfg @@ -1,7 +1,4 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - -SERIAL 0 38400 +SERIAL 0 115200 UI vesamenu.c32 MENU TITLE Parabola GNU/Linux-libre MENU BACKGROUND splash.png @@ -15,7 +12,7 @@ MENU CMDLINEROW 14 MENU HELPMSGROW 16 MENU HELPMSGENDROW 29 -# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu +# Refer to https://wiki.syslinux.org/wiki/index.php/Comboot/menu.c32 MENU COLOR border 35;40 #ff777caa #a0000000 std MENU COLOR title 1;35;40 #ff777caa #a0000000 std diff --git a/configs/releng/syslinux/parabolaiso_pxe32-linux-libre.cfg b/configs/releng/syslinux/parabolaiso_pxe32-linux-libre.cfg index 8f1a5ac..fa629f1 100644 --- a/configs/releng/syslinux/parabolaiso_pxe32-linux-libre.cfg +++ b/configs/releng/syslinux/parabolaiso_pxe32-linux-libre.cfg @@ -1,15 +1,12 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - LABEL parabola32_nbd TEXT HELP Boot the Parabola GNU/Linux-libre (i686) live medium (Using NBD). It allows you to install Parabola GNU/Linux-libre or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola GNU/Linux-libre (i686) (NBD) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% parabolaiso_nbd_srv=${pxeserver} checksum verify +LINUX ::/%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre +INITRD ::/%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% parabolaiso_nbd_srv=${pxeserver} cms_verify=y SYSAPPEND 3 LABEL parabola32_nfs @@ -18,9 +15,9 @@ Boot the Parabola GNU/Linux-libre (i686) live medium (Using NFS). It allows you to install Parabola GNU/Linux-libre or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola GNU/Linux-libre (i686) (NFS) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt checksum verify +LINUX ::/%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre +INITRD ::/%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt cms_verify=y SYSAPPEND 3 LABEL parabola32_http @@ -29,7 +26,7 @@ Boot the Parabola GNU/Linux-libre (i686) live medium (Using HTTP). It allows you to install Parabola GNU/Linux-libre or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola GNU/Linux-libre (i686) (HTTP) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ checksum verify +LINUX ::/%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre +INITRD ::/%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ cms_verify=y SYSAPPEND 3 diff --git a/configs/releng/syslinux/parabolaiso_pxe64-linux-libre.cfg b/configs/releng/syslinux/parabolaiso_pxe64-linux-libre.cfg index 3e46234..44531ab 100644 --- a/configs/releng/syslinux/parabolaiso_pxe64-linux-libre.cfg +++ b/configs/releng/syslinux/parabolaiso_pxe64-linux-libre.cfg @@ -1,15 +1,12 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - LABEL parabola64_nbd TEXT HELP Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using NBD). It allows you to install Parabola GNU/Linux-libre or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (NBD) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% parabolaiso_nbd_srv=${pxeserver} checksum verify +LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre +INITRD ::/%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% parabolaiso_nbd_srv=${pxeserver} cms_verify=y SYSAPPEND 3 LABEL parabola64_nfs @@ -18,9 +15,9 @@ Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using NFS). It allows you to install Parabola GNU/Linux-libre or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (NFS) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt checksum verify +LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre +INITRD ::/%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_nfs_srv=${pxeserver}:/run/parabolaiso/bootmnt cms_verify=y SYSAPPEND 3 LABEL parabola64_http @@ -29,7 +26,7 @@ Boot the Parabola GNU/Linux-libre (x86_64) live medium (Using HTTP). It allows you to install Parabola GNU/Linux-libre or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola GNU/Linux-libre (x86_64) (HTTP) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre -INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ checksum verify +LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre +INITRD ::/%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaiso_http_srv=http://${pxeserver}/ cms_verify=y SYSAPPEND 3 diff --git a/configs/releng/syslinux/parabolaiso_pxe_32_inc.cfg b/configs/releng/syslinux/parabolaiso_pxe_32_inc.cfg index 6b0cd85..e42cf87 100644 --- a/configs/releng/syslinux/parabolaiso_pxe_32_inc.cfg +++ b/configs/releng/syslinux/parabolaiso_pxe_32_inc.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - INCLUDE parabolaiso_head.cfg INCLUDE parabolaiso_pxe32.cfg INCLUDE parabolaiso_tail.cfg diff --git a/configs/releng/syslinux/parabolaiso_pxe_both_inc.cfg b/configs/releng/syslinux/parabolaiso_pxe_both_inc.cfg index ed898b5..279fba1 100644 --- a/configs/releng/syslinux/parabolaiso_pxe_both_inc.cfg +++ b/configs/releng/syslinux/parabolaiso_pxe_both_inc.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - INCLUDE parabolaiso_head.cfg INCLUDE parabolaiso_pxe64-linux-libre.cfg INCLUDE parabolaiso_pxe32-linux-libre.cfg diff --git a/configs/releng/syslinux/parabolaiso_pxe_choose.cfg b/configs/releng/syslinux/parabolaiso_pxe_choose.cfg index ad5a822..dcf16b6 100644 --- a/configs/releng/syslinux/parabolaiso_pxe_choose.cfg +++ b/configs/releng/syslinux/parabolaiso_pxe_choose.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - DEFAULT choose LABEL choose diff --git a/configs/releng/syslinux/parabolaiso_sys32-linux-libre.cfg b/configs/releng/syslinux/parabolaiso_sys32-linux-libre.cfg index b2c943c..d15cac6 100644 --- a/configs/releng/syslinux/parabolaiso_sys32-linux-libre.cfg +++ b/configs/releng/syslinux/parabolaiso_sys32-linux-libre.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - TIMEOUT 150 LABEL parabola32 @@ -11,7 +8,7 @@ ENDTEXT MENU LABEL Parabola GNU/Linux-libre install medium (i686, BIOS) LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% # Accessibility boot option LABEL parabola32speech @@ -22,4 +19,15 @@ ENDTEXT MENU LABEL Parabola GNU/Linux-libre install medium (i686, BIOS) with ^speech LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% accessibility=on + +# Copy to RAM boot option +LABEL parabola32ram +TEXT HELP +Boot the Parabola GNU/Linux-libre install medium on BIOS with Copy-to-RAM option +It allows you to install Parabola GNU/Linux-libre or perform system maintenance. +ENDTEXT +MENU LABEL Parabola GNU/Linux-libre install medium (i686, BIOS, Copy to RAM) +LINUX /%INSTALL_DIR%/boot/i686/vmlinuz-linux-libre +INITRD /%INSTALL_DIR%/boot/i686/initramfs-linux-libre.img +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% copytoram diff --git a/configs/releng/syslinux/parabolaiso_sys64-linux-libre.cfg b/configs/releng/syslinux/parabolaiso_sys64-linux-libre.cfg index b173f93..9750687 100644 --- a/configs/releng/syslinux/parabolaiso_sys64-linux-libre.cfg +++ b/configs/releng/syslinux/parabolaiso_sys64-linux-libre.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - LABEL parabola64 TEXT HELP Boot the Parabola GNU/Linux-libre install medium on BIOS. @@ -9,7 +6,7 @@ ENDTEXT MENU LABEL Parabola GNU/Linux-libre install medium (x86_64, BIOS) LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% # Accessibility boot option LABEL parabola64speech @@ -20,4 +17,4 @@ ENDTEXT MENU LABEL Parabola GNU/Linux-libre install medium (x86_64, BIOS) with ^speech LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img -APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% accessibility=on +APPEND parabolaisobasedir=%INSTALL_DIR% parabolaisodevice=UUID=%PARABOLAISO_UUID% accessibility=on diff --git a/configs/releng/syslinux/parabolaiso_sys_32_inc.cfg b/configs/releng/syslinux/parabolaiso_sys_32_inc.cfg index b9306ed..bbe92a3 100644 --- a/configs/releng/syslinux/parabolaiso_sys_32_inc.cfg +++ b/configs/releng/syslinux/parabolaiso_sys_32_inc.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - INCLUDE parabolaiso_head.cfg DEFAULT parabola32 diff --git a/configs/releng/syslinux/parabolaiso_sys_both_inc.cfg b/configs/releng/syslinux/parabolaiso_sys_both_inc.cfg index afb027d..1f54dde 100644 --- a/configs/releng/syslinux/parabolaiso_sys_both_inc.cfg +++ b/configs/releng/syslinux/parabolaiso_sys_both_inc.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - INCLUDE parabolaiso_head.cfg DEFAULT parabola64 diff --git a/configs/releng/syslinux/parabolaiso_sys_choose.cfg b/configs/releng/syslinux/parabolaiso_sys_choose.cfg index cf814d9..41c0e06 100644 --- a/configs/releng/syslinux/parabolaiso_sys_choose.cfg +++ b/configs/releng/syslinux/parabolaiso_sys_choose.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - DEFAULT choose LABEL choose diff --git a/configs/releng/syslinux/parabolaiso_tail.cfg b/configs/releng/syslinux/parabolaiso_tail.cfg index af172c0..dcbb413 100644 --- a/configs/releng/syslinux/parabolaiso_tail.cfg +++ b/configs/releng/syslinux/parabolaiso_tail.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - LABEL existing TEXT HELP Boot an existing operating system. @@ -10,12 +7,12 @@ MENU LABEL Boot existing OS COM32 chain.c32 APPEND hd0 0 -# http://www.memtest.org/ +# https://www.memtest.org/ LABEL memtest MENU LABEL Run Memtest86+ (RAM test) LINUX /%INSTALL_DIR%/boot/memtest -# http://hdt-project.org/ +# https://wiki.syslinux.org/wiki/index.php/Hdt_(Hardware_Detection_Tool) LABEL hdt MENU LABEL Hardware Information (HDT) COM32 hdt.c32 diff --git a/configs/releng/syslinux/syslinux.cfg b/configs/releng/syslinux/syslinux.cfg index 187eea5..2894460 100644 --- a/configs/releng/syslinux/syslinux.cfg +++ b/configs/releng/syslinux/syslinux.cfg @@ -1,6 +1,3 @@ -# -# SPDX-License-Identifier: GPL-3.0-or-later - DEFAULT select LABEL select diff --git a/docs/README.altbootmethods b/docs/README.altbootmethods deleted file mode 100644 index e246540..0000000 --- a/docs/README.altbootmethods +++ /dev/null @@ -1,125 +0,0 @@ -INDEX ------ - -* Alternative boot methods (configs/releng) - * ISO in loopback mode - * ISO in memdisk mode - * Network booting (PXE) [first stage] - * DHCP + TFTP - * DHCP + HTTP - * HTTP/NFS/NBD [second stage] - - - -*** Alternative boot methods (configs/releng) - -ISO images names consist of: parabola-<YYYY>.<MM>.<DD>-dual.iso - -Where: - <YYYY> Year - <MM> Month - <DD> Day - - -** ISO in loopback mode. - -Note: Described method is for using with GRUB2. - GRUB2 is installed on target media and parabola-<YYYY>.<MM>.<DD>-dual.iso - is at path <TARGET-PATH> on disk <D> and partition <P>, - where filesystem is labeled as <TARGET-FS-LABEL>. - -menuentry "Parabola GNU/Linux-libre (x86_64)" { - set isofile="/<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-dual.iso" - loopback loop (hd<D>,<P>)$isofile - linux (loop)/parabola/boot/x86_64/vmlinuz parabolaisolabel=<FS-LABEL> img_label=<TARGET-FS-LABEL> img_loop=$isofile - initrd (loop)/parabola/boot/x86_64/parabolaiso.img -} - -menuentry "Parabola GNU/Linux-libre (i686)" { - set isofile="/<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-dual.iso" - loopback loop (hd<D>,<P>)$isofile - linux (loop)/parabola/boot/i686/vmlinuz parabolaisolabel=<FS-LABEL> img_label=<TARGET-FS-LABEL> img_loop=$isofile - initrd (loop)/parabola/boot/i686/parabolaiso.img -} - - -** ISO in memdisk mode. - -Note: Described method is for using with SYSLINUX. Anyway MEMDISK from SYSLINUX can work - with other bootloaders. - SYSLINUX is installed on target media and parabola-<YYYY>.<MM>.<DD>-dual.iso - is at path <TARGET-PATH>. - On 32-bit systems, is needed to pass vmalloc=nnM to the kernel, where nn is the size - of the ISO image plus 64 MiB (or 128 MiB). - - -LABEL parabola_x64 - LINUX memdisk - INITRD /<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-dual.iso - APPEND iso - -LABEL parabola_x32 - LINUX memdisk - INITRD /<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-dual.iso - APPEND iso - - -** Network booting (PXE). - -All ISOs are ready to act as PXE server, some manual steps are needed -to setup the desired PXE boot mode. -Alternatively it is possible to use an existing PXE server following the same logic. -Note: Setup network first, adjust IP adresses, and respect all slashes "/". - -First stage is for loading kernel and initramfs via PXE, two methods described here: - -* DHCP + TFTP - -Note: All NIC firmwares should support this. - -# dnsmasq --port=0 \ - --enable-tftp \ - --tftp-root=/run/parabolaiso/bootmnt \ - --dhcp-range=192.168.0.2,192.168.0.254,86400 \ - --dhcp-boot=/parabola/boot/syslinux/lpxelinux.0 \ - --dhcp-option-force=209,boot/syslinux/parabolaiso.cfg \ - --dhcp-option-force=210,/parabola/ - -* DHCP + HTTP - -Note: Not all NIC firmware supports HTTP and DNS (if domain name is used). - At least this works with iPXE and gPXE. - -# dnsmasq --port=0 \ - --dhcp-range=192.168.0.2,192.168.0.254,86400 \ - --dhcp-boot=http://192.168.0.7/parabola/boot/syslinux/lpxelinux.0 \ - --dhcp-option-force=209,boot/syslinux/parabolaiso.cfg \ - --dhcp-option-force=210,http://192.168.0.7/parabola/ - - -Once the kernel is started from PXE, SquashFS files and other misc files -inside "parabola" directory must be loaded (second stage). One of the following -methods can be used to serve the rest of live-medium. - -* HTTP - -# darkhttpd /run/parabolaiso/bootmnt - - -* NFS - -# echo "/run/parabolaiso/bootmnt 192.168.0.*(ro,no_subtree_check,no_root_squash)" >> /etc/exports -# systemctl start nfs-server.service - - -* NBD - -Note: Adjust PARA_201302 as needed. - -# cat << EOF > /tmp/nbd-server.conf -[generic] -[parabolaiso] - readonly = true - exportname = /dev/disk/by-label/PARA_201302 -EOF -# nbd-server -C /tmp/nbd-server.conf diff --git a/docs/README.bootparams b/docs/README.bootparams deleted file mode 100644 index b9eadb4..0000000 --- a/docs/README.bootparams +++ /dev/null @@ -1,141 +0,0 @@ -INDEX ------ - -* Boot parameters (initramfs stage) - * hooks/parabolaiso - * hooks/parabolaiso_pxe_common - * hooks/parabolaiso_pxe_nbd - * hooks/parabolaiso_pxe_http - * hooks/parabolaiso_pxe_nfs - * hooks/parabolaiso_loop_mnt - -* Boot parameters (configs/releng) - * scripts/choose-mirror - - -*** Boot parameters (initramfs stage) - -** hooks/parabolaiso - -* parabolaisolabel= Set the filesystem label where parabolaiso files reside. - Default: (unset) -* parabolaisodevice= Set the device node where parabolaiso medium is located. - Default: "/dev/disk/by-label/${parabolaisolabel}" -* parabolaisobasedir= Set the base directory where all files reside. - Default: "parabola" -* copytoram= If set to "y" or just "copytoram" without arguments, - all SquashFS are copied to "RAM". - Default: (unset) -* checksum= If set to "y" or just "checksum" without arguments, - performs a self-test of all files inside ${install_dir}, - and continue booting if ok. - Default: (unset) -* cow_label= Set the filesystem label where COW file (for dm-snapshot) - or upperdir/workdir files (for overlayfs) must be stored. - Default: (unset) -* cow_device= Like cow_label= but using device node. - Default: (unset) or "/dev/disk/by-label/${cow_label}" -* cow_flags= Set extra mount options, e.g. for btrfs subvolumes. - Default: defaults -* cow_directory= Set a directory inside ${cow_device}. - Default: "/persistent_${parabolaisolabel}/${arch}" -* cow_persistent= Set if snapshot is persistent "P" or non-persistent "N". - Only used for dm-snapshot mode, ignored for overlayfs. - Default: "N" (if no ${cow_device} is used) otherwise "P". -* cow_spacesize= Set the size for COW space (tmpfs). Valid for both - dm-snapshot and overlayfs mode. - The argument is an integer and optional unit. - Units are M,G (powers of 1024). - Default: "256M" -* cow_chunksize= Set chunksize used for dm-snapshot. This is number - of 512 byte blocks to write at once. - Default: "8" -* copytoram_size= Set the size of tmpfs. This space is used for - airootfs.sfs image if copytoram=y. - Size is in bytes (suffix with "k", "m" and "g") or - in percentage of available RAM. - Default: "75%" -* dm_snap_prefix= Set a prefix for dm-snapshot node names. - Only used for dm-snapshot mode, ignored for overlayfs. - Default: "parabola" -* arch= Force an architecture type (i686 | x86_64). - Do not set it for normal operations. - Default: (architecture of running kernel) - - -** hooks/parabolaiso_pxe_common - -* ip= This parameter is setup automatically by PXELINUX - when option "SYSAPPEND" is set to 1 or 2 in config. - ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask> - Default: (set via PXE server) -* BOOTIF= This parameter is setup automatically by PXELINUX - when option "SYSAPPEND" is set to 2 or 3 in config. - BOOTIF=<hardware-address-of-boot-interface> - Default: (set via PXELINUX) -* copy_resolvconf= Copy /etc/resolv.conf from initramfs to live-enviroment. - Set to "n" to skip them. - Default: "y" - - -** hooks/parabolaiso_pxe_nbd - -* parabolaiso_nbd_name= Set NBD export name used by the server. - Default: parabolaiso -* parabolaiso_nbd_srv= Set an IP address where NBD reside. - If ${pxeserver} is used, PXE IP will be used. - Default: (unset) - - -** hooks/parabolaiso_pxe_http - -* parabolaiso_http_srv= Set an HTTP URL (must end with /) where ${parabolaisobasedir} - is found with all *.sfs files. - In the IP/domain part if ${pxeserver} is used, use PXE IP. - Default: (unset) -* parabolaiso_http_spc= Set the size of tmpfs where *.sfs files are downloaded. - Default: "75%" - - -** hooks/parabolaiso_pxe_nfs - -* parabolaiso_nfs_srv= Set the NFS-IP:/path of the server - In the IP part if ${pxeserver} is used, PXE IP will be used. - Default: (unset) -* parabolaiso_nfs_opt= Set NFS mount options separated by comma. - Default: (unset, see below) - These are the implicit options: - port = as given by server portmap daemon - rsize = 1024 - wsize = 1024 - timeo = 7 - retrans = 3 - acregmin = 3 - acregmax = 60 - acdirmin = 30 - acdirmax = 60 - flags = hard, nointr, noposix, cto, ac - - -** hooks/parabolaiso_loop_mnt - -* img_label= Set the filesystem label where parabolaiso-image.iso. - Default: (unset) -* img_dev= Device where parabolaiso-image.iso reside. - Default: (unset) or "/dev/disk/by-label/${img_label}" -* img_flags= Set extra mount options, e.g. for btrfs subvolumes. - Default: defaults -* img_loop= Full path where parabolaiso-image.iso is located on ${img_dev} - Default: (unset) - - - -*** Boot parameters (configs/releng) - -** scripts/choose-mirror - -* mirror= Takes a mirror URL and creates a new mirrorlist. - When setting mirror=auto, the mirror is taken from - parabolaiso_http_srv= in order to keep using the mirror - selected in the netboot menu. - Default: (unset) diff --git a/docs/README.build b/docs/README.build deleted file mode 100644 index 8855789..0000000 --- a/docs/README.build +++ /dev/null @@ -1,68 +0,0 @@ -INDEX ------ - -* Build requirements -* Building the most basic Parabola GNU/Linux-libre live media. (configs/baseline) -* Building official Parabola GNU/Linux-libre live media. (configs/releng) - - - -*** Build requirements - -** For mkparabolaiso script needs these packages (build host): - + arch-install-scripts for pacstrap/arch-chroot - + edk2-shell for UEFI shell - + squashfs-tools for mksquashfs - + libisoburn for xorriso - + btrfs-progs for mkfs.btrfs (optional) - -** For configs/releng build.sh needs theses packages (build host): - + dosfstools for mkfs.fat - + lynx for fetching the latest installation guide - -** For these hooks needs these packages (on target airootfs) -* parabolaiso - + (none) -* parabolaiso_loop_mnt - + (none) -* parabolaiso_pxe_common - + mkinitcpio-nfs-utils for ipconfig -* parabolaiso_pxe_nbd - + nbd for nbd-client -* parabolaiso_pxe_http - + curl for curl -* parabolaiso_pxe_nfs - + mkinitcpio-nfs-utils for nfsmount -* parabolaiso_shutdown - + (none) - - -*** Building the most basic Parabola GNU/Linux-libre live media. (configs/baseline) - -* Install needed packages. - # pacman -S git make arch-install-scripts squashfs-tools libisoburn --needed - -* Install parabolaiso. - # git clone git://git.parabola.nu/packages/parabolaiso.git - # make -C parabolaiso install - -* Build a basic iso. - # /usr/share/parabolaiso/configs/baseline/build.sh - -Note: If you want to customize, just see the configs/releng directory which is -used to build official images with much more things. - - -*** Building official Parabola GNU/Linux-libre live media. (configs/releng) - -* Install needed packages. - # pacman -S git make arch-install-scripts squashfs-tools libisoburn dosfstools lynx --needed - -* Install parabolaiso. - # git clone git://git.parabola.nu/packages/parabolaiso.git - # make -C parabolaiso install - -* Build them! - # /usr/share/parabolaiso/configs/releng/build.sh - -Note: See build.sh -h for more options. This only runs on x86_64. diff --git a/docs/README.knownissues b/docs/README.knownissues deleted file mode 100644 index 7002c5e..0000000 --- a/docs/README.knownissues +++ /dev/null @@ -1,12 +0,0 @@ -*** Know issues - -** (1) On shutdown lots of messages from systemd like: - - "Could not unmount /run/parabolaiso/<ABC>: Device or resource busy" - "Could not delete loopback /dev/loop<N>: Device or resource busy" - This is not a real issue since, all mounted filesystem, loopback devices - and device mapper devices made by parabolaiso will be "free" on "shutdown tmpfs" - (A.K.A deinitramfs), build at initramfs by [parabolaiso_shutdown] initcpio hook. - Proper shutdown is mostly important when persistent is used. - - diff --git a/docs/README.profile.rst b/docs/README.profile.rst new file mode 100644 index 0000000..ec76ede --- /dev/null +++ b/docs/README.profile.rst @@ -0,0 +1,193 @@ +======= +profile +======= + +A parabolaiso profile consists of several configuration files and a directory for files to be added to the resulting image. + +.. code:: plaintext + + profile/ + ├── airootfs/ + ├── efiboot/ + ├── syslinux/ + ├── grub/ + ├── bootstrap_packages.arch + ├── packages.arch + ├── pacman.conf + └── profiledef.sh + +The required files and directories are explained in the following sections. + +profiledef.sh +============= + +This file describes several attributes of the resulting image and is a place for customization to the general behavior +of the image. + +The image file is constructed from some of the variables in ``profiledef.sh``: ``<iso_name>-<iso_version>-<arch>.iso`` +(e.g. ``parabola-202010-x86_64.iso``). + +* ``iso_name``: The first part of the name of the resulting image (defaults to ``mkparabolaiso``) +* ``iso_label``: The ISO's volume label (defaults to ``MKPARABOLAISO``) +* ``iso_publisher``: A free-form string that states the publisher of the resulting image (defaults to ``mkparabolaiso``) +* ``iso_application``: A free-form string that states the application (i.e. its use-case) of the resulting image (defaults + to ``mkparabolaiso iso``) +* ``iso_version``: A string that states the version of the resulting image (defaults to ``""``) +* ``install_dir``: A string (maximum eight characters long, which **must** consist of ``[a-z0-9]``) that states the + directory on the resulting image into which all files will be installed (defaults to ``mkparabolaiso``) +* ``buildmodes``: An optional list of strings, that state the build modes that the profile uses. Only the following are + understood: + + - ``bootstrap``: Build a compressed file containing a minimal system to bootstrap from + - ``iso``: Build a bootable ISO image (implicit default, if no ``buildmodes`` are set) + - ``netboot``: Build artifacts required for netboot using iPXE +* ``bootmodes``: A list of strings, that state the supported boot modes of the resulting image. Only the following are + understood: + + - ``bios.syslinux.mbr``: Syslinux for x86 BIOS booting from a disk + - ``bios.syslinux.eltorito``: Syslinux for x86 BIOS booting from an optical disc + - ``uefi-ia32.grub.esp``: GRUB for IA32 UEFI booting from a disk + - ``uefi-ia32.grub.eltorito``: GRUB for IA32 UEFI booting from an optical disc + - ``uefi-x64.grub.esp``: GRUB for x64 UEFI booting from a disk + - ``uefi-x64.grub.eltorito``: GRUB for x64 UEFI booting from an optical disc + - ``uefi-ia32.systemd-boot.esp``: systemd-boot for IA32 UEFI booting from a disk + - ``uefi-ia32.systemd-boot.eltorito``: systemd-boot for IA32UEFI booting from an optical disc + - ``uefi-x64.systemd-boot.esp``: systemd-boot for x64 UEFI booting from a disk + - ``uefi-x64.systemd-boot.eltorito``: systemd-boot for x64 UEFI booting from an optical disc + Note that BIOS El Torito boot mode must always be listed before UEFI El Torito boot mode. +* ``arch``: The architecture (e.g. ``x86_64``) to build the image for. This is also used to resolve the name of the packages + file (e.g. ``packages.x86_64``) +* ``pacman_conf``: The ``pacman.conf`` to use to install packages to the work directory when creating the image (defaults to + the host's ``/etc/pacman.conf``) +* ``airootfs_image_type``: The image type to create. The following options are understood (defaults to ``squashfs``): + + - ``squashfs``: Create a squashfs image directly from the airootfs work directory + - ``ext4+squashfs``: Create an ext4 partition, copy the airootfs work directory to it and create a squashfs image from it + - ``erofs``: Create an EROFS image for the airootfs work directory +* ``airootfs_image_tool_options``: An array of options to pass to the tool to create the airootfs image. ``mksquashfs`` and + ``mkfs.erofs`` are supported. See ``mksquashfs --help`` or ``mkfs.erofs --help`` for all possible options +* ``file_permissions``: An associative array that lists files and/or directories who need specific ownership or + permissions. The array's keys contain the path and the value is a colon separated list of owner UID, owner GID and + access mode. E.g. ``file_permissions=(["/etc/shadow"]="0:0:400")``. When directories are listed with a trailing backslash (``/``) **all** files and directories contained within the listed directory will have the same owner UID, owner GID, and access mode applied recursively. + +bootstrap_packages.arch +======================= + +All packages to be installed into the environment of a bootstrap image have to be listed in an architecture specific +file (e.g. ``bootstrap_packages.x86_64``), which resides top-level in the profile. + +Packages have to be listed one per line. Lines starting with a ``#`` and blank lines are ignored. + +This file is required when generating bootstrap images using the ``bootstrap`` build mode. + +packages.arch +============= + +All packages to be installed into the environment of an ISO image have to be listed in an architecture specific file +(e.g. ``packages.x86_64``), which resides top-level in the profile. + +Packages have to be listed one per line. Lines starting with a ``#`` and blank lines are ignored. + + .. note:: + + The **mkinitcpio** and **mkinitcpio-parabolaiso** packages are mandatory (see `#30 + <https://gitlab.archlinux.org/archlinux/archiso/-/issues/30>`_). + +This file is required when generating ISO images using the ``iso`` or ``netboot`` build modes. + +pacman.conf +=========== + +A configuration for pacman is required per profile. + +Some configuration options will not be used or will be modified: + +* ``CacheDir``: the profile's option is **only** used if it is not the default (i.e. ``/var/cache/pacman/pkg``) and if it is + not the same as the system's option. In all other cases the system's pacman cache is used. +* ``HookDir``: it is **always** set to the ``/etc/pacman.d/hooks`` directory in the work directory's airootfs to allow + modification via the profile and ensure interoparability with hosts using dracut (see `#73 + <https://gitlab.archlinux.org/archlinux/archiso/-/issues/73>`_) +* ``RootDir``: it is **always** removed, as setting it explicitely otherwise refers to the host's root filesystem (see + ``man 8 pacman`` for further information on the ``-r`` option used by ``pacstrap``) +* ``LogFile``: it is **always** removed, as setting it explicitely otherwise refers to the host's pacman log file (see + ``man 8 pacman`` for further information on the ``-r`` option used by ``pacstrap``) +* ``DBPath``: it is **always** removed, as setting it explicitely otherwise refers to the host's pacman database (see + ``man 8 pacman`` for further information on the ``-r`` option used by ``pacstrap``) + +airootfs +======== + +This optional directory may contain files and directories that will be copied to the work directory of the resulting +image's root filesystem. +The files are copied before packages are being installed to work directory location. +Ownership and permissions of files and directories from the profile's ``airootfs`` directory are not preserved. The mode +will be ``644`` for files and ``755`` for directories, all of them will be owned by root. To set custom ownership and/or +permissions, use ``file_permissions`` in ``profiledef.sh``. + +With this overlay structure it is possible to e.g. create users and set passwords for them, by providing +``airootfs/etc/passwd``, ``airootfs/etc/shadow``, ``airootfs/etc/gshadow`` (see ``man 5 passwd``, ``man 5 shadow`` and ``man 5 gshadow`` respectively). +If user home directories exist in the profile's ``airootfs``, their ownership and (and top-level) permissions will be +altered according to the provided information in the password file. + +Boot loader configuration +========================= + +A profile may contain configuration for several boot loaders. These reside in specific top-level directories, which are +explained in the following subsections. + +The following *custom template identifiers* are understood and will be replaced according to the assignments of the +respective variables in ``profiledef.sh``: + +* ``%PARABOLAISO_LABEL%``: Set this using the ``iso_label`` variable in ``profiledef.sh``. +* ``%INSTALL_DIR%``: Set this using the ``install_dir`` variable in ``profiledef.sh``. +* ``%ARCH%``: Set this using the ``arch`` variable in ``profiledef.sh``. + +Additionally there are also *custom template identifiers* have harcoded values set by ``mkparabolaiso`` that cannot be +overridden: + +* ``%PARABOLAISO_UUID%``: the ISO 9660 modification date in UTC, i.e. its "UUID", +* ``%PARABOLAISO_SEARCH_FILENAME%``: file path on ISO 9660 that can be used by GRUB to find the ISO volume + (**for GRUB ``.cfg`` files only**). + + +efiboot +------- + +This directory is mandatory when the ``uefi-x64.systemd-boot.esp`` or ``uefi-x64.systemd-boot.eltorito`` bootmodes are +selected in ``profiledef.sh``. It contains configuration for `systemd-boot +<https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`_. + + .. note:: + + The directory is a top-level representation of the systemd-boot configuration directories and files found in the + root of an EFI system partition. + +The *custom template identifiers* are **only** understood in the boot loader entry `.conf` files (i.e. **not** in +``loader.conf``). + +The same applies for the ``uefi-x64.refind.esp`` and ``uefi-x64.refind.eltorito`` bootmodes. In the case of OpenRC profiles, +this directory contains configuration for `rEFInd <https://www.rodsbooks.com/refind/>`_. + +syslinux +-------- + +This directory is mandatory when the ``bios.syslinux.mbr`` or the ``bios.syslinux.eltorito`` bootmodes are selected in +``profiledef.sh``. +It contains configuration files for `syslinux <https://wiki.syslinux.org/wiki/index.php?title=SYSLINUX>`_ or `isolinux +<https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX>`_ , or `pxelinux +<https://wiki.syslinux.org/wiki/index.php?title=PXELINUX>`_ used in the resuling image. + +The *custom template identifiers* are understood in all `.cfg` files in this directory. + +grub +---- + +This directory is mandatory when any of the following bootmodes is used in ``profiledef.sh``: + +- ``uefi-ia32.grub.esp`` or +- ``uefi-ia32.grub.eltorito`` or +- ``uefi-x64.grub.esp`` or +- ``uefi-x64.grub.eltorito`` + +It contains configuration files for `GRUB <https://www.gnu.org/software/grub/>`_ +used in the resulting image. diff --git a/docs/README.transfer b/docs/README.transfer deleted file mode 100644 index 2cf28e3..0000000 --- a/docs/README.transfer +++ /dev/null @@ -1,133 +0,0 @@ -INDEX ------ - -* Transfer ISO file to target medium (configs/releng) - * To -> CD / DVD / BD - * To -> USB-key / SD / HDD / SSD - * PC-BIOS (MBR) - * PC-BIOS (ISOHYBRID-MBR) - * PC-EFI (GPT) [x86_64 only] - * PC-EFI (ISOHYBRID-GPT) [x86_64 only] - - - -*** Transfer ISO image to target medium (configs/releng) - -ISO images names consist of: parabola-<YYYY>.<MM>.<DD>-dual.iso - -Where: - <YYYY> Year - <MM> Month - <DD> Day - - -** To -> CD / DVD / BD - -Note: All ISO images are booteable on a PC-BIOS via "El Torito" in no-emulation mode, - All x86_64 ISO images are booteable on a PC-EFI via "El Torito" in no-emulation mode. - -Nomeclature: - <B> scsibus number - <T> target number - <L> lun number - (Note: see cdrecord -scanbus, for these numbers) - - -1) Write it directly using your favorite recording program. -# cdrecord dev=<B>,<T>,<L> -dao parabola-<YYYY>.<MM>.<DD>-dual.iso - - -** To -> USB Flash Drive (USB-key) / Memory card (SD) / - Hard-Disk Drive (HDD) / Solid-State Drive (SSD) - -Note: These steps are the general workflow, you can skip some of them, - using another filesystem if your bootloader supports it, - installing to another directory than "parabola/" or using more than - one partition. Just ensure that main boot params options - (parabolaisolabel= and parabolaisobasedir=) are set correctly according to your setup. - -Nomeclature: -<DEV-TARGET>: Device node of the drive where ISO contents should be copied - (example: /dev/sdx) -<DEV-TARGET-N>: Device node of the partition on <DEV-TARGET> - (example: /dev/sdx1) -<MNT-TARGET-N>: Mount point path where <DEV-TARGET-N> is mounted - (example: /mnt/sdx/1) -<ISO-SOURCE>: Path to the ISO file parabola-<YYYY>.<MM>.<DD>-dual.iso - (example: ~/parabola-2012.07.22-dual.iso) -<FS-LABEL>: Represents the filesystem label of the <ISO-SOURCE> - (example: PARA_201302) - - -* PC-BIOS (MBR): - -Note: Using here a MBR partition mode as example, but GPT should also works - if machine firmware is not broken. - Just ensure that partition is set with attribute "2: legacy BIOS bootable" - and use gptmbr.bin instead of mbr.bin for syslinux. - -1) Create one partition entry in MBR and mark it as "active" (booteable). -Note: Type "b" for FAT32, "83" for EXTFS or "7" for NTFS. -# fdisk <DEV-TARGET> - -2) Create a FAT32, EXTFS or NTFS filesystem on such partition and setup a label. -Note: COW is not supported on NTFS. -# mkfs.fat -F 32 -n <FS-LABEL> <DEV-TARGET-N> -# mkfs.ext4 -L <FS-LABEL> <DEV-TARGET-N> -# mkfs.ntfs -L <FS-LABEL> <DEV-TARGET-N> - -3) Mount target filesystem. -# mount <DEV-TARGET-N> <MNT-TARGET-N> - -4) Extract ISO image on target filesystem. -# bsdtar -x --exclude=isolinux/ --exclude=EFI/ --exclude=loader/ -f <ISO-SOURCE> -C <MNT-TARGET-N> - -5) Install syslinux bootloader on target filesystem. -# extlinux -i <MNT-TARGET-N>/parabola/boot/syslinux - -6) Unmount target filesystem. -# umount <MNT-TARGET-N> - -7) Install syslinux MBR boot code on target drive. -# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/mbr.bin of=<DEV-TARGET> - - -* PC-BIOS (ISOHYBRID-MBR): - -Note: This method is the most easily, quick and dirty, but is the most limited - if you want to use your target medium for other purposes. - If using this does not work, use PC-BIOS (MBR) method instead. - -1) Dump ISO file to target medium. -# dd if=<ISO-SOURCE> of=<DEV-TARGET> - - -* PC-EFI (GPT) [x86_64 only] - -Note: Using here a GPT partition mode as example, but MBR should also works - if machine firmware is not broken. - -1) Create one partition entry in GPT (of type "ef00") -# gdisk <DEV-TARGET> - -2) Create a FAT32 filesystem on such partition and setup a label. -# mkfs.fat -F 32 -n <FS-LABEL> <DEV-TARGET-N> - -3) Mount target filesystem. -# mount <DEV-TARGET-N> <MNT-TARGET-N> - -4) Extract ISO image on target filesystem. -# bsdtar -x --exclude=isolinux/ --exclude=EFI/parabolaiso/ --exclude=parabola/boot/syslinux/ -f <ISO-SOURCE> -C <MNT-TARGET-N> - -5) Unmount target filesystem. -# umount <MNT-TARGET-N> - - -* PC-EFI (ISOHYBRID-GPT) [x86_64 only] - -Note: This method is the most easily, quick and dirty, but is the most limited - if you want to use your target medium for other purposes. - If using this does not work, use PC-EFI (GPT) method instead. - -1) Dump ISO file to target medium. -# dd if=<ISO-SOURCE> of=<DEV-TARGET> diff --git a/docs/README.transfer.rst b/docs/README.transfer.rst new file mode 100644 index 0000000..c09b41d --- /dev/null +++ b/docs/README.transfer.rst @@ -0,0 +1,165 @@ +============================================== +Transfer ISO to target medium (configs/releng) +============================================== + +ISO images names consist of: ``parabola-YYYY.MM.DD-x86_64.iso``. + +Where: ``YYYY`` is the year, ``MM`` the month and ``DD`` the day. + +.. contents:: + +Burn to an optical disc +======================= + + .. note:: + All ISO images are BIOS and UEFI bootable via "El Torito" in no-emulation mode. + +Burn the ISO using your favorite disc burning program. + +For example: + +.. code:: sh + + xorriso -as cdrecord -v -sao dev=/dev/sr0 parabola-YYYY.MM.DD-x86_64.iso + +Write to an USB flash drive / memory card / hard disk drive / solid state drive / etc. +====================================================================================== + + .. tip:: + See https://wiki.archlinux.org/title/USB_flash_installation_medium for more detailed instructions. + +Nomeclature: + +``<DEV-TARGET>`` + Device node of the drive where ISO contents should be copied (example: ``/dev/sdx``). +``<DEV-TARGET-N>`` + Device node of the partition on ``<DEV-TARGET>`` (example: ``/dev/sdx1``). +``<FS-LABEL>`` + Represents the file system label of the ``parabola-YYYY.MM.DD-x86_64.iso`` (example: ``ARCH_201703``). + +ISOHYBRID (BIOS and UEFI) +------------------------- + + .. note:: + This method is the most easily, quick and dirty, but is the most limited if you want to use your target medium + for other purposes. If using this does not work, use the `File system transposition (UEFI only)`_ method instead. + +Directly write the ISO file to the target medium: + +.. code:: sh + + dd bs=4M if=parabola-YYYY.MM.DD-x86_64.iso of=<DEV-TARGET> conv=fsync oflag=direct status=progress + +File system transposition (UEFI only) +-------------------------------- + +This method extracts the contents of the ISO onto a prepared UEFI-bootable volume. + +If your drive is already partitioned and formatted, skip to the "Mount the target file system" step. + + .. note:: + Using MBR with one FAT formatted active partition is the most compatible method. + +1. Partition the drive with *fdisk*. + + .. code:: sh + + fdisk <DEV-TARGET> + + 1) Create a new MBR partition table with command ``o``. + + .. warning:: + This will destroy all data on the drive. + + 2) Create a new primary partition with command ``n`` and set its type code to ``0c`` with command ``t``. + + 3) Mark the partition as bootable with the ``a`` command. + + 4) Write the changes and exit with ``w``. + +2. Format the newly created partition to FAT32 + + .. code:: sh + + mkfs.fat -F 32 /dev/disk/by-id/<TARGET-DEVICE>-part1 + +3. Mount the target file system + + .. code:: sh + + mount <DEV-TARGET-N> /mnt + +4. Extract the ISO image on the target file system. + + .. code:: sh + + bsdtar -x --exclude=boot/syslinux/ -f parabola-YYYY.MM.DD-x86_64.iso -C /mnt + +5. Unmount the target file system. + + .. code:: sh + + umount /mnt + +Manual formatting (BIOS only) +----------------------------- + + .. note:: + These steps are the general workflow, you can skip some of them, using another file system if your boot loader + supports it, installing to another directory than ``arch/`` or using more than one partition. Just ensure that + main boot parameters (``archisolabel=`` and ``archisobasedir=``) are set correctly according to your setup. + + Using here a MBR partition mode as example, but GPT should also work if the machine firmware is not broken. Just + ensure that partition is set with attribute ``2: legacy BIOS bootable`` and use ``gptmbr.bin`` instead of + ``mbr.bin`` for syslinux. + +1) Create one partition entry in MBR and mark it as "active" (bootable). + + .. note:: + Type ``b`` for FAT32, ``83`` for EXTFS or ``7`` for NTFS. + + .. code:: sh + + fdisk <DEV-TARGET> + +2) Create a FAT32, EXTFS or NTFS file system on such partition and setup a label. + + .. note:: + COW is not supported on NTFS. + + .. code:: sh + + mkfs.fat -F 32 -n <FS-LABEL> <DEV-TARGET-N> + mkfs.ext4 -L <FS-LABEL> <DEV-TARGET-N> + mkfs.ntfs -L <FS-LABEL> <DEV-TARGET-N> + +3) Mount the target file system. + + .. code:: sh + + mount <DEV-TARGET-N> /mnt + +4) Extract the ISO image on the target file system. + + .. code:: sh + + bsdtar -x --exclude=boot/grub/ --exclude=EFI/ -f parabola-YYYY.MM.DD-x86_64.iso -C /mnt + +5) Install the syslinux boot loader on the target file system. + + .. code:: sh + + extlinux -i /mnt/boot/syslinux + +6) Unmount the target file system. + + .. code:: sh + + umount /mnt + +7) Install syslinux MBR boot code on the target drive. + + .. code:: sh + + dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/mbr.bin of=<DEV-TARGET> + diff --git a/parabolaiso/initcpio/hooks/parabolaiso b/parabolaiso/initcpio/hooks/parabolaiso deleted file mode 100644 index 8f532c3..0000000 --- a/parabolaiso/initcpio/hooks/parabolaiso +++ /dev/null @@ -1,272 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# args: source, newroot, mountpoint -_mnt_dmsnapshot() { - local img="${1}" - local newroot="${2}" - local mnt="${3}" - local img_fullname="${img##*/}"; - local img_name="${img_fullname%%.*}" - local dm_snap_name="${dm_snap_prefix}_${img_name}" - local ro_dev ro_dev_size rw_dev - - ro_dev="$(losetup --find --show --read-only -- "${img}")" - echo "${ro_dev}" >> /run/parabolaiso/used_block_devices - ro_dev_size="$(blockdev --getsz "${ro_dev}")" - - if [ "${cow_persistent}" = "P" ]; then - if [ -f "/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow" ]; then - msg ":: Found '/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow', using as persistent." - else - msg ":: Creating '/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow' as persistent." - truncate -s "${cow_spacesize}" "/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow" - fi - else - if [ -f "/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow" ]; then - msg ":: Found '/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow' but non-persistent requested, removing." - rm -f "/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow" - fi - msg ":: Creating '/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow' as non-persistent." - truncate -s "${cow_spacesize}" "/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow" - fi - - rw_dev="$(losetup --find --show "/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow")" - echo "${rw_dev}" >> /run/parabolaiso/used_block_devices - - dmsetup create "${dm_snap_name}" --table \ - "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} ${cow_chunksize}" - - if [ "${cow_persistent}" != "P" ]; then - rm -f "/run/parabolaiso/cowspace/${cow_directory}/${img_name}.cow" - fi - - _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w" "defaults" - readlink -f "/dev/mapper/${dm_snap_name}" >> /run/parabolaiso/used_block_devices -} - -# args: source, newroot, mountpoint -_mnt_overlayfs() { - local src="${1}" - local newroot="${2}" - local mnt="${3}" - mkdir -p "/run/parabolaiso/cowspace/${cow_directory}/upperdir" "/run/parabolaiso/cowspace/${cow_directory}/workdir" - mount -t overlay -o \ - "lowerdir=${src},upperdir=/run/parabolaiso/cowspace/${cow_directory}/upperdir,workdir=/run/parabolaiso/cowspace/${cow_directory}/workdir" \ - airootfs "${newroot}${mnt}" -} - - -# args: /path/to/image_file, mountpoint -_mnt_sfs() { - local img="${1}" - local mnt="${2}" - local img_fullname="${img##*/}" - local sfs_dev - - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${copytoram}" = "y" ]; then - msg -n ":: Copying squashfs image to RAM..." - if ! cp -- "${img}" "/run/parabolaiso/copytoram/${img_fullname}" ; then - echo "ERROR: while copy '${img}' to '/run/parabolaiso/copytoram/${img_fullname}'" - launch_interactive_shell - fi - img="/run/parabolaiso/copytoram/${img_fullname}" - msg "done." - fi - sfs_dev="$(losetup --find --show --read-only -- "${img}")" - echo "${sfs_dev}" >> /run/parabolaiso/used_block_devices - _mnt_dev "${sfs_dev}" "${mnt}" "-r" "defaults" -} - -# args: /path/to/image_file, mountpoint -_mnt_erofs() { - local img="${1}" - local mnt="${2}" - local img_fullname="${img##*/}" - local erofs_dev - - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${copytoram}" = "y" ]; then - msg -n ":: Copying EROFS image to RAM..." - if ! cp -- "${img}" "/run/parabolaiso/copytoram/${img_fullname}" ; then - echo "ERROR: while copy '${img}' to '/run/parabolaiso/copytoram/${img_fullname}'" - launch_interactive_shell - fi - img="/run/parabolaiso/copytoram/${img_fullname}" - msg "done." - fi - erofs_dev="$(losetup --find --show --read-only -- "${img}")" - echo "${erofs_dev}" >> /run/parabolaiso/used_block_devices - _mnt_dev "${erofs_dev}" "${mnt}" "-r" "defaults" "erofs" -} - -# args: device, mountpoint, flags, opts -_mnt_dev() { - local dev="${1}" - local mnt="${2}" - local flg="${3}" - local opts="${4}" - local fstype="${5:-auto}" - - mkdir -p "${mnt}" - - msg ":: Mounting '${dev}' to '${mnt}'" - - while ! poll_device "${dev}" 30; do - echo "ERROR: '${dev}' device did not show up after 30 seconds..." - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - done - - if mount -t "${fstype}" -o "${opts}" "${flg}" "${dev}" "${mnt}"; then - msg ":: Device '${dev}' mounted successfully." - else - echo "ERROR; Failed to mount '${dev}'" - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - fi -} - -_verify_checksum() { - local _status - cd "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}" || exit 1 - sha512sum -c airootfs.sha512 > /tmp/checksum.log 2>&1 - _status=$? - cd -- "${OLDPWD}" || exit 1 - return "${_status}" -} - -_verify_signature() { - local _status - local sigfile="${1}" - cd "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}" || exit 1 - gpg --homedir /gpg --status-fd 1 --verify "${sigfile}" 2>/dev/null | grep -qE '^\[GNUPG:\] GOODSIG' - _status=$? - cd -- "${OLDPWD}" || exit 1 - return ${_status} -} - -run_hook() { - [ -z "${arch}" ] && arch="$(uname -m)" - [ -z "${copytoram_size}" ] && copytoram_size="75%" - [ -z "${parabolaisobasedir}" ] && parabolaisobasedir="parabola" - [ -z "${dm_snap_prefix}" ] && dm_snap_prefix="parabola" - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - [ -z "${parabolaisodevice}" ] && parabolaisodevice="/dev/disk/by-label/${parabolaisolabel}" - [ -z "${cow_spacesize}" ] && cow_spacesize="256M" - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ -n "${cow_label}" ]; then - cow_device="/dev/disk/by-label/${cow_label}" - [ -z "${cow_persistent}" ] && cow_persistent="P" - elif [ -n "${cow_device}" ]; then - [ -z "${cow_persistent}" ] && cow_persistent="P" - else - cow_persistent="N" - fi - - [ -z "${cow_flags}" ] && cow_flags="defaults" - [ -z "${cow_directory}" ] && cow_directory="persistent_${parabolaisolabel}/${arch}" - [ -z "${cow_chunksize}" ] && cow_chunksize="8" - - # set mount handler for parabolaiso - export mount_handler="parabolaiso_mount_handler" -} - -# This function is called normally from init script, but it can be called -# as chain from other mount handlers. -# args: /path/to/newroot -parabolaiso_mount_handler() { - local newroot="${1}" - local sigfile - - if ! mountpoint -q "/run/parabolaiso/bootmnt"; then - _mnt_dev "${parabolaisodevice}" "/run/parabolaiso/bootmnt" "-r" "defaults" - if [ "${copytoram}" != "y" ]; then - readlink -f "${parabolaisodevice}" >> /run/parabolaiso/used_block_devices - fi - fi - - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${checksum}" = "y" ]; then - if [ -f "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}/airootfs.sha512" ]; then - msg -n ":: Self-test requested, please wait..." - if _verify_checksum; then - msg "done. Checksum is OK, continue booting." - else - echo "ERROR: one or more files are corrupted" - echo "see /tmp/checksum.log for details" - launch_interactive_shell - fi - else - echo "ERROR: checksum=y option specified but ${parabolaisobasedir}/${arch}/airootfs.sha512 not found" - launch_interactive_shell - fi - fi - - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${verify}" = "y" ]; then - if [ -f "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}/airootfs.sfs.sig" ]; then - sigfile="airootfs.sfs.sig" - elif [ -f "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}/airootfs.erofs.sig" ]; then - sigfile="airootfs.erofs.sig" - fi - if [ -n "${sigfile}" ]; then - msg -n ":: Signature verification requested, please wait..." - if _verify_signature "${sigfile}"; then - msg "done. Signature is OK, continue booting." - else - echo "ERROR: one or more files are corrupted" - launch_interactive_shell - fi - else - echo "ERROR: verify=y option specified but GPG signature not found in ${parabolaisobasedir}/${arch}/" - launch_interactive_shell - fi - fi - - if [ "${copytoram}" = "y" ]; then - msg ":: Mounting /run/parabolaiso/copytoram (tmpfs) filesystem, size=${copytoram_size}" - mkdir -p /run/parabolaiso/copytoram - mount -t tmpfs -o "size=${copytoram_size}",mode=0755 copytoram /run/parabolaiso/copytoram - fi - - if [ -n "${cow_device}" ]; then - _mnt_dev "${cow_device}" "/run/parabolaiso/cowspace" "-r" "${cow_flags}" - readlink -f "${cow_device}" >> /run/parabolaiso/used_block_devices - mount -o remount,rw "/run/parabolaiso/cowspace" - else - msg ":: Mounting /run/parabolaiso/cowspace (tmpfs) filesystem, size=${cow_spacesize}..." - mkdir -p /run/parabolaiso/cowspace - mount -t tmpfs -o "size=${cow_spacesize}",mode=0755 cowspace /run/parabolaiso/cowspace - fi - mkdir -p "/run/parabolaiso/cowspace/${cow_directory}" - chmod 0700 "/run/parabolaiso/cowspace/${cow_directory}" - - if [ -f "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}/airootfs.sfs" ]; then - _mnt_sfs "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}/airootfs.sfs" "/run/parabolaiso/airootfs" - elif [ -f "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}/airootfs.erofs" ]; then - _mnt_erofs "/run/parabolaiso/bootmnt/${parabolaisobasedir}/${arch}/airootfs.erofs" "/run/parabolaiso/airootfs" - fi - if [ -f "/run/parabolaiso/airootfs/airootfs.img" ]; then - _mnt_dmsnapshot "/run/parabolaiso/airootfs/airootfs.img" "${newroot}" "/" - else - _mnt_overlayfs "/run/parabolaiso/airootfs" "${newroot}" "/" - fi - - if [ "${copytoram}" = "y" ]; then - umount -d /run/parabolaiso/bootmnt - rmdir /run/parabolaiso/bootmnt - fi -} - -# vim: set ft=sh: diff --git a/parabolaiso/initcpio/hooks/parabolaiso_loop_mnt b/parabolaiso/initcpio/hooks/parabolaiso_loop_mnt deleted file mode 100644 index f76d204..0000000 --- a/parabolaiso/initcpio/hooks/parabolaiso_loop_mnt +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -run_hook () { - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - [ -n "${img_label}" ] && img_dev="/dev/disk/by-label/${img_label}" - [ -z "${img_flags}" ] && img_flags="defaults" - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ -n "${img_dev}" ] && [ -n "${img_loop}" ]; then - export mount_handler="parabolaiso_loop_mount_handler" - fi -} - -parabolaiso_loop_mount_handler () { - newroot="${1}" - - local _dev_loop - - msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" - _mnt_dev "${img_dev}" "/run/parabolaiso/img_dev" "-r" "${img_flags}" - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${copytoram}" != "y" ]; then - readlink -f "${img_dev}" >> /run/parabolaiso/used_block_devices - fi - - if _dev_loop=$(losetup --find --show --read-only "/run/parabolaiso/img_dev/${img_loop}"); then - export parabolaisodevice="${_dev_loop}" - else - echo "ERROR: Setting loopback device for file '/run/parabolaiso/img_dev/${img_loop}'" - launch_interactive_shell - fi - - parabolaiso_mount_handler "${newroot}" - - if [ "${copytoram}" = "y" ]; then - losetup -d "${_dev_loop}" 2>/dev/null - umount /run/parabolaiso/img_dev - fi -} - -# vim: set ft=sh: diff --git a/parabolaiso/initcpio/hooks/parabolaiso_pxe_common b/parabolaiso/initcpio/hooks/parabolaiso_pxe_common deleted file mode 100644 index 4144983..0000000 --- a/parabolaiso/initcpio/hooks/parabolaiso_pxe_common +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -run_hook () { - # Do *not* declare 'bootif_dev' local! We need it in run_latehook(). - local i net_mac bootif_mac - local DNSDOMAIN HOSTNAME IPV4DNS0 IPV4DNS1 ROOTSERVER - # These variables will be parsed from /tmp/net-*.conf generated by ipconfig - # shellcheck disable=SC2034 - local DEVICE IPV4ADDR IPV4BROADCAST IPV4NETMASK IPV4GATEWAY NISDOMAIN ROOTPATH filename - - if [ -n "${ip}" ]; then - if [ -n "${BOOTIF}" ]; then - bootif_mac="${BOOTIF#01-}" - # shellcheck disable=SC2169 - # ash supports bash-like string replacment - bootif_mac="${bootif_mac//-/:}" - for i in /sys/class/net/*/address; do - read -r net_mac < "${i}" - if [ "${bootif_mac}" = "${net_mac}" ]; then - bootif_dev=${i#/sys/class/net/} - bootif_dev=${bootif_dev%/address} - break - fi - done - if [ "${ip}" = "dhcp" ]; then - ip=":::::${bootif_dev}:dhcp" - else - ip="${ip}::${bootif_dev}" - fi - fi - - # setup network and save some values - if ! ipconfig -t 20 "ip=${ip}"; then - echo "ERROR; Failed to configure network" - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - fi - - # shellcheck disable=SC1090 - # ipconfig generates these files - . /tmp/net-*.conf - - export pxeserver="${ROOTSERVER}" - - # setup DNS resolver - if [ "${IPV4DNS0}" != "0.0.0.0" ]; then - echo "# added by parabolaiso_pxe_common hook" > /etc/resolv.conf - echo "nameserver ${IPV4DNS0}" >> /etc/resolv.conf - fi - if [ "${IPV4DNS1}" != "0.0.0.0" ]; then - echo "nameserver ${IPV4DNS1}" >> /etc/resolv.conf - fi - if [ -n "${DNSDOMAIN}" ]; then - echo "search ${DNSDOMAIN}" >> /etc/resolv.conf - echo "domain ${DNSDOMAIN}" >> /etc/resolv.conf - fi - fi -} - -run_latehook () { - if [ -n "${ip}" ]; then - [ -z "${copy_resolvconf}" ] && copy_resolvconf="y" - - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${copytoram}" = "y" ]; then - if [ -n "${bootif_dev}" ]; then - ip addr flush dev "${bootif_dev}" - ip link set "${bootif_dev}" down - fi - elif [ "${copy_resolvconf}" != "n" ] && [ -f /etc/resolv.conf ]; then - rm -f /new_root/etc/resolv.conf - cp /etc/resolv.conf /new_root/etc/resolv.conf - fi - fi -} - -# vim: set ft=sh: diff --git a/parabolaiso/initcpio/hooks/parabolaiso_pxe_http b/parabolaiso/initcpio/hooks/parabolaiso_pxe_http deleted file mode 100644 index 68eaad6..0000000 --- a/parabolaiso/initcpio/hooks/parabolaiso_pxe_http +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -run_hook() { - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ -n "${ip}" ] && [ -n "${parabolaiso_http_srv}" ]; then - - # booting with http is always copy-to-ram, so set here to make sure - # addresses are flushed and interface is set down - export copytoram="y" - - parabolaiso_http_srv=$(eval echo "${parabolaiso_http_srv}") - [ -z "${parabolaiso_http_spc}" ] && parabolaiso_http_spc="75%" - - export mount_handler="parabolaiso_pxe_http_mount_handler" - fi -} - -# Fetch a file with CURL -# -# $1 URL -# $2 Destination directory inside httpspace/${parabolaisobasedir} -_curl_get() { - local _url="${1}" - local _dst="${2}" - - msg ":: Downloading '${_url}'" - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if ! curl -L -f -o "/run/parabolaiso/httpspace/${parabolaisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then - echo "ERROR: Downloading '${_url}'" - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - fi -} - -parabolaiso_pxe_http_mount_handler () { - newroot="${1}" - local img_type="sfs" - - msg ":: Mounting /run/parabolaiso/httpspace (tmpfs) filesystem, size='${parabolaiso_http_spc}'" - mkdir -p "/run/parabolaiso/httpspace" - mount -t tmpfs -o size="${parabolaiso_http_spc}",mode=0755 httpspace "/run/parabolaiso/httpspace" - - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if ! curl -L -f -o /dev/null -s -r 0-0 "${parabolaiso_http_srv}${parabolaisobasedir}/${arch}/airootfs.sfs"; then - if curl -L -f -o /dev/null -s -r 0-0 "${parabolaiso_http_srv}${parabolaisobasedir}/${arch}/airootfs.erofs"; then - img_type="erofs" - fi - fi - _curl_get "${parabolaiso_http_srv}${parabolaisobasedir}/${arch}/airootfs.${img_type}" "/${arch}" - - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${checksum}" = "y" ]; then - _curl_get "${parabolaiso_http_srv}${parabolaisobasedir}/${arch}/airootfs.sha512" "/${arch}" - fi - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ "${verify}" = "y" ]; then - _curl_get "${parabolaiso_http_srv}${parabolaisobasedir}/${arch}/airootfs.${img_type}.sig" "/${arch}" - fi - - mkdir -p "/run/parabolaiso/bootmnt" - mount -o bind /run/parabolaiso/httpspace /run/parabolaiso/bootmnt - - parabolaiso_mount_handler "${newroot}" -} - -# vim: set ft=sh: diff --git a/parabolaiso/initcpio/hooks/parabolaiso_pxe_nbd b/parabolaiso/initcpio/hooks/parabolaiso_pxe_nbd deleted file mode 100644 index b8c1e53..0000000 --- a/parabolaiso/initcpio/hooks/parabolaiso_pxe_nbd +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -run_earlyhook() { - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ -n "${ip}" ] && [ -n "${parabolaiso_nbd_srv}" ]; then - # Module autoloading like with loop devices does not work, doing manually... - modprobe nbd 2> /dev/null - fi -} - -run_hook() { - if [ -n "${ip}" ] && [ -n "${parabolaiso_nbd_srv}" ]; then - - parabolaiso_nbd_srv=$(eval echo "${parabolaiso_nbd_srv}") - [ -z "${parabolaiso_nbd_name}" ] && parabolaiso_nbd_name="parabolaiso" - - export mount_handler="parabolaiso_pxe_nbd_mount_handler" - fi -} - -parabolaiso_pxe_nbd_mount_handler () { - newroot="${1}" - - msg ":: Waiting for boot device..." - while ! poll_device /dev/nbd0 30; do - echo "ERROR: boot device didn't show up after 30 seconds..." - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - done - - msg ":: Setup NBD from ${parabolaiso_nbd_srv} at /dev/nbd0" - if [ "${copytoram}" != "n" ]; then - nbd-client "${parabolaiso_nbd_srv}" -N "${parabolaiso_nbd_name}" /dev/nbd0 - copytoram="y" - else - nbd-client "${parabolaiso_nbd_srv}" -N "${parabolaiso_nbd_name}" -systemd-mark -persist /dev/nbd0 - fi - - export parabolaisodevice=/dev/nbd0 - - parabolaiso_mount_handler "${newroot}" - - if [ "${copytoram}" = "y" ]; then - msg ":: Disconnect NBD from ${parabolaiso_nbd_srv} at /dev/nbd0" - nbd-client -d /dev/nbd0 - fi -} - -# vim: set ft=sh: diff --git a/parabolaiso/initcpio/hooks/parabolaiso_pxe_nfs b/parabolaiso/initcpio/hooks/parabolaiso_pxe_nfs deleted file mode 100644 index 815e33b..0000000 --- a/parabolaiso/initcpio/hooks/parabolaiso_pxe_nfs +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -run_hook() { - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ -n "${ip}" ] && [ -n "${parabolaiso_nfs_srv}" ]; then - - parabolaiso_nfs_srv=$(eval echo "${parabolaiso_nfs_srv}") - - export mount_handler="parabolaiso_nfs_mount_handler" - fi -} - -parabolaiso_nfs_mount_handler() { - local mount_status - newroot="${1}" - mkdir -p "/run/parabolaiso/bootmnt" - msg ":: Mounting '${parabolaiso_nfs_srv}'" - # shellcheck disable=SC2154 - # defined via initcpio's parse_cmdline() - if [ -n "${parabolaiso_nfs_opt}" ]; then - nfsmount -o "${parabolaiso_nfs_opt}" "${parabolaiso_nfs_srv}" "/run/parabolaiso/bootmnt" - mount_status=$? - else - nfsmount "${parabolaiso_nfs_srv}" "/run/parabolaiso/bootmnt" - mount_status=$? - fi - if [ $mount_status -gt 0 ]; then - echo "ERROR: Mounting '${parabolaiso_nfs_srv}'" - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - fi - - if [ "${copytoram}" != "n" ]; then - copytoram="y" - fi - - parabolaiso_mount_handler "${newroot}" -} - -# vim: set ft=sh: diff --git a/parabolaiso/initcpio/hooks/parabolaiso_shutdown b/parabolaiso/initcpio/hooks/parabolaiso_shutdown deleted file mode 100644 index ebb6b11..0000000 --- a/parabolaiso/initcpio/hooks/parabolaiso_shutdown +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -run_cleanuphook() { - rm -rf /usr/lib/modules - cp -ax / /run/initramfs -} - -# vim: set ft=sh: diff --git a/parabolaiso/initcpio/install/parabolaiso b/parabolaiso/initcpio/install/parabolaiso deleted file mode 100644 index 1e3b3b6..0000000 --- a/parabolaiso/initcpio/install/parabolaiso +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_module "cdrom" - add_module "loop" - add_module "dm-snapshot" - add_module "overlay" - - add_runscript - - add_binary /usr/lib/udev/cdrom_id - add_binary blockdev - add_binary dmsetup - add_binary losetup - add_binary mountpoint - add_binary truncate - add_binary gpg - add_binary grep - - add_file /usr/lib/udev/rules.d/60-cdrom_id.rules - add_file /usr/lib/udev/rules.d/10-dm.rules - add_file /usr/lib/udev/rules.d/95-dm-notify.rules - add_file /usr/lib/initcpio/udev/11-dm-initramfs.rules /usr/lib/udev/rules.d/11-dm-initramfs.rules - if [[ $PARABOLAISO_GNUPG_FD ]]; then - mkdir -m 0700 -- "$BUILDROOT/gpg" - gpg --homedir "$BUILDROOT/gpg" --import <& "$PARABOLAISO_GNUPG_FD" - fi -} diff --git a/parabolaiso/initcpio/install/parabolaiso_kms b/parabolaiso/initcpio/install/parabolaiso_kms deleted file mode 100644 index 8129127..0000000 --- a/parabolaiso/initcpio/install/parabolaiso_kms +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_module "amdgpu" - add_module "radeon" - add_module "nouveau" - add_module "i915" - add_module "mgag200" - add_module "via-agp" - add_module "sis-agp" - add_module "intel-agp" - - if [[ $(uname -m) == i686 ]]; then - add_module "amd64-agp" - add_module "ati-agp" - add_module "sworks-agp" - add_module "ali-agp" - add_module "amd-k7-agp" - add_module "nvidia-agp" - add_module "efficeon-agp" - fi -} - -help() { - cat << HELPEOF -Adds all common KMS drivers to the initramfs image. -HELPEOF -} diff --git a/parabolaiso/initcpio/install/parabolaiso_loop_mnt b/parabolaiso/initcpio/install/parabolaiso_loop_mnt deleted file mode 100644 index 1f2c529..0000000 --- a/parabolaiso/initcpio/install/parabolaiso_loop_mnt +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_runscript -} - -help() { -cat<<HELPEOF - This hook loads the necessary modules for boot via loop device. -HELPEOF -} diff --git a/parabolaiso/initcpio/install/parabolaiso_pxe_common b/parabolaiso/initcpio/install/parabolaiso_pxe_common deleted file mode 100644 index 458fa69..0000000 --- a/parabolaiso/initcpio/install/parabolaiso_pxe_common +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_checked_modules -f "(irda|phy|wimax|wireless|ppp_|plip|pppoe)" "/drivers/net/" - - add_runscript - - add_binary /usr/lib/initcpio/ipconfig /bin/ipconfig - - # Add hosts support files+dns - add_symlink /usr/lib/libnss_files.so.2 "$(readlink /usr/lib/libnss_files.so.2)" - add_binary "$(readlink -f /usr/lib/libnss_files.so.2)" - add_symlink /usr/lib/libnss_dns.so.2 "$(readlink /usr/lib/libnss_dns.so.2)" - add_binary "$(readlink -f /usr/lib/libnss_dns.so.2)" - - add_dir /etc - echo "hosts: files dns" > "$BUILDROOT/etc/nsswitch.conf" -} - -help() { -cat<<HELPEOF - This hook loads the necessary modules for boot via PXE. -HELPEOF -} diff --git a/parabolaiso/initcpio/install/parabolaiso_pxe_http b/parabolaiso/initcpio/install/parabolaiso_pxe_http deleted file mode 100644 index 1e80852..0000000 --- a/parabolaiso/initcpio/install/parabolaiso_pxe_http +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_runscript - - add_binary curl - - add_file "$(readlink -f /etc/ssl/certs/ca-certificates.crt)" /etc/ssl/certs/ca-certificates.crt -} - -help() { -cat<<HELPEOF - This hook loads the necessary modules for boot via PXE and HTTP. -HELPEOF -} diff --git a/parabolaiso/initcpio/install/parabolaiso_pxe_nbd b/parabolaiso/initcpio/install/parabolaiso_pxe_nbd deleted file mode 100644 index b4fb3b6..0000000 --- a/parabolaiso/initcpio/install/parabolaiso_pxe_nbd +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_module "nbd" - - add_runscript - - add_binary nbd-client -} - -help() { -cat<<HELPEOF - This hook loads the necessary modules for boot via PXE and NBD. -HELPEOF -} diff --git a/parabolaiso/initcpio/install/parabolaiso_pxe_nfs b/parabolaiso/initcpio/install/parabolaiso_pxe_nfs deleted file mode 100644 index efd609d..0000000 --- a/parabolaiso/initcpio/install/parabolaiso_pxe_nfs +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_module "nfs" - - add_runscript - - add_binary /usr/lib/initcpio/nfsmount /bin/nfsmount -} - -help() { - cat <<HELPEOF - This hook loads the necessary modules for boot via PXE and NFS. -HELPEOF -} diff --git a/parabolaiso/initcpio/install/parabolaiso_shutdown b/parabolaiso/initcpio/install/parabolaiso_shutdown deleted file mode 100644 index f99c8c9..0000000 --- a/parabolaiso/initcpio/install/parabolaiso_shutdown +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -build() { - add_binary cp - - add_runscript - - add_file /usr/lib/initcpio/parabolaiso_shutdown /shutdown -} - -help() { - cat <<HELPEOF -This hook will create a shutdown initramfs in /run/initramfs -that we can pivot to on shutdown in order to unmount / and -and other mount points, dm-snapshot and loopback devices. -Mostly useful for persistent dm-snapshot. -HELPEOF -} diff --git a/parabolaiso/initcpio/script/parabolaiso_shutdown b/parabolaiso/initcpio/script/parabolaiso_shutdown deleted file mode 100644 index d12cd90..0000000 --- a/parabolaiso/initcpio/script/parabolaiso_shutdown +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/ash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# /oldroot depends on things inside /oldroot/run/parabolaiso... -mkdir /oldrun -mount -n --move /oldroot/run /oldrun - -# Unmount all mounts now. -umount "$(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r)" - -# Remove all dm-snapshot devices. -dmsetup remove_all - -# Remove all loopback devices. -for _lup in $(grep ^/dev/loop /oldrun/parabolaiso/used_block_devices | tac); do - if ! losetup -d -- "${_lup}" 2> /dev/null; then - umount -d -- "${_lup}" - fi -done - -# Unmount the space used to store *.cow. -umount /oldrun/parabolaiso/cowspace - -# Unmount boot device if needed (no copytoram=y used) -if [ ! -d /oldrun/parabolaiso/copytoram ]; then - if [ -d /oldrun/parabolaiso/img_dev ]; then - umount /oldrun/parabolaiso/img_dev - else - umount /oldrun/parabolaiso/bootmnt - fi -fi - -# reboot / poweroff / halt, depending on the argument passed by init -# if something invalid is passed, we halt -case "$1" in - reboot|poweroff|halt) "$1" -f ;; - *) halt -f;; -esac - -# vim: set ft=sh: diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index de48fae..3beb237 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -3,24 +3,33 @@ # SPDX-License-Identifier: GPL-3.0-or-later set -e -u +shopt -s extglob # Control the environment umask 0022 -export LANG="C" -export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-"$(date +%s)"}" +export LC_ALL="C.UTF-8" +if [[ -v LANGUAGE ]]; then + # LC_ALL=C.UTF-8, unlike LC_ALL=C, does not override LANGUAGE. + # See https://sourceware.org/bugzilla/show_bug.cgi?id=16621 and https://savannah.gnu.org/bugs/?62815 + unset LANGUAGE +fi +[[ -v SOURCE_DATE_EPOCH ]] || printf -v SOURCE_DATE_EPOCH '%(%s)T' -1 +export SOURCE_DATE_EPOCH # Set application name from the script's file name app_name="${0##*/}" # Define global variables. All of them will be overwritten later pkg_list=() +bootstrap_pkg_list=() quiet="" work_dir="" out_dir="" -img_name="" gpg_key="" +gpg_sender="" iso_name="" iso_label="" +iso_uuid="" iso_publisher="" iso_application="" iso_version="" @@ -29,11 +38,18 @@ arch="" pacman_conf="" packages="" packages_dual="" +bootstrap_packages="" +bootstrap_packages_dual="" +pacstrap_dir="" +declare -i rm_work_dir=0 +buildmodes=() bootmodes=() airootfs_image_type="" airootfs_image_tool_options=() +cert_list=() declare -A file_permissions=() - +efibootimg="" +efiboot_files=() # Show an INFO message # $1: message string @@ -61,22 +77,6 @@ _msg_error() { fi } -_mount_airootfs() { - trap "_umount_airootfs" EXIT HUP INT TERM - install -d -m 0755 -- "${work_dir}/mnt/airootfs" - _msg_info "Mounting '${airootfs_dir}.img' on '${work_dir}/mnt/airootfs'..." - mount -- "${airootfs_dir}.img" "${work_dir}/mnt/airootfs" - _msg_info "Done!" -} - -_umount_airootfs() { - _msg_info "Unmounting '${work_dir}/mnt/airootfs'..." - umount -d -- "${work_dir}/mnt/airootfs" - _msg_info "Done!" - rmdir -- "${work_dir}/mnt/airootfs" - trap - EXIT HUP INT TERM -} - # Show help usage, with an exit status. # $1: exit status number. _usage() { @@ -87,19 +87,30 @@ usage: ${app_name} [options] <profile_dir> Default: '${iso_application}' -C <file> pacman configuration file. Default: '${pacman_conf}' - -D <install_dir> Set an install_dir. All files will by located here. + -D <install_dir> Set an install_dir. All files will be located here. Default: '${install_dir}' NOTE: Max 8 characters, use only [a-z0-9] -L <label> Set the ISO volume label Default: '${iso_label}' -P <publisher> Set the ISO publisher Default: '${iso_publisher}' - -g <gpg_key> Set the GPG key to be used for signing the squashfs image + -c [cert ..] Provide certificates for codesigning of netboot artifacts as + well as the rootfs artifact. + Multiple files are provided as quoted, space delimited list. + The first file is considered as the signing certificate, + the second as the key. + -g <gpg_key> Set the PGP key ID to be used for signing the rootfs image. + Passed to gpg as the value for --default-key + -G <mbox> Set the PGP signer (must include an email address) + Passed to gpg as the value for --sender -h This message + -m [mode ..] Build mode(s) to use (valid modes are: 'bootstrap', 'iso' and 'netboot'). + Multiple build modes are provided as quoted, space delimited list. -o <out_dir> Set the output directory Default: '${out_dir}' - -p PACKAGE(S) Package(s) to install. + -p [package ..] Package(s) to install. Multiple packages are provided as quoted, space delimited list. + -r Delete the working directory at the end. -v Enable verbose output -w <work_dir> Set the working directory Default: '${work_dir}' @@ -113,211 +124,236 @@ ENDUSAGETEXT # Shows configuration options. _show_config() { local build_date - build_date="$(date --utc --iso-8601=seconds -d "@${SOURCE_DATE_EPOCH}")" + printf -v build_date '%(%FT%R%z)T' "${SOURCE_DATE_EPOCH}" _msg_info "${app_name} configuration settings" _msg_info " Architecture: ${arch}" _msg_info " Working directory: ${work_dir}" _msg_info " Installation directory: ${install_dir}" _msg_info " Build date: ${build_date}" _msg_info " Output directory: ${out_dir}" + _msg_info " Current build mode: ${buildmode}" + _msg_info " Build modes: ${buildmodes[*]}" _msg_info " GPG key: ${gpg_key:-None}" + _msg_info " GPG signer: ${gpg_sender:-None}" + _msg_info "Code signing certificates: ${cert_list[*]:-None}" _msg_info " Profile: ${profile}" _msg_info "Pacman configuration file: ${pacman_conf}" - _msg_info " Image file name: ${img_name}" + _msg_info " Image file name: ${image_name:-None}" _msg_info " ISO volume label: ${iso_label}" _msg_info " ISO publisher: ${iso_publisher}" _msg_info " ISO application: ${iso_application}" - _msg_info " Boot modes: ${bootmodes[*]}" - _msg_info " Packages: ${pkg_list[*]}" + _msg_info " Boot modes: ${bootmodes[*]:-None}" + _msg_info " Packages File: ${buildmode_packages}" + _msg_info " Packages: ${buildmode_pkg_list[*]}" if [[ "${arch}" == "dual" ]]; then - _msg_info " Packages (x86_64): ${pkg_list_x86_64[*]:-None}" - _msg_info " Packages (i686): ${pkg_list_i686[*]:-None}" + _msg_info " Packages (i686): ${buildmode_pkg_list_i686[*]:-None}" + _msg_info " Packages (x86_64): ${buildmode_pkg_list_x86_64[*]:-None}" fi } # Cleanup airootfs -_cleanup_airootfs() { - _msg_info "Cleaning up what we can on ${arch} airootfs..." +_cleanup_pacstrap_dir() { + _msg_info "Cleaning up in ${arch} pacstrap location..." # Delete all files in /boot - [[ -d "${airootfs_dir}/boot" ]] && find "${airootfs_dir}/boot" -mindepth 1 -delete + [[ -d "${pacstrap_dir}/boot" ]] && find "${pacstrap_dir}/boot" -mindepth 1 -delete # Delete pacman database sync cache files (*.tar.gz) - [[ -d "${airootfs_dir}/var/lib/pacman" ]] && find "${airootfs_dir}/var/lib/pacman" -maxdepth 1 -type f -delete + [[ -d "${pacstrap_dir}/var/lib/pacman" ]] && find "${pacstrap_dir}/var/lib/pacman" -maxdepth 1 -type f -delete # Delete pacman database sync cache - [[ -d "${airootfs_dir}/var/lib/pacman/sync" ]] && find "${airootfs_dir}/var/lib/pacman/sync" -delete + [[ -d "${pacstrap_dir}/var/lib/pacman/sync" ]] && find "${pacstrap_dir}/var/lib/pacman/sync" -delete # Delete pacman package cache - [[ -d "${airootfs_dir}/var/cache/pacman/pkg" ]] && find "${airootfs_dir}/var/cache/pacman/pkg" -type f -delete + [[ -d "${pacstrap_dir}/var/cache/pacman/pkg" ]] && find "${pacstrap_dir}/var/cache/pacman/pkg" -type f -delete # Delete all log files, keeps empty dirs. - [[ -d "${airootfs_dir}/var/log" ]] && find "${airootfs_dir}/var/log" -type f -delete + [[ -d "${pacstrap_dir}/var/log" ]] && find "${pacstrap_dir}/var/log" -type f -delete # Delete all temporary files and dirs - [[ -d "${airootfs_dir}/var/tmp" ]] && find "${airootfs_dir}/var/tmp" -mindepth 1 -delete + [[ -d "${pacstrap_dir}/var/tmp" ]] && find "${pacstrap_dir}/var/tmp" -mindepth 1 -delete # Delete package pacman related files. find "${work_dir}" \( -name '*.pacnew' -o -name '*.pacsave' -o -name '*.pacorig' \) -delete - # Create an empty /etc/machine-id - printf '' > "${airootfs_dir}/etc/machine-id" + # Create /etc/machine-id with special value 'uninitialized': the final id is + # generated on first boot, systemd's first-boot mechanism applies (see machine-id(5)) + rm -f -- "${pacstrap_dir}/etc/machine-id" + printf 'uninitialized\n' >"${pacstrap_dir}/etc/machine-id" _msg_info "Done!" } +# Create a squashfs image and place it in the ISO 9660 file system. +# $@: options to pass to mksquashfs _run_mksquashfs() { - local image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" - if [[ "${quiet}" == "y" ]]; then - mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" -no-progress > /dev/null - else - mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" - fi + local mksquashfs_options=() image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" + rm -f -- "${image_path}" + [[ ! "${quiet}" == "y" ]] || mksquashfs_options+=('-no-progress' '-quiet') + mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" "${mksquashfs_options[@]}" } -# Makes a ext4 filesystem inside a SquashFS from a source directory. +# Create an ext4 image containing the root file system and pack it inside a squashfs image. +# Save the squashfs image on the ISO 9660 file system. _mkairootfs_ext4+squashfs() { - [[ -e "${airootfs_dir}" ]] || _msg_error "The path '${airootfs_dir}' does not exist" 1 - - _msg_info "Creating ext4 image of 32 GiB..." - if [[ "${quiet}" == "y" ]]; then - mkfs.ext4 -q -O '^has_journal,^resize_inode' -E 'lazy_itable_init=0' -m 0 -F -- "${airootfs_dir}.img" 32G - else - mkfs.ext4 -O '^has_journal,^resize_inode' -E 'lazy_itable_init=0' -m 0 -F -- "${airootfs_dir}.img" 32G - fi - tune2fs -c 0 -i 0 -- "${airootfs_dir}.img" > /dev/null - _msg_info "Done!" - _mount_airootfs - _msg_info "Copying '${airootfs_dir}/' to '${work_dir}/mnt/airootfs/'..." - cp -aT -- "${airootfs_dir}/" "${work_dir}/mnt/airootfs/" - chown -- 0:0 "${work_dir}/mnt/airootfs/" + local ext4_hash_seed mkfs_ext4_options=() + [[ -e "${pacstrap_dir}" ]] || _msg_error "The path '${pacstrap_dir}' does not exist" 1 + + _msg_info "Creating ext4 image of 32 GiB and copying '${pacstrap_dir}/' to it..." + + ext4_hash_seed="$(uuidgen --sha1 --namespace 93a870ff-8565-4cf3-a67b-f47299271a96 \ + --name "${SOURCE_DATE_EPOCH} ext4 hash seed")" + mkfs_ext4_options=( + '-d' "${pacstrap_dir}" + '-O' '^has_journal,^resize_inode' + '-E' "lazy_itable_init=0,root_owner=0:0,hash_seed=${ext4_hash_seed}" + '-m' '0' + '-F' + '-U' 'clear' + ) + [[ ! "${quiet}" == "y" ]] || mkfs_ext4_options+=('-q') + rm -f -- "${pacstrap_dir}.img" + E2FSPROGS_FAKE_TIME="${SOURCE_DATE_EPOCH}" mkfs.ext4 "${mkfs_ext4_options[@]}" -- "${pacstrap_dir}.img" 32G + tune2fs -c 0 -i 0 -- "${pacstrap_dir}.img" >/dev/null _msg_info "Done!" - _umount_airootfs + install -d -m 0755 -- "${isofs_dir}/${install_dir}/${arch}" _msg_info "Creating SquashFS image, this may take some time..." - _run_mksquashfs "${airootfs_dir}.img" + _run_mksquashfs "${pacstrap_dir}.img" _msg_info "Done!" - rm -- "${airootfs_dir}.img" + rm -- "${pacstrap_dir}.img" } -# Makes a SquashFS filesystem from a source directory. +# Create a squashfs image containing the root file system and saves it on the ISO 9660 file system. _mkairootfs_squashfs() { - [[ -e "${airootfs_dir}" ]] || _msg_error "The path '${airootfs_dir}' does not exist" 1 + [[ -e "${pacstrap_dir}" ]] || _msg_error "The path '${pacstrap_dir}' does not exist" 1 install -d -m 0755 -- "${isofs_dir}/${install_dir}/${arch}" _msg_info "Creating ${arch} SquashFS image, this may take some time..." - _run_mksquashfs "${airootfs_dir}" - _msg_info "Done!" + _run_mksquashfs "${pacstrap_dir}" } -_mkchecksum() { - _msg_info "Creating checksum file for self-test..." - cd -- "${isofs_dir}/${install_dir}/${arch}" - if [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" ]]; then - sha512sum airootfs.sfs > airootfs.sha512 - elif [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" ]]; then - sha512sum airootfs.erofs > airootfs.sha512 - fi - cd -- "${OLDPWD}" - _msg_info "Done!" -} - -# Makes an EROFS file system from a source directory. +# Create an EROFS image containing the root file system and saves it on the ISO 9660 file system. _mkairootfs_erofs() { - local fsuuid - [[ -e "${airootfs_dir}" ]] || _msg_error "The path '${airootfs_dir}' does not exist" 1 + local fsuuid mkfs_erofs_options=() + [[ -e "${pacstrap_dir}" ]] || _msg_error "The path '${pacstrap_dir}' does not exist" 1 install -d -m 0755 -- "${isofs_dir}/${install_dir}/${arch}" local image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" + rm -f -- "${image_path}" + [[ ! "${quiet}" == "y" ]] || mkfs_erofs_options+=('--quiet') # Generate reproducible file system UUID from SOURCE_DATE_EPOCH fsuuid="$(uuidgen --sha1 --namespace 93a870ff-8565-4cf3-a67b-f47299271a96 --name "${SOURCE_DATE_EPOCH}")" + mkfs_erofs_options+=('-U' "${fsuuid}" "${airootfs_image_tool_options[@]}") _msg_info "Creating EROFS image, this may take some time..." - mkfs.erofs -U "${fsuuid}" "${airootfs_image_tool_options[@]}" -- "${image_path}" "${airootfs_dir}" + mkfs.erofs "${mkfs_erofs_options[@]}" -- "${image_path}" "${pacstrap_dir}" _msg_info "Done!" } -_mksignature() { - _msg_info "Signing SquashFS image..." +# Create checksum file for the rootfs image. +_mkchecksum() { + _msg_info "Creating checksum file for self-test..." cd -- "${isofs_dir}/${install_dir}/${arch}" if [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" ]]; then - gpg --detach-sign --default-key "${gpg_key}" airootfs.sfs + sha512sum airootfs.sfs >airootfs.sha512 elif [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" ]]; then - gpg --detach-sign --default-key "${gpg_key}" airootfs.erofs + sha512sum airootfs.erofs >airootfs.sha512 fi cd -- "${OLDPWD}" _msg_info "Done!" } +# GPG sign the root file system image. +_mk_pgp_signature() { + local gpg_options=() + local airootfs_image_filename="${1}" + _msg_info "Signing rootfs image using GPG..." + + rm -f -- "${airootfs_image_filename}.sig" + # Add gpg sender option if the value is provided + [[ -z "${gpg_sender}" ]] || gpg_options+=('--sender' "${gpg_sender}") + # always use the .sig file extension, as that is what mkinitcpio-parabolaiso's hooks expect + gpg --batch --no-armor --no-include-key-block --output "${airootfs_image_filename}.sig" --detach-sign \ + --default-key "${gpg_key}" "${gpg_options[@]}" "${airootfs_image_filename}" + _msg_info "Done!" +} + # Helper function to run functions only one time. +# $1: function name _run_once() { - if [[ ! -e "${work_dir}/build.${1}_${arch}" ]]; then + if [[ ! -e "${work_dir}/${run_once_mode}.${1}.${arch}" ]]; then "$1" - touch "${work_dir}/build.${1}_${arch}" + touch "${work_dir}/${run_once_mode}.${1}.${arch}" fi } -# Helper function to run functions for both architectures +# Helper function to run commands for the i686 and x86_64 architectures. +# $@: commands to run in both architectures _run_dual() { + local architectures="${arch}" + local arch local cmd - if [[ "${arch}" == "dual" ]]; then - local arch - for arch in i686 x86_64; do - airootfs_dir="${work_dir}/${arch}/airootfs" - for cmd in "$@"; do - ${cmd} - done - done - else + + if [[ "${architectures}" == "dual" ]]; then + architectures="i686 x86_64" + fi + + for arch in ${architectures}; do + pacstrap_dir="${work_dir}/${arch}/airootfs" + if [[ "${buildmode}" == "bootstrap" ]]; then + pacstrap_dir="${work_dir}/${arch}/bootstrap/root.${arch}" + fi for cmd in "$@"; do ${cmd} done - fi + done } -# Set up custom pacman.conf with custom cache and pacman hook directories +# Set up custom pacman.conf with custom cache and pacman hook directories. _make_pacman_conf() { local _cache_dirs _system_cache_dirs _profile_cache_dirs - _system_cache_dirs="$(pacman-conf CacheDir| tr '\n' ' ')" - _profile_cache_dirs="$(pacman-conf --config "${pacman_conf}" CacheDir| tr '\n' ' ')" + _system_cache_dirs="$(pacman-conf CacheDir | tr '\n' ' ')" + _profile_cache_dirs="$(pacman-conf --config "${pacman_conf}" CacheDir | tr '\n' ' ')" - # only use the profile's CacheDir, if it is not the default and not the same as the system cache dir - if [[ "${_profile_cache_dirs}" != "/var/cache/pacman/pkg" ]] && \ - [[ "${_system_cache_dirs}" != "${_profile_cache_dirs}" ]]; then + # Only use the profile's CacheDir, if it is not the default and not the same as the system cache dir. + if [[ "${_profile_cache_dirs}" != "/var/cache/pacman/pkg" ]] \ + && [[ "${_system_cache_dirs}" != "${_profile_cache_dirs}" ]]; then _cache_dirs="${_profile_cache_dirs}" else _cache_dirs="${_system_cache_dirs}" fi - _msg_info "Copying custom pacman.conf to work directory..." + _msg_info "Copying custom pacman.conf to ${arch} work directory..." _msg_info "Using pacman CacheDir: ${_cache_dirs}" # take the profile pacman.conf and strip all settings that would break in chroot when using pacman -r # append CacheDir and HookDir to [options] section # HookDir is *always* set to the airootfs' override directory # see `man 8 pacman` for further info - setarch "${arch}" pacman-conf --config "${pacman_conf}" | \ - sed "/CacheDir/d;/DBPath/d;/HookDir/d;/LogFile/d;/RootDir/d;/\[options\]/a CacheDir = ${_cache_dirs} - /\[options\]/a HookDir = ${airootfs_dir}/etc/pacman.d/hooks/" > "${work_dir}/pacman_${arch}.conf" + sed "/Architecture/d;/\[options\]/a Architecture = ${arch}" "${pacman_conf}" | \ + pacman-conf --config /dev/stdin \ + | sed "/CacheDir/d;/DBPath/d;/HookDir/d;/LogFile/d;/RootDir/d;/\[options\]/a CacheDir = ${_cache_dirs} + /\[options\]/a HookDir = ${pacstrap_dir}/etc/pacman.d/hooks/" >"${work_dir}/${buildmode}.pacman.conf.${arch}" } -# Prepare working directory and copy custom airootfs files (airootfs) +# Prepare working directory and copy custom root file system files. _make_custom_airootfs() { local passwd=() local filename permissions - install -d -m 0755 -o 0 -g 0 -- "${airootfs_dir}" + install -d -m 0755 -o 0 -g 0 -- "${pacstrap_dir}" if [[ -d "${profile}/airootfs" ]]; then - _msg_info "Copying custom airootfs files..." - cp -af --no-preserve=ownership,mode -- "${profile}/airootfs/." "${airootfs_dir}" + _msg_info "Copying custom ${arch} airootfs files..." + cp -af --no-preserve=ownership,mode -- "${profile}/airootfs/." "${pacstrap_dir}" # Set ownership and mode for files and directories for filename in "${!file_permissions[@]}"; do - IFS=':' read -ra permissions <<< "${file_permissions["${filename}"]}" - # Prevent file path traversal outside of $airootfs_dir - if [[ "$(realpath -q -- "${airootfs_dir}${filename}")" != "${airootfs_dir}"* ]]; then - _msg_error "Failed to set permissions on '${airootfs_dir}${filename}'. Outside of valid path." 1 + IFS=':' read -ra permissions <<<"${file_permissions["${filename}"]}" + # Prevent file path traversal outside of $pacstrap_dir + if [[ "$(realpath -q -- "${pacstrap_dir}${filename}")" != "${pacstrap_dir}"* ]]; then + _msg_error "Failed to set permissions on '${pacstrap_dir}${filename}'. Outside of valid path." 1 # Warn if the file does not exist - elif [[ ! -e "${airootfs_dir}${filename}" ]]; then - _msg_warning "Cannot change permissions of '${airootfs_dir}${filename}'. The file or directory does not exist." + elif [[ ! -e "${pacstrap_dir}${filename}" ]]; then + _msg_warning "Cannot change permissions of '${pacstrap_dir}${filename}'. The file or directory does not exist." else if [[ "${filename: -1}" == "/" ]]; then - chown -fhR -- "${permissions[0]}:${permissions[1]}" "${airootfs_dir}${filename}" - chmod -fR -- "${permissions[2]}" "${airootfs_dir}${filename}" + chown -fhR -- "${permissions[0]}:${permissions[1]}" "${pacstrap_dir}${filename}" + chmod -fR -- "${permissions[2]}" "${pacstrap_dir}${filename}" else - chown -fh -- "${permissions[0]}:${permissions[1]}" "${airootfs_dir}${filename}" - chmod -f -- "${permissions[2]}" "${airootfs_dir}${filename}" + chown -fh -- "${permissions[0]}:${permissions[1]}" "${pacstrap_dir}${filename}" + chmod -f -- "${permissions[2]}" "${pacstrap_dir}${filename}" fi fi done @@ -325,25 +361,62 @@ _make_custom_airootfs() { fi } -# Install desired packages to airootfs +# Install desired packages to the root file system _make_packages() { - _msg_info "Installing packages to '${airootfs_dir}/'..." + _msg_info "Installing packages to '${pacstrap_dir}/'..." - local pkg_list_arch - eval "pkg_list_arch=(\${pkg_list_${arch}[@]})" + local buildmode_pkg_list_arch + eval "buildmode_pkg_list_arch=(\${buildmode_pkg_list_${arch}[@]})" - if [[ -n "${gpg_key}" ]]; then - exec {PARABOLAISO_GNUPG_FD}<>"${work_dir}/pubkey.gpg" + if [[ -v gpg_publickey ]]; then + exec {PARABOLAISO_GNUPG_FD}<"$gpg_publickey" export PARABOLAISO_GNUPG_FD fi + if [[ -v cert_list[0] ]]; then + exec {PARABOLAISO_TLS_FD}<"${cert_list[0]}" + export PARABOLAISO_TLS_FD + fi + if [[ -v cert_list[2] ]]; then + exec {PARABOLAISO_TLSCA_FD}<"${cert_list[2]}" + export PARABOLAISO_TLSCA_FD + fi + + + # Install the qemu-arm-static binary + if [[ "${arch}" == "armv7h" ]] && ! setarch armv7l /bin/true 2>/dev/null; then + # Make sure that qemu-static is set up with binfmt_misc + if [[ -z $(grep -l -xF \ + -e "interpreter /usr/bin/qemu-arm-static" \ + -r -- /proc/sys/fs/binfmt_misc 2>/dev/null \ + | xargs -r grep -xF 'enabled') ]]; then + # Register the qemu-arm-static as an ARM interpreter in the kernel (using binfmt_misc kernel module) + printf ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' >/proc/sys/fs/binfmt_misc/register + fi + install -d -m 0755 -- "${pacstrap_dir}/usr/bin" + install -m 0755 -- /usr/bin/qemu-arm-static "${pacstrap_dir}/usr/bin" + fi + # Unset TMPDIR to work around https://bugs.archlinux.org/task/70580 if [[ "${quiet}" = "y" ]]; then - pacstrap -C "${work_dir}/pacman_${arch}.conf" -c -G -M -- "${airootfs_dir}" "${pkg_list[@]}" "${pkg_list_arch[@]}" &> /dev/null + env -u TMPDIR pacstrap -C "${work_dir}/${buildmode}.pacman.conf.${arch}" -c -G -M -- "${pacstrap_dir}" "${buildmode_pkg_list[@]}" "${buildmode_pkg_list_arch[@]}" &>/dev/null else - pacstrap -C "${work_dir}/pacman_${arch}.conf" -c -G -M -- "${airootfs_dir}" "${pkg_list[@]}" "${pkg_list_arch[@]}" + env -u TMPDIR pacstrap -C "${work_dir}/${buildmode}.pacman.conf.${arch}" -c -G -M -- "${pacstrap_dir}" "${buildmode_pkg_list[@]}" "${buildmode_pkg_list_arch[@]}" fi - if [[ -n "${gpg_key}" ]]; then + # Delete the qemu-arm-static binary + if [[ "${arch}" == "armv7h" ]] && ! setarch armv7l /bin/true 2>/dev/null; then + rm -f -- "${pacstrap_dir}/usr/bin/qemu-arm-static" + fi + + if [[ -v cert_list[0] ]]; then + exec {PARABOLAISO_TLS_FD}<&- + unset PARABOLAISO_TLS_FD + fi + if [[ -v cert_list[2] ]]; then + exec {PARABOLAISO_TLSCA_FD}<&- + unset PARABOLAISO_TLSCA_FD + fi + if [[ -v gpg_publickey ]]; then exec {PARABOLAISO_GNUPG_FD}<&- unset PARABOLAISO_GNUPG_FD fi @@ -351,7 +424,7 @@ _make_packages() { _msg_info "Done! Packages installed successfully." } -# Customize installation (airootfs) +# Customize installation. _make_customize_airootfs() { local passwd=() @@ -363,27 +436,28 @@ _make_customize_airootfs() { # Skip invalid home directories [[ "${passwd[5]}" == '/' ]] && continue [[ -z "${passwd[5]}" ]] && continue - # Prevent path traversal outside of $airootfs_dir - if [[ "$(realpath -q -- "${airootfs_dir}${passwd[5]}")" == "${airootfs_dir}"* ]]; then - if [[ ! -d "${airootfs_dir}${passwd[5]}" ]]; then - install -d -m 0750 -o "${passwd[2]}" -g "${passwd[3]}" -- "${airootfs_dir}${passwd[5]}" + # Prevent path traversal outside of $pacstrap_dir + if [[ "$(realpath -q -- "${pacstrap_dir}${passwd[5]}")" == "${pacstrap_dir}"* ]]; then + if [[ ! -d "${pacstrap_dir}${passwd[5]}" ]]; then + install -d -m 0750 -o "${passwd[2]}" -g "${passwd[3]}" -- "${pacstrap_dir}${passwd[5]}" fi - cp -dnRT --preserve=mode,timestamps,links -- "${airootfs_dir}/etc/skel/." "${airootfs_dir}${passwd[5]}" - chmod -f 0750 -- "${airootfs_dir}${passwd[5]}" - chown -hR -- "${passwd[2]}:${passwd[3]}" "${airootfs_dir}${passwd[5]}" + cp -dRT --update=none --preserve=mode,timestamps,links -- "${pacstrap_dir}/etc/skel/." "${pacstrap_dir}${passwd[5]}" + chmod -f 0750 -- "${pacstrap_dir}${passwd[5]}" + chown -hR -- "${passwd[2]}:${passwd[3]}" "${pacstrap_dir}${passwd[5]}" else - _msg_error "Failed to set permissions on '${airootfs_dir}${passwd[5]}'. Outside of valid path." 1 + _msg_error "Failed to set permissions on '${pacstrap_dir}${passwd[5]}'. Outside of valid path." 1 fi - done < "${profile}/airootfs/etc/passwd" + done <"${profile}/airootfs/etc/passwd" _msg_info "Done!" fi - if [[ -e "${airootfs_dir}/root/customize_airootfs.sh" ]]; then - _msg_info "Running customize_airootfs.sh in '${airootfs_dir}' chroot..." + if [[ -e "${pacstrap_dir}/root/customize_airootfs.sh" ]]; then + _msg_info "Running customize_airootfs.sh in '${pacstrap_dir}' chroot..." _msg_warning "customize_airootfs.sh is deprecated! Support for it will be removed in a future parabolaiso version." - chmod -f -- +x "${airootfs_dir}/root/customize_airootfs.sh" - eval -- arch-chroot "${airootfs_dir}" "/root/customize_airootfs.sh" - rm -- "${airootfs_dir}/root/customize_airootfs.sh" + chmod -f -- +x "${pacstrap_dir}/root/customize_airootfs.sh" + # Unset TMPDIR to work around https://bugs.archlinux.org/task/70580 + eval -- env -u TMPDIR arch-chroot "${pacstrap_dir}" "/root/customize_airootfs.sh" + rm -- "${pacstrap_dir}/root/customize_airootfs.sh" _msg_info "Done! customize_airootfs.sh run successfully." fi } @@ -394,63 +468,67 @@ _make_bootmodes() { for bootmode in "${bootmodes[@]}"; do _run_once "_make_bootmode_${bootmode}" done + + if [[ "${bootmodes[*]}" != *grub* ]]; then + _run_once _make_common_grubenv_and_loopbackcfg + fi } -# Prepare kernel/initramfs ${install_dir}/boot/ +# Copy kernel and initramfs to ISO 9660 _make_boot_on_iso9660() { _msg_info "Preparing ${arch} kernel and initramfs for the ISO 9660 file system..." install -d -m 0755 -- "${isofs_dir}/${install_dir}/boot/${arch}" - install -m 0644 -- "${airootfs_dir}/boot/initramfs-"*".img" "${isofs_dir}/${install_dir}/boot/${arch}/" - install -m 0644 -- "${airootfs_dir}/boot/vmlinuz-"* "${isofs_dir}/${install_dir}/boot/${arch}/" + install -m 0644 -- "${pacstrap_dir}/boot/initramfs-"*".img" "${isofs_dir}/${install_dir}/boot/${arch}/" + install -m 0644 -- "${pacstrap_dir}/boot/vmlinuz-"* "${isofs_dir}/${install_dir}/boot/${arch}/" _msg_info "Done!" } -# Prepare /syslinux +# Prepare syslinux for booting from MBR (isohybrid) _make_bootmode_bios.syslinux.mbr() { _msg_info "Setting up SYSLINUX for BIOS booting from a disk..." - install -d -m 0755 -- "${isofs_dir}/syslinux" + install -d -m 0755 -- "${isofs_dir}/boot/syslinux" for _cfg in "${profile}/syslinux/"*.cfg; do sed "s|%PARABOLAISO_LABEL%|${iso_label}|g; + s|%PARABOLAISO_UUID%|${iso_uuid}|g; s|%INSTALL_DIR%|${install_dir}|g; s|%ARCH%|${arch}|g" \ - "${_cfg}" > "${isofs_dir}/syslinux/${_cfg##*/}" + "${_cfg}" >"${isofs_dir}/boot/syslinux/${_cfg##*/}" done if [[ -e "${profile}/syslinux/splash.png" ]]; then - install -m 0644 -- "${profile}/syslinux/splash.png" "${isofs_dir}/syslinux/" + install -m 0644 -- "${profile}/syslinux/splash.png" "${isofs_dir}/boot/syslinux/" fi - install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/"*.c32 "${isofs_dir}/syslinux/" - install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/lpxelinux.0" "${isofs_dir}/syslinux/" - install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/memdisk" "${isofs_dir}/syslinux/" + install -m 0644 -- "${pacstrap_dir}/usr/lib/syslinux/bios/"*.c32 "${isofs_dir}/boot/syslinux/" + install -m 0644 -- "${pacstrap_dir}/usr/lib/syslinux/bios/lpxelinux.0" "${isofs_dir}/boot/syslinux/" + install -m 0644 -- "${pacstrap_dir}/usr/lib/syslinux/bios/memdisk" "${isofs_dir}/boot/syslinux/" _run_dual '_run_once _make_boot_on_iso9660' - if [[ -e "${isofs_dir}/syslinux/hdt.c32" ]]; then - install -d -m 0755 -- "${isofs_dir}/syslinux/hdt" - if [[ -e "${airootfs_dir}/usr/share/hwdata/pci.ids" ]]; then - gzip -c -9 "${airootfs_dir}/usr/share/hwdata/pci.ids" > \ - "${isofs_dir}/syslinux/hdt/pciids.gz" + if [[ -e "${isofs_dir}/boot/syslinux/hdt.c32" ]]; then + install -d -m 0755 -- "${isofs_dir}/boot/syslinux/hdt" + if [[ -e "${pacstrap_dir}/usr/share/hwdata/pci.ids" ]]; then + gzip -cn9 "${pacstrap_dir}/usr/share/hwdata/pci.ids" > \ + "${isofs_dir}/boot/syslinux/hdt/pciids.gz" fi - find "${airootfs_dir}/usr/lib/modules" -name 'modules.alias' -print -exec gzip -c -9 '{}' ';' -quit > \ - "${isofs_dir}/syslinux/hdt/modalias.gz" + find "${pacstrap_dir}/usr/lib/modules" -name 'modules.alias' -print -exec gzip -cn9 '{}' ';' -quit > \ + "${isofs_dir}/boot/syslinux/hdt/modalias.gz" fi # Add other aditional/extra files to ${install_dir}/boot/ - if [[ -e "${airootfs_dir}/boot/memtest86+/memtest.bin" ]]; then + if [[ -e "${pacstrap_dir}/boot/memtest86+/memtest.bin" ]]; then + install -d -m 0755 -- "${isofs_dir}/boot/memtest86+/" # rename for PXE: https://wiki.parabola.nu/index.php/Syslinux#Using_memtest - install -m 0644 -- "${airootfs_dir}/boot/memtest86+/memtest.bin" "${isofs_dir}/${install_dir}/boot/memtest" - install -d -m 0755 -- "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/" - install -m 0644 -- "${airootfs_dir}/usr/share/licenses/common/GPL2/license.txt" \ - "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/" + install -m 0644 -- "${pacstrap_dir}/boot/memtest86+/memtest.bin" "${isofs_dir}/boot/memtest86+/memtest" + install -m 0644 -- "${pacstrap_dir}/usr/share/licenses/common/GPL2/license.txt" "${isofs_dir}/boot/memtest86+/" fi _msg_info "Done! SYSLINUX set up for BIOS booting from a disk successfully." } -# Prepare /syslinux for El-Torito booting +# Prepare syslinux for El-Torito booting _make_bootmode_bios.syslinux.eltorito() { _msg_info "Setting up SYSLINUX for BIOS booting from an optical disc..." - install -d -m 0755 -- "${isofs_dir}/syslinux" - install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/isolinux.bin" "${isofs_dir}/syslinux/" - install -m 0644 -- "${airootfs_dir}/usr/lib/syslinux/bios/isohdpfx.bin" "${isofs_dir}/syslinux/" + install -d -m 0755 -- "${isofs_dir}/boot/syslinux" + install -m 0644 -- "${pacstrap_dir}/usr/lib/syslinux/bios/isolinux.bin" "${isofs_dir}/boot/syslinux/" + install -m 0644 -- "${pacstrap_dir}/usr/lib/syslinux/bios/isohdpfx.bin" "${isofs_dir}/boot/syslinux/" # ISOLINUX and SYSLINUX installation is shared _run_once _make_bootmode_bios.syslinux.mbr @@ -458,168 +536,491 @@ _make_bootmode_bios.syslinux.eltorito() { _msg_info "Done! SYSLINUX set up for BIOS booting from an optical disc successfully." } -# Prepare /EFI on ISO-9660 -_make_efi_dir_on_iso9660() { - _msg_info "Preparing an /EFI directory for the ISO 9660 file system..." - install -d -m 0755 -- "${isofs_dir}/EFI/BOOT" - install -m 0644 -- "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" \ - "${isofs_dir}/EFI/BOOT/BOOTx64.EFI" +# Copy kernel and initramfs to FAT image +_make_boot_on_fat() { + _msg_info "Preparing kernel and initramfs for the FAT file system..." + mmd -i "${efibootimg}" \ + "::/${install_dir}" "::/${install_dir}/boot" "::/${install_dir}/boot/x86_64" + mcopy -i "${efibootimg}" "${pacstrap_dir}/boot/vmlinuz-"* \ + "${pacstrap_dir}/boot/initramfs-"*".img" "::/${install_dir}/boot/x86_64/" + _msg_info "Done!" +} - install -d -m 0755 -- "${isofs_dir}/loader/entries" - install -m 0644 -- "${profile}/efiboot/loader/loader.conf" "${isofs_dir}/loader/" +# Create a FAT image (efiboot.img) which will serve as the EFI system partition +# $1: image size in bytes +_make_efibootimg() { + local imgsize_kib="0" + local imgsize_bytes=${1} - for _conf in "${profile}/efiboot/loader/entries/"*".conf"; do + if (( imgsize_bytes < 2*1024*1024 )); then + _msg_info "Validating '${bootmode}': efiboot.img size is ${imgsize_bytes} bytes is less than 2 MiB! Bumping up to 2 MiB" + imgsize_bytes=$((2*1024*1024)) + fi + + # Convert from bytes to KiB and round up to the next full MiB with an additional MiB for reserved sectors. + imgsize_kib="$( + awk 'function ceil(x){return int(x)+(x>int(x))} + function byte_to_kib(x){return x/1024} + function mib_to_kib(x){return x*1024} + END {print mib_to_kib(ceil((byte_to_kib($1)+1024)/1024))}' <<<"${imgsize_bytes}" + )" + # The FAT image must be created with mkfs.fat not mformat, as some systems have issues with mformat made images: + # https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html + rm -f -- "${efibootimg}" + _msg_info "Creating FAT image of size: ${imgsize_kib} KiB..." + if [[ "${quiet}" == "y" ]]; then + # mkfs.fat does not have a -q/--quiet option, so redirect stdout to /dev/null instead + # https://github.com/dosfstools/dosfstools/issues/103 + mkfs.fat -C -n PARAISO_EFI "${efibootimg}" "${imgsize_kib}" >/dev/null + else + mkfs.fat -C -n PARAISO_EFI "${efibootimg}" "${imgsize_kib}" + fi + + # Create the default/fallback boot path in which a boot loaders will be placed later. + mmd -i "${efibootimg}" ::/EFI ::/EFI/BOOT +} + +# Copy GRUB files to ISO 9660 which is used by both IA32 UEFI and x64 UEFI +_make_common_bootmode_grub_copy_to_isofs() { + local files_to_copy=() + + files_to_copy+=("${work_dir}/grub/"*) + if compgen -G "${profile}/grub/!(*.cfg)" &>/dev/null; then + files_to_copy+=("${profile}/grub/"!(*.cfg)) + fi + install -d -m 0755 -- "${isofs_dir}/boot/grub" + cp -r --remove-destination -- "${files_to_copy[@]}" "${isofs_dir}/boot/grub/" +} + +# Prepare GRUB configuration files +_make_common_bootmode_grub_cfg() { + local _cfg search_filename + + install -d -- "${work_dir}/grub" + + # Create a /boot/grub/YYYY-mm-dd-HH-MM-SS-00.uuid file on ISO 9660. GRUB will search for it to find the ISO + # volume. This is similar to what grub-mkrescue does, except it places the file in /.disk/, but we opt to use a + # directory that does not start with a dot to avoid it being accidentally missed when copying the ISO's contents. + : >"${work_dir}/grub/${iso_uuid}.uuid" + search_filename="/boot/grub/${iso_uuid}.uuid" + + # Fill GRUB configuration files + for _cfg in "${profile}/grub/"*'.cfg'; do sed "s|%PARABOLAISO_LABEL%|${iso_label}|g; + s|%PARABOLAISO_UUID%|${iso_uuid}|g; s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" \ - "${_conf}" > "${isofs_dir}/loader/entries/${_conf##*/}" + s|%ARCH%|${arch}|g; + s|%PARABOLAISO_SEARCH_FILENAME%|${search_filename}|g" \ + "${_cfg}" >"${work_dir}/grub/${_cfg##*/}" done - # edk2-shell based UEFI shell - # shellx64.efi is picked up automatically when on / - if [[ -e "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then - install -m 0644 -- "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" "${isofs_dir}/shellx64.efi" + # Prepare grub.cfg that will be embedded inside the GRUB binaries + IFS='' read -r -d '' grubembedcfg <<'EOF' || true +if ! [ -d "$cmdpath" ]; then + # On some firmware, GRUB has a wrong cmdpath when booted from an optical disc. During El Torito boot, GRUB is + # launched from a case-insensitive FAT-formatted EFI system partition, but it seemingly cannot access that partition + # and sets cmdpath to the whole cd# device which has case-sensitive ISO 9660 + Rock Ridge + Joliet file systems. + # See https://gitlab.archlinux.org/archlinux/archiso/-/issues/183 and https://savannah.gnu.org/bugs/?62886 + if regexp --set=1:parabolaiso_bootdevice '^\(([^)]+)\)\/?[Ee][Ff][Ii]\/[Bb][Oo][Oo][Tt]\/?$' "${cmdpath}"; then + set cmdpath="(${parabolaiso_bootdevice})/EFI/BOOT" + set PARABOLAISO_HINT="${parabolaiso_bootdevice}" fi -} +fi -_make_refind_efi_dir_on_iso9660() { - _msg_info "Preparing an /EFI directory for the ISO 9660 file system..." - install -d -m 0755 -- "${isofs_dir}/EFI/BOOT/entries" - install -m 0644 -- "${airootfs_dir}/usr/share/refind/refind_x64.efi" \ - "${isofs_dir}/EFI/BOOT/BOOTx64.EFI" +# Prepare a hint for the search command using the device in cmdpath +if [ -z "${PARABOLAISO_HINT}" ]; then + regexp --set=1:PARABOLAISO_HINT '^\(([^)]+)\)' "${cmdpath}" +fi - install -m 0644 -- "${profile}/efiboot/EFI/BOOT/refind.conf" "${isofs_dir}/EFI/BOOT/" +# Search for the ISO volume +if search --no-floppy --set=parabolaiso_device --file '%PARABOLAISO_SEARCH_FILENAME%' --hint "${PARABOLAISO_HINT}"; then + set PARABOLAISO_HINT="${parabolaiso_device}" + if probe --set PARABOLAISO_UUID --fs-uuid "${PARABOLAISO_HINT}"; then + export PARABOLAISO_UUID + fi +else + echo "Could not find a volume with a '%PARABOLAISO_SEARCH_FILENAME%' file on it!" +fi + +# Load grub.cfg +if [ "${PARABOLAISO_HINT}" == 'memdisk' -o -z "${PARABOLAISO_HINT}" ]; then + echo 'Could not find the ISO volume!' +elif [ -e "(${PARABOLAISO_HINT})/boot/grub/grub.cfg" ]; then + export PARABOLAISO_HINT + set root="${PARABOLAISO_HINT}" + configfile "(${PARABOLAISO_HINT})/boot/grub/grub.cfg" +else + echo "File '(${PARABOLAISO_HINT})/boot/grub/grub.cfg' not found!" +fi +EOF + grubembedcfg="${grubembedcfg//'%PARABOLAISO_SEARCH_FILENAME%'/"${search_filename}"}" + printf '%s\n' "$grubembedcfg" >"${work_dir}/grub-embed.cfg" + + # Write grubenv + printf '%.1024s' \ + "$(printf '# GRUB Environment Block\nNAME=%s\nVERSION=%s\nPARABOLAISO_LABEL=%s\nINSTALL_DIR=%s\nARCH=%s\nPARABOLAISO_SEARCH_FILENAME=%s\n%s' \ + "${iso_name}" \ + "${iso_version}" \ + "${iso_label}" \ + "${install_dir}" \ + "${arch}" \ + "${search_filename}" \ + "$(printf '%0.1s' "#"{1..1024})")" \ + >"${work_dir}/grub/grubenv" +} - for _conf in "${profile}/efiboot/EFI/BOOT/entries/"*".conf"; do +# Create GRUB specific configuration files when GRUB is not used as a boot loader +_make_common_grubenv_and_loopbackcfg() { + local search_filename + + install -d -m 0755 -- "${isofs_dir}/boot/grub" + # Create a /boot/grub/YYYY-mm-dd-HH-MM-SS-00.uuid file on ISO 9660. GRUB will search for it to find the ISO + # volume. This is similar to what grub-mkrescue does, except it places the file in /.disk/, but we opt to use a + # directory that does not start with a dot to avoid it being accidentally missed when copying the ISO's contents. + search_filename="/boot/grub/${iso_uuid}.uuid" + : >"${isofs_dir}/${search_filename}" + + # Write grubenv + printf '%.1024s' \ + "$(printf '# GRUB Environment Block\nNAME=%s\nVERSION=%s\nPARABOLAISO_LABEL=%s\nINSTALL_DIR=%s\nARCH=%s\nPARABOLAISO_SEARCH_FILENAME=%s\n%s' \ + "${iso_name}" \ + "${iso_version}" \ + "${iso_label}" \ + "${install_dir}" \ + "${arch}" \ + "${search_filename}" \ + "$(printf '%0.1s' "#"{1..1024})")" \ + >"${isofs_dir}/boot/grub/grubenv" + + # Copy loopback.cfg to /boot/grub/ on ISO 9660 + if [[ -e "${profile}/grub/loopback.cfg" ]]; then sed "s|%PARABOLAISO_LABEL%|${iso_label}|g; + s|%PARABOLAISO_UUID%|${iso_uuid}|g; s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" \ - "${_conf}" > "${isofs_dir}/EFI/BOOT/entries/${_conf##*/}" - done + s|%ARCH%|${arch}|g; + s|%PARABOLAISO_SEARCH_FILENAME%|${search_filename}|g" \ + "${profile}/grub/loopback.cfg" >"${isofs_dir}/boot/grub/loopback.cfg" + fi +} + +_make_bootmode_uefi-ia32.grub.esp() { + local grubmodules=() + + # Prepare configuration files + _run_once _make_common_bootmode_grub_cfg + + # Create EFI binary + # Module list from https://bugs.archlinux.org/task/71382#comment202911 + grubmodules=(all_video at_keyboard boot btrfs cat chain configfile echo efifwsetup efinet exfat ext2 f2fs fat font \ + gfxmenu gfxterm gzio halt hfsplus iso9660 jpeg keylayouts linux loadenv loopback lsefi lsefimmap \ + minicmd normal ntfs ntfscomp part_apple part_gpt part_msdos png read reboot regexp search \ + search_fs_file search_fs_uuid search_label serial sleep tpm udf usb usbserial_common usbserial_ftdi \ + usbserial_pl2303 usbserial_usbdebug video xfs zstd) + grub-mkstandalone -O i386-efi \ + --modules="${grubmodules[*]}" \ + --locales="en@quot" \ + --themes="" \ + --disable-shim-lock \ + -o "${work_dir}/BOOTIA32.EFI" "boot/grub/grub.cfg=${work_dir}/grub-embed.cfg" + # Add GRUB to the list of files used to calculate the required FAT image size. + efiboot_files+=("${work_dir}/BOOTIA32.EFI" + "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi") + + if [[ " ${bootmodes[*]} " =~ uefi-x64.systemd-boot.esp ]]; then + # TODO: Remove this branch. + _run_once _make_bootmode_uefi-x64.systemd-boot.esp + elif [[ " ${bootmodes[*]} " =~ uefi-x64.grub.esp ]]; then + _run_once _make_bootmode_uefi-x64.grub.esp + else + efiboot_imgsize="$(du -bcs -- "${efiboot_files[@]}" 2>/dev/null | awk 'END { print $1 }')" + # Create a FAT image for the EFI system partition + _make_efibootimg "$efiboot_imgsize" + fi + + # Copy GRUB EFI binary to the default/fallback boot path + mcopy -i "${efibootimg}" "${work_dir}/BOOTIA32.EFI" ::/EFI/BOOT/BOOTIA32.EFI + + # Copy GRUB files + _run_once _make_common_bootmode_grub_copy_to_isofs + + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ]]; then + mcopy -i "${efibootimg}" "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ::/shellia32.efi + fi + + _msg_info "Done! GRUB set up for UEFI booting successfully." +} + +# Prepare GRUB for El Torito booting +_make_bootmode_uefi-ia32.grub.eltorito() { + # El Torito UEFI boot requires an image containing the EFI system partition. + # uefi-ia32.grub.eltorito has the same requirements as uefi-ia32.grub.esp + _run_once _make_bootmode_uefi-ia32.grub.esp + + # Prepare configuration files + _run_once _make_common_bootmode_grub_cfg + + # Additionally set up systemd-boot in ISO 9660. This allows creating a medium for the live environment by using + # manual partitioning and simply copying the ISO 9660 file system contents. + # This is not related to El Torito booting and no firmware uses these files. + _msg_info "Preparing an /EFI directory for the ISO 9660 file system..." + install -d -m 0755 -- "${isofs_dir}/EFI/BOOT" + + # Copy GRUB EFI binary to the default/fallback boot path + install -m 0644 -- "${work_dir}/BOOTIA32.EFI" "${isofs_dir}/EFI/BOOT/BOOTIA32.EFI" + + # Copy GRUB configuration files + _run_once _make_common_bootmode_grub_copy_to_isofs # edk2-shell based UEFI shell - # shellx64.efi is picked up automatically when on / - if [[ -e "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then - install -m 0644 -- "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" "${isofs_dir}/shellx64.efi" + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ]]; then + install -m 0644 -- "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" "${isofs_dir}/shellia32.efi" fi + + _msg_info "Done!" } -# Prepare kernel/initramfs on efiboot.img -_make_boot_on_fat() { - _msg_info "Preparing kernel and initramfs for the FAT file system..." - mmd -i "${work_dir}/efiboot.img" \ - "::/${install_dir}" "::/${install_dir}/boot" "::/${install_dir}/boot/x86_64" - mcopy -i "${work_dir}/efiboot.img" "${airootfs_dir}/boot/vmlinuz-"* \ - "${airootfs_dir}/boot/initramfs-"*".img" "::/${install_dir}/boot/x86_64/" +_make_bootmode_uefi-x64.grub.esp() { + local grubmodules=() + + # Prepare configuration files + _run_once _make_common_bootmode_grub_cfg + + # Create EFI binary + # Module list from https://bugs.archlinux.org/task/71382#comment202911 + grubmodules=(all_video at_keyboard boot btrfs cat chain configfile echo efifwsetup efinet ext2 f2fs fat font \ + gfxmenu gfxterm gzio halt hfsplus iso9660 jpeg keylayouts linux loadenv loopback lsefi lsefimmap \ + minicmd normal part_apple part_gpt part_msdos png read reboot regexp search search_fs_file \ + search_fs_uuid search_label serial sleep tpm usb usbserial_common usbserial_ftdi usbserial_pl2303 \ + usbserial_usbdebug video xfs zstd) + grub-mkstandalone -O x86_64-efi \ + --modules="${grubmodules[*]}" \ + --locales="en@quot" \ + --themes="" \ + --disable-shim-lock \ + -o "${work_dir}/BOOTx64.EFI" "boot/grub/grub.cfg=${work_dir}/grub-embed.cfg" + # Add GRUB to the list of files used to calculate the required FAT image size. + efiboot_files+=("${work_dir}/BOOTx64.EFI" + "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi") + + efiboot_imgsize="$(du -bcs -- "${efiboot_files[@]}" 2>/dev/null | awk 'END { print $1 }')" + + # Create a FAT image for the EFI system partition + _make_efibootimg "$efiboot_imgsize" + + # Copy GRUB EFI binary to the default/fallback boot path + mcopy -i "${efibootimg}" "${work_dir}/BOOTx64.EFI" ::/EFI/BOOT/BOOTx64.EFI + + # Copy GRUB files + _run_once _make_common_bootmode_grub_copy_to_efibootimg + + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then + mcopy -i "${efibootimg}" "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi + fi + + # Add other aditional/extra files to ${install_dir}/boot/ + if [[ -e "${pacstrap_dir}/boot/memtest86+/memtest.efi" ]]; then + install -d -m 0755 -- "${isofs_dir}/boot/memtest86+/" + install -m 0644 -- "${pacstrap_dir}/boot/memtest86+/memtest.efi" "${isofs_dir}/boot/memtest86+/memtest.efi" + install -m 0644 -- "${pacstrap_dir}/usr/share/licenses/common/GPL2/license.txt" "${isofs_dir}/boot/memtest86+/" + fi + + _msg_info "Done! GRUB set up for UEFI booting successfully." +} + +# Prepare GRUB for El Torito booting +_make_bootmode_uefi-x64.grub.eltorito() { + # El Torito UEFI boot requires an image containing the EFI system partition. + # uefi-x64.grub.eltorito has the same requirements as uefi-x64.grub.esp + _run_once _make_bootmode_uefi-x64.grub.esp + + # Prepare configuration files + _run_once _make_common_bootmode_grub_cfg + + # Additionally set up systemd-boot in ISO 9660. This allows creating a medium for the live environment by using + # manual partitioning and simply copying the ISO 9660 file system contents. + # This is not related to El Torito booting and no firmware uses these files. + _msg_info "Preparing an /EFI directory for the ISO 9660 file system..." + install -d -m 0755 -- "${isofs_dir}/EFI/BOOT" + + # Copy GRUB EFI binary to the default/fallback boot path + install -m 0644 -- "${work_dir}/BOOTx64.EFI" "${isofs_dir}/EFI/BOOT/BOOTx64.EFI" + + # Copy GRUB files + _run_once _make_common_bootmode_grub_copy_to_isofs + + # edk2-shell based UEFI shell + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then + install -m 0644 -- "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" "${isofs_dir}/shellx64.efi" + fi + _msg_info "Done!" } -# Prepare efiboot.img::/EFI for EFI boot mode -_make_bootmode_uefi-x64.systemd-boot.esp() { - local efiboot_imgsize="0" - _msg_info "Setting up systemd-boot for UEFI booting..." - - # the required image size in KiB (rounded up to the next full MiB with an additional MiB for reserved sectors) - efiboot_imgsize="$(du -bc \ - "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" \ - "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" \ - "${profile}/efiboot/" \ - "${airootfs_dir}/boot/vmlinuz-"* \ - "${airootfs_dir}/boot/initramfs-"*".img" \ - 2>/dev/null | awk 'function ceil(x){return int(x)+(x>int(x))} - function byte_to_kib(x){return x/1024} - function mib_to_kib(x){return x*1024} - END {print mib_to_kib(ceil((byte_to_kib($1)+1024)/1024))}' - )" - # The FAT image must be created with mkfs.fat not mformat, as some systems have issues with mformat made images: - # https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html - [[ -e "${work_dir}/efiboot.img" ]] && rm -f -- "${work_dir}/efiboot.img" - _msg_info "Creating FAT image of size: ${efiboot_imgsize} KiB..." - mkfs.fat -C -n PARAISO_EFI "${work_dir}/efiboot.img" "$efiboot_imgsize" +_make_common_bootmode_systemd-boot() { + local _file efiboot_imgsize + + # Calculate the required FAT image size in bytes + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' || " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.eltorito ' ]]; then + efiboot_files+=("${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" + "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi") + fi + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-ia32.systemd-boot.esp ' || " ${bootmodes[*]} " =~ ' uefi-ia32.systemd-boot.eltorito ' ]]; then + efiboot_files+=("${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootia32.efi" + "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi") + fi + efiboot_files+=("${work_dir}/loader/" + "${pacstrap_dir}/boot/vmlinuz-"* + "${pacstrap_dir}/boot/initramfs-"*".img") + efiboot_imgsize="$(du -bcs -- "${efiboot_files[@]}" 2>/dev/null | awk 'END { print $1 }')" + # Create a FAT image for the EFI system partition + _make_efibootimg "$efiboot_imgsize" +} + +_make_common_bootmode_systemd-boot_conf() { + local _conf - mmd -i "${work_dir}/efiboot.img" ::/EFI ::/EFI/BOOT - mcopy -i "${work_dir}/efiboot.img" \ - "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" ::/EFI/BOOT/BOOTx64.EFI + install -d -m 0755 -- "${work_dir}/loader" "${work_dir}/loader/entries" - mmd -i "${work_dir}/efiboot.img" ::/loader ::/loader/entries - mcopy -i "${work_dir}/efiboot.img" "${profile}/efiboot/loader/loader.conf" ::/loader/ + install -m 0644 -- "${profile}/efiboot/loader/loader.conf" "${work_dir}/loader" for _conf in "${profile}/efiboot/loader/entries/"*".conf"; do sed "s|%PARABOLAISO_LABEL%|${iso_label}|g; + s|%PARABOLAISO_UUID%|${iso_uuid}|g; s|%INSTALL_DIR%|${install_dir}|g; s|%ARCH%|${arch}|g" \ - "${_conf}" | mcopy -i "${work_dir}/efiboot.img" - "::/loader/entries/${_conf##*/}" + "${_conf}" >"${work_dir}/loader/entries/${_conf##*/}" done +} - # shellx64.efi is picked up automatically when on / - if [[ -e "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then - mcopy -i "${work_dir}/efiboot.img" \ - "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi - fi - - # Copy kernel and initramfs - _make_boot_on_fat +# Copy systemd-boot configuration files to ISO 9660 +_make_common_bootmode_systemd-boot_conf.isofs() { + cp -r --remove-destination -- "${work_dir}/loader" "${isofs_dir}/" +} - _msg_info "Done! systemd-boot set up for UEFI booting successfully." +# Copy systemd-boot configuration files to FAT image +_make_common_bootmode_systemd-boot_conf.esp() { + mcopy -i "${efibootimg}" -s "${work_dir}/loader" ::/ } -_make_bootmode_uefi-x64.refind.esp() { - local efiboot_imgsize="0" - _msg_info "Setting up rEFInd for UEFI booting..." +# Prepare systemd-boot for booting when written to a disk (isohybrid) +_make_bootmode_uefi-x64.systemd-boot.esp() { + _msg_info "Setting up systemd-boot for x64 UEFI booting..." - # the required image size in KiB (rounded up to the next full MiB with an additional MiB for reserved sectors) - efiboot_imgsize="$(du -bc \ - "${airootfs_dir}/usr/share/refind/refind_x64.efi" \ - "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" \ - "${profile}/efiboot/" \ - "${airootfs_dir}/boot/vmlinuz-"* \ - "${airootfs_dir}/boot/initramfs-"*".img" \ - 2>/dev/null | awk 'function ceil(x){return int(x)+(x>int(x))} - function byte_to_kib(x){return x/1024} - function mib_to_kib(x){return x*1024} - END {print mib_to_kib(ceil((byte_to_kib($1)+1024)/1024))}' - )" - # The FAT image must be created with mkfs.fat not mformat, as some systems have issues with mformat made images: - # https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html - [[ -e "${work_dir}/efiboot.img" ]] && rm -f -- "${work_dir}/efiboot.img" - _msg_info "Creating FAT image of size: ${efiboot_imgsize} KiB..." - mkfs.fat -C -n PARAISO_EFI "${work_dir}/efiboot.img" "$efiboot_imgsize" + # Prepare configuration files + _run_once _make_common_bootmode_systemd-boot_conf - mmd -i "${work_dir}/efiboot.img" ::/EFI ::/EFI/BOOT - mcopy -i "${work_dir}/efiboot.img" \ - "${airootfs_dir}/usr/share/refind/refind_x64.efi" ::/EFI/BOOT/BOOTx64.EFI + # Prepare a FAT image for the EFI system partition + _run_once _make_common_bootmode_systemd-boot - mmd -i "${work_dir}/efiboot.img" ::/EFI/BOOT/entries - mcopy -i "${work_dir}/efiboot.img" "${profile}/efiboot/EFI/BOOT/refind.conf" ::/EFI/BOOT/ - for _conf in "${profile}/efiboot/EFI/BOOT/entries/"*".conf"; do - sed "s|%PARABOLAISO_LABEL%|${iso_label}|g; - s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" \ - "${_conf}" | mcopy -i "${work_dir}/efiboot.img" - "::/EFI/BOOT/entries/${_conf##*/}" - done + # Copy systemd-boot EFI binary to the default/fallback boot path + mcopy -i "${efibootimg}" \ + "${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" ::/EFI/BOOT/BOOTx64.EFI + + # Copy systemd-boot configuration files + _run_once _make_common_bootmode_systemd-boot_conf.esp # shellx64.efi is picked up automatically when on / - if [[ -e "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then - mcopy -i "${work_dir}/efiboot.img" \ - "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then + mcopy -i "${efibootimg}" \ + "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi fi - # Copy kernel and initramfs - _make_boot_on_fat + # Copy kernel and initramfs to FAT image. + # systemd-boot can only access files from the EFI system partition it was launched from. + _run_once _make_boot_on_fat - _msg_info "Done! rEFInd set up for UEFI booting successfully." + _msg_info "Done! systemd-boot set up for x64 UEFI booting successfully." } -# Prepare efiboot.img::/EFI for "El Torito" EFI boot mode +# Prepare systemd-boot for El Torito booting _make_bootmode_uefi-x64.systemd-boot.eltorito() { + # Prepare configuration files + _run_once _make_common_bootmode_systemd-boot_conf + + # El Torito UEFI boot requires an image containing the EFI system partition. + # uefi-x64.systemd-boot.eltorito has the same requirements as uefi-x64.systemd-boot.esp _run_once _make_bootmode_uefi-x64.systemd-boot.esp - # Set up /EFI on ISO-9660 to allow preparing an installation medium by manually copying files - _run_once _make_efi_dir_on_iso9660 + + # Additionally set up systemd-boot in ISO 9660. This allows creating a medium for the live environment by using + # manual partitioning and simply copying the ISO 9660 file system contents. + # This is not related to El Torito booting and no firmware uses these files. + _msg_info "Preparing an /EFI directory for the ISO 9660 file system..." + install -d -m 0755 -- "${isofs_dir}/EFI/BOOT" + + # Copy systemd-boot EFI binary to the default/fallback boot path + install -m 0644 -- "${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" \ + "${isofs_dir}/EFI/BOOT/BOOTx64.EFI" + + # Copy systemd-boot configuration files + _run_once _make_common_bootmode_systemd-boot_conf.isofs + + # edk2-shell based UEFI shell + # shellx64.efi is picked up automatically when on / + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then + install -m 0644 -- "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" "${isofs_dir}/shellx64.efi" + fi + + _msg_info "Done!" +} + +_make_bootmode_uefi-ia32.systemd-boot.esp() { + _msg_info "Setting up systemd-boot for IA32 UEFI booting..." + + # Prepare configuration files + _run_once _make_common_bootmode_systemd-boot_conf + + # Prepare a FAT image for the EFI system partition + _run_once _make_common_bootmode_systemd-boot + + # Copy systemd-boot EFI binary to the default/fallback boot path + mcopy -i "${efibootimg}" \ + "${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootia32.efi" ::/EFI/BOOT/BOOTIA32.EFI + + # Copy systemd-boot configuration files + _run_once _make_common_bootmode_systemd-boot_conf.esp + + # shellia32.efi is picked up automatically when on / + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ]]; then + mcopy -i "${efibootimg}" \ + "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ::/shellia32.efi + fi + + # Copy kernel and initramfs to FAT image. + # systemd-boot can only access files from the EFI system partition it was launched from. + _run_once _make_boot_on_fat + + _msg_info "Done! systemd-boot set up for IA32 UEFI booting successfully." } -_make_bootmode_uefi-x64.refind.eltorito() { - _run_once _make_bootmode_uefi-x64.refind.esp - # Set up /EFI on ISO-9660 to allow preparing an installation medium by manually copying files - _run_once _make_refind_efi_dir_on_iso9660 +_make_bootmode_uefi-ia32.systemd-boot.eltorito() { + # Prepare configuration files + _run_once _make_common_bootmode_systemd-boot_conf + + # El Torito UEFI boot requires an image containing the EFI system partition. + # uefi-ia32.systemd-boot.eltorito has the same requirements as uefi-ia32.systemd-boot.esp + _run_once _make_bootmode_uefi-ia32.systemd-boot.esp + + # Additionally set up systemd-boot in ISO 9660. This allows creating a medium for the live environment by using + # manual partitioning and simply copying the ISO 9660 file system contents. + # This is not related to El Torito booting and no firmware uses these files. + _msg_info "Preparing an /EFI directory for the ISO 9660 file system..." + install -d -m 0755 -- "${isofs_dir}/EFI/BOOT" + + # Copy systemd-boot EFI binary to the default/fallback boot path + install -m 0644 -- "${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootia32.efi" \ + "${isofs_dir}/EFI/BOOT/BOOTIA32.EFI" + + # Copy systemd-boot configuration files + _run_once _make_common_bootmode_systemd-boot_conf.isofs + + # edk2-shell based UEFI shell + # shellia32.efi is picked up automatically when on / + if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ]]; then + install -m 0644 -- "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" "${isofs_dir}/shellia32.efi" + fi + + _msg_info "Done!" } _validate_requirements_bootmode_bios.syslinux.mbr() { @@ -661,18 +1062,20 @@ _validate_requirements_bootmode_bios.syslinux.mbr() { } _validate_requirements_bootmode_bios.syslinux.eltorito() { + # bios.syslinux.eltorito has the exact same requirements as bios.syslinux.mbr _validate_requirements_bootmode_bios.syslinux.mbr } -_validate_requirements_bootmode_uefi-x64.systemd-boot.esp() { +_validate_requirements_common_systemd-boot() { # Check if mkfs.fat is available - if ! command -v mkfs.fat &> /dev/null; then + if ! command -v mkfs.fat &>/dev/null; then (( validation_error=validation_error+1 )) _msg_error "Validating '${bootmode}': mkfs.fat is not available on this host. Install 'dosfstools'!" 0 fi # Check if mmd and mcopy are available - if ! { command -v mmd &> /dev/null && command -v mcopy &> /dev/null; }; then + if ! { command -v mmd &>/dev/null && command -v mcopy &>/dev/null; }; then + (( validation_error=validation_error+1 )) _msg_error "Validating '${bootmode}': mmd and/or mcopy are not available on this host. Install 'mtools'!" 0 fi @@ -698,90 +1101,221 @@ _validate_requirements_bootmode_uefi-x64.systemd-boot.esp() { # Check for optional packages # shellcheck disable=SC2076 - if [[ "${arch}" == "dual" ]]; then - if [[ ! " ${pkg_list_x86_64[*]} " =~ ' edk2-shell ' ]]; then - _msg_info "'edk2-shell' is not in the x86_64 package list. The ISO will not contain a bootable UEFI shell." - fi + if [[ ! " ${pkg_list[*]} " =~ ' edk2-shell ' ]]; then + _msg_info "'edk2-shell' is not in the package list. The ISO will not contain a bootable UEFI shell." + fi +} + +_validate_requirements_bootmode_uefi-x64.systemd-boot.esp() { + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.grub.esp ' ]]; then + _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-x64.grub.esp!" 0 + fi + _validate_requirements_common_systemd-boot +} + +_validate_requirements_bootmode_uefi-x64.systemd-boot.eltorito() { + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.grub.eltorito ' ]]; then + _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-x64.grub.eltorito!" 0 + fi + + # uefi-x64.systemd-boot.eltorito has the exact same requirements as uefi-x64.systemd-boot.esp + _validate_requirements_bootmode_uefi-x64.systemd-boot.esp +} + +_validate_requirements_bootmode_uefi-ia32.systemd-boot.esp() { + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-ia32.grub.esp ' ]]; then + _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-ia32.grub.esp!" 0 + fi + + _validate_requirements_common_systemd-boot +} + +_validate_requirements_bootmode_uefi-ia32.systemd-boot.eltorito() { + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-ia32.grub.eltorito ' ]]; then + _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-ia32.grub.eltorito!" 0 + fi + + # uefi-ia32.systemd-boot.eltorito has the exact same requirements as uefi-ia32.systemd-boot.esp + _validate_requirements_bootmode_uefi-x64.systemd-boot.esp +} + +_validate_requirements_bootmode_uefi-ia32.grub.esp() { + # Check if GRUB is available + if ! command -v grub-mkstandalone &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating '${bootmode}': grub-install is not available on this host. Install 'grub'!" 0 + fi + + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' ]]; then + _validate_requirements_bootmode_uefi-x64.systemd-boot.esp + elif [[ " ${bootmodes[*]} " =~ ' uefi-x64.grub.esp ' ]]; then + _validate_requirements_bootmode_uefi-x64.grub.esp else - if [[ ! " ${pkg_list[*]} " =~ ' edk2-shell ' ]]; then - _msg_info "'edk2-shell' is not in the package list. The ISO will not contain a bootable UEFI shell." - fi + _msg_error "Validating '${bootmode}': requires one of bootmode uefi-x64.systemd-boot.esp or uefi-x64.grub.esp" 0 fi } -_validate_requirements_bootmode_uefi-x64.refind.esp() { - # Check if mkfs.fat is available - if ! command -v mkfs.fat &> /dev/null; then +_validate_requirements_bootmode_uefi-ia32.grub.eltorito() { + # uefi-ia32.grub.eltorito has the exact same requirements as uefi-ia32.grub.esp + _validate_requirements_bootmode_uefi-ia32.grub.esp +} + +_validate_requirements_bootmode_uefi-x64.grub.esp() { + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' ]]; then + _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-x64.systemd-boot.esp!" 0 + fi + + # Check if GRUB is available + if ! command -v grub-mkstandalone &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating '${bootmode}': grub-install is not available on this host. Install 'grub'!" 0 + fi + + # Check if mkfs.fat is available + if ! command -v mkfs.fat &>/dev/null; then (( validation_error=validation_error+1 )) _msg_error "Validating '${bootmode}': mkfs.fat is not available on this host. Install 'dosfstools'!" 0 fi # Check if mmd and mcopy are available - if ! { command -v mmd &> /dev/null && command -v mcopy &> /dev/null; }; then + if ! { command -v mmd &>/dev/null && command -v mcopy &>/dev/null; }; then _msg_error "Validating '${bootmode}': mmd and/or mcopy are not available on this host. Install 'mtools'!" 0 fi - # Check if rEFInd configuration files exist - if [[ ! -d "${profile}/efiboot/EFI/BOOT/entries" ]]; then + # Check if GRUB configuration files exist + if [[ ! -d "${profile}/grub" ]]; then (( validation_error=validation_error+1 )) - _msg_error "Validating '${bootmode}': The '${profile}/efiboot/EFI/BOOT/entries' directory is missing!" 0 + _msg_error "Validating '${bootmode}': The '${profile}/grub' directory is missing!" 0 else - if [[ ! -e "${profile}/efiboot/EFI/BOOT/refind.conf" ]]; then + if [[ ! -e "${profile}/grub/grub.cfg" ]]; then (( validation_error=validation_error+1 )) - _msg_error "Validating '${bootmode}': File '${profile}/efiboot/EFI/BOOT/refind.conf' not found!" 0 + _msg_error "Validating '${bootmode}': File '${profile}/grub/grub.cfg' not found!" 0 fi local conffile - for conffile in "${profile}/efiboot/EFI/BOOT/entries/"*'.conf'; do + for conffile in "${profile}/grub/"*'.cfg'; do if [[ -e "${conffile}" ]]; then break else (( validation_error=validation_error+1 )) - _msg_error "Validating '${bootmode}': No configuration file found in '${profile}/efiboot/EFI/BOOT/entries/'!" 0 + _msg_error "Validating '${bootmode}': No configuration file found in '${profile}/grub/'!" 0 fi done fi # Check for optional packages # shellcheck disable=SC2076 - if [[ "${arch}" == "dual" ]]; then - if [[ ! " ${pkg_list_x86_64[*]} " =~ ' edk2-shell ' ]]; then - _msg_info "'edk2-shell' is not in the x86_64 package list. The ISO will not contain a bootable UEFI shell." - fi - else - if [[ ! " ${pkg_list[*]} " =~ ' edk2-shell ' ]]; then - _msg_info "'edk2-shell' is not in the package list. The ISO will not contain a bootable UEFI shell." - fi + if [[ ! " ${pkg_list[*]} " =~ ' edk2-shell ' ]]; then + _msg_info "'edk2-shell' is not in the package list. The ISO will not contain a bootable UEFI shell." + fi + # shellcheck disable=SC2076 + if [[ ! " ${pkg_list[*]} " =~ ' memtest86+-efi ' ]]; then + _msg_info "Validating '${bootmode}': 'memtest86+-efi' is not in the package list. Memory testing will not be available from GRUB." fi } -_validate_requirements_bootmode_uefi-x64.systemd-boot.eltorito() { - # uefi-x64.systemd-boot.eltorito has the exact same requirements as uefi-x64.systemd-boot.esp - _validate_requirements_bootmode_uefi-x64.systemd-boot.esp -} - -_validate_requirements_bootmode_uefi-x64.refind.eltorito() { - # uefi-x64.refind.eltorito has the exact same requirements as uefi-x64.refind.esp - _validate_requirements_bootmode_uefi-x64.refind.esp +_validate_requirements_bootmode_uefi-x64.grub.eltorito() { + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.eltorito ' ]]; then + _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-x64.systemd-boot.eltorito!" 0 + fi + # uefi-x64.grub.eltorito has the exact same requirements as uefi-x64.grub.esp + _validate_requirements_bootmode_uefi-x64.grub.esp } # Build airootfs filesystem image _prepare_airootfs_image() { _run_once "_mkairootfs_${airootfs_image_type}" _mkchecksum + + if [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" ]]; then + airootfs_image_filename="${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" + elif [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" ]]; then + airootfs_image_filename="${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" + fi + if [[ -n "${gpg_key}" ]]; then - _mksignature + _mk_pgp_signature "${airootfs_image_filename}" + fi + if [[ -v cert_list ]]; then + _cms_sign_artifact "${airootfs_image_filename}" fi } +# export build artifacts for netboot +_export_netboot_artifacts() { + _msg_info "Exporting netboot artifacts..." + install -d -m 0755 "${out_dir}" + cp -a -- "${isofs_dir}/${install_dir}/" "${out_dir}/" + + # Remove grubenv since it serves no purpose in netboot artifacts + rm -f -- "${out_dir}/${install_dir}/grubenv" + + _msg_info "Done!" + du -hs -- "${out_dir}/${install_dir}" +} + +_cms_sign_artifact() { + local artifact="${1}" + local openssl_flags=( + "-sign" + "-binary" + "-nocerts" + "-noattr" + "-outform" "DER" "-out" "${artifact}.cms.sig" + "-in" "${artifact}" + "-signer" "${cert_list[0]}" + "-inkey" "${cert_list[1]}" + ) + + if (( ${#cert_list[@]} > 2 )); then + openssl_flags+=("-certfile" "${cert_list[2]}") + fi + + _msg_info "Signing ${artifact} image using openssl cms..." + + rm -f -- "${artifact}.cms.sig" + + openssl cms "${openssl_flags[@]}" + + _msg_info "Done!" +} + +# sign build artifacts for netboot +_sign_netboot_artifacts() { + local _file _dir + local _files_to_sign=() + _msg_info "Signing netboot artifacts..." + _dir="${isofs_dir}/${install_dir}/boot/" + for _file in "${_files_to_sign[@]}" "${_dir}${arch}/vmlinuz-"!(*.sig) "${_dir}${arch}/initramfs-"*.img; do + rm -f -- "${_file}".ipxe.sig + openssl cms \ + -sign \ + -binary \ + -noattr \ + -in "${_file}" \ + -signer "${cert_list[0]}" \ + -inkey "${cert_list[1]}" \ + -outform DER \ + -out "${_file}".ipxe.sig + done + _msg_info "Done!" +} + _validate_requirements_airootfs_image_type_squashfs() { - if ! command -v mksquashfs &> /dev/null; then + if ! command -v mksquashfs &>/dev/null; then (( validation_error=validation_error+1 )) _msg_error "Validating '${airootfs_image_type}': mksquashfs is not available on this host. Install 'squashfs-tools'!" 0 fi } _validate_requirements_airootfs_image_type_ext4+squashfs() { - if ! { command -v mkfs.ext4 &> /dev/null && command -v tune2fs &> /dev/null; }; then + if ! { command -v mkfs.ext4 &>/dev/null && command -v tune2fs &>/dev/null; }; then (( validation_error=validation_error+1 )) _msg_error "Validating '${airootfs_image_type}': mkfs.ext4 and/or tune2fs is not available on this host. Install 'e2fsprogs'!" 0 fi @@ -789,64 +1323,267 @@ _validate_requirements_airootfs_image_type_ext4+squashfs() { } _validate_requirements_airootfs_image_type_erofs() { - if ! command -v mkfs.erofs; then + if ! command -v mkfs.erofs &>/dev/nul; then (( validation_error=validation_error+1 )) _msg_error "Validating '${airootfs_image_type}': mkfs.erofs is not available on this host. Install 'erofs-utils'!" 0 fi } +_validate_common_requirements_buildmode_all() { + if ! command -v pacman &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating build mode '${_buildmode}': pacman is not available on this host. Install 'pacman'!" 0 + fi + if ! command -v find &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating build mode '${_buildmode}': find is not available on this host. Install 'findutils'!" 0 + fi + if ! command -v gzip &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating build mode '${_buildmode}': gzip is not available on this host. Install 'gzip'!" 0 + fi +} + +_validate_requirements_buildmode_bootstrap() { + local bootstrap_pkg_list_from_file=() + + if [[ "${arch}" == "dual" ]]; then + # Check if packages for the bootstrap image are specified for each architecture + for bootstrap_packages in ${bootstrap_packages_dual}; do + if [[ "${bootstrap_packages##*/}" == "bootstrap_packages.both" ]]; then + if [[ -e "${bootstrap_packages}" ]]; then + mapfile -t bootstrap_pkg_list_from_file < \ + <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${bootstrap_packages}") + bootstrap_pkg_list+=("${bootstrap_pkg_list_from_file[@]}") + if (( ${#bootstrap_pkg_list_from_file[@]} < 1 )); then + (( validation_error=validation_error+1 )) + _msg_error "No package specified in '${bootstrap_packages}'." 0 + fi + else + (( validation_error=validation_error+1 )) + _msg_error "Bootstrap packages file '${bootstrap_packages}' does not exist." 0 + fi + elif [[ -e "${bootstrap_packages}" ]]; then + mapfile -t "bootstrap_pkg_list_from_file_${bootstrap_packages##*.}" < \ + <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${bootstrap_packages}") + eval "bootstrap_pkg_list_${bootstrap_packages##*.}+=(\${bootstrap_pkg_list_from_file_${bootstrap_packages##*.}[@]})" + fi + done + else + # Check if packages for the bootstrap image are specified + if [[ -e "${bootstrap_packages}" ]]; then + mapfile -t bootstrap_pkg_list_from_file < \ + <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${bootstrap_packages}") + bootstrap_pkg_list+=("${bootstrap_pkg_list_from_file[@]}") + if (( ${#bootstrap_pkg_list_from_file[@]} < 1 )); then + (( validation_error=validation_error+1 )) + _msg_error "No package specified in '${bootstrap_packages}'." 0 + fi + else + (( validation_error=validation_error+1 )) + _msg_error "Bootstrap packages file '${bootstrap_packages}' does not exist." 0 + fi + fi + + _validate_common_requirements_buildmode_all + if ! command -v bsdtar &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating build mode '${_buildmode}': bsdtar is not available on this host. Install 'libarchive'!" 0 + fi + + if [[ "${arch}" == "armv7h" ]] && ! setarch armv7l /bin/true &>/dev/null; then + if ! command -v qemu-arm-static &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating build mode '${_buildmode}': qemu-arm-static is not available on this host. Install 'qemu-user-static'!" 0 + fi + fi +} + +_validate_common_requirements_buildmode_iso_netboot() { + local bootmode + local pkg_list_from_file=() + + # Check if the package list file exists and read packages from it + if [[ "${arch}" == "dual" ]]; then + # Check if the package list files exist and read packages from them for each architecture + for packages in ${packages_dual}; do + if [[ "${packages##*/}" == "packages.both" ]]; then + if [[ -e "${packages}" ]]; then + mapfile -t pkg_list_from_file < <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${packages}") + pkg_list+=("${pkg_list_from_file[@]}") + if (( ${#pkg_list_from_file[@]} < 1 )); then + (( validation_error=validation_error+1 )) + _msg_error "Packages file '${packages}' does not exist." 0 + fi + else + (( validation_error=validation_error+1 )) + _msg_error "Packages file '${packages}' does not exist." 0 + fi + elif [[ -e "${packages}" ]]; then + mapfile -t "pkg_list_from_file_${packages##*.}" < <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${packages}") + eval "pkg_list_${packages##*.}+=(\${pkg_list_from_file_${packages##*.}[@]})" + fi + done + else + # Check if the package list file exists and read packages from it + if [[ -e "${packages}" ]]; then + mapfile -t pkg_list_from_file < <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${packages}") + pkg_list+=("${pkg_list_from_file[@]}") + if (( ${#pkg_list_from_file[@]} < 1 )); then + (( validation_error=validation_error+1 )) + _msg_error "Packages file '${packages}' does not exist." 0 + fi + else + (( validation_error=validation_error+1 )) + _msg_error "Packages file '${packages}' does not exist." 0 + fi + fi + + if [[ -v cert_list ]]; then + # Check if the certificate files exist + for _cert in "${cert_list[@]}"; do + if [[ ! -e "${_cert}" ]]; then + (( validation_error=validation_error+1 )) + _msg_error "File '${_cert}' does not exist." 0 + fi + done + # Check if there are at least three certificate files to sign netboot and rootfs. + if (( ${#cert_list[@]} < 2 )); then + (( validation_error=validation_error+1 )) + _msg_error "Two certificates are required for codesigning netboot artifacts, but '${cert_list[*]}' is provided." 0 + fi + + if ! command -v openssl &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating build mode '${_buildmode}': openssl is not available on this host. Install 'openssl'!" 0 + fi + fi + + # Check if the specified airootfs_image_type is supported + if typeset -f "_mkairootfs_${airootfs_image_type}" &>/dev/null; then + if typeset -f "_validate_requirements_airootfs_image_type_${airootfs_image_type}" &>/dev/null; then + "_validate_requirements_airootfs_image_type_${airootfs_image_type}" + else + _msg_warning "Function '_validate_requirements_airootfs_image_type_${airootfs_image_type}' does not exist. Validating the requirements of '${airootfs_image_type}' airootfs image type will not be possible." + fi + else + (( validation_error=validation_error+1 )) + _msg_error "Unsupported image type: '${airootfs_image_type}'" 0 + fi +} + +_validate_requirements_buildmode_iso() { + _validate_common_requirements_buildmode_iso_netboot + _validate_common_requirements_buildmode_all + # Check if the specified bootmodes are supported + if (( ${#bootmodes[@]} < 1 )); then + (( validation_error=validation_error+1 )) + _msg_error "No boot modes specified in '${profile}/profiledef.sh'." 0 + fi + for bootmode in "${bootmodes[@]}"; do + if typeset -f "_make_bootmode_${bootmode}" &>/dev/null; then + if typeset -f "_validate_requirements_bootmode_${bootmode}" &>/dev/null; then + "_validate_requirements_bootmode_${bootmode}" + else + _msg_warning "Function '_validate_requirements_bootmode_${bootmode}' does not exist. Validating the requirements of '${bootmode}' boot mode will not be possible." + fi + else + (( validation_error=validation_error+1 )) + _msg_error "${bootmode} is not a valid boot mode!" 0 + fi + done + + if ! command -v awk &>/dev/null; then + (( validation_error=validation_error+1 )) + _msg_error "Validating build mode '${_buildmode}': awk is not available on this host. Install 'awk'!" 0 + fi +} + +_validate_requirements_buildmode_netboot() { + _validate_common_requirements_buildmode_iso_netboot + _validate_common_requirements_buildmode_all +} + # SYSLINUX El Torito _add_xorrisofs_options_bios.syslinux.eltorito() { xorrisofs_options+=( # El Torito boot image for x86 BIOS - '-eltorito-boot' 'syslinux/isolinux.bin' + '-eltorito-boot' 'boot/syslinux/isolinux.bin' # El Torito boot catalog file - '-eltorito-catalog' 'syslinux/boot.cat' + '-eltorito-catalog' 'boot/syslinux/boot.cat' # Required options to boot with ISOLINUX '-no-emul-boot' '-boot-load-size' '4' '-boot-info-table' ) } -# SYSLINUX MBR +# SYSLINUX MBR (isohybrid) _add_xorrisofs_options_bios.syslinux.mbr() { xorrisofs_options+=( # SYSLINUX MBR bootstrap code; does not work without "-eltorito-boot syslinux/isolinux.bin" - '-isohybrid-mbr' "${isofs_dir}/syslinux/isohdpfx.bin" + '-isohybrid-mbr' "${isofs_dir}/boot/syslinux/isohdpfx.bin" # When GPT is used, create an additional partition in the MBR (besides 0xEE) for sectors 0–1 (MBR # bootstrap code area) and mark it as bootable - # This violates the UEFI specification, but may allow booting on some systems - # https://wiki.archlinux.org/index.php/Partitioning#Tricking_old_BIOS_into_booting_from_GPT + # May allow booting on some systems + # https://wiki.archlinux.org/title/Partitioning#Tricking_old_BIOS_into_booting_from_GPT '--mbr-force-bootable' - # Set the ISO 9660 partition's type to "Linux filesystem data" - # When only MBR is present, the partition type ID will be 0x83 "Linux" as xorriso translates all - # GPT partition type GUIDs except for the ESP GUID to MBR type ID 0x83 - '-iso_mbr_part_type' '0FC63DAF-8483-4772-8E79-3D69D8477DE4' - # Move the first partition away from the start of the ISO to match the expectations of partition - # editors + # Move the first partition away from the start of the ISO to match the expectations of partition editors # May allow booting on some systems # https://dev.lovelyhq.com/libburnia/libisoburn/src/branch/master/doc/partition_offset.wiki '-partition_offset' '16' ) } +# GRUB in an attached EFI system partition +_add_xorrisofs_options_uefi-ia32.grub.esp() { + # TODO: how does the bootmodes systemd-boot vs x64.grub affect ${bootmodes[*]} tests in _add_xorrisofs_options_uefi-x64.systemd-boot.esp etc? + # shellcheck disable=SC2076 + if [[ ! " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' && ! " ${bootmodes[*]} " =~ ' uefi-x64.grub.esp ' ]]; then + # _add_xorrisofs_options_uefi-x64.systemd-boot.esp + _add_xorrisofs_options_uefi-x64.grub.esp + fi +} + +# GRUB via El Torito +_add_xorrisofs_options_uefi-ia32.grub.eltorito() { + # shellcheck disable=SC2076 + if [[ ! " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.eltorito ' && ! " ${bootmodes[*]} " =~ ' uefi-x64.grub.eltorito ' ]]; then + # _add_xorrisofs_options_uefi-x64.systemd-boot.eltorito + _add_xorrisofs_options_uefi-x64.grub.eltorito + fi +} + # systemd-boot in an attached EFI system partition _add_xorrisofs_options_uefi-x64.systemd-boot.esp() { # Move the first partition away from the start of the ISO, otherwise the GPT will not be valid and ISO 9660 # partition will not be mountable # shellcheck disable=SC2076 [[ " ${xorrisofs_options[*]} " =~ ' -partition_offset ' ]] || xorrisofs_options+=('-partition_offset' '16') - xorrisofs_options+=( - # Attach efiboot.img as a second partition and set its partition type to "EFI system partition" - '-append_partition' '2' 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B' "${work_dir}/efiboot.img" - # Ensure GPT is used as some systems do not support UEFI booting without it - '-appended_part_as_gpt' - ) + # Attach efiboot.img as a second partition and set its partition type to "EFI system partition" + xorrisofs_options+=('-append_partition' '2' 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B' "${efibootimg}") + # Ensure GPT is used as some systems do not support UEFI booting without it + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' bios.syslinux.mbr ' ]]; then + # A valid GPT prevents BIOS booting on some systems, instead use an invalid GPT (without a protective MBR). + # The attached partition will have the EFI system partition type code in MBR, but in the invalid GPT it will + # have a Microsoft basic partition type code. + if [[ ! " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.eltorito ' && ! " ${bootmodes[*]} " =~ ' uefi-ia32.grub.eltorito ' ]]; then + # If '-isohybrid-gpt-basdat' is specified before '-e', then the appended EFI system partition will have the + # EFI system partition type ID/GUID in both MBR and GPT. If '-isohybrid-gpt-basdat' is specified after '-e', + # the appended EFI system partition will have the Microsoft basic data type GUID in GPT. + if [[ ! " ${xorrisofs_options[*]} " =~ ' -isohybrid-gpt-basdat ' ]]; then + xorrisofs_options+=('-isohybrid-gpt-basdat') + fi + fi + else + # Use valid GPT if BIOS booting support will not be required + xorrisofs_options+=('-appended_part_as_gpt') + fi } # systemd-boot via El Torito _add_xorrisofs_options_uefi-x64.systemd-boot.eltorito() { # shellcheck disable=SC2076 - if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' ]]; then + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' || " ${bootmodes[*]} " =~ ' uefi-ia32.grub.esp ' ]]; then # systemd-boot in an attached EFI system partition via El Torito xorrisofs_options+=( # Start a new El Torito boot entry for UEFI @@ -856,11 +1593,20 @@ _add_xorrisofs_options_uefi-x64.systemd-boot.eltorito() { # Boot image is not emulating floppy or hard disk; required for all known boot loaders '-no-emul-boot' ) + # A valid GPT prevents BIOS booting on some systems, use an invalid GPT instead. + if [[ " ${bootmodes[*]} " =~ ' bios.syslinux.mbr ' ]]; then + # If '-isohybrid-gpt-basdat' is specified before '-e', then the appended EFI system partition will have the + # EFI system partition type ID/GUID in both MBR and GPT. If '-isohybrid-gpt-basdat' is specified after '-e', + # the appended EFI system partition will have the Microsoft basic data type GUID in GPT. + if [[ ! " ${xorrisofs_options[*]} " =~ ' -isohybrid-gpt-basdat ' ]]; then + xorrisofs_options+=('-isohybrid-gpt-basdat') + fi + fi else # The ISO will not contain a GPT partition table, so to be able to reference efiboot.img, place it as a # file inside the ISO 9660 file system install -d -m 0755 -- "${isofs_dir}/EFI/parabolaiso" - cp -a -- "${work_dir}/efiboot.img" "${isofs_dir}/EFI/parabolaiso/efiboot.img" + cp -a -- "${efibootimg}" "${isofs_dir}/EFI/parabolaiso/efiboot.img" # systemd-boot in an embedded efiboot.img via El Torito xorrisofs_options+=( # Start a new El Torito boot entry for UEFI @@ -876,17 +1622,41 @@ _add_xorrisofs_options_uefi-x64.systemd-boot.eltorito() { [[ " ${bootmodes[*]} " =~ ' bios.' ]] || xorrisofs_options+=('-eltorito-catalog' 'EFI/boot.cat') } -# rEFInd in an attached EFI system partition -_add_xorrisofs_options_uefi-x64.refind.esp() { - # _add_xorrisofs_options_uefi-x64.refind.esp does the exact same thing as _add_xorrisofs_options_uefi-x64.systemd-boot.esp - _add_xorrisofs_options_uefi-x64.systemd-boot.esp +# GRUB in an attached EFI system partition. +# Same as _add_xorrisofs_options_uefi-x64.systemd-boot.esp. +_add_xorrisofs_options_uefi-x64.grub.esp() { + # Move the first partition away from the start of the ISO, otherwise the GPT will not be valid and ISO 9660 + # partition will not be mountable + # shellcheck disable=SC2076 + [[ " ${xorrisofs_options[*]} " =~ ' -partition_offset ' ]] || xorrisofs_options+=('-partition_offset' '16') + # Attach efiboot.img as a second partition and set its partition type to "EFI system partition" + xorrisofs_options+=('-append_partition' '2' 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B' "${efibootimg}") + # Ensure GPT is used as some systems do not support UEFI booting without it + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' bios.syslinux.mbr ' ]]; then + # A valid GPT prevents BIOS booting on some systems, instead use an invalid GPT (without a protective MBR). + # The attached partition will have the EFI system partition type code in MBR, but in the invalid GPT it will + # have a Microsoft basic partition type code. + if [[ ! " ${bootmodes[*]} " =~ ' uefi-x64.grub.eltorito ' && ! " ${bootmodes[*]} " =~ ' uefi-ia32.grub.eltorito ' ]]; then + # If '-isohybrid-gpt-basdat' is specified before '-e', then the appended EFI system partition will have the + # EFI system partition type ID/GUID in both MBR and GPT. If '-isohybrid-gpt-basdat' is specified after '-e', + # the appended EFI system partition will have the Microsoft basic data type GUID in GPT. + if [[ ! " ${xorrisofs_options[*]} " =~ ' -isohybrid-gpt-basdat ' ]]; then + xorrisofs_options+=('-isohybrid-gpt-basdat') + fi + fi + else + # Use valid GPT if BIOS booting support will not be required + xorrisofs_options+=('-appended_part_as_gpt') + fi } -# rEFInd via El Torito -_add_xorrisofs_options_uefi-x64.refind.eltorito() { +# GRUB via El Torito +# Same as _add_xorrisofs_options_uefi-x64.systemd-boot.eltorito. +_add_xorrisofs_options_uefi-x64.grub.eltorito() { # shellcheck disable=SC2076 - if [[ " ${bootmodes[*]} " =~ ' uefi-x64.refind.esp ' ]]; then - # rEFInd in an attached EFI system partition via El Torito + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.grub.esp ' || " ${bootmodes[*]} " =~ ' uefi-ia32.grub.esp ' ]]; then + # grub in an attached EFI system partition via El Torito xorrisofs_options+=( # Start a new El Torito boot entry for UEFI '-eltorito-alt-boot' @@ -895,12 +1665,21 @@ _add_xorrisofs_options_uefi-x64.refind.eltorito() { # Boot image is not emulating floppy or hard disk; required for all known boot loaders '-no-emul-boot' ) + # A valid GPT prevents BIOS booting on some systems, use an invalid GPT instead. + if [[ " ${bootmodes[*]} " =~ ' bios.syslinux.mbr ' ]]; then + # If '-isohybrid-gpt-basdat' is specified before '-e', then the appended EFI system partition will have the + # EFI system partition type ID/GUID in both MBR and GPT. If '-isohybrid-gpt-basdat' is specified after '-e', + # the appended EFI system partition will have the Microsoft basic data type GUID in GPT. + if [[ ! " ${xorrisofs_options[*]} " =~ ' -isohybrid-gpt-basdat ' ]]; then + xorrisofs_options+=('-isohybrid-gpt-basdat') + fi + fi else # The ISO will not contain a GPT partition table, so to be able to reference efiboot.img, place it as a # file inside the ISO 9660 file system install -d -m 0755 -- "${isofs_dir}/EFI/parabolaiso" - cp -a -- "${work_dir}/efiboot.img" "${isofs_dir}/EFI/parabolaiso/efiboot.img" - # rEFInd in an embedded efiboot.img via El Torito + cp -a -- "${efibootimg}" "${isofs_dir}/EFI/parabolaiso/efiboot.img" + # grub in an embedded efiboot.img via El Torito xorrisofs_options+=( # Start a new El Torito boot entry for UEFI '-eltorito-alt-boot' @@ -915,36 +1694,67 @@ _add_xorrisofs_options_uefi-x64.refind.eltorito() { [[ " ${bootmodes[*]} " =~ ' bios.' ]] || xorrisofs_options+=('-eltorito-catalog' 'EFI/boot.cat') } +# Build bootstrap image +_build_bootstrap_image() { + local _bootstrap_parent + _bootstrap_parent="$(dirname -- "${pacstrap_dir}")" + + local image_name_arch + eval "image_name_arch=\${image_name_${arch}}" + [[ -z "${image_name_arch}" ]] || image_name="${image_name_arch}" + + [[ -d "${out_dir}" ]] || install -d -- "${out_dir}" + + cd -- "${_bootstrap_parent}" + + _msg_info "Creating ${arch} bootstrap image..." + bsdtar -cf - "root.${arch}" | gzip -cn9 >"${out_dir}/${image_name}" + _msg_info "Done!" + du -h -- "${out_dir}/${image_name}" + cd -- "${OLDPWD}" +} + # Build ISO -_build_iso() { - local xorrisofs_options=() +_build_iso_image() { + local xorriso_options=() xorrisofs_options=() local bootmode [[ -d "${out_dir}" ]] || install -d -- "${out_dir}" - [[ "${quiet}" == "y" ]] && xorrisofs_options+=('-quiet') + # Do not read xorriso startup files to prevent interference and unintended behavior. + # For it to work, -no_rc must be the first argument passed to xorriso. + xorriso_options=('-no_rc') + + + if [[ "${quiet}" == "y" ]]; then + # The when xorriso is run in mkisofs compatibility mode (xorrisofs), the mkisofs option -quiet is interpreted + # too late (e.g. messages about SOURCE_DATE_EPOCH still get shown). + # Instead use native xorriso option to silence the output. + xorriso_options+=('-report_about' 'SORRY') + fi # Add required xorrisofs options for each boot mode for bootmode in "${bootmodes[@]}"; do - typeset -f "_add_xorrisofs_options_${bootmode}" &> /dev/null && "_add_xorrisofs_options_${bootmode}" + typeset -f "_add_xorrisofs_options_${bootmode}" &>/dev/null && "_add_xorrisofs_options_${bootmode}" done + rm -f -- "${out_dir}/${image_name}" _msg_info "Creating ISO image..." - xorriso -as mkisofs \ - -iso-level 3 \ - -full-iso9660-filenames \ - -joliet \ - -joliet-long \ - -rational-rock \ - -volid "${iso_label}" \ - -appid "${iso_application}" \ - -publisher "${iso_publisher}" \ - -preparer "prepared by ${app_name}" \ - "${xorrisofs_options[@]}" \ - -output "${out_dir}/${img_name}" \ - "${isofs_dir}/" + xorriso "${xorriso_options[@]}" -as mkisofs \ + -iso-level 3 \ + -full-iso9660-filenames \ + -joliet \ + -joliet-long \ + -rational-rock \ + -volid "${iso_label}" \ + -appid "${iso_application}" \ + -publisher "${iso_publisher}" \ + -preparer "prepared by ${app_name}" \ + "${xorrisofs_options[@]}" \ + -output "${out_dir}/${image_name}" \ + "${isofs_dir}/" _msg_info "Done!" - du -h -- "${out_dir}/${img_name}" + du -h -- "${out_dir}/${image_name}" } # Read profile's values from profiledef.sh @@ -963,16 +1773,32 @@ _read_profile() { # shellcheck source=configs/releng/profiledef.sh . "${profile}/profiledef.sh" - # Resolve paths of files that are expected to reside in the profile's directory + [[ -n "$arch" ]] || arch="$(uname -m)" if [[ "${arch}" == "dual" ]]; then - [[ -n "$packages_dual" ]] || packages_dual=("${profile}/packages."{both,i686,x86_64}) - # shellcheck disable=SC2178 - packages_dual="$(realpath -- "${packages_dual[@]}")" + # Resolve paths of files that are expected to reside in the profile's directory for each architecture + [[ -n "$packages_dual" ]] || packages_files_dual=("${profile}/packages."{both,i686,x86_64}) + packages_dual="$(realpath -- "${packages_files_dual[@]}")" + pacman_conf="$(realpath -- "${pacman_conf}")" + + # Resolve paths of files that may reside in the profile's directory for each architecture + if [[ -z "$bootstrap_packages_dual" ]] && [[ -e "${profile}/bootstrap_packages.both" ]]; then + bootstrap_packages_files_dual=("${profile}/bootstrap_packages."{both,i686,x86_64}) + bootstrap_packages_dual="$(realpath -- "${bootstrap_packages_files_dual[@]}")" + pacman_conf="$(realpath -- "${pacman_conf}")" + fi else + # Resolve paths of files that are expected to reside in the profile's directory [[ -n "$packages" ]] || packages="${profile}/packages.${arch}" packages="$(realpath -- "${packages}")" + pacman_conf="$(realpath -- "${pacman_conf}")" + + # Resolve paths of files that may reside in the profile's directory + if [[ -z "$bootstrap_packages" ]] && [[ -e "${profile}/bootstrap_packages.${arch}" ]]; then + bootstrap_packages="${profile}/bootstrap_packages.${arch}" + bootstrap_packages="$(realpath -- "${bootstrap_packages}")" + pacman_conf="$(realpath -- "${pacman_conf}")" + fi fi - pacman_conf="$(realpath -- "${pacman_conf}")" cd -- "${OLDPWD}" fi @@ -980,74 +1806,37 @@ _read_profile() { # Validate set options _validate_options() { - local validation_error=0 bootmode - local pkg_list_from_file=() - _msg_info "Validating options..." - # Check if the package list file exists and read packages from it - if [[ "${arch}" == "dual" ]]; then - # shellcheck disable=SC2128 - for packages in ${packages_dual}; do - if [[ "${packages##*/}" = "packages.both" ]]; then - if [[ -e "${packages}" ]]; then - mapfile -t pkg_list_from_file < <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${packages}") - pkg_list+=("${pkg_list_from_file[@]}") - if (( ${#pkg_list_from_file} < 1 )); then - (( validation_error=validation_error+1 )) - _msg_error "No package specified in '${packages}'." 0 - fi - else - (( validation_error=validation_error+1 )) - _msg_error "File '${packages}' does not exist." 0 - fi - elif [[ -e "${packages}" ]]; then - mapfile -t "pkg_list_from_file_${packages##*.}" < <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${packages}") - eval "pkg_list_${packages##*.}+=(\${pkg_list_from_file_${packages##*.}[@]})" - fi - done - else - if [[ -e "${packages}" ]]; then - mapfile -t pkg_list_from_file < <(sed '/^[[:blank:]]*#.*/d;s/#.*//;/^[[:blank:]]*$/d' "${packages}") - pkg_list+=("${pkg_list_from_file[@]}") - if (( ${#pkg_list_from_file} < 1 )); then - (( validation_error=validation_error+1 )) - _msg_error "No package specified in '${packages}'." 0 - fi - else - (( validation_error=validation_error+1 )) - _msg_error "File '${packages}' does not exist." 0 - - fi - fi + local validation_error=0 _buildmode certfile + _msg_info "Validating options..." # Check if pacman configuration file exists if [[ ! -e "${pacman_conf}" ]]; then (( validation_error=validation_error+1 )) _msg_error "File '${pacman_conf}' does not exist." 0 fi - # Check if the specified bootmodes are supported - for bootmode in "${bootmodes[@]}"; do - if typeset -f "_make_bootmode_${bootmode}" &> /dev/null; then - if typeset -f "_validate_requirements_bootmode_${bootmode}" &> /dev/null; then - "_validate_requirements_bootmode_${bootmode}" + + # Check if the code signing certificate files exist + for certfile in "${cert_list[@]}"; do + if [[ ! -e "$certfile" ]]; then + (( validation_error=validation_error+1 )) + _msg_error "Code signing certificate '${certfile}' does not exist." 0 + fi + done + + # Check if the specified buildmodes are supported + for _buildmode in "${buildmodes[@]}"; do + if typeset -f "_build_buildmode_${_buildmode}" &>/dev/null; then + if typeset -f "_validate_requirements_buildmode_${_buildmode}" &>/dev/null; then + "_validate_requirements_buildmode_${_buildmode}" else - _msg_warning "Function '_validate_requirements_bootmode_${bootmode}' does not exist. Validating the requirements of '${bootmode}' boot mode will not be possible." + _msg_warning "Function '_validate_requirements_buildmode_${_buildmode}' does not exist. Validating the requirements of '${_buildmode}' build mode will not be possible." fi else (( validation_error=validation_error+1 )) - _msg_error "${bootmode} is not a valid boot mode!" 0 + _msg_error "${_buildmode} is not a valid build mode!" 0 fi done - # Check if the specified airootfs_image_type is supported - if typeset -f "_mkairootfs_${airootfs_image_type}" &> /dev/null; then - if typeset -f "_validate_requirements_airootfs_image_type_${airootfs_image_type}" &> /dev/null; then - "_validate_requirements_airootfs_image_type_${airootfs_image_type}" - else - _msg_warning "Function '_validate_requirements_airootfs_image_type_${airootfs_image_type}' does not exist. Validating the requirements of '${airootfs_image_type}' airootfs image type will not be possible." - fi - else - (( validation_error=validation_error+1 )) - _msg_error "Unsupported image type: '${airootfs_image_type}'" 0 - fi + if (( validation_error )); then _msg_error "${validation_error} errors were encountered while validating the profile. Aborting." 1 fi @@ -1057,6 +1846,10 @@ _validate_options() { # Set defaults and, if present, overrides from mkparabolaiso command line option parameters _set_overrides() { # Set variables that have command line overrides + [[ ! -v override_buildmodes ]] || buildmodes=("${override_buildmodes[@]}") + if (( ${#buildmodes[@]} < 1 )); then + buildmodes+=('iso') + fi if [[ -v override_work_dir ]]; then work_dir="$override_work_dir" elif [[ -z "$work_dir" ]]; then @@ -1076,6 +1869,7 @@ _set_overrides() { fi pacman_conf="$(realpath -- "$pacman_conf")" [[ ! -v override_pkg_list ]] || pkg_list+=("${override_pkg_list[@]}") + # TODO: allow overriding bootstrap_pkg_list if [[ -v override_iso_label ]]; then iso_label="$override_iso_label" elif [[ -z "$iso_label" ]]; then @@ -1097,52 +1891,119 @@ _set_overrides() { install_dir="${app_name}" fi [[ ! -v override_gpg_key ]] || gpg_key="$override_gpg_key" + [[ ! -v override_gpg_sender ]] || gpg_sender="$override_gpg_sender" + [[ ! -v override_cert_list ]] || mapfile -t cert_list < <(realpath -- "${override_cert_list[@]}") if [[ -v override_quiet ]]; then quiet="$override_quiet" elif [[ -z "$quiet" ]]; then quiet="y" fi + if [[ -v override_rm_work_dir ]]; then + rm_work_dir="$override_rm_work_dir" + fi # Set variables that do not have overrides - [[ -n "$arch" ]] || arch="$(uname -m)" [[ -n "$airootfs_image_type" ]] || airootfs_image_type="squashfs" [[ -n "$iso_name" ]] || iso_name="${app_name}" - [[ -n "$img_name" ]] || img_name="${iso_name}-${iso_version}-${arch}.iso" + # Precalculate the ISO's modification date in UTC, i.e. its "UUID" + TZ=UTC printf -v iso_uuid '%(%F-%H-%M-%S-00)T' "$SOURCE_DATE_EPOCH" } _export_gpg_publickey() { - gpg --batch --output "${work_dir}/pubkey.gpg" --export "${gpg_key}" + gpg_publickey="${work_dir}/pubkey.gpg" + rm -f -- "$gpg_publickey" + gpg --batch --no-armor --output "$gpg_publickey" --export "${gpg_key}" + [[ -s "$gpg_publickey" ]] || return } _make_version() { - install -d -m 0755 -- "${isofs_dir}/${install_dir}" - _msg_info "Creating ${arch} files with iso version..." - printf '%s\n' "${iso_version}" > "${airootfs_dir}/version" - printf '%s\n' "${iso_version}" > "${isofs_dir}/${install_dir}/version" - printf '%.1024s' "$(printf '# GRUB Environment Block\nVERSION=%s\n%s' "${iso_version}" \ - "$(printf '%0.1s' "#"{1..1024})")" > "${isofs_dir}/${install_dir}/grubenv" + local _os_release + + _msg_info "Creating ${arch} version files..." + # Write version file to system installation dir + rm -f -- "${pacstrap_dir}/version" + printf '%s\n' "${iso_version}" >"${pacstrap_dir}/version" + + if [[ "${buildmode}" == @("iso"|"netboot") ]]; then + install -d -m 0755 -- "${isofs_dir}/${install_dir}" + # Write version file to ISO 9660 + printf '%s\n' "${iso_version}" >"${isofs_dir}/${install_dir}/version" + + fi + if [[ "${buildmode}" == "iso" ]]; then + # Write grubenv with version information to ISO 9660 + # TODO: after sufficient time has passed, do not create this file anymore. + # _make_common_bootmode_grub_cfg and _make_common_grubenv_and_loopbackcfg already create a + # ${isofs_dir}/boot/grub/grubenv file + rm -f -- "${isofs_dir}/${install_dir}/grubenv" + printf '%.1024s' "$(printf '# GRUB Environment Block\nNAME=%s\nVERSION=%s\n%s' \ + "${iso_name}" "${iso_version}" "$(printf '%0.1s' "#"{1..1024})")" \ + >"${isofs_dir}/${install_dir}/grubenv" + fi + + # Append IMAGE_ID & IMAGE_VERSION to os-release + _os_release="$(realpath -- "${pacstrap_dir}/etc/os-release")" + if [[ ! -e "${pacstrap_dir}/etc/os-release" && -e "${pacstrap_dir}/usr/lib/os-release" ]]; then + _os_release="$(realpath -- "${pacstrap_dir}/usr/lib/os-release")" + fi + if [[ "${_os_release}" != "${pacstrap_dir}"* ]]; then + _msg_warning "os-release file '${_os_release}' is outside of valid path." + else + [[ ! -e "${_os_release}" ]] || sed -i '/^IMAGE_ID=/d;/^IMAGE_VERSION=/d' "${_os_release}" + printf 'IMAGE_ID=%s\nIMAGE_VERSION=%s\n' "${iso_name}" "${iso_version}" >>"${_os_release}" + fi + + # Touch /usr/lib/clock-epoch to give another hint on date and time + # for systems with screwed or broken RTC. + touch -m -d"@${SOURCE_DATE_EPOCH}" -- "${pacstrap_dir}/usr/lib/clock-epoch" + _msg_info "Done!" } _make_pkglist() { - install -d -m 0755 -- "${isofs_dir}/${install_dir}" _msg_info "Creating a list of installed packages on ${arch} live-enviroment..." - pacman -Q --sysroot "${airootfs_dir}" > "${isofs_dir}/${install_dir}/pkglist.${arch}.txt" + case "${buildmode}" in + "bootstrap") + pacman -Q --sysroot "${pacstrap_dir}" >"${pacstrap_dir}/pkglist.${arch}.txt" + ;; + "iso"|"netboot") + install -d -m 0755 -- "${isofs_dir}/${install_dir}" + pacman -Q --sysroot "${pacstrap_dir}" >"${isofs_dir}/${install_dir}/pkglist.${arch}.txt" + ;; + esac _msg_info "Done!" } -_build_profile() { +# Create working directory +_make_work_dir() { + if [[ ! -d "${work_dir}" ]]; then + install -d -- "${work_dir}" + elif (( rm_work_dir )); then + rm_work_dir=0 + _msg_warning "Working directory removal requested, but '${work_dir}' already exists. It will not be removed!" 0 + fi +} + +# build the base for an ISO and/or a netboot target +_build_iso_base() { + local run_once_mode="base" + local buildmode_packages="${packages}" + if [[ "${arch}" == "dual" ]]; then + buildmode_packages="${packages_dual}" + # Set the package list to use for each architecture + local buildmode_pkg_list_i686=("${pkg_list_i686[@]}") + local buildmode_pkg_list_x86_64=("${pkg_list_x86_64[@]}") + fi + # Set the package list to use + local buildmode_pkg_list=("${pkg_list[@]}") # Set up essential directory paths - airootfs_dir="${work_dir}/${arch}/airootfs" + pacstrap_dir="${work_dir}/${arch}/airootfs" isofs_dir="${work_dir}/iso" + # Create working directory - [[ -d "${work_dir}" ]] || install -d -- "${work_dir}" - # Write build date to file or if the file exists, read it from there - if [[ -e "${work_dir}/build_date" ]]; then - SOURCE_DATE_EPOCH="$(<"${work_dir}/build_date")" - else - printf '%s\n' "$SOURCE_DATE_EPOCH" > "${work_dir}/build_date" - fi + _run_once _make_work_dir + # Write build date to file if it does not exist already + [[ -e "${work_dir}/build_date" ]] || printf '%s\n' "$SOURCE_DATE_EPOCH" >"${work_dir}/build_date" [[ "${quiet}" == "y" ]] || _show_config _run_dual '_run_once _make_pacman_conf' @@ -1152,24 +2013,116 @@ _build_profile() { _run_dual '_run_once _make_version' _run_dual '_run_once _make_customize_airootfs' _run_dual '_run_once _make_pkglist' - _make_bootmodes - _run_dual '_run_once _cleanup_airootfs' \ + if [[ "${buildmode}" == 'netboot' ]]; then + _run_dual '_run_once _make_boot_on_iso9660' + else + _make_bootmodes + fi + _run_dual '_run_once _cleanup_pacstrap_dir' \ '_run_once _prepare_airootfs_image' - _run_once _build_iso } -while getopts 'p:C:L:P:A:D:w:o:g:vh?' arg; do +# Build the bootstrap buildmode +_build_buildmode_bootstrap() { + local run_once_mode="${buildmode}" + # shellcheck disable=SC2034 + local image_name_armv7h="" + local image_name_i686="" + local image_name_x86_64="" + if [[ "${arch}" == "dual" ]]; then + image_name_i686="${iso_name}-bootstrap-${iso_version}-i686.tar.gz" + image_name_x86_64="${iso_name}-bootstrap-${iso_version}-x86_64.tar.gz" + local image_name="${image_name_i686} ${image_name_x86_64}" + local buildmode_packages="${bootstrap_packages_dual}" + # Set the package lists to use + local buildmode_pkg_list_i686=("${bootstrap_pkg_list_i686[@]}") + local buildmode_pkg_list_x86_64=("${bootstrap_pkg_list_x86_64[@]}") + local buildmode_pkg_list=("${bootstrap_pkg_list[@]}") + + # Set up essential directory paths + pacstrap_dir_i686="${work_dir}/i686/bootstrap/root.i686" + pacstrap_dir_x86_64="${work_dir}/x86_64/bootstrap/root.x86_64" + [[ -d "${work_dir}" ]] || install -d -- "${work_dir}" + install -d -m 0755 -o 0 -g 0 -- "${pacstrap_dir_i686}" "${pacstrap_dir_x86_64}" + else + local image_name="${iso_name}-bootstrap-${iso_version}-${arch}.tar.gz" + local buildmode_packages="${bootstrap_packages}" + # Set the package list to use + local buildmode_pkg_list=("${bootstrap_pkg_list[@]}") + + # Set up essential directory paths + pacstrap_dir="${work_dir}/${arch}/bootstrap/root.${arch}" + [[ -d "${work_dir}" ]] || install -d -- "${work_dir}" + install -d -m 0755 -o 0 -g 0 -- "${pacstrap_dir}" + fi + + [[ "${quiet}" == "y" ]] || _show_config + _run_dual '_run_once _make_pacman_conf' + _run_dual '_run_once _make_packages' + _run_dual '_run_once _make_version' + _run_dual '_run_once _make_pkglist' + _run_dual '_run_once _cleanup_pacstrap_dir' + _run_dual '_run_once _build_bootstrap_image' +} + +# Build the netboot buildmode +_build_buildmode_netboot() { + local run_once_mode="${buildmode}" + + _build_iso_base + + if [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" ]]; then + airootfs_image_filename="${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" + elif [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" ]]; then + airootfs_image_filename="${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" + fi + + if [[ -v cert_list ]]; then + _run_once _sign_netboot_artifacts + fi + _run_once _export_netboot_artifacts +} + +# Build the ISO buildmode +_build_buildmode_iso() { + local image_name="${iso_name}-${iso_version}-${arch}.iso" + local run_once_mode="${buildmode}" + efibootimg="${work_dir}/efiboot.img" + _build_iso_base + _run_once _build_iso_image +} + +# build all buildmodes +_build() { + local buildmode + local run_once_mode="build" + + for buildmode in "${buildmodes[@]}"; do + _run_once "_build_buildmode_${buildmode}" + done + if (( rm_work_dir )); then + _msg_info 'Removing the working directory...' + rm -rf -- "${work_dir:?}/" + _msg_info 'Done!' + fi +} + +while getopts 'c:p:C:L:P:A:D:w:m:o:g:G:vrh?' arg; do case "${arg}" in - p) read -r -a override_pkg_list <<< "${OPTARG}" ;; + p) read -r -a override_pkg_list <<<"${OPTARG}" ;; C) override_pacman_conf="${OPTARG}" ;; L) override_iso_label="${OPTARG}" ;; P) override_iso_publisher="${OPTARG}" ;; A) override_iso_application="${OPTARG}" ;; D) override_install_dir="${OPTARG}" ;; + c) read -r -a override_cert_list <<<"${OPTARG}" ;; w) override_work_dir="${OPTARG}" ;; + m) read -r -a override_buildmodes <<<"${OPTARG}" ;; o) override_out_dir="${OPTARG}" ;; g) override_gpg_key="${OPTARG}" ;; + G) override_gpg_sender="${OPTARG}" ;; v) override_quiet="n" ;; + r) declare -i override_rm_work_dir=1 ;; h|?) _usage 0 ;; *) _msg_error "Invalid argument '${arg}'" 0 @@ -1192,9 +2145,16 @@ fi # get the absolute path representation of the first non-option argument profile="$(realpath -- "${1}")" +# Read SOURCE_DATE_EPOCH from file early +build_date_file="$(realpath -q -- "${override_work_dir:-./work}/build_date")" || : +if [[ -f "$build_date_file" ]]; then + SOURCE_DATE_EPOCH="$(<"$build_date_file")" +fi +unset build_date_file + _read_profile _set_overrides _validate_options -_build_profile +_build # vim:ts=4:sw=4:et: diff --git a/scripts/run_parabolaiso.sh b/scripts/run_parabolaiso.sh index 63f6c86..4a64e86 100755 --- a/scripts/run_parabolaiso.sh +++ b/scripts/run_parabolaiso.sh @@ -4,14 +4,13 @@ # # SPDX-License-Identifier: GPL-3.0-or-later # -# A simple script to run an parabolaiso image using qemu. The image can be booted +# A simple script to run a parabolaiso image using qemu. The image can be booted # using BIOS or UEFI. # # Requirements: # - qemu # - edk2-ovmf (when UEFI booting) - set -eu print_help() { @@ -73,7 +72,7 @@ run_image() { local ovmf_code='/usr/share/edk2-ovmf/x64/OVMF_CODE.fd' fi qemu_options+=( - '-drive' "if=pflash,format=raw,unit=0,file=${ovmf_code},readonly" + '-drive' "if=pflash,format=raw,unit=0,file=${ovmf_code},read-only=on" '-drive' "if=pflash,format=raw,unit=1,file=${working_dir}/OVMF_VARS.fd" '-global' "driver=cfi.pflash01,property=secure,value=${secure_boot}" ) @@ -89,7 +88,7 @@ run_image() { if [[ -n "${oddimage}" ]]; then qemu_options+=( '-device' 'scsi-cd,bus=scsi0.0,drive=cdrom1' - '-drive' "id=cdrom1,if=none,format=raw,media=cdrom,readonly=on,file=${oddimage}" + '-drive' "id=cdrom1,if=none,format=raw,media=cdrom,read-only=on,file=${oddimage}" ) fi @@ -100,7 +99,7 @@ run_image() { -name parabolaiso,process=parabolaiso_0 \ -device virtio-scsi-pci,id=scsi0 \ -device "scsi-${mediatype%rom},bus=scsi0.0,drive=${mediatype}0" \ - -drive "id=${mediatype}0,if=none,format=raw,media=${mediatype/hd/disk},readonly=on,file=${image}" \ + -drive "id=${mediatype}0,if=none,format=raw,media=${mediatype/hd/disk},read-only=on,file=${image}" \ -display "${display}" \ -vga virtio \ -audiodev pa,id=snd0 \ |