aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1994-11-07 00:41:38 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1994-11-07 00:41:38 +0000
commitc4f169592351afe752c12e4f816bb1ae52526dcd (patch)
treedb0c86e7f74c90bad8733a14a9fa8f80486c7b3f
parentae7d223f92e8814661d2d52e9edc8433a84607ab (diff)
downloadsrc-c4f169592351afe752c12e4f816bb1ae52526dcd.tar.gz
src-c4f169592351afe752c12e4f816bb1ae52526dcd.zip
Only Mount relative to Written disklabel.
Notes
Notes: svn path=/head/; revision=4220
-rw-r--r--sbin/sysinstall/label.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/sysinstall/label.c b/sbin/sysinstall/label.c
index a57e6a965636..65d3d6029d92 100644
--- a/sbin/sysinstall/label.c
+++ b/sbin/sysinstall/label.c
@@ -568,6 +568,10 @@ DiskLabel()
break;
case 'm': case 'M':
+ if (memcmp(lbl, Dlbl[diskno], sizeof *lbl)) {
+ yip = "Please (W)rite changed partition information first";
+ break;
+ }
j = AskWhichPartition("Mountpoint of which partition ? ");
if (j < 0) {
yip = "Invalid partition";
@@ -606,17 +610,13 @@ DiskLabel()
Dlbl[diskno]->d_magic2 = DISKMAGIC;
Dlbl[diskno]->d_checksum = 0;
Dlbl[diskno]->d_checksum = dkcksum(Dlbl[diskno]);
- *lbl= *Dlbl[diskno];
- flag=1;
- if (ioctl(Dfd[diskno], DIOCWLABEL, &flag) < 0)
- Fatal("Couldn't enable writing of labels");
+ *lbl = *Dlbl[diskno];
+ enable_label(Dfd[diskno]);
if (ioctl(Dfd[diskno], DIOCSDINFO, Dlbl[diskno]) == -1)
Fatal("Couldn't set label: %s", strerror(errno));
if (ioctl(Dfd[diskno], DIOCWDINFO, Dlbl[diskno]) == -1)
Fatal("Couldn't write label: %s", strerror(errno));
- flag=0;
- if (ioctl(Dfd[diskno], DIOCWLABEL, &flag) < 0)
- Fatal("Couldn't disable writing of labels");
+ disable_label(Dfd[diskno]);
yip = "Label written successfully.";
break;