Commit Graph

80 Commits

Author SHA1 Message Date
Anton Midyukov
27a675134a tar2fs: Enable secure-boot support for x86_64, add riscv64 support, cleanup 2021-02-01 18:04:40 +07:00
Anton Midyukov
a2c43788d2 tar2fs: Disable os-probe at the time of grub installation
os-probe finds loopback devices.
2021-01-25 19:42:32 +07:00
Anton Midyukov
1782ffdcdc arm-rpi4, build-vm, tar2fs: Add new argument VM_BOOTTYPE for tar2fs
While this argument can only have one "EFI" value.
Thus, the problem of building an image for Raspberry Pi on armh,
where there is no grub-efi, was solved.
2020-11-26 19:52:29 +07:00
Anton Midyukov
b07db07061 tar2fs: Set UUID in extlinux.conf, if exist
extlinux.conf is not tied to the u-boot bootloader and always
needed replace Label with the UUID if the file exist.
2020-09-09 23:20:54 +07:00
Anton Midyukov
b7a390f633 tar2fs: Set flag boot on root part for u-boot bootloader 2020-07-16 02:28:58 +07:00
Anton Midyukov
95ced6d0c4 tar2fs: Added Raspberry Pi 4 support
Since the main goal for aarch64 and armh for us is Raspberry Pi,
it is always worth creating a fat32 partition for these arches.
At least for now.
2020-07-16 02:28:58 +07:00
Anton Midyukov
0f28ee414f build-vm, tar2fs: added VM_PARTTABLE
For Raspberry Pi needed to build grub-efi + MBR images.
2020-05-22 13:34:37 +07:00
Anton Midyukov
f6449ec0ec tar2fs: fixed empty space between section 1 and 2 on ppc64le 2020-04-07 22:35:52 +07:00
Anton Midyukov
fc67e5a8c2 build-vm, tar2fs: get ARCH from command line argument
tar2fs does not run in hasher and without qemu. This causes build
problems for an architecture other than the host.
2020-04-07 22:35:52 +07:00
Anton Midyukov
8117194b02 tar2fs: grub-efi without Secure Boot
If build is performed on a system with EFI Secure Boot enabled,
then grub will not boot even on EFI without Secure Boot.
This problem is caused by the use of the --removable option, which
is not compatible with option --uefi-secure-boot  the current grub.
Option --uefi-secure-boot is enabled automatically if the system is
booted in EFI Secure Boot mode.
2020-04-07 22:35:52 +07:00
Anton Midyukov
4d39e0236d tar2fs: add support efi 2020-04-03 22:56:58 +07:00
Anton Midyukov
d65ae1021b archdep-filter: add @ARM filter for aarch64, arm*
There are use cases when having this common knob would be desirable.
2019-11-01 13:48:54 +03:00
Michael Shigorin
0e9bb9a650 bin/check-pkg-list: imported from m-p-d
I've long wanted to have this nice helper around in m-p too
but might have set the bar too high.

The "prorper integration" idea was to have the script check
just those pkglists which are relevant for a given image IIRC.

Let's toss it in to begin.
2019-10-31 13:15:39 +03:00
Michael Shigorin
fab15ba7a8 bin/archdep-filter: factored out
This code started breeding within pkg.in/*/Makefile,
and it was lacking both E2K (as a generic alias,
not just "e2k or e2kv4") _and_ the ability to negate
selection, as in "everywhere but not on any e2k").

Let's fix all of that at once, and parallelize sed
execution as well; my tests with 1000-line file
containing "a b c d@!E2K e@e2k f g@!X86 h i@IA32"
lines show roughly 3x higher CPU load and lower
execution time (~0.3 sec vs ~0.9 sec on 801-PC).

And turn that code snippet into a proper filter
with inline edit capability (I've dropped the exit
trap as failing to mv signals a disaster anyway).
2019-10-23 14:40:36 +03:00
Anton Midyukov
2ac26880f1 tar2fs: avoid duplicate fstab entry
This commit fixes duplication of root device entry in /etc/fstab
and changes LABEL=ROOT entry with the proper one if found.

Apparently this didn't hurt qemu images much though...
2019-09-23 19:51:57 +03:00
Gleb Fotengauer-Malinovskiy
d4cbbcba76 tar2fs: Add support of ppc64le vm images 2019-08-19 23:31:00 +03:00
Anton Midyukov
0e5e1215f9 tar2fs: switch case for $BOOTLOADER
This allows one not to hope that only the packages of the desired
loader will be installed.
2019-08-19 23:26:54 +03:00
Anton Midyukov
07559bc94a tar2fs: clean fstab
Should be done this way in the first place it seems.
2019-08-19 23:26:22 +03:00
Anton Midyukov
8e1dd12f8e kernel, tar2fs: do not create /boot/.origver 2019-08-19 23:18:31 +03:00
Anton Midyukov
27674e297b build-vm, kernel, tar2fs: make-initrd happens now in build-vm
NB: 07-kernel change breaks multi-kernel setup!

Breaks: 650e92bf7f
2019-08-19 23:16:06 +03:00
Anton Midyukov
d571ab545e tar2fs: implement u-boot support 2019-06-10 20:37:06 +03:00
Michael Shigorin
f8ae619bbb cleanlog, reports.mk: factor the script out
Sometimes REPORT=1 just wasn't passed to make, and the build.log
saved is noisy and harder to compare through diff(1); let's move
the implementation out of the makefile and into a standalone
script so it can be reused like this:

  BUILDDIR=$(sed -rn "s/^mki-image-scripts: export GLOBAL_BUILDDIR='(.*)'$/\1/p" build/build.log
  bin/cleanlog < build/build.log > build/reports/clean.log

See "export GLOBAL_BUILDDIR=" line in the particular log
(grabbing that one from stdin is not exactly trivial though).
2019-06-10 19:47:14 +03:00
Anton Midyukov
12f8d8e2f4 tar2fs: unified partition type selector
Currently, only e2k requires specific disk partitioning.
2019-06-04 17:58:36 +03:00
Anton Midyukov
d55bfec1e9 tar2fs: clean duplicate
INITRD_MODULES is reset further down the script.

Fixes: be75d3c3d2
2019-06-04 17:48:33 +03:00
Mikhail Gordeev
7f1ec09c9b tar2fs: do not chown ROOTFS and WORKDIR
Changing ROOTFS owner causes a problem:
created image's root directory is owned
by user executing make instead of root.

Changing WORKDIR owner is unnecessary
because it will be removed anyways.
2019-03-04 20:23:58 +03:00
Dmitriy Terekhin
be75d3c3d2 need /.host/qemu* in the chroot if qemu is used
The original commit broke system tar2fs use by accidentally
moving TOPDIR definition into a separate shell execution;
thanks iv@ for spotting and fixing it promptly.

Co-authored-by: Ivan A. Melnikov" <iv@altlinux.org>
2019-03-04 19:56:03 +03:00
Ivan A. Melnikov
bedd7cf453 tar2fs: set defaults for mips* 2018-12-25 15:43:21 +03:00
11e1bf73db tar2fs: add grub support
...for vm images; BIOS one tested, EFI one untested yet
but will be required for AArch64 VMs it seems.
2018-12-24 19:33:41 +03:00
Michael Shigorin
c71ff2a39e tar2fs: handle single boot label as default
No sense to "provide" choice when there's none.
2018-10-29 12:46:08 +03:00
Michael Shigorin
27b07b2dca tar2fs: ensure proper cwd when cleaning up
...so that umounts can happen reliably.

Reported-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
2018-10-29 12:45:46 +03:00
Michael Shigorin
b31af10c79 tar2fs: generate proper boot.conf for e2k
This one supports multiple kernels (and tweaks boot
labels aiming to simplify target kernel selection
for the CPU at hand) instead of an earlier attempt
to fill in a template.

No need for the template so just drop it.
2018-05-21 22:50:07 +03:00
Michael Shigorin
650e92bf7f build-vm, tar2fs: handle multiple kernels either
This was crucial for e2k rescue image supporting
multiple CPU versions but can be useful elsewhere.
2018-05-21 22:50:00 +03:00
Michael Shigorin
aa7f2d8423 tar2fs: chgrp and failsafe kpartx
The current state made vm images belong to root group,
no reason to not change those to the primary group of
the user building an image.

kpartx -d -s could fail in some circumstances,
make a safety cleanup call more verbose.
2017-08-07 18:00:16 +03:00
Michael Shigorin
35dd200883 tar2fs: add e2k arch support
Somewhat ARM-like with only the bootloader bits
standing out; Elbrus 2000 firmware can read ext2
and boot the kernel directly.
2017-08-02 22:14:09 +03:00
Michael Shigorin
3d7a0c5c39 build-vm, tar2fs: unify kver handling
No need to deduce kernel version again,
just save it in a temporary file.

The main reason to change what worked is
that e2k kernel-image package has Linux bits
named as image-$kver and not vmlinuz-$kver;
the guessing logic taking all of this into
account resulted in non-aesthetic patch.

NB: there's a duplicating script within
    kernel feature; it wasn't easy to avoid
    this and it might differ when handling
    multiple kernels, I didn't think much
    about this now as vm images tend to ship
    with the sole one.
2017-08-02 22:13:44 +03:00
Gleb Fotengauer-Malinovskiy
1f63af0159 mp-commit: disable git hooks
These commits are temporary, so we do not care about stuff like
trailing whitespaces at all.
2017-02-08 23:04:24 +03:00
Michael Shigorin
a289726792 check-recipe: generalize dependency control
An initial (and quite naive) implementation was done
for conf.d/ files but features do need it as well --
which became obvious during a casual inspection of
distro/alt-workstation's target graph (which occured
broken).

The code is a messy hackery unfortunately, regexes used
are fragile regarding e.g. [A-Z_] in target names.
Read with care.

NB: lib/ might need this too but it's rather stable
    and contains some special cases that would obstruct
    the regexes even more...
2017-01-29 15:50:58 +03:00
Michael Shigorin
949733a9b4 report-targets: tweak targets
There's yet another m-p target class, ve/*; and
let's put a semicolon after anything else, too.
2017-01-29 15:02:05 +03:00
Michael Shigorin
b3caf70fa9 mktmpdir: refer to docs
Manual BUILDDIR specification isn't exactly obvious
from this script (aiming to derive it automatically),
so at least point those interested at QUICKSTART
they might have long forgotten already or, gasp,
not even started reading.
2016-12-26 15:56:46 +03:00
9526477124 - add virtio modules to initrd
- add output to console=ttS0 for run in cloud
2016-03-02 07:20:22 +03:00
Michael Shigorin
3b3cf4cc93 QUICKSTART, mktmpdir, build.mk: hasher's /proc
Either /etc/hasher-priv/system or /etc/hasher-priv/user.d/$USER
must contain at least "allowed_mountpoints=/proc" for mkimage
to work for mkimage-profiles; thanks Daniil Golovanov for
providing feedback indicating the lack of the corresponding
checks.
2016-01-10 13:08:03 +03:00
Michael Shigorin
025e611057 mktmpdir: fixed sort key
The sort key field value has been off-by-one apparently,
"6" corresponds to "capacity" field of df -PT output
while the "available" one was meant:

Filesystem     Type  1024-blocks     Used Available Capacity Mounted on
/dev/sda9      ext4     15350768 12799972   1747980      88% /
tmpfs          tmpfs     1967204    27396   1939808       2% /tmp

1              2               3        4         5       6

This lapse has been five years old, looks like it's only
been masked by lower available space limit *and* filesystem
ordering by type so far.  It didn't hit me even now, rather
inspected the code while implementing volumes-profile-starterkit...
2015-09-07 21:01:14 +03:00
Michael Shigorin
0cdc8a7d77 tar2fs: fixed broken sfdisk use
Yet another age old bug: `sfdisk -l' is mimicking what
a person does by hand but the script is rather interested
in what `sfdisk -g' provides, that is, geometry.

And it's stupid enough to only grok C locale.
2015-05-31 18:08:19 +03:00
Michael Shigorin
5542415e19 tar2fs: wait a bit
Looks like there's a race condition somewhere: this script
will fail to clean up after itself when considerable background
load is inflicted upon the host it's running on (e.g. LA ~16
on a 8-core, single-disk system).

Note that this commit is NOT enough to win that race
but just a step in the right direction...
2015-02-16 17:58:51 +03:00
Michael Shigorin
e238973c04 tar2fs: add ahci module
It's unwise to skip the common storage driver,
and vagrant (which uses virtualbox by default)
is likely to crash and burn as well.
2015-02-16 17:58:43 +03:00
Michael Shigorin
7b0501ae2a tar2fs: fix check for lilo binary
The check introduced by commit d7689f30 while rewriting tar2vm
(which presumed x86) was subtly broken: it checked for *host*
binary before preparing *chroot* configuration file for it.

Wonder how many build servers run lilo over here that this BUG
has managed to evade attention for almost two years...
2015-02-02 21:45:57 +03:00
Gleb Fotengauer-Malinovskiy
e177121ddf tar2vm: use UUID, prepare for virtio as well
Forward-port of b84182c5cb684afbd30ed1f9e5b6f89f55b4b53f
commit extended to handle /boot as well.
2014-03-20 19:46:53 +04:00
Michael Shigorin
9e162659a4 tar2fs: append to MODULES_PRELOAD, do not clobber
Thanks glebfm@ for spotting that it's = instead of +=
as it goes in all the other places; I remember no good
reason to overwrite the potentially preexisting contents.
2014-03-03 19:56:09 +04:00
Michael Shigorin
7c7d74b4d9 tags2lists: skip backup files too
Seeing tagged/base+rescue~ in build.log isn't particularly
heart-warming; while other editors but the one leaving tilda
marked backups and .sw* swap files might exist let's do this
step at this time.

Wonder what changed though, this used not to happen before.
2014-01-16 15:52:12 +04:00
Michael Shigorin
4918019b29 tar2fs: use -s Luke
Really no need to test and sleep when there's sync mode.
2013-07-22 23:40:58 +04:00