Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Reintroduce scripting for writing the diskl...
details: https://anonhg.NetBSD.org/src/rev/43adae63f87d
branches: trunk
changeset: 461965:43adae63f87d
user: martin <martin%NetBSD.org@localhost>
date: Sun Jul 21 11:36:34 2019 +0000
description:
Reintroduce scripting for writing the disklabel
diffstat:
usr.sbin/sysinst/disklabel.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diffs (52 lines):
diff -r c2ea559a8416 -r 43adae63f87d usr.sbin/sysinst/disklabel.c
--- a/usr.sbin/sysinst/disklabel.c Sun Jul 21 11:35:36 2019 +0000
+++ b/usr.sbin/sysinst/disklabel.c Sun Jul 21 11:36:34 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.7 2019/07/12 18:22:36 martin Exp $ */
+/* $NetBSD: disklabel.c,v 1.8 2019/07/21 11:36:34 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -300,32 +300,34 @@
sizeof(parts->l.d_typename));
lp = parts->l.d_partitions;
- fprintf(f, "%s|NetBSD installation generated:\\\n",
+ scripting_fprintf(NULL, "cat <<EOF >%s\n", fname);
+ scripting_fprintf(f, "%s|NetBSD installation generated:\\\n",
parts->l.d_typename);
- fprintf(f, "\t:nc#%d:nt#%d:ns#%d:\\\n",
+ scripting_fprintf(f, "\t:nc#%d:nt#%d:ns#%d:\\\n",
parts->l.d_ncylinders, parts->l.d_ntracks, parts->l.d_nsectors);
- fprintf(f, "\t:sc#%d:su#%" PRIu32 ":\\\n",
+ scripting_fprintf(f, "\t:sc#%d:su#%" PRIu32 ":\\\n",
parts->l.d_secpercyl, lp[RAW_PART].p_offset+lp[RAW_PART].p_size);
- fprintf(f, "\t:se#%d:\\\n", parts->l.d_secsize);
+ scripting_fprintf(f, "\t:se#%d:\\\n", parts->l.d_secsize);
for (i = 0; i < parts->l.d_npartitions; i++) {
- fprintf(f, "\t:p%c#%" PRIu32 ":o%c#%" PRIu32
+ scripting_fprintf(f, "\t:p%c#%" PRIu32 ":o%c#%" PRIu32
":t%c=%s:", 'a'+i, (uint32_t)lp[i].p_size,
'a'+i, (uint32_t)lp[i].p_offset, 'a'+i,
getfslabelname(lp[i].p_fstype, 0));
if (lp[i].p_fstype == FS_BSDLFS ||
lp[i].p_fstype == FS_BSDFFS)
- fprintf (f, "b%c#%" PRIu32 ":f%c#%" PRIu32
+ scripting_fprintf (f, "b%c#%" PRIu32 ":f%c#%" PRIu32
":", 'a'+i,
(uint32_t)(lp[i].p_fsize *
lp[i].p_frag),
'a'+i, (uint32_t)lp[i].p_fsize);
if (i < parts->l.d_npartitions - 1)
- fprintf(f, "\\\n");
+ scripting_fprintf(f, "\\\n");
else
- fprintf(f, "\n");
+ scripting_fprintf(f, "\n");
}
+ scripting_fprintf(NULL, "EOF\n");
fclose(f);
Home |
Main Index |
Thread Index |
Old Index