d7f55bad98
with proper options, and the installed system does not use NAME= syntax in fstab(5), use the device name we used to get here, instead of the name from fstab, it might be different to what the real system calls the device (compact flash root showing up as wd0 native, but sd? on the card reader used for updating it right now). This is an abuse of the upgrade functionality and in general pretty dangerous when multiple devices are used in the upgraded fstab (e.g. separate /usr), and it used to work more by accident with the old code. However, it is a quite usefull way to upgrade tiny systems with compact flash root, and it used to work - so support it properly (as far as we can). |
||
---|---|---|
.. | ||
arch | ||
aout2elf.c | ||
bsddisklabel.c | ||
checkrc.c | ||
configmenu.c | ||
defs.h | ||
defsizes.h | ||
disklabel.c | ||
disks_lfs.c | ||
disks.c | ||
endian.h | ||
factor.c | ||
geom.c | ||
gpt_uuid.c | ||
gpt.c | ||
install.c | ||
label.c | ||
main.c | ||
Makefile | ||
Makefile.inc | ||
mbr.c | ||
mbr.h | ||
menus.mi | ||
menus.pm | ||
msg_cmp.sh | ||
msg_xlat.sh | ||
msg.mbr.de | ||
msg.mbr.en | ||
msg.mbr.es | ||
msg.mbr.fr | ||
msg.mbr.pl | ||
msg.mi.de | ||
msg.mi.en | ||
msg.mi.es | ||
msg.mi.fr | ||
msg.mi.pl | ||
msg.pm.de | ||
msg.pm.en | ||
msg.pm.es | ||
msg.pm.fr | ||
msg.pm.pl | ||
net.c | ||
part_edit.c | ||
partitions.c | ||
partitions.h | ||
partman.c | ||
README.md_defs | ||
run.c | ||
sizemultname.c | ||
SPELLING.en | ||
target.c | ||
TODO | ||
txtwalk.c | ||
txtwalk.h | ||
unif.awk | ||
upgrade.c | ||
util.c | ||
wskbd.c |
/* $NetBSD: README.md_defs,v 1.1 2019/08/14 12:49:37 martin Exp $ */ The following is trying to document the most important machine dependent defines used in the sysinst code. If HAVE_GPT is true, the MD code may limit the space used for the GPT at the beginning of the disk to allow e.g. a bootloader being added after it (see evbarm on allwinner SoCs, u-boot is copied at 8k into the image). /* Size limit for the initial GPT part, in bytes */ #define MD_GPT_INITIAL_SIZE (8*1024) The default installation description is created as a static array using lots of conditionals. It may be overriden / replaced in the MD code (see below), an example for that is arch/i386/md.c when we have been booted from UEFI firmware. Name Value / example Description PART_BOOT (8*MEG) (undefined) if defined, a boot partition of this size (in bytes, rounded) will be part of the default partition suggestions. Must be compile time const! Use MD_PART_DEFAULTS if runtime adjustment is needed. PART_BOOT_MOUNT "/boot" (undefined) Add boot partition to fstab for this mount point PART_BOOT_TYPE FS_BSDFS Kind of filesystem used PART_BOOT_SUBT MBR_PTYPE_FAT12 File system specific sub type The boot partition is always inserted at the front of the suggested default partitions, to cope with firmwares that may not be able to load from the whole disk. If multiple boot partitions are required (see ofppc, where various schemes are supported, depending on exact model), the variables above can all be repeated with _BOOT1_ or _BOOT2_ name instead of _BOOT_. ATTENTION: PART_BOOT is in BYTE (not MB), while most other sizes (DEFROOTSIZE, DEFSWAP, ...) are in MB! The following macros provide optional MD hooks: MD_PART_DEFAULTS may be undefined used like: void MD_PART_DEFAULTS(struct pm_dev*, struct part_usage_info*, size_t num_usage_infos), Called before any of the partition usage defaults is ever used, can be used to adjust e.g. partition sizes to actual system requirements (align boot partition with cylindersize), or (since it is a macro and all params are by references) to completely swap the defaults (e.g. EFI vs. biosboot). If swapping, make sure allocation and num_usage_infos stays consistent, old allocation is done by calloc(3), use free(3) to release. MD_NEED_BOOTBLOCK may be undefined used like: bool MD_NEED_BOOTBLOCK(struct install_partition_desc *install) returns true if this setup needs boot blocks. Used for example on x86 when UEFI installs do not need any bootblocks, but BIOS ones do. HAVE_PLAIN_DISKLABEL_BOOT may be undefined, only used on architectures that have MBR as primary with disklabel as secondary partitioning scheme (RAW_PART != 2) used like: bool HAVE_PLAIN_DISKLABEL_BOOT(const char *disk) returns true if the disk could be made bootable with only a disklabel (and no MBR).