NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: install/12020: Sysinst refuses upgrade unnecessarily (overzealous fscking)



The following reply was made to PR install/12020; it has been noted by GNATS.

From: Julian Djamil Fagir <gnrp%komkon2.de@localhost>
To: gnats-bugs%gnats.netbsd.org@localhost
Cc: 
Subject: Re: install/12020: Sysinst refuses upgrade unnecessarily
 (overzealous fscking)
Date: Wed, 29 Feb 2012 02:14:29 +0100

 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Hi,
 
 what about the attached patches?
 They will ask after a failed fsck and after a failed mount whether to
 continue or rather abort the installation.
 Btw, fixed a bug where mount_disks() returned 0 (which was expected to define
 no error) if there was an error, thus the installation continued though I had
 no /etc/fstab on the upgraded machine.
 As I only have one machine to test this on, please test and review this patch.
 
 Regards, Julian
 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=disks.c.diff
 
 --- disks.c
 +++ disks.c
 @@ -803,12 +803,16 @@
        error = fsck_preen(list[0].u.s_val, ' '-'a', "ffs");
        if (error != 0)
                return error;
  
        error = target_mount("", list[0].u.s_val, ' '-'a', list[1].u.s_val);
 -      if (error != 0)
 -              return error;
 +      if (error != 0) {
 +              msg_display(MSG_mount_failed, list[0].u.s_val);
 +              process_menu(MENU_noyes, NULL);
 +              if (!yesno)
 +                      return error;
 +      }
        return 0;
  }
  
  #ifdef USE_SYSVBFS
  static int
 @@ -852,11 +856,13 @@
                fixsb(prog, disk, ptn);
        error = run_program(0, "%s -p -q /dev/r%s%c", prog, disk, ptn);
        free(prog);
        if (error != 0) {
                msg_display(MSG_badfs, disk, ptn, error);
 -              process_menu(MENU_ok, NULL);
 +              process_menu(MENU_noyes, NULL);
 +              if (yesno)
 +                      error = 0;
                /* XXX at this point maybe we should run a full fsck? */
        }
        return error;
  }
  
 @@ -964,29 +970,29 @@
                /* avoid needing to call target_already_root() again */
                targetroot_mnt[0] = 0;
        else {
                error = mount_root();
                if (error != 0 && error != EBUSY)
 -                      return 0;
 +                      return -1;
        }
  
        /* Check the target /etc/fstab exists before trying to parse it. */
        if (target_dir_exists_p("/etc") == 0 ||
            target_file_exists_p("/etc/fstab") == 0) {
                msg_display(MSG_noetcfstab, diskdev);
                process_menu(MENU_ok, NULL);
 -              return 0;
 +              return -1;
        }
  
  
        /* Get fstab entries from the target-root /etc/fstab. */
        fstabsize = target_collect_file(T_FILE, &fstab, "/etc/fstab");
        if (fstabsize < 0) {
                /* error ! */
                msg_display(MSG_badetcfstab, diskdev);
                process_menu(MENU_ok, NULL);
 -              return 0;
 +              return -1;
        }
        error = walk(fstab, (size_t)fstabsize, fstabbuf, numfstabbuf);
        free(fstab);
  
        return error;
 
 
 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=menus.mi.diff
 
 --- menus.mi
 +++ menus.mi
 @@ -374,10 +374,16 @@
                  yesno = 0;
  #endif
                }; 
        option MSG_other, exit, action
                { yesno = 0; };
 +
 +menu runpostinst, title MSG_Run_Postinst, y=-5;
 +      option MSG_Postinst,       exit, action { *(int *)arg = 0; };
 +      option MSG_Etcupdate,      exit, action { *(int *)arg = 1; };
 +      option MSG_Skip_postinst,  exit, action { *(int *)arg = 2; };
 +      option MSG_Abandon,        exit, action { *(int *)arg = 3; };
  
  menu rootsh, title MSG_Root_shell;
        option "/bin/sh",  exit, action {*(const char **)arg = "/bin/sh";}; 
        option "/bin/ksh", exit, action {*(const char **)arg = "/bin/ksh";};
        option "/bin/csh", exit, action {*(const char **)arg = "/bin/csh";};
 
 
 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/x-patch
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename=msg.mi.de.diff
 
 --- msg.mi.de
 +++ msg.mi.de
 @@ -106,10 +106,22 @@
  Zu diesem Zeitpunkt sollten Sie bereits eine vollst=E4ndige
  Datensicherung durchgef=FChrt haben! Wollen Sie NetBSD wirklich aktualisie=
 ren?
  (Dies ist die letzte Warnung, bevor Ihre Festplatte(n) modifiziert werden.)
  }
 =20
 +message Run_Postinst
 +{Dateien in /etc updaten}
 +
 +message Postinst
 +{postinst ausf=FChren (existierende Konfiguration =FCberschreiben)}
 +
 +message Etcupdate
 +{etcupdate ausf=FChren (zu jeder ge=E4nderten Datei nachfragen)}
 +
 +message Skip_postinst
 +{Keine Dateien in /etc updaten}
 +
  message reinstallusure
  {Im folgenden werden die NetBSD Distributionssets (Kernel + Basissystem)
  auf eine vorbereitete Festplatte ausgepackt. Diese Prozedur l=E4dt und ent=
 packt
  die Sets auf eine im Vorfeld partitionierte und bootf=E4hige Festplatte au=
 s.
  Es werden weder Festplatten gelabelt, Bootbl=F6cke aktualisiert noch beste=
 hende
 @@ -122,10 +134,13 @@
  Wollen Sie die NetBSD Distributionssets wirklich erneut installieren?
  (Dies ist die letzte Warnung, bevor die Inhalte Ihres Dateisystems
  =FCberschrieben werden!)
  }
 =20
 +message mount_failed
 +{Versuch, %s zu mounten ist fehlgeschlagen. Fortfahren?
 +}
 =20
  message nodisk
  {Ich kann keine f=FCr NetBSD nutzbaren Festplatten finden.
  Zur=FCck zum Hauptmen=FC...
  }
 @@ -709,13 +724,13 @@
  {Erstelle Ger=E4tedateien in /dev ...
  }
 =20
  message badfs
  {Das Dateisystem auf /dev/%s%c scheint kein BSD-Dateisystem zu sein,
 -die Pr=FCfung des Dateisystems (fsck) ist fehlgeschlagen.
 +die Pr=FCfung des Dateisystems (fsck) ist fehlgeschlagen (Fehler %d).
 =20
 -Die Aktualisierung wird abgebrochen. (Fehlernummer %d.)
 +Die Aktualisierung trotzdem fortsetzen?
  }
 =20
  message rootmissing
  {Das Zielverzeichnis %s existiert nicht.
  }
 
 
 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=msg.mi.en.diff
 
 --- msg.mi.en
 +++ msg.mi.en
 @@ -102,10 +102,22 @@
  before this procedure!  Do you really want to upgrade NetBSD?
  (This is your last warning before this procedure starts modifying your
  disks.)
  }
  
 +message Run_Postinst
 +{Update files in /etc}
 +
 +message Postinst
 +{Execute postinst (overwrite existing configuration)}
 +
 +message Etcupdate
 +{Execute etcupdate (ask for every overwrite)}
 +
 +message Skip_postinst
 +{Don't update any file on /etc}
 +
  message reinstallusure
  {Ok, let's unpack the NetBSD distribution sets to a bootable hard disk.
  This procedure just fetches and unpacks sets onto an pre-partitioned
  bootable disk. It does not label disks, upgrade bootblocks, or save
  any existing configuration info.  (Quit and choose `install' or
 @@ -115,10 +127,13 @@
  Do you really want to reinstall NetBSD distribution sets?
  (This is your last warning before this procedure starts modifying your
  disks.)
  }
  
 +message mount_failed
 +{Mounting %s failed. Continue?
 +}
  
  message nodisk
  {I can not find any hard disks for use by NetBSD.  You will be
  returned to the original menu.
  }
 @@ -678,11 +693,11 @@
  {Making device nodes ...
  }
  
  message badfs
  {It appears that /dev/%s%c is not a BSD file system or the fsck was
 -not successful.  The upgrade has been aborted.  (Error number %d.)
 +not successful (Error number %d.). Try mounting it anyway?
  }
  
  message rootmissing
  { target root is missing %s.
  }
 
 
 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/x-patch
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename=msg.mi.es.diff
 
 --- msg.mi.es
 +++ msg.mi.es
 @@ -108,10 +108,22 @@
  completa antes de este procedimiento!  =BFRealmente desea actualizar NetBS=
 D?
  (=C9ste es su =FAltimo aviso antes de que el programa empiece a modificar
  sus discos.)
  }
 =20
 +message Run_Postinst
 +{Update files in /etc}
 +
 +message Postinst
 +{Execute postinst (overwrite existing configuration)}
 +
 +message Etcupdate
 +{Execute etcupdate (ask for every overwrite)}
 +
 +message Skip_postinst
 +{Don't update any file on /etc}
 +
  message reinstallusure
  {Se va a desempaquetar los conjuntos de distribuci=F3n de NetBSD
  a un disco duro marcado como arrancable.  Este procedimiento solamente
  descarga y desempaqueta los conjuntos en un disco arrancable preparticiona=
 do.
  No pone nombre a los discos, ni actualiza los bloques de arranque, ni guar=
 da
 @@ -122,10 +134,13 @@
  =BFRealmente quiere reinstalar los conjuntos de la distribuci=F3n NetBSD?
  (=C9ste es su =FAltimo aviso antes de que el programa empiece a modificar
  sus discos.)
  }
 =20
 +message mount_failed
 +{Mounting %s failed. Continue?
 +}
 =20
  message nodisk
  {No se ha podido encontrar ning=FAn disco duro para ser usado por NetBSD.
  Se le volver=E1 a llevar al men=FA original.
  }
 @@ -699,11 +714,11 @@
  {Creando nodos de dispositivo ...
  }
 =20
  message badfs
  {Parece que /dev/%s%c no es un sistema de archivos BSD o el fsck no ha sido
 -correcto.  La actualizaci=F3n ha sido interrumpida.  (Error n=FAmero %d.)
 +correcto (Error n=FAmero %d.) =BFContinuar?
  }
 =20
  message rootmissing
  { el directorio ra=EDz objetivo no existe %s.
  }
 
 
 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/x-patch
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename=msg.mi.fr.diff
 
 --- msg.mi.fr
 +++ msg.mi.fr
 @@ -107,10 +107,22 @@
  Voulez-vous vraiment mettre =E0 jour NetBSD ?
  (Ceci est le dernier avertissement avant que cette
  proc=E9dure ne modifie votre disque.)
  }
 =20
 +message Run_Postinst
 +{Update files in /etc}
 +
 +message Postinst
 +{Execute postinst (overwrite existing configuration)}
 +
 +message Etcupdate
 +{Execute etcupdate (ask for every overwrite)}
 +
 +message Skip_postinst
 +{Don't update any file on /etc}
 +
  message reinstallusure
  {D=E9compressons maintenant les composants de NetBSD sur un disque dur
  d=E9marrable.
  Cette proc=E9dure va rapatrier et d=E9compresser les composants
  sur un disque d=E9marrable d=E9j=E0 partitionnn=E9.
 @@ -122,10 +134,14 @@
  ou une mise =E0 jour avant de d=E9marrer cette proc=E9dure !
 =20
  Voulez-vous r=E9ellement r=E9installer les composants NetBSD ?
  (Ceci est le dernier avertissement avant que cette proc=E9dure ne commence=
  =E0
  modifier vos disques.)
 +}
 +
 +message mount_failed
 +{Mounting %s failed. Continue?
  }
 =20
  message nodisk
  {Nous ne trouvons aucun disque utilisable par NetBSD. Vous allez retourner
  au menu pr=E9c=E9dent.
 @@ -740,13 +756,13 @@
  }
 =20
  message badfs
  {
  /dev/%s%c ne semble pas =EAtre un syst=E8me de fichiers BSD ou bien
 -la v=E9rification de son int=E9grit=E9 par fsck a =E9chou=E9.
 +la v=E9rification de son int=E9grit=E9 par fsck a =E9chou=E9, code d'erreu=
 r %d.
 =20
 -Interruption de la proc=E9dure de mise =E0 jour, code d'erreur %d.
 +Souhaitez-vous continuer mise =E0 jour?
  }
 =20
  message rootmissing
  {
  Impossible de trouver la racine du disque cible %s.
 
 
 --MP_/WoQlOUNoIVFZto9BifgJS9M
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=msg.mi.pl.diff
 
 --- msg.mi.pl
 +++ msg.mi.pl
 @@ -106,10 +106,22 @@
  przed rozpoczeciem!  Czy napewno chcesz zaktualizowac NetBSD?
  (Jest to ostatnie ostrzezenie zanim zacznie sie modyfikacja danych na
  twoich dyskach.)
  }
  
 +message Run_Postinst
 +{Update files in /etc}
 +
 +message Postinst
 +{Execute postinst (overwrite existing configuration)}
 +
 +message Etcupdate
 +{Execute etcupdate (ask for every overwrite)}
 +
 +message Skip_postinst
 +{Don't update any file on /etc}
 +
  message reinstallusure
  {Ok, rozpakujmy pakiety dystrybucyjne NetBSD na bootowalny twardy dysk.
  Ta procedura tylko sciaga i rozpakowuje pakiety na pre-partycjonowany
  bootowalny dysk. Nie nazywa dyskow, aktualizuje bootblokow, lub zapisuje
  istniejacej konfiguracji.   (Wyjdz i wybierz `instaluj' lub
 @@ -119,10 +131,13 @@
  Czy napewno chcesz przeinstalowac pakiety dystrybucjne NetBSD?
  (Jest to ostatnie ostrzezenie zanim zacznie sie modyfikacja danych na
  twoich dyskach.)
  }
  
 +message mount_failed
 +{Mounting %s failed. Continue?
 +}
  
  message nodisk
  {Nie moge znalezc zadnych twardych dyskow do uzycia z NetBSD. Zostaniesz
  przeniesiony do menu glownego.
  }
 @@ -677,10 +692,14 @@
  
  message badfs
  {Wyglada na to, ze /dev/%s%c nie jest systemem plikow BSD albo nie powiodlo 
sie
  jego sprawdzenie. Aktualizacja zostala przerwana. (Blad numer %d.)
  }
 +/* XXX: Translate:
 + * -not successful.  The upgrade has been aborted.  (Error number %d.)
 + * +not successful (Error number %d.). Try mounting it anyway?
 + */
  
  message rootmissing
  { docelowy / jest zagubiony %s.
  }
  
 
 
 --MP_/WoQlOUNoIVFZto9BifgJS9M--
 


Home | Main Index | Thread Index | Old Index