Commit Graph

57 Commits

Author SHA1 Message Date
Anton Midyukov
5c4f4aabd1 Remove lilo support
lilo is stagnating, it is better to prepare in advance for the fact
that it will not exist.
2023-10-01 22:05:36 +07:00
Anton Midyukov
a4f89be95b tar2fs: do not install grub to /EFI/altlinux, install prebuilt grub image always
The idea is to not embed grub.cfg in the efi image, in order to determine the
installed grub in EFI/BOOT/boot*.efi by grub.cfg.
In the case of x86_64, the prebuilt uefi image is always used.
2023-08-21 20:10:32 +07:00
Anton Midyukov
36d25f43c9 tar2fs, e2k: replace creating boot.conf from tar2fs to feature e2k 2023-08-21 20:10:07 +07:00
Anton Midyukov
265b5e6fdf tar2fs: install grub-pc for x86_64 with UEFI
Both UEFI and Legacy BIOS are supported on x86_64 machines. Now the
image x86_64 will be bootloaded on both.
2023-07-18 18:16:32 +07:00
Anton Midyukov
4ed779d7fb tar2fs: add grub-efi install on loongarch64 2023-07-18 15:01:51 +07:00
Anton Midyukov
8497d394a0 tar2fs: install grub-efi to EFI/altlinux also (--no-nvram)
grub-efi-autoupdate does not update grub in EFI/BOOT if there is
no shim and EFI/altlinux.
See https://bugzilla.altlinux.org/41959
2023-07-18 14:47:09 +07:00
Anton Midyukov
fff98d416f tar2fs, build-vm: add VM_BOOTSIZE for change size /boot partition 2023-07-03 14:50:13 +07:00
Anton Midyukov
37dce2b242 tar2fs: create /boot partition with ext4, if extlinux.conf and '/' is not ext4 2023-07-03 14:50:13 +07:00
Anton Midyukov
f4a4a6bff7 tar2fs: drop armh grub-efi support (not supported) 2023-04-17 12:59:41 +07:00
Anton Midyukov
aa2320bb17 tar2fs: grub-install --uefi-secureboot for all platforms
Use a prebuilt grub image for EFI, creating BOOT/EFI/grub.cfg
2023-04-17 12:58:50 +07:00
Michael Shigorin
1a33a37aca tar2fs: avoid losetup race
There's a race condition (TOCTOU) between losetup --find
and applying the obtained path after additional dd in between;
twice awful as *at least* running both losetups closely would
reduce the window significantly, and reading the manpage
properly back then would eliminate this.

Reported-by: Anton Midyukov <antohami@altlinux.org>
Suggested-by: Gleb F-Malinovskiy <glebfm@altlinux.org>
2022-04-05 14:12:14 +07:00
Anton Midyukov
b1923f94a3 tar2fs: start partitions from 34 MiB for riscv64
This space is reserved for installation U-Boot.
2021-11-22 22:30:28 +07:00
Dmitriy Terekhin
10b37d45f3 tar2fs: fix syntax of legacy_boot parameter
Parameter "legacyboot" causes an error:
parted: invalid token: legacyboot
2021-09-04 21:52:15 +07:00
Anton Midyukov
edd7cceddb tar2fs: Mark root partition as bootable if extlinux.conf is present
Booting from extlinux.conf is preferred over booting in EFI mode.
2021-07-23 16:02:03 +07:00
Anton Midyukov
1fcd9baad8 tar2fs: Add offset 16 MiB for singleboard PC support
This space can be used by single board for u-boot.
2021-07-23 16:02:03 +07:00
Michael Shigorin
ee8892702f tar2fs: fix e2k handling
The missing glob resulted in disk images properly
partitioned only for e2kv3 ("e2k" for historical
reasons in ALT), and v4+ ones only got a single
ext4 partition that wouldn't work with current
MCST's Boot code.
2021-04-28 17:54:19 +07:00
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
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
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
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
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