Re: [master 2/2] Redownload and extract updates.img during anaconda restart.

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

 



On 05/20/2010 09:45 PM, Chris Lumens wrote:
diff --git a/loader/loader.c b/loader/loader.c
index 6a701e4..d9c0589 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1712,9 +1712,15 @@ void loaderUsrXHandler(int signum) {
      init_sig = signum;
  }

-int restart_anaconda() {
+int restart_anaconda(struct loaderData_s *loaderData) {
      if (access("/tmp/restart_anaconda", R_OK))
          return 0;
+    if (loaderData->updatessrc) {
+        if (rm_rf("/tmp/updates"))
+            fprintf(stderr, "Error removing /tmp/updates. Updates won't be re-downloaded.");
+        else
+            loadUpdatesFromRemote(loaderData->updatessrc, loaderData);
+    }
      puts("Restarting Anaconda.");
      return 1;
  }

It seems like we're bound to start building up a longer and longer list
of these sorts of things that will need to be done on restart, doesn't
it?  Any ideas for what to do once there are three or four tasks that
need to be done?

We'll refactor like insane people so that everything's at one place and the code doesn't repeat itself!

I looked for a good while for some code that we already have that does
this, but it turns out there isn't any.  Barring that, pjones suggests
copying this code:

http://git.kernel.org/?p=utils/util-linux-ng/kzak/libmount.git;a=blob;f=sys-utils/switch_root.c;h=c43225da2e14dbc671251a037caef022b5b35c40;hb=HEAD#l41

It's already in use, and it already handles some corner cases.  I just
wish it were in a library.

Uh, I'll use it then. I can never understand why glib in all it's greatness doesn't support recursive_delete(path,follow_symlinks).

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux