. setup fixes

. added atnormalize commands, which resets at driver timeouts and retries
  to defaults
. usyslogd now logs to /usr/log/messages instead of /var (on root, which is
  shrinking)
This commit is contained in:
Ben Gras 2005-08-09 16:46:46 +00:00
parent f902df5c5a
commit ad9e5d2cc0
5 changed files with 116 additions and 45 deletions

View File

@ -7,6 +7,7 @@ CCLD = $(CC) -i $(CFLAGS)
MAKE = exec make -$(MAKEFLAGS) MAKE = exec make -$(MAKEFLAGS)
ALL = \ ALL = \
atnormalize \
dosread \ dosread \
fdisk \ fdisk \
format \ format \
@ -30,6 +31,10 @@ dosread: dosread.c
$(CCLD) -o $@ $? $(CCLD) -o $@ $?
install -S 16kw $@ install -S 16kw $@
atnormalize: atnormalize.c
$(CCLD) -o $@ $?
install -S 16kw $@
fdisk: fdisk.c fdisk: fdisk.c
$(CCLD) -o $@ $? $(CCLD) -o $@ $?
install -S 4kw $@ install -S 4kw $@
@ -91,6 +96,7 @@ sdump: sdump.c
install -S 4kw $@ install -S 4kw $@
install: \ install: \
/usr/bin/atnormalize \
/usr/bin/dosread \ /usr/bin/dosread \
/usr/bin/dosdir \ /usr/bin/dosdir \
/usr/bin/doswrite \ /usr/bin/doswrite \
@ -112,6 +118,9 @@ install: \
/bin/loadkeys \ /bin/loadkeys \
/bin/readclock \ /bin/readclock \
/usr/bin/atnormalize: atnormalize
install -cs -o bin $? $@
/usr/bin/dosread: dosread /usr/bin/dosread: dosread
install -cs -o bin $? $@ install -cs -o bin $? $@

43
commands/ibm/atnormalize.c Executable file
View File

@ -0,0 +1,43 @@
#include <sys/types.h>
#include <stdio.h>
#include <termcap.h>
#include <errno.h>
#include <unistd.h>
#include <stddef.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <time.h>
#include <dirent.h>
#include <limits.h>
#include <a.out.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <minix/config.h>
#include <minix/const.h>
#include <minix/partition.h>
#include <minix/u64.h>
#include <ibm/partition.h>
#include <termios.h>
#include <stdarg.h>
int main(void)
{
int v, d;
char name[20];
for(d = 0; d < 4; d++) {
int device;
sprintf(name, "/dev/c0d%d", d);
if((device=open(name, O_RDONLY)) >= 0) {
v = 0;
ioctl(device, DIOCTIMEOUT, &v);
close(device);
}
}
return 0;
}

View File

@ -2372,6 +2372,8 @@ select_region(void)
} }
do { do {
printstep(5, "Select a region");
printf("\nI've found the following region%s on this disk (%s).\n\n", printf("\nI've found the following region%s on this disk (%s).\n\n",
SORNOT(nr_regions), prettysizeprint(table[0].size/2)); SORNOT(nr_regions), prettysizeprint(table[0].size/2));
printregions(regions, 0, nr_partitions, free_regions, nr_regions, 1); printregions(regions, 0, nr_partitions, free_regions, nr_regions, 1);
@ -2408,9 +2410,11 @@ select_region(void)
printf("That region number isn't available.\n"); printf("That region number isn't available.\n");
continue; continue;
} }
printstep(6, "Confirm your partition choice");
sure = is_sure(0, "\nPlease confirm you want to use disk region number %d?", rn); sure = is_sure(0, "\nPlease confirm you want to use disk region number %d?", rn);
} else { } else {
printstep(6, "Confirm your partition choice");
rn = 0; rn = 0;
sure = is_sure(0, "\nUse this region?"); sure = is_sure(0, "\nUse this region?");
} }
@ -2419,6 +2423,14 @@ select_region(void)
return(&regions[rn]); return(&regions[rn]);
} }
void printstep(int step, char *str)
{
int n;
n = printf("\n --- Step %d: %s ", step, str);
while(n++ < 70) printf("-");
printf("\n\n");
}
device_t * device_t *
select_disk(void) select_disk(void)
{ {
@ -2426,7 +2438,7 @@ select_disk(void)
int i, choice, drives; int i, choice, drives;
static char line[500]; static char line[500];
printf("\nProbing for disks. This may take a short while. "); printf("\nProbing for disks. This may take a short while.");
do { do {
i = 0; i = 0;
@ -2460,21 +2472,27 @@ select_disk(void)
printf("\nProbing done; %d drive%s found.\n", drives, SORNOT(drives)); printf("\nProbing done; %d drive%s found.\n", drives, SORNOT(drives));
printf("\nI've found the following drive%s on your system.\n", SORNOT(drives)); if(drives == 1) {
sure = 1;
choice = 0;
} else {
for(i = 0; i < drives; i++) { printstep(3, "Choose a disk to install MINIX 3 on");
if(drives > 1)
printf("\n %2d. ", i); printf("\nI've found the following drive%s on your system.\n", SORNOT(drives));
else printf(" ");
printf(" (%s, ", devices[i].dev->name); for(i = 0; i < drives; i++) {
printf("%s)\n", prettysizeprint(devices[i].sectors/2)); if(drives > 1)
printregions(devices[i].regions, 8, printf("\n %2d. ", i);
devices[i].nr_partitions, else printf(" ");
devices[i].free_regions, printf(" (%s, ", devices[i].dev->name);
devices[i].nr_regions, 0); printf("%s)\n", prettysizeprint(devices[i].sectors/2));
} printregions(devices[i].regions, 8,
devices[i].nr_partitions,
devices[i].free_regions,
devices[i].nr_regions, 0);
}
if(drives > 1) {
printf("\nPlease enter disk number you want to use: "); printf("\nPlease enter disk number you want to use: ");
fflush(NULL); fflush(NULL);
if(!fgets(line, sizeof(line)-2, stdin)) if(!fgets(line, sizeof(line)-2, stdin))
@ -2484,13 +2502,9 @@ select_disk(void)
printf("Number out of range.\n"); printf("Number out of range.\n");
continue; continue;
} }
if(!(sure = is_sure(0, "\nPlease confirm you want to use disk %d (%s)?", printstep(4, "Confirm your choice");
choice, devices[choice].dev->name))) sure = is_sure(0, "\nPlease confirm you want to use disk %d (%s)?",
exit(1); choice, devices[choice].dev->name);
} else {
if(!(sure = is_sure(0, "\nUse this disk?")))
exit(1);
choice = 0;
} }
} while(!sure); } while(!sure);
return devices[choice].dev; return devices[choice].dev;
@ -2553,8 +2567,6 @@ do_autopart(int resultfd)
probing = 1; probing = 1;
autopartmode = 1; autopartmode = 1;
printf("\n\n --- Step 2.1 --- Select drive and region -----------------------------\n\n");
do { do {
curdev = select_disk(); curdev = select_disk();
} while(!curdev); } while(!curdev);
@ -2570,14 +2582,10 @@ do_autopart(int resultfd)
memcpy(orig_table, table, sizeof(table)); memcpy(orig_table, table, sizeof(table));
do { do {
printf("\n\n --- Step 2.1 --- Select drive and region -----------------------------\n\n");
/* Show regions. */ /* Show regions. */
r = select_region(); r = select_region();
} while(!r); /* Back to step 2. */ } while(!r); /* Back to step 2. */
printf("\n\n --- Step 2.2 --- Confirm your choice ---------------------------------\n\n");
/* Write things. */ /* Write things. */
if(scribble_region(r, &pe)) { if(scribble_region(r, &pe)) {
char *name; char *name;
@ -2592,6 +2600,8 @@ do_autopart(int resultfd)
m_dump(table); m_dump(table);
#endif #endif
printstep(7, "Point of no return");
printf("\nThis is the point of no return. You have selected to install MINIX\n"); printf("\nThis is the point of no return. You have selected to install MINIX\n");
printf("into region %d of disk %d. If you agree with this selection, your\n", (int)(r-regions), (int) (curdev-firstdev)); printf("into region %d of disk %d. If you agree with this selection, your\n", (int)(r-regions), (int) (curdev-firstdev));
printf("disk will be written to prepare for the rest of the installation.\n\n"); printf("disk will be written to prepare for the rest of the installation.\n\n");

View File

@ -107,7 +107,7 @@ then
# Expert mode # Expert mode
echo -n " echo -n "
MINIX needs one primary partition of about 250 MB for a full install. MINIX needs one primary partition of about 250 MB for a full install.
The maxium fill system currently supported is 4 GB. The maximum fill system currently supported is 4 GB.
If there is no free space on your disk then you have to choose an option: If there is no free space on your disk then you have to choose an option:
(1) Delete one or more partitions (1) Delete one or more partitions
@ -149,6 +149,10 @@ else
fi fi
else echo "Autopart tool failed. Trying again." else echo "Autopart tool failed. Trying again."
fi fi
# reset at retries and timeouts in case autopart left
# them messy
atnormalize
done done
fi fi
@ -184,8 +188,9 @@ echo "1. Intel Pro/100"
echo "2. Realtek 8139 based card" echo "2. Realtek 8139 based card"
echo "3. Realtek 8029 based card (emulated by Qemu)" echo "3. Realtek 8029 based card (emulated by Qemu)"
echo "4. NE2000, 3com 503 or WD based card (NE2000 is emulated by Bochs)" echo "4. NE2000, 3com 503 or WD based card (NE2000 is emulated by Bochs)"
echo "5. A 3com 501 or 509" echo "5. NE2000, with default settings for Bochs emulation in $LOCALRC"
echo "6. A different Ethernet card (no networking)" echo "6. A 3com 501 or 509"
echo "7. A different Ethernet card (no networking)"
echo "" echo ""
echo "With some cards, you'll have to edit $LOCALRC " echo "With some cards, you'll have to edit $LOCALRC "
echo "after installing to the proper parameters." echo "after installing to the proper parameters."
@ -196,12 +201,18 @@ echo -n "Choice? "
read eth read eth
driver="" driver=""
driverargs="" driverargs=""
config_warn="Note: After installing, please edit $LOCALRC to the right configuration."
case "$eth" in case "$eth" in
1) driver=fxp; ;; 1) driver=fxp; ;;
2) driver=rtl8139; ;; 2) driver=rtl8139; ;;
3) driver=dp8390; driverargs="dp8390_args='DPETH0=pci'"; ;; 3) driver=dp8390; driverargs="dp8390_arg='DPETH0=pci'"; ;;
4) driver=dp8390; driverargs="#dp8390_args='DPETH0=port:irq:memory'"; echo "Note: After installing, please edit $LOCALRC to the right configuration."; ;; 4) driver=dp8390; driverargs="#dp8390_arg='DPETH0=port:irq:memory'";
5) driver=dpeth; ;; echo $config_warn;
;;
5) driver=dp8390; driverargs="dp8390_arg='DPETH0=240:9'"; ;;
6) driver=dpeth; driverargs="#dpeth_arg='DPETH0=port:irq:memory'";
echo $config_warn;
;;
esac esac
# Compute the amount of memory available to MINIX. # Compute the amount of memory available to MINIX.
@ -226,23 +237,21 @@ i86)
*) test $memsize -lt 6144 && swapadv=$(expr 6144 - $memsize) *) test $memsize -lt 6144 && swapadv=$(expr 6144 - $memsize)
esac esac
blockdefault=8 blockdefault=2
echo " --- Step 9: Select a disk block size -----------------------------" echo " --- Step 9: Select a disk block size -----------------------------"
echo "The default block size on the disk is $blockdefault KB. echo "The default block size on the disk is $blockdefault KB.
If you have a small disk or small RAM you may want less If you have a small disk or small RAM you may want 1 KB blocks.
than $blockdefault KB. Please type 1, 2, or 4 for a smaller Please type 1 then, or leave it at the default.
block size (in KB), or hit ENTER for the default of
$blockdefault KB blocks, which should be fine in most cases."
while [ -z "$blocksize" ] while [ -z "$blocksize" ]
do echo -n "Block size [$blockdefault KB]? " do echo -n "Block size in KB [$blockdefault]? "
read blocksize read blocksize
if [ -z "$blocksize" ] if [ -z "$blocksize" ]
then blocksize=$blockdefault then blocksize=$blockdefault
fi fi
if [ "$blocksize" -ne 1 -a "$blocksize" -ne 2 -a "$blocksize" -ne 4 -a "$blocksize" -ne $blockdefault ] if [ "$blocksize" -ne 1 -a "$blocksize" -ne $blockdefault ]
then echo "$blocksize bogus block size. 1, 2, 4 or $blockdefault please." then echo "$blocksize bogus block size. 1 or $blockdefault please."
blocksize="" blocksize=""
fi fi
done done
@ -282,7 +291,7 @@ installboot -m /dev/$primary /usr/mdec/masterboot >/dev/null || exit
# Partition the primary. # Partition the primary.
p3=0:0 p3=0:0
test "$swapsize" -gt 0 && p3=81:`expr $swapsize \* 2` test "$swapsize" -gt 0 && p3=81:`expr $swapsize \* 2`
partition /dev/$primary 1 81:32768* $p3 81:0+ || exit partition /dev/$primary 1 81:4352* $p3 81:0+ || exit
if [ "$swapsize" -gt 0 ] if [ "$swapsize" -gt 0 ]
then then
@ -302,7 +311,6 @@ Scanning /dev/$usr for bad blocks. (Hit DEL to stop the scan if you are
absolutely sure that there can not be any bad blocks. Otherwise just wait.)" absolutely sure that there can not be any bad blocks. Otherwise just wait.)"
trap ': nothing' 2 trap ': nothing' 2
readall -b /dev/$usr | sh readall -b /dev/$usr | sh
sleep 2
trap 2 trap 2
echo " --- Step 13: Wait for files to be copied ------------------------------" echo " --- Step 13: Wait for files to be copied ------------------------------"
@ -345,6 +353,7 @@ Copying $fdroot to /dev/$root
" "
mkfs -B $blocksizebytes /dev/$root || exit mkfs -B $blocksizebytes /dev/$root || exit
readall -b /dev/$root | sh
mount /dev/$root /mnt || exit mount /dev/$root /mnt || exit
# Running from the installation CD. # Running from the installation CD.
cpdir -vx / /mnt || exit cpdir -vx / /mnt || exit

View File

@ -79,8 +79,8 @@ main(int argc, char *argv[])
return 1; return 1;
} }
if(!(logfp = fopen("/var/log/messages", "a"))) { if(!(logfp = fopen("/usr/log/messages", "a"))) {
perror("/var/log/messages"); perror("/usr/log/messages");
return 1; return 1;
} }