Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/hooks
AgeCommit message (Collapse)Author
2022-01-22hooks/archiso: merge _mnt_sfs and _mnt_erofs into one funtion _mnt_fsnl6720
Now that EROFS is detected by util-linux, the actions to mount a squashfs or erofs image are basically the same. The _mnt_sfs and _mnt_erofs functions can be merged into one: _mnt_fs. If neither airootfs.sfs nor airootfs.erofs are found, error out to interactive shell.
2022-01-12Change default DHCP timeout to 60 seconds instead of 30 to avoid issues with ↵Anton Hvornum
STP (Spanning Tree Protocol). STP defaults to 15 + 15 seconds on a lot of popular devices for listening and learning states. Which if not disabled (which you should on access switches, sure..) most netboots will fail intermittently due to the port access on switches performing port learning while the machine is trying to get DHCP leases. Added comment referencing to why the 60 seconds. More information can be found here: https://www.ciscopress.com/articles/article.asp?p=2832407&seqNum=6 and https://techhub.hpe.com/eginfolib/networking/docs/switches/5980/5200-3921_l2-lan_cg/content/499036677.htm
2022-01-03hooks/archiso: mount cow_device read-only at first and remount it read-write ↵nl6720
right after This prevents errors when the device is already mounted read-only somewhere else (e.g. if cow_device and archisodevice are the same). Partially reverts d0d7eb25cf503753cb1452756059a281289e7a41 Fixes #9.
2021-12-10hooks/archiso{,_loop_mnt}: remove /run/archiso/used_block_devicesnl6720
Now that the archiso_shutdown is removed, nothing uses this file anymore and it is not needed. Additionally, cowspace is mounted read-write on first mount, not mounted read-only and then remounted read-write.
2021-12-10Remove obsolete archiso_shutdown hooknl6720
The functionality it provides has been available in mkinitcpio itself since 2013. https://lists.archlinux.org/pipermail/arch-dev-public/2013-December/025742.html Implements #8.
2021-12-02hooks/archiso: remove unneeded file system type from _mnt_devnl6720
It was only used because util-linux did not support detecting EROFS and the mount command required `-t erofs` to mount EROFS. util-linux 2.37 supports detecting EROFS; see https://github.com/util-linux/util-linux/commit/7b2a874e2ee306e9503210f8aa5eed7f53c06755. Now that the workaround is not needed anymore, it can be removed.
2021-11-02hooks/archiso: show GPG "GOODSIG" line when verifying the signaturenl6720
2021-07-31Fix formatting with shfmtDavid Runge
{hooks,install,script}/*: Fix formatting in all scripts using shfmt. Replace a few echo calls with printf.
2021-05-14Apply 1 suggestion(s) to 1 file(s)Simon Wilper
2021-05-14add optional pv toolSimon Wilper
use pv to give feedback on copying the airootfs to RAM when copytoram kernel parameter is given
2021-04-30Ignore SC3060 in initcpio hookDavid Runge
archiso/initcpio/hooks/archiso_pxe_common: Disable shellcheck's SC3060, as ash is able to do bash-like string replacements.
2021-03-09Support EROFSnl6720
EROFS, like Squashfs, is a read-only file system. It can be used to store airootfs in an image file. Its advantage is the support for POSIX ACLs. EROFS downside is that currently it only supports LZ4 compression (LZMA support is not yet fully implemented). A difference from Squashfs is that, EROFS stores change time (ctime) not modification time (mtime). The reverse is true for Squashfs. Implements https://gitlab.archlinux.org/archlinux/archiso/-/issues/59
2021-03-09archiso/initcpio/hooks/archiso: remove redundant /sfs/ from airootfs mount pointnl6720
Remove /run/archiso/bootmnt directory if nothing is mounted there. An empty directory is just confusing.
2021-01-26archiso_pxe_common: remove resolv.conf before copyChristian Hesse
Booting via PXE we want to keep our DNS configuration. So remove /etc/resolv.conf in new root before copying the current file. Without this systemd-resolved fallback nameservers are used and we see an error message when the root ships a symbolic link to systemd-resolved's stub-resolv.conf: cp: not writing through dangling symlink '/new_root/etc/resolv.conf'
2020-11-18Reset network interfaces at the end of the PXE boot to allow DHCP to runfdupoux
2020-08-11archiso/initcpio/hooks/archiso: remove option terminator from the blockdev ↵nl6720
command Apparently blockdev does not support it. In an ISO made using '-s img' (Squashfs with dm-snapshot), it results in: blockdev: Unknown command: --
2020-07-29Add license and basic documentationDavid Runge
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-17Separate custom comments from shellcheck commentsnl6720
Having a shellcheck directive and custom comments in the same line can trigger SC1107 on old versions of shellcheck.
2020-07-11Adding linting for initcpio scriptsDavid Runge
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
2018-06-29Remove cow file early for non-persistent systemsChristian Hesse
The kernel has an open file handle after setting up the mapping. We can remove it early to make sure it is gone on shutdown. This helps to keep the cow_device clean for non-persistent systems where cow_directory contains a version specific string. Signed-off-by: Christian Hesse <mail@eworm.de>
2017-10-17use a stronger hashing algorithmChristian Hesse
Nobody wants to use md5 these days... Signed-off-by: Christian Hesse <mail@eworm.de>
2017-03-14Handle case where ip=dhcpDavid Thurstenson
Signed-off-by: David Thurstenson <thurstylark@gmail.com>
2017-03-14Add timeout to ipconfig callDavid Thurstenson
Signed-off-by: David Thurstenson <thurstylark@gmail.com>
2016-09-29pxe-common: not only search, but also domain entry in resolv.confChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-09-29pxe-common: add dns domain name in resolv.confChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-09-29pxe-common: add a comment what added settings to resolv.confChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-07-05always set copytoram for pxe boot via httpChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-05-29fix indention and add EditorConfig configurationChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-05-28flush and set down only if boot interface is knownChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-05-27do not declare bootif_dev localChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-05-27use ip syntax according to ip-address(8)Christian Hesse
According to ip-address(8) flushing an interface requires the keyword 'dev'. Also add proper quoting. Signed-off-by: Christian Hesse <mail@eworm.de>
2016-05-25move modprobe to run_earlyhook()Christian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-05-24only run pxe late hook if $ip is givenChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-05-24fix NBD boot without copy-to-ramChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2016-03-18[archiso] Set net iface down if copytoram=y (default)Gerardo Exequiel Pozzi
This should fix FS#36749 Also flush address on specified device (default) Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
2016-02-28Add the verify=y option to verify the squashfs signature with gpgThomas Bächler
2016-02-04fix boot parameters for mount optionsChristian Hesse
Fixes: e7ea394e5181de37a403b29e55d89afc34fdb867 Signed-off-by: Christian Hesse <mail@eworm.de>
2015-12-13add boot params archisoflags= and cow_flags= for mount optionsChristian Hesse
Having files on btrfs subvolumes requires to give mount options. Add boot params archisoflags= and cow_flags= for this purpose. Boot parameters could look like this: ... archisodevice=/dev/sdaX archisoflags=subvolume=isos cow_device=/dev/sdaX cow_flags=subvolume=persist ... Signed-off-by: Christian Hesse <mail@eworm.de>
2015-09-13cleaner boot from loopmounted iso fileAdam Purkrt
Currently, when booting loopmounted iso file, it is necessary to specify not only img_dev and img_loop (which should be sufficient), but also archisolabel or archisodevice. With this patch, archisodevice is directly populated with the correct loop device, and it is not necessary to specify the label when booting from loopmounted iso, which makes for leaner and cleaner grub.cfg.
2015-06-24flush ip addresses after copy to RAMChristian Hesse
We received an IP address from DHCP server and configure it statically. This is required if we continue to use network connectivity to access the root device (for example via NBD or NFS). The lease is not updated, though. This can cause trouble in networks with low lease times. So let's flush the addresses if root filesystem has been copied to RAM. A dhcp client in main system can handle the network connectivity then. Signed-off-by: Christian Hesse <mail@eworm.de>
2015-05-29limit access to cow directoryChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2015-05-29launch interactive shell if ipconfig failsChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2015-05-29explicitly detach loop device on umount and silent losetup errorChristian Hesse
Umount detaches the loop device automatically, but let's make it explicit to be sure. Additionally losetup gives: losetup: /dev/loop0: detach failed: No such device or address This is kind of expected, let's silent the error message. Signed-off-by: Christian Hesse <mail@eworm.de>
2015-01-27[archiso] Rename cowfile_size to cow_spacesize=Gerardo Exequiel Pozzi
The name is more relevant since the usage is shared for both dm-snapshot and overlayfs. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
2015-01-27[archiso] Add optional OverlayFS supportGerardo Exequiel Pozzi
This is the first attemp to test overlayfs in archiso. The current dm-snapshot mode is keep and is enabled by default, while the new mode is enabled via "-s sfs" to mkarchiso. No new boot parameters are added, since archiso hooks detects if the .sfs file is for dm-snapshot (airootfs.img inside) or for overlayfs. Persistence is supported in overlayfs mode using the same options (cowlabel or cowdevice), but warning while in dm-snapshot mode, only one file is used (airootfs.cow), in overlayfs mode internal files for workdir/ and upperdir/ are allocated, so you can not use VFAT or NTFS. To test this, you need to enable [testing] in pacman.conf from releng profile and edit build.sh then add "-s sfs" in make_prepare() Look at: setarch ${arch} mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" prepare Replace with: setarch ${arch} mkarchiso ${verbose} -w "${work_dir}" -s sfs -D "${install_dir}" prepare The build requires just half of space that the build for dm-snapshot, since there is no ext4 img ;) Just to remember: there is no space gain in .sfs (just about 2M) There is at least one thing during boot with machine-id service: Dec 24 03:31:39 archiso systemd-machine-id-commit[183]: Failed to unmount transient /etc/machine-id file in our private namespace: Invalid argument Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
2015-01-02allow to change dm snapshot chunksizeChristian Hesse
Copying big amount of data results in bad performance as data is written in chunks of 4kiB (8 * 512 bytes). The default is not changed but can be overwritten. Signed-off-by: Christian Hesse <mail@eworm.de>
2015-01-02use consistent syntax for boot parameter processingChristian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2014-12-13[archiso] Merge cowspace_size= option in cowfile_size=Gerardo Exequiel Pozzi
Since now cowspace_size == cowfile_size (only one file inside) Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
2014-10-13[archiso] Change cowfile_size= behaviorGerardo Exequiel Pozzi
Move from percent to explicit size and set a default of 256M (sparse) Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
2014-08-12archiso_pxe_http: Fix location of airootfs.md5Lukas Fleischer
Currently, when booting via HTTP, the airootfs.md5 file is downloaded to /run/archiso/bootmnt/arch/. However, the checksum file is later assumed to be located at "/run/archiso/bootmnt/arch/${arch}". Fix the _curl_get invocation and directly place the file in the right directory. Fixes a regression introduced in commit 5506e1e ([archiso] Rework checksum function, 2014-06-28). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>