diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2019-12-17 09:44:50 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2019-12-17 09:44:50 +0000 |
| commit | ccc9ebe053cdaee6e64cbd63967f963e83c6c4da (patch) | |
| tree | a0324f44d377f889e8c2e7535916ee1112c722be /usr.sbin | |
| parent | aa87d54aa5a81c712b9742b43edd5f41cd9cb0ef (diff) | |
Pull up following revision(s) (requested by martin in ticket #560):
usr.sbin/sysinst/partitions.h: revision 1.11
usr.sbin/sysinst/defs.h: revision 1.49
usr.sbin/sysinst/mbr.c: revision 1.23
usr.sbin/sysinst/msg.mi.en: revision 1.26
usr.sbin/sysinst/disks.c: revision 1.58
usr.sbin/sysinst/arch/evbarm/menus.md.pl: revision 1.2
usr.sbin/sysinst/msg.mi.es: revision 1.20
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.9
usr.sbin/sysinst/gpt.c: revision 1.13
usr.sbin/sysinst/arch/evbarm/md.c: revision 1.10
usr.sbin/sysinst/arch/arc/md.c: revision 1.10
usr.sbin/sysinst/disklabel.c: revision 1.18
usr.sbin/sysinst/bsddisklabel.c: revision 1.33
usr.sbin/sysinst/disklabel.c: revision 1.19
usr.sbin/sysinst/main.c: revision 1.19
usr.sbin/sysinst/partman.c: revision 1.45
usr.sbin/sysinst/arch/alpha/md.c: revision 1.7
usr.sbin/sysinst/msg.mi.de: revision 1.19
usr.sbin/sysinst/arch/evbarm/menus.md.en: revision 1.2
usr.sbin/sysinst/arch/x68k/md.h: revision 1.4
usr.sbin/sysinst/arch/x68k/md.c: revision 1.9
usr.sbin/sysinst/arch/evbarm/menus.md.es: revision 1.2
usr.sbin/sysinst/wskbd.c: revision 1.4
usr.sbin/sysinst/label.c: revision 1.15
usr.sbin/sysinst/arch/amiga/md.h: revision 1.5
usr.sbin/sysinst/label.c: revision 1.16
usr.sbin/sysinst/arch/hp300/md.c: revision 1.9
usr.sbin/sysinst/arch/emips/md.c: revision 1.8
usr.sbin/sysinst/label.c: revision 1.17
usr.sbin/sysinst/arch/pmax/md.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.6
usr.sbin/sysinst/arch/prep/md.c: revision 1.10
usr.sbin/sysinst/arch/mipsco/md.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.8
usr.sbin/sysinst/arch/ews4800mips/md.c: revision 1.5
usr.sbin/sysinst/disklabel.c: revision 1.20
usr.sbin/sysinst/arch/evbarm/menus.md.fr: revision 1.2
usr.sbin/sysinst/msg.mi.fr: revision 1.24
usr.sbin/sysinst/disklabel.c: revision 1.21
usr.sbin/sysinst/partitions.h: revision 1.9
usr.sbin/sysinst/msg.mi.pl: revision 1.27
usr.sbin/sysinst/disklabel.c: revision 1.22
usr.sbin/sysinst/disklabel.c: revision 1.23
usr.sbin/sysinst/arch/i386/md.c: revision 1.27
usr.sbin/sysinst/disklabel.c: revision 1.24
usr.sbin/sysinst/disklabel.c: revision 1.25
usr.sbin/sysinst/arch/cobalt/md.h: revision 1.5
usr.sbin/sysinst/disklabel.c: revision 1.26
usr.sbin/sysinst/disklabel.c: revision 1.27
usr.sbin/sysinst/partitions.h: revision 1.10
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.10
PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.
Get rid of the evbarm preliminary menu: do not bother to ask the user
whether this is a RPi - query the FDT instead.
PR 54065: add optional "old compat" variant of ext2fs in file system
type selection and use that as default for the cobalt boot file system.
For now rely on the kernel mapping native RDB partitions.
Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.
Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)
Fix inverted comparison
Do not try to change the keyboard layout if we are not running on the
console.
When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.
Remove bogus assert.
When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.
Adapt MD parts to changes in get_fs_part_type (pass partition type).
If a fictious label has no RAW_PART assume there is no valid disk label.
Pass proper track size when initializing the default alignment - this is
important with sunlabels.
Fix overlapping partitions display
Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.
Do not show disklabel command invocation by default (only if there are
errors).
After installing boot blocks with RUN_NO_CLEAR (and handling the
potential errors) make sure to clear the stdscreen.
Diffstat (limited to 'usr.sbin')
37 files changed, 232 insertions, 119 deletions
diff --git a/usr.sbin/sysinst/arch/alpha/md.c b/usr.sbin/sysinst/arch/alpha/md.c index 799037ae979..94f5ea11b08 100644 --- a/usr.sbin/sysinst/arch/alpha/md.c +++ b/usr.sbin/sysinst/arch/alpha/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.6 2019/07/13 17:13:36 martin Exp $ */ +/* $NetBSD: md.c,v 1.6.2.1 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -166,6 +166,11 @@ md_post_newfs(struct install_partition_desc *install) process_menu(MENU_ok, __UNCONST("Warning: disk is probably not bootable")); + wclear(stdscr); + touchwin(stdscr); + clearok(stdscr, 1); + refresh(); + return 0; } diff --git a/usr.sbin/sysinst/arch/amiga/md.h b/usr.sbin/sysinst/arch/amiga/md.h index f3058de547c..1e674ef9a89 100644 --- a/usr.sbin/sysinst/arch/amiga/md.h +++ b/usr.sbin/sysinst/arch/amiga/md.h @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.3.2.1 2019/11/17 07:04:36 martin Exp $ */ +/* $NetBSD: md.h,v 1.3.2.2 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -71,6 +71,13 @@ /* + * We rely on kernel support to translate native RDB partitions + * to in-core disklabels, so we can not check for existance of "real" + * disklabels on-disk before offering disklabel partitions. + */ +#define DISKLABEL_NO_ONDISK_VERIFY 1 + +/* * prototypes for MD code. */ diff --git a/usr.sbin/sysinst/arch/arc/md.c b/usr.sbin/sysinst/arch/arc/md.c index bc3aac0b997..f4650c0a796 100644 --- a/usr.sbin/sysinst/arch/arc/md.c +++ b/usr.sbin/sysinst/arch/arc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:51 msaitoh Exp $ */ +/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -271,7 +271,7 @@ md_parts_use_wholedisk(struct disk_partitions *parts) }; boot_part.nat_type = parts->pscheme->get_fs_part_type( - boot_part.fs_type, boot_part.fs_sub_type); + PT_root, boot_part.fs_type, boot_part.fs_sub_type); return parts_use_wholedisk(parts, 1, &boot_part); } diff --git a/usr.sbin/sysinst/arch/cobalt/md.c b/usr.sbin/sysinst/arch/cobalt/md.c index 3bf3429b162..87c2bef32a6 100644 --- a/usr.sbin/sysinst/arch/cobalt/md.c +++ b/usr.sbin/sysinst/arch/cobalt/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:53 msaitoh Exp $ */ +/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -286,7 +286,7 @@ md_parts_use_wholedisk(struct disk_partitions *parts) }; boot_part.nat_type = parts->pscheme->get_fs_part_type( - boot_part.fs_type, boot_part.fs_sub_type); + PT_root, boot_part.fs_type, boot_part.fs_sub_type); return parts_use_wholedisk(parts, 1, &boot_part); } diff --git a/usr.sbin/sysinst/arch/cobalt/md.h b/usr.sbin/sysinst/arch/cobalt/md.h index 9773d419a75..6cf757fc4aa 100644 --- a/usr.sbin/sysinst/arch/cobalt/md.h +++ b/usr.sbin/sysinst/arch/cobalt/md.h @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.3.2.1 2019/11/17 07:04:38 martin Exp $ */ +/* $NetBSD: md.h,v 1.3.2.2 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -48,6 +48,7 @@ #define PART_BOOT (5 * 1024 * 1024) /* 5MB boot partition */ #define PART_BOOT_MIN (1 * 1024 * 1024) /* 1MB minimum */ #define PART_BOOT_TYPE FS_EX2FS +#define PART_BOOT_SUBT 1 /* use "old" ext2 */ #define PART_BOOT_MOUNT "/stand" /* default partition size */ diff --git a/usr.sbin/sysinst/arch/emips/md.c b/usr.sbin/sysinst/arch/emips/md.c index 13d6aea0209..9a9e0813ea8 100644 --- a/usr.sbin/sysinst/arch/emips/md.c +++ b/usr.sbin/sysinst/arch/emips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.7 2019/07/13 17:13:37 martin Exp $ */ +/* $NetBSD: md.c,v 1.7.2.1 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -175,6 +175,11 @@ md_post_extract(struct install_partition_desc *install) "/bin/dd if=%s of=/dev/reflash0c bs=512", ldr_path)) process_menu(MENU_ok, __UNCONST("Warning: the system " "is probably not bootable")); + + wclear(stdscr); + touchwin(stdscr); + clearok(stdscr, 1); + refresh(); } return 0; diff --git a/usr.sbin/sysinst/arch/evbarm/md.c b/usr.sbin/sysinst/arch/evbarm/md.c index d8c9ffaa6d4..aad26db046b 100644 --- a/usr.sbin/sysinst/arch/evbarm/md.c +++ b/usr.sbin/sysinst/arch/evbarm/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:52 msaitoh Exp $ */ +/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -48,18 +48,20 @@ #include "msg_defs.h" #include "menu_defs.h" -int boardtype = 0; - -void -md_prelim_menu(void) -{ - /* get the boardtype from the user */ - process_menu(MENU_prelim, NULL); -} +int boardtype = BOARD_TYPE_NORMAL; void md_init(void) { + int rv; + + rv =run_program(RUN_SILENT|RUN_ERROR_OK, "sh -c 'ofctl -p / model | " + "fgrep \"Raspberry Pi\"'"); + if (rv != 0) + return; + + /* this is some kind of Raspberry Pi */ + boardtype = BOARD_TYPE_RPI; } void diff --git a/usr.sbin/sysinst/arch/evbarm/menus.md.en b/usr.sbin/sysinst/arch/evbarm/menus.md.en index b5bb3f3e99d..ece45209b35 100644 --- a/usr.sbin/sysinst/arch/evbarm/menus.md.en +++ b/usr.sbin/sysinst/arch/evbarm/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.1 2014/07/26 19:30:45 dholland Exp $ */ +/* $NetBSD: menus.md.en,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -35,7 +35,3 @@ /* evbarm machine dependent menus, english */ -menu prelim, title "What kind of system do you have?", y=-10; - option "Raspberry PI", exit, action { boardtype = 1; }; - option "Other", exit, action { boardtype = 0; }; - diff --git a/usr.sbin/sysinst/arch/evbarm/menus.md.es b/usr.sbin/sysinst/arch/evbarm/menus.md.es index 0823df2998c..8128c6929f9 100644 --- a/usr.sbin/sysinst/arch/evbarm/menus.md.es +++ b/usr.sbin/sysinst/arch/evbarm/menus.md.es @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.es,v 1.1 2014/07/26 19:30:45 dholland Exp $ */ +/* $NetBSD: menus.md.es,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -35,7 +35,3 @@ /* evbarm machine dependent menus, spanish */ -menu prelim, title "What kind of system do you have?", y=-10; - option "Raspberry PI", exit, action { boardtype = 1; }; - option "Other", exit, action { boardtype = 0; }; - diff --git a/usr.sbin/sysinst/arch/evbarm/menus.md.fr b/usr.sbin/sysinst/arch/evbarm/menus.md.fr index b28042212d6..4be4a478f8b 100644 --- a/usr.sbin/sysinst/arch/evbarm/menus.md.fr +++ b/usr.sbin/sysinst/arch/evbarm/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.1 2014/07/26 19:30:45 dholland Exp $ */ +/* $NetBSD: menus.md.fr,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -35,7 +35,3 @@ /* evbarm machine dependent menus, french */ -menu prelim, title "What kind of system do you have?", y=-10; - option "Raspberry PI", exit, action { boardtype = 1; }; - option "Other", exit, action { boardtype = 0; }; - diff --git a/usr.sbin/sysinst/arch/evbarm/menus.md.pl b/usr.sbin/sysinst/arch/evbarm/menus.md.pl index 3b506ac6d5f..e37cd113446 100644 --- a/usr.sbin/sysinst/arch/evbarm/menus.md.pl +++ b/usr.sbin/sysinst/arch/evbarm/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.1 2014/07/26 19:30:45 dholland Exp $ */ +/* $NetBSD: menus.md.pl,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.2 2002/03/31 02:14:06 thorpej Exp */ @@ -37,7 +37,3 @@ /* evbarm machine dependent menus, Polish */ -menu prelim, title "What kind of system do you have?", y=-10; - option "Raspberry PI", exit, action { boardtype = 1; }; - option "Other", exit, action { boardtype = 0; }; - diff --git a/usr.sbin/sysinst/arch/ews4800mips/md.c b/usr.sbin/sysinst/arch/ews4800mips/md.c index 8cd9883b735..e2beae501de 100644 --- a/usr.sbin/sysinst/arch/ews4800mips/md.c +++ b/usr.sbin/sysinst/arch/ews4800mips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.4 2019/07/13 17:13:37 martin Exp $ */ +/* $NetBSD: md.c,v 1.4.2.1 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -259,7 +259,7 @@ md_parts_use_wholedisk(struct disk_partitions *parts) }; boot_part.nat_type = parts->pscheme->get_fs_part_type( - boot_part.fs_type, boot_part.fs_sub_type); + PT_root, boot_part.fs_type, boot_part.fs_sub_type); return parts_use_wholedisk(parts, 1, &boot_part); } diff --git a/usr.sbin/sysinst/arch/hp300/md.c b/usr.sbin/sysinst/arch/hp300/md.c index 1f26c5a6f02..a5e32cd8da6 100644 --- a/usr.sbin/sysinst/arch/hp300/md.c +++ b/usr.sbin/sysinst/arch/hp300/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.8 2019/07/13 17:13:37 martin Exp $ */ +/* $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -187,6 +187,12 @@ md_post_newfs(struct install_partition_desc *install) "/usr/sbin/installboot /dev/r%sc /usr/mdec/uboot.lif", pm->diskdev)) process_menu(MENU_ok, __UNCONST("Warning: disk is probably not bootable")); + + wclear(stdscr); + touchwin(stdscr); + clearok(stdscr, 1); + refresh(); + return 0; } diff --git a/usr.sbin/sysinst/arch/i386/md.c b/usr.sbin/sysinst/arch/i386/md.c index 2c29f0d71dc..7f7e588791a 100644 --- a/usr.sbin/sysinst/arch/i386/md.c +++ b/usr.sbin/sysinst/arch/i386/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.20.2.3 2019/11/19 06:19:04 msaitoh Exp $ */ +/* $NetBSD: md.c,v 1.20.2.4 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -837,8 +837,6 @@ md_gpt_post_write(struct disk_partitions *parts, part_id root_id, { struct disk_part_info info; - assert(efi_id == NO_PART); /* XXX EFI support still missing */ - if (root_id != NO_PART) { /* we always update the gpt boot record for now */ if (!parts->pscheme->get_part_info(parts, root_id, &info)) diff --git a/usr.sbin/sysinst/arch/mipsco/md.c b/usr.sbin/sysinst/arch/mipsco/md.c index 8fc0c04d27d..71e4b1fd2e8 100644 --- a/usr.sbin/sysinst/arch/mipsco/md.c +++ b/usr.sbin/sysinst/arch/mipsco/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.6 2019/07/13 17:13:39 martin Exp $ */ +/* $NetBSD: md.c,v 1.6.2.1 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -168,6 +168,12 @@ md_post_newfs(struct install_partition_desc *install) "/usr/mdec/installboot /dev/r%sc /usr/mdec/bootxx_ffs", pm->diskdev)) process_menu(MENU_ok, __UNCONST("Warning: disk is probably not bootable")); + + wclear(stdscr); + touchwin(stdscr); + clearok(stdscr, 1); + refresh(); + return 0; } diff --git a/usr.sbin/sysinst/arch/mvme68k/md.c b/usr.sbin/sysinst/arch/mvme68k/md.c index cef2e415b5c..e2ad2b75f0c 100644 --- a/usr.sbin/sysinst/arch/mvme68k/md.c +++ b/usr.sbin/sysinst/arch/mvme68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.8 2019/07/13 17:13:39 martin Exp $ */ +/* $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -190,6 +190,12 @@ md_post_newfs(struct install_partition_desc *install) target_expand("/.bootsd"), pm->diskdev)) process_menu(MENU_ok, __UNCONST("Warning: disk is probably not bootable")); + + wclear(stdscr); + touchwin(stdscr); + clearok(stdscr, 1); + refresh(); + return 0; } diff --git a/usr.sbin/sysinst/arch/pmax/md.c b/usr.sbin/sysinst/arch/pmax/md.c index 2cbc8894e85..753ccc8d96b 100644 --- a/usr.sbin/sysinst/arch/pmax/md.c +++ b/usr.sbin/sysinst/arch/pmax/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.6 2019/07/13 17:13:39 martin Exp $ */ +/* $NetBSD: md.c,v 1.6.2.1 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -177,6 +177,11 @@ md_post_newfs(struct install_partition_desc *install) process_menu(MENU_ok, __UNCONST("Warning: disk is probably not bootable")); + wclear(stdscr); + touchwin(stdscr); + clearok(stdscr, 1); + refresh(); + return 0; } diff --git a/usr.sbin/sysinst/arch/prep/md.c b/usr.sbin/sysinst/arch/prep/md.c index a167791f7e7..b5d30a1cef3 100644 --- a/usr.sbin/sysinst/arch/prep/md.c +++ b/usr.sbin/sysinst/arch/prep/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:52 msaitoh Exp $ */ +/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:51 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -282,7 +282,7 @@ md_parts_use_wholedisk(struct disk_partitions *parts) }; boot_part.nat_type = parts->pscheme->get_fs_part_type( - boot_part.fs_type, boot_part.fs_sub_type); + PT_root, boot_part.fs_type, boot_part.fs_sub_type); return parts_use_wholedisk(parts, 1, &boot_part); } diff --git a/usr.sbin/sysinst/arch/x68k/md.c b/usr.sbin/sysinst/arch/x68k/md.c index 94d5b5f42f9..24498371263 100644 --- a/usr.sbin/sysinst/arch/x68k/md.c +++ b/usr.sbin/sysinst/arch/x68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.8 2019/07/13 17:13:40 martin Exp $ */ +/* $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -276,6 +276,12 @@ md_post_newfs(struct install_partition_desc *install) pm->diskdev)) process_menu(MENU_ok, __UNCONST("Warning: disk is probably not bootable")); + + wclear(stdscr); + touchwin(stdscr); + clearok(stdscr, 1); + refresh(); + return 0; } diff --git a/usr.sbin/sysinst/arch/x68k/md.h b/usr.sbin/sysinst/arch/x68k/md.h index 49ca21efd84..fb5527ae986 100644 --- a/usr.sbin/sysinst/arch/x68k/md.h +++ b/usr.sbin/sysinst/arch/x68k/md.h @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.2.2.1 2019/11/17 07:04:35 martin Exp $ */ +/* $NetBSD: md.h,v 1.2.2.2 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -89,3 +89,10 @@ * On x68k, do what the 1.2 install scripts did. */ #define DISKLABEL_CMD "disklabel -w" + +/* + * We rely on kernel support to translate Human68k partitions + * to in-core disklabels, so we can not check for existance of "real" + * disklabels on-disk before offering disklabel partitions. + */ +#define DISKLABEL_NO_ONDISK_VERIFY 1 diff --git a/usr.sbin/sysinst/bsddisklabel.c b/usr.sbin/sysinst/bsddisklabel.c index a1bacfcd6d3..e0ed54a85f7 100644 --- a/usr.sbin/sysinst/bsddisklabel.c +++ b/usr.sbin/sysinst/bsddisklabel.c @@ -1,4 +1,4 @@ -/* $NetBSD: bsddisklabel.c,v 1.23.2.7 2019/12/09 19:33:25 bouyer Exp $ */ +/* $NetBSD: bsddisklabel.c,v 1.23.2.8 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1320,7 +1320,7 @@ apply_settings_to_partitions(struct pm_devs *p, struct disk_partitions *parts, infos[i].size = min(want->size, space.size); infos[i].nat_type = ps->pscheme->get_fs_part_type( - want->fs_type, want->fs_version); + want->type, want->fs_type, want->fs_version); infos[i].last_mounted = want->mount; infos[i].fs_type = want->fs_type; infos[i].fs_sub_type = want->fs_version; @@ -1400,7 +1400,7 @@ apply_settings_to_partitions(struct pm_devs *p, struct disk_partitions *parts, infos[i].size = min(want->size, space.size); infos[i].nat_type = wanted->parts->pscheme->get_fs_part_type( - want->fs_type, want->fs_version); + want->type, want->fs_type, want->fs_version); infos[i].last_mounted = want->mount; infos[i].fs_type = want->fs_type; infos[i].fs_sub_type = want->fs_version; @@ -1444,7 +1444,7 @@ apply_settings_to_partitions(struct pm_devs *p, struct disk_partitions *parts, infos[i].start = want->cur_start; infos[i].size = want->size; infos[i].nat_type = wanted->parts->pscheme->get_fs_part_type( - want->fs_type, want->fs_version); + want->type, want->fs_type, want->fs_version); infos[i].last_mounted = want->mount; infos[i].fs_type = want->fs_type; infos[i].fs_sub_type = want->fs_version; diff --git a/usr.sbin/sysinst/defs.h b/usr.sbin/sysinst/defs.h index 858661d1317..c3d9ab2aee6 100644 --- a/usr.sbin/sysinst/defs.h +++ b/usr.sbin/sysinst/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.42.2.4 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: defs.h,v 1.42.2.5 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -583,7 +583,6 @@ void remove_gpt_options(void); /* Machine dependent functions .... */ void md_init(void); -void md_prelim_menu(void); void md_init_set_status(int); /* SFLAG_foo */ /* MD functions if user selects install - in order called */ diff --git a/usr.sbin/sysinst/disklabel.c b/usr.sbin/sysinst/disklabel.c index 2566e3815ad..3dc16931ef8 100644 --- a/usr.sbin/sysinst/disklabel.c +++ b/usr.sbin/sysinst/disklabel.c @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.10.2.6 2019/12/09 19:31:18 bouyer Exp $ */ +/* $NetBSD: disklabel.c,v 1.10.2.7 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -170,10 +170,16 @@ disklabel_parts_read(const char *disk, daddr_t start, daddr_t len, int fd; char diskpath[MAXPATHLEN]; uint flags; +#ifndef DISKLABEL_NO_ONDISK_VERIFY + bool have_raw_label = false; + /* + * Verify we really have a disklabel. + */ if (run_program(RUN_SILENT | RUN_ERROR_OK, - "disklabel -r %s", disk) != 0) - return NULL; + "disklabel -r %s", disk) == 0) + have_raw_label = true; +#endif /* read partitions */ @@ -219,7 +225,7 @@ disklabel_parts_read(const char *disk, daddr_t start, daddr_t len, parts->dp.disk = strdup(disk); parts->dp.disk_start = start; parts->dp.disk_size = parts->dp.free_space = len; - disklabel_init_default_alignment(parts, 0); + disklabel_init_default_alignment(parts, parts->l.d_secpercyl); for (int part = 0; part < parts->l.d_npartitions; part++) { if (parts->l.d_partitions[part].p_fstype == FS_UNUSED @@ -259,6 +265,42 @@ disklabel_parts_read(const char *disk, daddr_t start, daddr_t len, } close(fd); +#ifndef DISKLABEL_NO_ONDISK_VERIFY + if (!have_raw_label) { + bool found_real_part = false; + + if (parts->l.d_npartitions <= RAW_PART || + parts->l.d_partitions[RAW_PART].p_size == 0) + goto no_valid_label; + + /* + * Check if kernel translation gave us "something" besides + * the raw or the whole-disk partition. + * If not: report missing disklabel. + */ + for (int part = 0; part < parts->l.d_npartitions; part++) { + if (parts->l.d_partitions[part].p_fstype == FS_UNUSED) + continue; + if (part == 0 && + parts->l.d_partitions[part].p_offset == + parts->l.d_partitions[RAW_PART].p_offset && + parts->l.d_partitions[part].p_size == + parts->l.d_partitions[RAW_PART].p_size) + continue; + if (part == RAW_PART) + continue; + found_real_part = true; + break; + } + if (!found_real_part) { + /* no partion there yet */ +no_valid_label: + free(parts); + return NULL; + } + } +#endif + return &parts->dp; } @@ -373,7 +415,7 @@ disklabel_write_to_disk(struct disk_partitions *arg) */ #ifdef DISKLABEL_CMD /* disklabel the disk */ - rv = run_program(RUN_DISPLAY, "%s -f %s %s '%s' '%s'", + rv = run_program(0, "%s -f %s %s '%s' '%s'", DISKLABEL_CMD, fname, disk, disktype, packname); #endif @@ -598,7 +640,7 @@ disklabel_create_custom_part_type(const char *custom, const char **err_msg) } static const struct part_type_desc * -disklabel_get_fs_part_type(unsigned fstype, unsigned subtype) +disklabel_get_fs_part_type(enum part_type pt, unsigned fstype, unsigned subtype) { return disklabel_find_type(fstype, false); } diff --git a/usr.sbin/sysinst/disks.c b/usr.sbin/sysinst/disks.c index a0ea8e57f11..fd414785d6e 100644 --- a/usr.sbin/sysinst/disks.c +++ b/usr.sbin/sysinst/disks.c @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.44.2.11 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: disks.c,v 1.44.2.12 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -113,6 +113,8 @@ getfslabelname(uint f, uint f_version) else if (f == FS_BSDFFS && f_version > 0) return f_version == 2 ? msg_string(MSG_fs_type_ffsv2) : msg_string(MSG_fs_type_ffs); + else if (f == FS_EX2FS && f_version == 1) + return msg_string(MSG_fs_type_ext2old); else if (f >= __arraycount(fstypenames) || fstypenames[f] == NULL) return "invalid"; return fstypenames[f]; @@ -1177,7 +1179,10 @@ make_filesystems(struct install_partition_desc *install) fsname = "v7fs"; break; case FS_EX2FS: - asprintf(&newfs, "/sbin/newfs_ext2fs"); + asprintf(&newfs, + ptn->fs_version == 1 ? + "/sbin/newfs_ext2fs -O 0" : + "/sbin/newfs_ext2fs"); mnt_opts = "-text2fs"; fsname = "ext2fs"; break; diff --git a/usr.sbin/sysinst/gpt.c b/usr.sbin/sysinst/gpt.c index 4462e3a9fe3..ae50a282052 100644 --- a/usr.sbin/sysinst/gpt.c +++ b/usr.sbin/sysinst/gpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.c,v 1.6.2.6 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: gpt.c,v 1.6.2.7 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -874,10 +874,17 @@ gpt_find_type(const char *desc) } static const struct part_type_desc * -gpt_get_fs_part_type(unsigned fstype, unsigned fs_sub_type) +gpt_get_fs_part_type(enum part_type pt, unsigned fstype, unsigned fs_sub_type) { size_t i; + /* Try with complet match (including part_type) first */ + for (i = 0; i < __arraycount(gpt_fs_types); i++) + if (fstype == gpt_fs_types[i].fstype && + pt == gpt_fs_types[i].ptype) + return gpt_find_type(gpt_fs_types[i].name); + + /* If that did not work, ignore part_type */ for (i = 0; i < __arraycount(gpt_fs_types); i++) if (fstype == gpt_fs_types[i].fstype) return gpt_find_type(gpt_fs_types[i].name); diff --git a/usr.sbin/sysinst/label.c b/usr.sbin/sysinst/label.c index e8d3b2c962f..b81db195a9b 100644 --- a/usr.sbin/sysinst/label.c +++ b/usr.sbin/sysinst/label.c @@ -1,4 +1,4 @@ -/* $NetBSD: label.c,v 1.10.2.3 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: label.c,v 1.10.2.4 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Jonathan Stone @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: label.c,v 1.10.2.3 2019/11/17 13:45:26 msaitoh Exp $"); +__RCSID("$NetBSD: label.c,v 1.10.2.4 2019/12/17 09:44:50 msaitoh Exp $"); #endif #include <sys/types.h> @@ -60,8 +60,7 @@ __RCSID("$NetBSD: label.c,v 1.10.2.3 2019/11/17 13:45:26 msaitoh Exp $"); * local prototypes */ static bool boringpart(const struct disk_part_info *info); -static bool checklabel(struct disk_partitions*, char[MENUSTRSIZE], - char[MENUSTRSIZE]); +static bool checklabel(struct disk_partitions*, char *, char *); static void show_partition_adder(menudesc *, struct partition_usage_set*); /* @@ -107,7 +106,7 @@ real_partition(const struct partition_usage_set *pset, int index) */ static bool checklabel(struct disk_partitions *parts, - char ovl1[MENUSTRSIZE], char ovl2[MENUSTRSIZE]) + char *ovl1, char *ovl2) { part_id i, j; struct disk_part_info info; @@ -124,7 +123,7 @@ checklabel(struct disk_partitions *parts, /* * check succeeding partitions for overlap. - * O(n^2), but n is small (currently <= 16). + * O(n^2), but n is small. */ istart = info.start; iend = istart + info.size; @@ -146,12 +145,12 @@ checklabel(struct disk_partitions *parts, /* overlap? */ if ((istart <= jstart && jstart < iend) || (jstart <= istart && istart < jend)) { - snprintf(ovl1, sizeof(*ovl1), + snprintf(ovl1, MENUSTRSIZE, "%" PRIu64 " - %" PRIu64 " %s, %s", istart / sizemult, iend / sizemult, multname, getfslabelname(fs_type, fs_sub_type)); - snprintf(ovl2, sizeof(*ovl2), + snprintf(ovl2, MENUSTRSIZE, "%" PRIu64 " - %" PRIu64 " %s, %s", jstart / sizemult, jend / sizemult, multname, @@ -461,6 +460,9 @@ init_fs_type_ext(menudesc *menu, void *arg) else menu->cursel = 1; return; + } else if (t == FS_EX2FS && edit->info.fs_sub_type == 1) { + menu->cursel = FSMAXTYPES; + return; } /* skip the two FFS entries, and do not add FFS later again */ for (ndx = 2, i = 0; i < FSMAXTYPES && ndx < max; i++) { @@ -484,17 +486,16 @@ set_fstype_ext(menudesc *menu, void *arg) { struct single_part_fs_edit *edit = arg; size_t i, ndx, max = menu->numopts; + enum part_type pt; if (menu->cursel == 0 || menu->cursel == 1) { edit->info.fs_type = FS_BSDFFS; edit->info.fs_sub_type = menu->cursel == 0 ? 2 : 1; - edit->info.nat_type = edit->pset->parts->pscheme-> - get_fs_part_type(edit->info.fs_type, - edit->info.fs_sub_type); - edit->wanted->type = edit->info.nat_type->generic_ptype; - edit->wanted->fs_type = edit->info.fs_type; - edit->wanted->fs_version = edit->info.fs_sub_type; - return 1; + goto found_type; + } else if (menu->cursel == FSMAXTYPES) { + edit->info.fs_type = FS_EX2FS; + edit->info.fs_sub_type = 1; + goto found_type; } for (ndx = 2, i = 0; i < FSMAXTYPES && ndx < max; i++) { @@ -508,19 +509,23 @@ set_fstype_ext(menudesc *menu, void *arg) if (ndx == (size_t)menu->cursel) { edit->info.fs_type = i; edit->info.fs_sub_type = 0; - edit->info.nat_type = edit->pset->parts->pscheme-> - get_fs_part_type(i, 0); - if (edit->info.nat_type == NULL) - edit->info.nat_type = edit->pset->parts-> - pscheme->get_generic_part_type(PT_root); - edit->wanted->type = edit->info.nat_type->generic_ptype; - edit->wanted->fs_type = edit->info.fs_type; - edit->wanted->fs_version = edit->info.fs_sub_type; - break; + goto found_type; } ndx++; } return 1; + +found_type: + pt = edit->info.nat_type ? edit->info.nat_type->generic_ptype : PT_root; + edit->info.nat_type = edit->pset->parts->pscheme-> + get_fs_part_type(pt, edit->info.fs_type, edit->info.fs_sub_type); + if (edit->info.nat_type == NULL) + edit->info.nat_type = edit->pset->parts->pscheme-> + get_generic_part_type(PT_root); + edit->wanted->type = edit->info.nat_type->generic_ptype; + edit->wanted->fs_type = edit->info.fs_type; + edit->wanted->fs_version = edit->info.fs_sub_type; + return 1; } /* @@ -534,7 +539,7 @@ edit_fs_type_ext(menudesc *menu, void *arg) int m; size_t i, ndx, cnt; - cnt = __arraycount(fstypenames)-1; + cnt = __arraycount(fstypenames); opts = calloc(cnt, sizeof(*opts)); if (opts == NULL) return 1; @@ -557,6 +562,9 @@ edit_fs_type_ext(menudesc *menu, void *arg) opts[ndx].opt_action = set_fstype_ext; ndx++; } + opts[ndx].opt_name = msg_string(MSG_fs_type_ext2old); + opts[ndx].opt_action = set_fstype_ext; + ndx++; assert(ndx == cnt); m = new_menu(MSG_Select_the_type, opts, ndx, 30, 6, 10, 0, MC_SUBMENU | MC_SCROLL, @@ -596,13 +604,15 @@ static int set_fstype(menudesc *menu, void *arg) { struct single_part_fs_edit *edit = arg; + enum part_type pt; int ndx; + pt = edit->info.nat_type ? edit->info.nat_type->generic_ptype : PT_root; if (menu->cursel < 2) { edit->info.fs_type = FS_BSDFFS; edit->info.fs_sub_type = menu->cursel == 0 ? 2 : 1; edit->info.nat_type = edit->pset->parts->pscheme-> - get_fs_part_type(FS_BSDFFS, 2); + get_fs_part_type(pt, FS_BSDFFS, 2); if (edit->info.nat_type == NULL) edit->info.nat_type = edit->pset->parts-> pscheme->get_generic_part_type(PT_root); @@ -620,7 +630,7 @@ set_fstype(menudesc *menu, void *arg) edit->info.fs_type = edit_fs_common_types[ndx]; edit->info.fs_sub_type = 0; edit->info.nat_type = edit->pset->parts->pscheme-> - get_fs_part_type(edit->info.fs_type, 0); + get_fs_part_type(pt, edit->info.fs_type, 0); if (edit->info.nat_type == NULL) edit->info.nat_type = edit->pset->parts-> pscheme->get_generic_part_type(PT_root); @@ -644,6 +654,10 @@ edit_fs_type(menudesc *menu, void *arg) /* * Shortcut to full menu if we have an exotic value */ + if (edit->info.fs_type == FS_EX2FS && edit->info.fs_sub_type == 1) { + edit_fs_type_ext(menu, arg); + return 0; + } for (i = 0; i < __arraycount(edit_fs_common_types); i++) if (edit->info.fs_type == edit_fs_common_types[i]) break; @@ -789,7 +803,7 @@ edit_ptn(menudesc *menu, void *arg) edit.info.fs_type = FS_BSDFFS; edit.info.fs_sub_type = 2; edit.info.nat_type = pset->parts->pscheme-> - get_fs_part_type(edit.info.fs_type, + get_fs_part_type(PT_root, edit.info.fs_type, edit.info.fs_sub_type); edit.wanted->instflags = PUIINST_NEWFS; } diff --git a/usr.sbin/sysinst/main.c b/usr.sbin/sysinst/main.c index 4ed905264e7..216d809a1e5 100644 --- a/usr.sbin/sysinst/main.c +++ b/usr.sbin/sysinst/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.17.2.1 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: main.c,v 1.17.2.2 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -164,9 +164,6 @@ init_lang(void) multname = msg_string(MSG_secname); } -__weakref_visible void prelim_menu(void) - __weak_reference(md_prelim_menu); - int main(int argc, char **argv) { @@ -264,12 +261,6 @@ main(int argc, char **argv) get_kb_encoding(); init_lang(); -#ifdef __weak_reference - /* if md wants to ask anything before we start, do it now */ - if (prelim_menu != 0) - prelim_menu(); -#endif - /* Menu processing */ if (partman_go) partman(); diff --git a/usr.sbin/sysinst/mbr.c b/usr.sbin/sysinst/mbr.c index 3dc6d835b50..647575dae37 100644 --- a/usr.sbin/sysinst/mbr.c +++ b/usr.sbin/sysinst/mbr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.c,v 1.19.2.3 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: mbr.c,v 1.19.2.4 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1046,7 +1046,7 @@ mbr_get_part_type_count(void) } static const struct part_type_desc * -mbr_get_fs_part_type(unsigned fs_type, unsigned sub_type) +mbr_get_fs_part_type(enum part_type pt, unsigned fs_type, unsigned sub_type) { if (known_part_types == 0) map_mbr_part_types(); diff --git a/usr.sbin/sysinst/msg.mi.de b/usr.sbin/sysinst/msg.mi.de index b16f5d17461..7e182d4d920 100644 --- a/usr.sbin/sysinst/msg.mi.de +++ b/usr.sbin/sysinst/msg.mi.de @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.de,v 1.13.2.4 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: msg.mi.de,v 1.13.2.5 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1346,6 +1346,7 @@ message free_space_line {Speicherplatz bei $0..$1 $3 (Größe $2 $3)\n} message fs_type_ffsv2 {FFSv2} message fs_type_ffs {FFS} +message fs_type_ext2old {Linux Ext2 (old)} message other_fs_type {Anderer Typ} message editpack {Namen der Festplatte festlegen} diff --git a/usr.sbin/sysinst/msg.mi.en b/usr.sbin/sysinst/msg.mi.en index b000cfa383f..0b59507905d 100644 --- a/usr.sbin/sysinst/msg.mi.en +++ b/usr.sbin/sysinst/msg.mi.en @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.en,v 1.19.2.5 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: msg.mi.en,v 1.19.2.6 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1276,6 +1276,7 @@ message free_space_line {Space at $0..$1 $3 (size $2 $3)\n} message fs_type_ffsv2 {FFSv2} message fs_type_ffs {FFS} +message fs_type_ext2old {Linux Ext2 (old)} message other_fs_type {Other type} message editpack {Edit name of the disk} diff --git a/usr.sbin/sysinst/msg.mi.es b/usr.sbin/sysinst/msg.mi.es index ad16f7dfb21..240ad1e88e2 100644 --- a/usr.sbin/sysinst/msg.mi.es +++ b/usr.sbin/sysinst/msg.mi.es @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.es,v 1.14.2.4 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: msg.mi.es,v 1.14.2.5 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1326,6 +1326,7 @@ message free_space_line {Espacio en $0..$1 $3 (tamaño $2 $3)\n} message fs_type_ffsv2 {FFSv2} message fs_type_ffs {FFS} +message fs_type_ext2old {Linux Ext2 (old)} message other_fs_type {Other type} message editpack {Edit name of the disk} diff --git a/usr.sbin/sysinst/msg.mi.fr b/usr.sbin/sysinst/msg.mi.fr index 16f9d8aca3a..42d4f5a66f0 100644 --- a/usr.sbin/sysinst/msg.mi.fr +++ b/usr.sbin/sysinst/msg.mi.fr @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.fr,v 1.17.2.5 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: msg.mi.fr,v 1.17.2.6 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1378,6 +1378,7 @@ message free_space_line {Espace à $0..$1 $3 (taille $2 $3)\n} message fs_type_ffsv2 {FFSv2} message fs_type_ffs {FFS} +message fs_type_ext2old {Linux Ext2 (old)} message other_fs_type {Other type} message editpack {Changer le nom du disque} diff --git a/usr.sbin/sysinst/msg.mi.pl b/usr.sbin/sysinst/msg.mi.pl index d5f2973707d..4fba46f891b 100644 --- a/usr.sbin/sysinst/msg.mi.pl +++ b/usr.sbin/sysinst/msg.mi.pl @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.pl,v 1.20.2.5 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: msg.mi.pl,v 1.20.2.6 2019/12/17 09:44:50 msaitoh Exp $ */ /* Based on english version: */ /* NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp */ @@ -1275,6 +1275,7 @@ message free_space_line {Miejsce od $0..$1 $3 (rozmiar $2 $3)\n} message fs_type_ffsv2 {FFSv2} message fs_type_ffs {FFS} +message fs_type_ext2old {Linux Ext2 (old)} message other_fs_type {Inny typ} message editpack {Edytuj nazwe dysku} diff --git a/usr.sbin/sysinst/partitions.c b/usr.sbin/sysinst/partitions.c index 770e1b372d4..99411994df2 100644 --- a/usr.sbin/sysinst/partitions.c +++ b/usr.sbin/sysinst/partitions.c @@ -1,4 +1,4 @@ -/* $NetBSD: partitions.c,v 1.1.2.3 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: partitions.c,v 1.1.2.4 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -79,7 +79,9 @@ generic_adapt_foreign_part_info(const struct disk_partitions *myself, return false; /* slightly simplistic, enhance when needed */ - dest->nat_type = myself->pscheme->get_fs_part_type(dest->fs_type, + dest->nat_type = myself->pscheme->get_fs_part_type( + dest->nat_type ? dest->nat_type->generic_ptype : PT_root, + dest->fs_type, dest->fs_sub_type); if (dest->nat_type == NULL) dest->nat_type = myself->pscheme->get_generic_part_type( diff --git a/usr.sbin/sysinst/partitions.h b/usr.sbin/sysinst/partitions.h index 20fc6bbe20c..529c4e05d07 100644 --- a/usr.sbin/sysinst/partitions.h +++ b/usr.sbin/sysinst/partitions.h @@ -1,4 +1,4 @@ -/* $NetBSD: partitions.h,v 1.4.2.4 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: partitions.h,v 1.4.2.5 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -222,7 +222,8 @@ struct disk_partitioning_scheme { * Get the prefered native partition type for a specific file system * type (FS_*) and subtype (fs specific value) */ - const struct part_type_desc * (*get_fs_part_type)(unsigned, unsigned); + const struct part_type_desc * (*get_fs_part_type)( + enum part_type, unsigned, unsigned); /* * Create a custom partition type. If the type already exists * (or there is a collision), the old existing type will be @@ -579,3 +580,4 @@ bool generic_adapt_foreign_part_info( */ void partitions_init(void); void partitions_cleanup(void); + diff --git a/usr.sbin/sysinst/partman.c b/usr.sbin/sysinst/partman.c index b7ac2947617..e59259d6fa4 100644 --- a/usr.sbin/sysinst/partman.c +++ b/usr.sbin/sysinst/partman.c @@ -1,4 +1,4 @@ -/* $NetBSD: partman.c,v 1.41.2.2 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: partman.c,v 1.41.2.3 2019/12/17 09:44:50 msaitoh Exp $ */ /* * Copyright 2012 Eugene Lozovoy @@ -2138,7 +2138,8 @@ pm_setfstype(struct pm_devs *pm_cur, part_id id, int fstype, int fs_subtype) if (!pm_cur->parts->pscheme->get_part_info(pm_cur->parts, id, &info)) return; - info.nat_type = pm_cur->parts->pscheme->get_fs_part_type(fstype, fs_subtype); + info.nat_type = pm_cur->parts->pscheme->get_fs_part_type(PT_root, + fstype, fs_subtype); if (info.nat_type == NULL) return; info.fs_type = fstype; diff --git a/usr.sbin/sysinst/wskbd.c b/usr.sbin/sysinst/wskbd.c index b0d7c0d8f6b..21192229e0c 100644 --- a/usr.sbin/sysinst/wskbd.c +++ b/usr.sbin/sysinst/wskbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $ */ +/* $NetBSD: wskbd.c,v 1.3.2.1 2019/12/17 09:44:50 msaitoh Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $"); +__RCSID("$NetBSD: wskbd.c,v 1.3.2.1 2019/12/17 09:44:50 msaitoh Exp $"); #include <unistd.h> #include <stdlib.h> @@ -93,6 +93,13 @@ get_kb_encoding(void) menu_ent opt[__arraycount(kb_types)]; const char *dflt = msg_string(MSG_kb_default); + /* + * Check if we are running on a wscons keyboard at all, + * do not bother to try changing the layout if not. + */ + if (ioctl(0, WSKBDIO_GTYPE, &i) == -1) + return; + memset(opt, 0, sizeof(opt)); fd = open("/dev/wskbd0", O_WRONLY); if (fd < 0) |
