Minor dinstall problems (2nd try)
[ NOTE - sorry about the blank message this morning. Seems that I did
my editing in the wrong buffer! Oops :-o
Here's the real message]
I had a couple of minor problems while installing 0.91. First, in the
section of dinstall where the mount points are configured, I entered
'/root/home/' instead of '/root/home'. I saw the error message from
'mkdir', but dinstall tried to mount the partition to a nonexistent
directory anyway.
It'd be great to have dinstall chop off any trailing "/"'s on the
paths in this section. I added a cheap fix (in the patch below) that
just tells the user that there was a problem creating the directory
and breaks the loop before the mount attempt. Any ideas on how to
make this cleaner?
My next problem occurred when I tried to write my new bootdisk to a
write-protected floppy. 'dd' complained a lot, but dinstall didn't take
heed. I changed the script somewhat so that, in the event that 'dd'
exits abnormally, the user can choose to try again or quit. If the
user quits, the script displays a brief message explaining how to
create a bootdisk at the shell prompt.
I haven't tested these two changes; I didn't want to break my newly-
installed system :-). In fact, since I was writing these in the early
morning without the benefit of black coffee, the syntax may not even be
correct.
The installation went remarkably smoothly, other
than these (and a couple of other very minor) problems. Looks groovy!
BTW - the patch below contains only _suggestions_ on how to fix these
two glitches. Please feel free to show me the error of my ways as you
see fit!
Later on...
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Ted Hajek Distributed Computing Services
University of Minnesota
I'm lying on the floor, on a futon, covered by a duvet.
_Futon_, _duvet_: this is how far we've come.
- Margaret Atwood, _Cat's Eye_
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
149,150c149,168
< mkdir -p /root/$DIR
< mount -t ext2 $FS /root/$DIR || ( echo "" ; echo "Cannot mount $FS on /root$DIR." ; echo "" ; break ) ;;
---
> #
> # I added the "or" part of the 'mkdir' line so that if a user types a "/"
> # at the end of the path, they'll get a decent message and mount won't
> # be called.
> #
> # It'd be much more graceful to kick non-empty $DIR strings to sed and
> # eliminate trailing "/"'s, but I'm too tired to set that up right now.
> # maybe later...
> #
> # oh, yeah... I don't know a good way to send the contents of a shell variable
> # through sed. Anyone?
> #
> # -Ted Hajek 1 Feb 1994
> #
> mkdir -p /root/$DIR || ( echo "" ; echo "Couldn't create /root/$DIR." ; echo "" ; break ) ;;
> #
> # end o' hack
> # -Ted
> #
> mount -t ext2 $FS /root/$DIR || ( echo "" ; echo "Cannot mount $FS on /root/$DIR." ; echo "" ; break ) ;;
216,223c234,278
< echo -n "Please insert a floppy disk into your boot drive and press <" ; echo -n $BOLD ; echo -n "RETURN" ; echo -n $NORM ; echo -n ">..."
< read INPUT
< echo ""
< echo "Copying the kernel image to the floppy disk..."
< /root/bin/dd if=/root/vmlinuz of=/dev/fd0
< echo "Done."
< echo ""
< echo "Now you may reboot your system with the custom bootdisk."
---
> #
> # I had another problem here. The floppy for my boot disk was write-protected;
> # dd bailed out. Unfortunately, dinstall went right on rolling. This hack
> # gives the user a chance to retry. If there's still a problem, it tells the
> # user what command to use to create the bootdisk at the shell prompt.
> # -Ted Hajek 1 February 1994
> #
> DD_OK="n"; DD_QUIT="n";
> until [ "$DD_OK" = "y" -o "$DD_QUIT" = "y" ]; do
> echo -n "Please insert a floppy disk into your boot drive and press <" ; echo -n $BOLD ; echo -n "RETURN" ; echo -n $NORM ; echo -n ">..."
> read INPUT
> echo ""
> echo "Copying the kernel image to the floppy disk..."
> /root/bin/dd if=/root/vmlinuz of=/dev/fd0
> if [ $? -eq 0 ]; then
> DD_OK="y"
> else
> echo "WARNING: There was a problem creating the bootdisk."
> echo "It's possible that your disk was write-protected."
> echo ""
> echo -n "Would you like to try again (y/n)? "
> read BOOTDISK
> if [ "$BOOTDISK" != "y" ]; then
> DD_QUIT="y"
> fi
> fi
> done
> if [ "$DD_OK" = "y" ]; then
> echo "Done."
> echo ""
> echo "Now you may reboot your system with the custom bootdisk."
> else
> echo "Oh, well."
> echo ""
> echo "To create a custom bootdisk from the shell, type:"
> echo " /root/bin/dd if=/root/vmlinuz of=/dev/fd0"
> echo ""
> echo "Otherwise, you can reboot your system with the installation bootdisk. At the"
> echo "introductory screen follow the instructions to boot to your new system."
> fi
> #
> # end o' hack
> #
> # - Ted
> #
Reply to: