FreeBSD Bugzilla – Attachment 9195 Details for
Bug 18923
boot0cfg(8) cannot select default boot slice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.42 KB, created by
iedowse
on 2000-05-31 23:20:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
iedowse
Created:
2000-05-31 23:20:02 UTC
Size:
3.42 KB
patch
obsolete
>Index: boot0cfg.8 >=================================================================== >RCS file: /FreeBSD/FreeBSD-CVS/src/usr.sbin/boot0cfg/boot0cfg.8,v >retrieving revision 1.5 >diff -u -r1.5 boot0cfg.8 >--- boot0cfg.8 1999/08/28 01:15:38 1.5 >+++ boot0cfg.8 2000/05/31 21:37:19 >@@ -38,6 +38,7 @@ > .Op Fl f Ar file > .Op Fl m Ar mask > .Op Fl o Ar options >+.Op Fl s Ar slice > .Op Fl t Ar ticks > .Ar disk > .Sh DESCRIPTION >@@ -118,6 +119,14 @@ > .Sq noupdate > option causes the MBR to be treated as read-only. > .El >+.It Fl s Ar slice >+Set the default boot selection to >+.Ar slice . >+Values between 1 and 4 refer to slices; a value of 5 refers to the >+option of booting from a second disk. This would normally be used in >+conjunction with the >+.Sq noupdate >+option. > .It Fl t Ar ticks > Set the timeout value to > .Ar ticks . >Index: boot0cfg.c >=================================================================== >RCS file: /FreeBSD/FreeBSD-CVS/src/usr.sbin/boot0cfg/boot0cfg.c,v >retrieving revision 1.7 >diff -u -r1.7 boot0cfg.c >--- boot0cfg.c 1999/08/28 01:15:38 1.7 >+++ boot0cfg.c 2000/05/31 21:45:08 >@@ -44,6 +44,7 @@ > > #define MBRSIZE 512 /* master boot record size */ > >+#define OFF_OPT 0x1b9 /* offset: default boot option */ > #define OFF_DRIVE 0x1ba /* offset: setdrv drive */ > #define OFF_FLAGS 0x1bb /* offset: option flags */ > #define OFF_TICKS 0x1bc /* offset: clock ticks */ >@@ -89,17 +90,17 @@ > const char *bpath, *fpath, *disk; > ssize_t n; > int B_flag, v_flag, o_flag; >- int d_arg, m_arg, t_arg; >+ int d_arg, m_arg, s_arg, t_arg; > int o_and, o_or; > int fd, fd1, up, c, i; > > bpath = "/boot/boot0"; > fpath = NULL; > B_flag = v_flag = o_flag = 0; >- d_arg = m_arg = t_arg = -1; >+ d_arg = m_arg = s_arg = t_arg = -1; > o_and = 0xff; > o_or = 0; >- while ((c = getopt(argc, argv, "Bvb:d:f:m:o:t:")) != -1) >+ while ((c = getopt(argc, argv, "Bvb:d:f:m:o:s:t:")) != -1) > switch (c) { > case 'B': > B_flag = 1; >@@ -123,6 +124,9 @@ > stropt(optarg, &o_and, &o_or); > o_flag = 1; > break; >+ case 's': >+ s_arg = argtoi(optarg, 1, 5, 's'); >+ break; > case 't': > t_arg = argtoi(optarg, 1, 0xffff, 't'); > break; >@@ -134,7 +138,8 @@ > if (argc != 1) > usage(); > disk = mkrdev(*argv); >- up = B_flag || d_arg != -1 || m_arg != -1 || o_flag || t_arg != -1; >+ up = B_flag || d_arg != -1 || m_arg != -1 || o_flag || s_arg != -1 || >+ t_arg != -1; > if ((fd = open(disk, up ? O_RDWR : O_RDONLY)) == -1) > err(1, "%s", disk); > if ((n = read(fd, buf, MBRSIZE)) == -1) >@@ -174,6 +179,8 @@ > buf[OFF_FLAGS] &= o_and; > buf[OFF_FLAGS] |= o_or; > } >+ if (s_arg != -1) >+ buf[OFF_OPT] = s_arg - 1; > if (t_arg != -1) > mk2(buf + OFF_TICKS, t_arg); > if (up) { >@@ -211,6 +218,12 @@ > printf("%s", opttbl[i].tok); > } > printf(" ticks=%u\n", cv2(buf + OFF_TICKS)); >+ printf("default_selection=F%d (", buf[OFF_OPT] + 1); >+ if (buf[OFF_OPT] < 4) >+ printf("Slice %d", buf[OFF_OPT] + 1); >+ else >+ printf("Drive 1"); >+ printf(")\n"); > } > return 0; > } >@@ -316,6 +329,6 @@ > { > fprintf(stderr, "%s\n%s\n", > "usage: boot0cfg [-Bv] [-b boot0] [-d drive] [-f file] [-m mask]", >- " [-o options] [-t ticks] disk"); >+ " [-o options] [-s slice] [-t ticks] disk"); > exit(1); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18923
: 9195