Commit Graph

933 Commits

Author SHA1 Message Date
nl6720
d7fc56e006
Move shell script linting into a separate make target
Makefile:
Move shellcheck to a "lint" target and change "check" so that it runs "lint".
This provides a more finer grained control and allows to extend "check" with things beyond just linting.

.gitlab-ci.yml:
Run `make lint` in the lint job.
2020-07-30 13:09:53 +03:00
David Runge
a96330699f
Use latest synced mirrors instead of age
configs/releng/airootfs/etc/systemd/system/reflector.service:
Use the 70 mirrors synced most recently (--latest) instead of a specific time since last sync (--age).
According to FS#67399 using 1hour as sync age is too short, as it sometimes leads to empty list.
2020-07-30 12:06:57 +02:00
nl6720
b5f04dba2b
Install mkinitcpio-archiso-hooks in airootfs instead of copying the hooks from host 2020-07-30 12:55:12 +03:00
nl6720
e9303ca175
Makefile: do not install mkinitcpio hooks by default
They are not required in the host system. See https://gitlab.archlinux.org/archlinux/archiso/-/issues/34 .
2020-07-29 19:14:59 +03:00
nl6720
ff0c13f90c
Build initramfs images only once
Place custom mkinitcpio.conf in airootfs.
Use a custom mkinitcpio preset to specify generated image file path.
2020-07-29 18:19:42 +03:00
nl6720
a5886ad71e
Remove unnecessary files from releng's airootfs
configs/releng/airootfs/etc/fstab:
/etc/fstab shipped by the filesystem package has only comments. There is no reason to replace it with an empty file.

configs/releng/airootfs/etc/systemd/system/default.target:
There is no harm in booting to graphical.target. releng does not enable (or even install) any service that has {Required,Wanted}By=graphical.target.
2020-07-29 18:10:25 +03:00
nl6720
b8dc4484e8
archiso/initcpio/install/archiso: fix GnuPG home directory permissions
Gets rid of a gpg warning:
gpg: WARNING: unsafe permissions on homedir '/tmp/mkinitcpio.*/root/gpg'
2020-07-29 18:05:16 +03:00
David Runge
e264b44682
Add license and basic documentation
LICENSE:
Add GPL-3.0 license.

{{archiso,configs}/*,.editorconfig,.gitlab-ci.yml}:
Add SPDX license identifier.

Makefile:
Add SPDX license identifier.
Install the `run_archiso.sh` script as global executable `run_archiso`.
Use -D and -t flags to install to install files more generically (without a previous call to install the directory).

README.rst:
Add README outlining the project's scope, how to build images from the profiles and how to test.

AUTHORS.rst:
Add list of all direct contributors to the repository.

CONTRIBUTING.rst:
Add basic contribution guidelines, explaining the linter and the license in use.

Closes #7
Closes #3
2020-07-29 14:27:48 +02:00
David Runge
47e11125e4
Copy files more generically
configs/*:
Copy all files that do not need a rename generically (not specifying a destination file name).
Do not rename vmlinuz-linux to vmlinuz or vmlinuz.efi (as this serves no purpose and makes the scripts more
complicated).
Do not rename microcode (i.e. {amd,intel}-ucode.img) when copying them and change all boot loader configuration files
that assume a renamed microcode image.
Add note and link to Arch Linux wiki to state why memtest.bin is renamed to memtest.
Copy license files for {amd,intel}-ucode and memtest more generically by placing them into subdirectories with the same
name as the package (to circumenvent overwriting one other).

Closes #33
2020-07-28 12:13:45 +02:00
nl6720
ba6b44f80a
Copy /etc/skel/ to user's home from build.sh instead of customize_airootfs.sh
Additionally copy the files to all custom user homes, not just root's.
2020-07-28 11:56:59 +03:00
nl6720
b922e8bc9c
Set up custom user home directories and their permissions 2020-07-28 11:56:59 +03:00
nl6720
78fe656042
Deprecate customize_airootfs.sh
Show a deprecation notice if airootfs/root/customize_airootfs.sh is found.
2020-07-28 11:56:58 +03:00
nl6720
df93289b73
Install all packages in one go and don't copy pacman.conf to airootfs
configs/{baseline,releng}/build.sh:
Copy custom files to airootfs before installing packages.
Instead of calling `mkarchiso init`, list all required packages in packages.x86_64 and install them all at once with `mkarchiso install`. The mkdir command which `mkarchiso init` performs is now done by make_custom_airootfs.

configs/releng/build.sh:
Don't copy configs/releng/pacman.conf to airootfs, it is only meant to provide a unmodified pacman.conf durring pacstrap. In airootfs, an unmodified /etc/pacman.conf will be installed with the pacman package.
2020-07-28 11:50:25 +03:00
nl6720
c54a41fb3d
Fix baseline profile
Install linux and mkinitcpio packages.
Remove root user's password.

Fixes https://bugs.archlinux.org/task/64236 .
2020-07-28 11:47:42 +03:00
nl6720
6689537563
Set root user's shell and password with custom /etc/passwd and /etc/shadow
Correct shadow file permissions from build.sh.
2020-07-20 13:39:41 +03:00
nl6720
12b02406eb
Revert "Add GitHub Actions workflow"
This reverts commit 2993b80816.

Actions are disabled in archiso's GitHub mirror.
2020-07-17 22:39:54 +03:00
nl6720
b40fb2ae53
Separate custom comments from shellcheck comments
Having a shellcheck directive and custom comments in the same line can trigger SC1107 on old versions of shellcheck.
2020-07-17 10:42:14 +03:00
nl6720
2993b80816
Add GitHub Actions workflow
.github/workflows/lint.yml:
Run `make check`.
2020-07-17 10:42:14 +03:00
nl6720
ecd339278d
Add check target to Makefile
Makefile:
Move shellcheck commands from .gitlab-ci.yml.

.gitlab-ci.yml:
Run `make check`.
Prevent partial upgrades, i.e. use '-Syu'.
Prevent reinstalling already installed packages by using pacman's '--needed' option.
Don't force-download the package database.
2020-07-17 10:42:14 +03:00
Justin Kromlinger
6f0a15c34a
Fix unexpected script_path behaviour
When one calls the `build.sh` scripts with bash instead of the shebang
`$script_path` contains the filepath, not the parent dir:

```
% cd /path
% grep -A2 script_path= build.sh
script_path=$(readlink -f "${0%/*}")
echo "$script_path"
exit 0
% ./build.sh
/path
% bash build.sh
/path/build.sh
```

This commit fixes that:

```
% grep -A2 script_path= build.sh
script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && pwd )"
echo "$script_path"
exit 0
% ./build.sh
/path
% bash build.sh
/path
```
2020-07-16 22:54:16 +02:00
nl6720
7acea696e4
Explicitly add linux and mkinitcpio to packages.x86_64
linux only gets pulled in because of broadcom-wl and mkinitcpio (usually) gets pulled in by linux.
2020-07-12 17:54:31 +03:00
nl6720
51170c5352
Don't hardcode packages in build.sh
Move all required packages to packages.x86_64.
Test file availability before copying them.
2020-07-12 16:28:38 +03:00
David Runge
e2032db4e7
Adding linting for initcpio scripts
archiso/initcpio/install/*:
Setting bash shebang for all scripts and making them comform with shellcheck.

archiso/initcpio/{hooks,script}/*:
Setting ash shebang for all scripts and making them comform with shellcheck (for dash, as shellcheck has no ash specific
ruleset). Essentially the ash based scripts should be POSIX compliant as much as possible to have an easier time
writing, debugging and maintaining them.
Ensuring that variables are not treated as options and introducing variable quoting.

.gitlab-ci.yml:
Integrating shellcheck for initcpio scripts.

Closes #32
2020-07-11 20:58:01 +02:00
nl6720
550aca7124
Remove lynx usage in configs/releng/build.sh
/usr/local/bin/Installation_guide:
Add a convenience script which opens the installation guide in lynx.

/etc/motd:
Provide a message with minimal instructions for connecting to internet and inform about the Installation_guide convenience script.
2020-07-11 17:08:44 +03:00
nl6720
8b4e987e17
Remove unnecessary dialog package
dialog was only added because it was needed for netctl's wifi-menu.
Now that netctl is removed, nothing requires dialog.
2020-07-11 17:00:51 +03:00
nl6720
d5d0f78139
Use /usr/bin/env in shebangs 2020-07-11 16:31:18 +03:00
nl6720
32e75b2a5d
Add work and out directories to .gitignore 2020-07-11 16:31:18 +03:00
nl6720
f44e91c631
Remove unneded ReadOnlyPaths from reflector.service
configs/releng/airootfs/etc/systemd/system/reflector.service:
Remove references to a nonexistent file.
2020-07-11 16:31:17 +03:00
nl6720
d39e2ba41b
Keep /root permissions as 750
The filesystem package installs /root as 750 not 700.

Move chmod from customize_airootfs.sh to build.sh.
2020-07-11 16:30:25 +03:00
nl6720
0ba88cb264
Update pacman.conf to the current version shipped by the pacman package 2020-07-11 16:28:31 +03:00
nl6720
41f74e3515
Sort packages.x86_64
Additionally update names of renamed packages:
https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/bind&id=1b097b9bcaddd65c7af4f92efef175f959395a7e
https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/vim&id=807b49bf022a6d523ca6215d5b34cd1e37457bd5
2020-07-11 16:28:27 +03:00
nl6720
9f3c69ee08
Warn about Syslinux's reboot.c32 and poweroff.c32 requiring APM
configs/releng/syslinux/archiso_tail.cfg:
APM is old and some motherboard firmwares have removed support for it.
reboot.c32 and poweroff.c32 will not work on such firmwares.
Add a help text to "Reboot" and "Power Off" boot menu entries that warns about requiring APM.
2020-07-11 15:10:34 +03:00
nl6720
fda96ac8dd
Add terminus-font
When built with CONFIG_FONT_TER16x32, the Linux kernel includes a TER16x32 font based on ter-i32b from terminus-font. The kernel will automatically choose this font on screen resolutions larger than 1920×1080.
The terminus-font package includes fonts for other character sets, which may be useful during installation.
2020-07-11 15:06:37 +03:00
nl6720
baf2363e3b
Add *-terminfo packages to ease installation via SSH 2020-07-11 13:28:17 +03:00
nl6720
2165d545fc
Automatically boot the installation environment from syslinux
Timeout is 3 seconds to match systemd-boot's configuration.
2020-07-11 10:45:22 +03:00
David Runge
d835419b36
Adding script to run archiso in qemu
scripts/run_archiso.sh:
A script to run a built archiso image using qemu.
It can run the image on an emulated BIOS (using seabios) or UEFI (using edk2-ovmf) system.

.gitlab-ci.yml:
Adding scripts/run_archiso.sh to shellcheck call.

Closes #28
2020-07-10 23:13:27 +02:00
nl6720
24a68d5879
Add amdgpu and mgag200 to the archiso_kms mkinitcpio hook
See https://wiki.archlinux.org/index.php/Kernel_mode_setting#Early_KMS_start .
2020-07-01 12:05:52 +03:00
nl6720
1b2a7b58ce
Allow systemd-networkd-wait-online to succeed with one interface
It is enough if one network interface is online, there is no need to wait for all of them.
Without this, when connecting with Wi-Fi and leaving Ethernet disconnected, the network-online.target will get unnecessarily delayed.
2020-06-30 20:53:00 +03:00
David Runge
5e43a63b3c
Fixing issues with variable quoting and arrays
archiso/mkarchiso:
Calls to _pacman() need to be done with multiple parameters (e.g. array) instead of one string, as string splitting is
not done in that function anymore.
Turning _iso_efi_boot_args from string into an array to have an easier time of passing it to xorriso.
Calling xorriso within the if statements instead of providing -quiet via variable.
Fixing command_install() to provide packages separately to _pacman()

configs/releng/build.sh:
Replacing all newlines when retrieving the packages from packages.x86_64 with spaces so they will be properly provided
to "mkarchiso install".
2020-06-30 19:35:56 +02:00
nl6720
511ca9d95d
Move choose-mirror script to /usr/local/bin/
/etc/systemd/scripts/ is not a standard directory.

Run shellchek on the choose-mirror script.
2020-06-30 18:10:55 +03:00
nl6720
3cf8e738ed
Do not download a mirrorlist durring build
Pacman's mirrolist will be updated by reflector.service in the live system.
2020-06-30 18:10:45 +03:00
nl6720
3c33e84c3e
Add reflector and enable reflector.service
reflector.service will update pacman's mirrorlist after a network connection is established in the live system.
Fixes https://gitlab.archlinux.org/archlinux/archiso/-/issues/26 .
2020-06-30 18:09:44 +03:00
David Runge
b08f1681cf
Standardizing boot loader entry format
{configs/releng/efiboot/loader/entries/archiso-x86_64-{cd,usb}.conf,configs/releng/syslinux/archiso_{pxe,sys}.cfg}:
Standardizing the boot loader entry format by switching all entries to the form:
"Arch Linux install medium (<CARCH>[, <PROPERTY>])".
This removes the distinction between "CD" and "USB" when booting in UEFI "el-torito" (as the information is not useful).
Changing some of the syslinux help text as well to reflect this change. This also drops the specific <CARCH> from the
syslinux help text as it is duplicated information.

Closes #24
2020-06-30 14:57:26 +02:00
nl6720
609e98847b
Add efibootmgr
It was previously pulled in as a dependency of refind. Now that refind is removed, add efibootmgr explicitly.
2020-06-30 14:38:08 +03:00
nl6720
4d0cc65dbd
Add back lsscsi
It cannot be fully replaced by lsblk.
2020-06-30 12:10:09 +03:00
nl6720
f00c0734ad
Clear the screen after syslinux exits
Reduce the time where boot loader artifacts linger on screen after the boot loader has done its job.
2020-06-30 10:43:08 +03:00
nl6720
ff926f72a1
Set timezone from outside chroot 2020-06-30 06:25:43 +03:00
nl6720
3720627e88
Enable systemd units with symlinks instead of doing it via systemctl in chroot 2020-06-30 06:25:43 +03:00
nl6720
d11737ffe8
Use drop-in files for journald and logind configuration 2020-06-30 06:25:43 +03:00
David Runge
47533fd974
Introducing shellcheck in gitlab CI
archiso/mkarchiso:
Quoting all variables.
Changing pkg_list to be an array instead of a string for easier
handling. Using read to properly populate pkg_list from OPTARG with
stripped whitespaces.
Not exporting iso_label anymore as there seems to be no reason to do so.
Introducing line breaks.

.editorconfig:
Setting max_line_length to 120.
Adding a section for YAML files (e.g. .gitlab-ci.yml).

configs/releng/build.sh
Quting nearly all variables.
Introducing line breaks.

configs/baseline/build.sh:
Quoting all variables.
Introducing line breaks.

.gitlab-ci.yml:
Adding gitlab CI for shelleck linting of the config build scripts, mkarchiso and startup scripts in releng.

Closes #19
2020-06-29 20:10:23 +02:00