Author Topic: Update/upgrade MD's from core not internet?  (Read 11919 times)

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Update/upgrade MD's from core not internet?
« Reply #15 on: June 06, 2011, 05:57:23 am »
The scripts will be run from the MDs environment so the scripts need to be overridden there.  Yes, the -f option should probably be used.

As for the {,.lmce-update}: the {A,B} substitutes a value of A for the first argument and substitutes the value of B for the second argument.  So sometext{A,B} expands to: sometextA sometextB.

J.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Update/upgrade MD's from core not internet?
« Reply #16 on: June 06, 2011, 06:57:49 am »
The scripts will be run from the MDs environment so the scripts need to be overridden there.  Yes, the -f option should probably be used.

As for the {,.lmce-update}: the {A,B} substitutes a value of A for the first argument and substitutes the value of B for the second argument.  So sometext{A,B} expands to: sometextA sometextB.

J.

I figured that part out... I guess I just don't understand where lmce-update is coming from... and how it is available to both directories... I thought that was why I was creating the TEMP environment, and why I was just moving them about to and from there.

I really appreciate your help.

I see now that it creates /dir/file.lmce-update and then transfers it back.

Here is the latest. Had to move a bunch of stuff around.
http://svn.linuxmce.org/trac.cgi/attachment/ticket/341/globalUpgrades.16.sh

Now I need to incorporate the system backup function (I don't know if it is more than a sql dump) and exclude some directories from the tarring process... and then make a button under computing, which ideally spawns a monitor window, sort of like the web admin does for certain functions.
« Last Edit: June 06, 2011, 08:59:19 am by l3mce »
I never quit... I just ping out.

tompin2

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Update/upgrade MD's from core not internet?
« Reply #17 on: June 11, 2011, 07:15:28 am »
Dear All I´m very happy to see people interested on this topic, I really wish I could understand Linux more to help, I just dropped the idea but you guys are amazing  :o, for me you are all talking in another language but I'm starting to learn little by little.

Keep up the good work, I wish I could bring the beers for moral support but I guess it will be a little bit difficult.

chears!

T

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Update/upgrade MD's from core not internet?
« Reply #18 on: June 11, 2011, 09:59:55 am »
Dear All I´m very happy to see people interested on this topic, I really wish I could understand Linux more to help, I just dropped the idea but you guys are amazing  :o, for me you are all talking in another language but I'm starting to learn little by little.

Keep up the good work, I wish I could bring the beers for moral support but I guess it will be a little bit difficult.

chears!

T

The best help would be to test it. Of course it is doing upgrade work, which can break things, and in an experimental way, which can break things... if you wanted to test, you might make a clonezilla backup to an external drive.

To test a script, just go download it (bottom of page of link, choose original format) on your core. Find it (typically in /root/Desktop if you use firefox in LMCE) and cd into the directory in a shell. Then do the following
Code: [Select]
chmod +x globalUpgrades.16.sh
./globalUpgrades.16.sh

save the output of that window... and report successes or failures...

There are even backups made of the MDs in case things go haywire... and as I mentioned, I need to add some DB backup, and it becomes a fairly benign process.
I never quit... I just ping out.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Update/upgrade MD's from core not internet?
« Reply #19 on: June 13, 2011, 05:45:54 pm »
Now I need to incorporate the system backup function (I don't know if it is more than a sql dump) and exclude some directories from the tarring process... and then make a button under computing, which ideally spawns a monitor window, sort of like the web admin does for certain functions.

The backup/restore process is a little more tricky. 

The database is updated as the core is upgraded...  Subsequent MD updates may have minor updates/changes applied to the database.  Restoring the database from a backup would mean that the database information will be out of sync with the installed packages on the core.  So a database restore should only be performed if the CORE packages would be restored to their original state as well.  This is probably best done, by the user, through a clonezilla image or other external backup system.  Perhaps there is a way to store a list of the upgraded packages to restore them at the same time as a database restore...  This seems like it'd be pretty flaky.

Restoring a 'live' MD (one that is running) that had been upgraded through SSH means that the MD in question cannot simply be 'restored' from the backup directly.  The machine would have to be powered down for the /usr/pluto/diskless/XX directory to be removed and then un-tar'd.  Tricky, especially if someone is using the MD in question at the time.

Restoring an MD that is not running (updated through chroot) is trivial.  The directory can be removed and restored from the .tar archive.  Unless the MD is booted partway through the update/restore process...  This would present an issue.


I think there are some big issues that would need to be addressed before any kind of restore capability could be implemented.

Other notes:
Use a variable for the DATE in your script, otherwise it is possible for a user to start the script one day and have the initial tar-ing of the backup archive, or the upgrades, take long enough it rolls over to the next day.  For instance, lets say I start the script at 11:55pm, it tars for 20 minutes, and upgrades for 20 minutes.  Later in the script the backup archive and the backed-up sources.list files will not be found because the date has rolled over to the next day...  Perhaps just don't use the date in the backup name, unless you see a need for it to be there.

Code: [Select]
mv /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d{,.lmce-update}
mv /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon{,.lmce-update}
echo -en '#!/bin/bash\necho "WARNING: fake invoke-rc.d called"\n' > /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d
echo -en '#!/bin/bash\necho "WARNING: fake start-stop-daemon called"\n' > /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon
chmod +x /usr/sbin/invoke-rc.d
chmod +x /sbin/start-stop-daemon

The first 4 lines, above, affect the desired scripts in the MDs directories.  The 2 final 'chmod' lines unfortunately are affecting the files on the core, not the MDs where you just created the diversion scripts.  Those two lines need to point to the /usr/pluto/diskless/XX/... structure so the appropriate files are affected.

Code: [Select]
rsh moon$moonDir apt-get update || /bin/true
rsh moon$moonDir apt-get -f -y upgrade
rsh moon$moonDir apt-get upgrade -f -y --force-yes

In this code the middle line should be 'apt-get upgrade -f -y install', rather than the two 'upgrade' commands.

Code: [Select]
cat /usr/pluto/diskless/$moonDir/etc/apt/sources.list-`date +%Y%m%d`.bak > /usr/pluto/diskless/$moonDir/etc/apt/sources.list

Are you using 'cat' here for a specific purpose?  I would use 'mv' here rather than cat.  Unless you see a need to maintain lots of chronological backup files.  Again, perhaps drop the date portion and use another file extension (such as .lmce-update) or something else.  This can be done with the 'mv' command and using {..}, like the backup of the scripts.

Code: [Select]
cp -ru /var/cache/apt/archives/* /usr/pluto/deb-cache

This line doesn't need the 'r' option.  I would also alter this and 'mv' (move) the files rather than duplicating them and comsuming the extra HD space.  The only files that need to be affected here are the '*.deb' files, you don't want to move any sub-directories from ../apt/archives/ to ../pluto/deb-cache/ -- just the .deb files.

Code: [Select]
dpkg-scanpackages /usr/pluto/deb-cache /dev/null | gzip -9c > /usr/pluto/deb-cache/Packages.gz

Although I havn't tested it, this line will not create the 'Packages' file, only the 'Packages.gz' file.  I did this is a couple steps in the version I edited to ensure both files are created.  I think the both files are required, but I am not certain.

The cleanup trap should probably umount the bound deb-cache folder for the chroot updated MDs.

Wow, lots to look at!  Keep it up!

J.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Update/upgrade MD's from core not internet?
« Reply #20 on: June 13, 2011, 07:07:49 pm »
I am running out the door, but just wanted to comment on the Packages thing...

It does indeed create a Packages file, then zips it up.
Code: [Select]
# dpkg-scanpackages /usr/pluto/deb-cache /dev/null | gzip -9c > /usr/pluto/deb-cache/Packages.gz
  ** Packages in archive but missing from override file: **
  acpi-support acpid adept akregator alsa-base alsa-modules-2.6.27-15-
  generic alsa-source alsa-utils amarok amarok-common amarok-engine-
  xine ansi2html ansi2html-source apache2 apache2-mpm-prefork apache2-
  utils apache2.2-common apparmor apparmor-utils apport apport-qt apt
  apt-utils apturl ark asterisk-perl asterisk-pluto attr autofs avahi-
  autoipd avahi-daemon avahi-utils base-files bin86 bind9 bind9-host
  bind9utils build-essential busybox-initramfs ca-certificates chan-
  sccp cmake comerr-dev command-not-found command-not-found-data
  compiz-wrapper console-setup consolekit cpp-4.3 cron cups cups-bsd
  cups-client cups-common curl dash dbus dbus-x11 debhelper debian-
  installer debootstrap dhcp3-client dhcp3-common dhcp3-server djmount
  dkms dnsutils docbook-xml dolphin dpkg dpkg-dev dragonplayer elinks
  elinks-data ethtool fakeroot ffmpeg fglrx-amdcccle fglrx-kernel-
  source fglrx-modaliases file firefox firefox-3.0 firefox-3.0-
  branding flac foo2zjs foomatic-filters freepbx fuse-utils g++ g++-
  4.3 gamin gawk gcc-4.3 gcc-4.3-base gconf2 gconf2-common gettext
  ghostscript ghostscript-x gksu gnome-app-install gnome-icon-theme
  gnome-keyring gnome-mime-data gnome-mount gsfonts-x11 gwenview gzip
  hai hai-src hal-info html2text id-my-disc imagemagick initramfs-
  tools intltool-debian java-common jockey-common jockey-kde
  kaddressbook kamera kate kde-icons-oxygen kde-printer-applet kde-
  window-manager kde-zeroconf kdebase-bin kdebase-data kdebase-plasma
  kdebase-runtime kdebase-runtime-bin-kde4 kdebase-runtime-data
  kdebase-runtime-data-common kdebase-workspace-bin kdebase-workspace-
  data kdebase-workspace-libs4+5 kdebluetooth kdegraphics-strigi-
  plugins kdelibs-bin kdelibs-data kdelibs4c2a kdelibs5 kdelibs5-data
  kdemultimedia-kio-plugins kdepasswd kdepim-kresources kdepim-strigi-
  plugins kdepim-wizards kdepimlibs-data kdepimlibs5 kdeplasma-addons
  kdeplasma-addons-data kdeplasma-addons-libs4 kdm kernel-package
  kfind khelpcenter4 klipper kmag kmail kmix kmousetool knotes
  konqueror konqueror-nsplugins konsole kontact konversation kopete
  korganizer krdc krfb ksnapshot ksysguard ksysguardd ksystemlog
  ktimetracker ktorrent kuser kwalletmanager language-pack-de
  language-pack-de-base language-pack-en language-pack-en-base
  language-pack-es language-pack-es-base language-pack-fr language-
  pack-fr-base language-pack-it language-pack-it-base language-pack-ja
  language-pack-ja-base language-pack-kde-de language-pack-kde-de-base
  language-pack-kde-en language-pack-kde-en-base language-pack-kde-es
  language-pack-kde-es-base language-pack-kde-fr language-pack-kde-fr-
  base language-pack-kde-it language-pack-kde-it-base language-pack-
  kde-ja language-pack-kde-ja-base language-pack-kde-pl language-pack-
  kde-pl-base language-pack-kde-pt language-pack-kde-pt-base language-
  pack-kde-ru language-pack-kde-ru-base language-pack-kde-zh language-
  pack-kde-zh-base language-pack-pl language-pack-pl-base language-
  pack-pt language-pack-pt-base language-pack-ru language-pack-ru-base
  language-pack-zh language-pack-zh-base lib64asound2 lib64asound2-dev
  libaa1-dev libadns1 libapache2-mod-php5 libapparmor-perl
  libapparmor1 libappconfig-perl libapr1 libaprutil1 libarchive-zip-
  perl libartsc0-dev libasound2 libasound2-dev libasound2-doc
  libasound2-plugins libaudio-dev libaudiofile-dev libaudiofile0
  libavahi-client3 libavahi-common-data libavahi-common3 libavahi-
  compat-libdnssd1 libavahi-core5 libavahi-glib1 libavahi-qt3-1
  libavc1394-0 libavcodec51 libavdevice52 libavformat52 libavutil49
  libbind9-40 libbonobo2-0 libbonobo2-common libbonoboui2-0
  libbonoboui2-common libc6 libc6-dev libc6-i686 libcaca-dev libcairo-
  perl libcairo2 libcairomm-1.0-1 libcdio7 libck-connector0
  libcompress-raw-zlib-perl libconvert-binhex-perl libcucul-dev
  libcups2 libcups2-dev libcupsimage2 libcupsys2-dev libcurl3
  libcurl3-gnutls libdate-manip-perl libdbd-mysql-perl libdbd-sqlite3-
  perl libdbi-perl libdbus-1-3 libdc1394-22 libdigest-hmac-perl
  libdigest-sha1-perl libdirectfb-dev libdirectfb-extra libdns43
  libdns44 libdv4 libesd0-dev libevent1 libexpat1 libexpat1-dev
  libfontconfig1-dev libfreetype6 libfreetype6-dev libft-perl libfuse2
  libgamin0 libgcc1 libgconf2-4 libgcrypt11-dev libgd2-noxpm libgd2-
  xpm libgksu2-0 libgl1-mesa-dev libglade2-0 libglib-perl libglib2.0-0
  libglib2.0-data libglib2.0-dev libglibmm-2.4-1c2a libglu1-mesa-dev
  libglu1-xorg-dev libgnome-keyring0 libgnome2-0 libgnome2-canvas-perl
  libgnome2-common libgnome2-perl libgnome2-vfs-perl libgnomecanvas2-0
  libgnomecanvas2-common libgnomecups1.0-1 libgnomeprint2.2-0
  libgnomeprint2.2-data libgnomeprintui2.2-0 libgnomeprintui2.2-common
  libgnomeui-0 libgnomeui-common libgnomevfs2-0 libgnomevfs2-common
  libgnomevfs2-extra libgnutls-dev libgnutls26 libgomp1 libgp11-0
  libgpg-error-dev libgphoto2-2 libgphoto2-port0 libgs8 libgsm1
  libgssglue1 libgstreamer-plugins-base0.10-0 libgtk2-perl
  libgtkhtml2-0 libgtkmm-2.4-1c2a libgtop2-7 libgtop2-common libhtml-
  parser-perl libice-dev libicu38 libid3-3.8.3c2a libid3tag0 libidl0
  libiec61883-0 libimlib2 libio-socket-inet6-perl libio-socket-ssl-
  perl libio-stringy-perl libisc44 libisccc40 libisccfg40 libjasper1
  libjpeg62-dev libkadm55 libkcddb4 libkdecorations4 libkdepim4
  libkholidays4 libkipi-common libkipi5 libkleo4 libkonq5 libkonq5-
  templates libkpgp4 libkrb5-dev libkrb53 libksieve4 libkwineffects1
  liblaunchpad-integration1 liblcms1 liblcms1-dev libldap-2.4-2
  liblircclient-dev liblircclient0 liblwres40 liblzo2-2 libmad0
  libmagic1 libmagick10 libmail-sendmail-perl libmime-tools-perl
  libmimelib4 libmng-dev libmodplug0c2 libmysqlclient15-dev
  libmysqlclient15off libmyth-0.22-0 libmyth-0.23-0 libmyth-dev
  libmyth-perl libmyth-python libmythtv-perl libncurses5-dev libneon27
  libneon27-gnutls libnet-daemon-perl libnet-dns-perl libnet-ip-perl
  libnet-ssleay-perl libnet-upnp-perl libnewt0.52 libnfsidmap2 libnm-
  glib0 libnm-util0 libnotify1 libnspr4-0d libnss3-1d liboil0.3
  libokularcore1 libopenexr6 libopenobex1 liborbit2 libossp-uuid15
  libpam-ck-connector libpam-gnome-keyring libpam-modules libpam-
  runtime libpam0g libpango1.0-0 libpango1.0-common libpangomm-1.4-1
  libparted-1.8-8 libparted-1.8-dbg libparted-1.8-dev libparted-1.8-
  i18n libparted1.8-9 libpcrecpp0 libperl5.10 libplasma2 libplrpc-perl
  libpng12-0 libpng12-dev libpolkit-gnome0 libpoppler-qt4-3
  libpoppler3 libpostproc51 libpq-dev libpq5 libpthread-stubs0
  libpthread-stubs0-dev libpulse0 libqt3-compat-headers libqt3-headers
  libqt3-mt-dev libqt4-assistant libqt4-core libqt4-dbus libqt4-
  designer libqt4-dev libqt4-help libqt4-network libqt4-opengl libqt4-
  opengl-dev libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-
  mysql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-
  xmlpatterns libqtcore4 libqtgui4 librpcsecgss3 librsvg2-common
  libruby1.8 libsasl2-2 libsasl2-modules libschroedinger-1.0-0
  libscrollkeeper0 libsdl-image1.2 libsdl-ttf2.0-0 libsdl1.2-dev
  libsdl1.2debian-all libsexy2 libshout3 libslang2-dev libsm-dev
  libsmbclient libsndfile1 libsnmp-base libsnmp15 libsocket6-perl
  libsoup2.4-1 libspeexdsp1 libsql-abstract-limit-perl libsql-
  abstract-perl libsqlite0 libsqlite0-dev libsqlite3-0 libssl-dev
  libssl0.9.8 libstartup-notification0 libstdc++6 libstdc++6-4.3-dev
  libsub-uplevel-perl libsvn1 libswscale0 libsys-hostname-long-perl
  libsysfs-dev libt1-5 libtasn1-3-dev libtemplate-perl libtest-
  exception-perl libtest-simple-perl libthai-data libthai0 libtie-
  ixhash-perl libtiff4 libunicode-string-perl libvdpau-dev libvdpau1
  libvolume-id0 libvorbis0a libvorbisenc2 libvorbisfile3 libvte-common
  libvte9 libwbclient0 libwmf0.2-7 libwnck-common libwnck22 libx11-6
  libx11-data libx11-dev libxau-dev libxcb-xlib0-dev libxcb1-dev
  libxcursor-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev
  libxi-dev libxine-dev libxine1 libxine1-all-plugins libxine1-bin
  libxine1-console libxine1-dbg libxine1-doc libxine1-ffmpeg libxine1-
  gnome libxine1-misc-plugins libxine1-plugins libxine1-x libxine1-
  xvdr libxineliboutput-fbfe libxineliboutput-sxfe libxinerama-dev
  libxml-dom-perl libxml-libxml-common-perl libxml-libxml-perl libxml-
  perl libxml-regexp-perl libxml-twig-perl libxml-writer-perl libxml-
  xpath-perl libxml2 libxmu-dev libxmu-headers libxrandr-dev
  libxrender-dev libxres1 libxt-dev linux-generic linux-headers-
  2.6.27-11 linux-headers-2.6.27-11-generic linux-headers-2.6.27-14
  linux-headers-2.6.27-14-generic linux-headers-2.6.27-15 linux-
  headers-2.6.27-15-generic linux-headers-2.6.27-17 linux-headers-
  2.6.27-17-generic linux-headers-2.6.27-7 linux-headers-2.6.27-7-
  generic linux-headers-generic linux-image-2.6.27-11-generic linux-
  image-2.6.27-14-generic linux-image-2.6.27-15-generic linux-image-
  2.6.27-17-generic linux-image-2.6.27-7-generic linux-image-diskless
  linux-image-generic linux-libc-dev linux-restricted-modules-2.6.27-
  11-generic linux-restricted-modules-2.6.27-14-generic linux-
  restricted-modules-2.6.27-15-generic linux-restricted-modules-
  2.6.27-17-generic linux-restricted-modules-common linux-restricted-
  modules-generic linux-sound-base lirc lirc-modules-source lirc-pluto
  lirc-x lmce-datalog-database lmce-datalog-db lmce-datalogger-plugin
  lmce-dpms-monitor lmce-enocean-tcm120 lmce-game-database lmce-game-
  db lmce-game-player lmce-game-plugin lmce-generic-pc-workstation
  lmce-hai-omni-rs232 lmce-hulu-player lmce-hulu-plugin lmce-hybrid
  lmce-insteon lmce-launch-manager lmce-linux-igd lmce-mame-metadata
  lmce-mame-snaps lmce-mediatomb lmce-mythtv-scripts lmce-pandora-
  plugin lmce-phoenix-solo-usb lmce-picture-plugin lmce-picture-viewer
  lmce-screen-capture-camera lmce-sdlmame lmce-sdlmess lmce-shoutcast-
  radio-plugin lmce-skins-slate lmce-skins-titanium lmce-skins-uita
  lmce-squeezeslave lmce-src-activate-orbiter-plasmoid lmce-src-
  datalogger-plugin lmce-src-dpms-monitor lmce-src-enocean-tcm120
  lmce-src-game-player lmce-src-game-plugin lmce-src-generic-pc-
  workstation lmce-src-hai-omni-series-rs232 lmce-src-hulu-player
  lmce-src-hulu-plugin lmce-src-launch-manager lmce-src-libwindowutils
  lmce-src-lmce-datalog lmce-src-lmce-game lmce-src-pandora-plugin
  lmce-src-picture-plugin lmce-src-picture-viewer lmce-src-screen-
  capture-camera lmce-src-sdlmame lmce-src-sdlmess lmce-src-vistaicm2
  lmce-update-system lmce-update-system-source lmce-update-traversal
  lmce-vistaicm2 lmce-wiimote-support lmce-windowutils lmcevdr login
  lshwd lsscsi lynx mail-transport-agent mce-diskless-tools mce-
  diskless-tools-src mce-installer mce-launcher mdadm media-player-
  only mesa-common-dev mjproxy mjproxy-src mtools mtx-pluto mysql-
  client mysql-client-5.0 mysql-common mysql-server mysql-server-5.0
  mytharchive mytharchive-data mythbrowser mythgallery mythgame
  mythmovies mythmusic mythnetvision mythnetvision-data mythnews
  mythplugins mythtv mythtv-backend mythtv-backend-master mythtv-
  common mythtv-database mythtv-doc mythtv-frontend mythtv-perl
  mythtv-themes mythtv-transcode-utils mythvideo mythweather mythweb
  mythzoneminder nbd-client nbd-server network-manager network-
  manager-kde nfs-common nfs-kernel-server nis nmap notification-
  daemon ntp ntpdate nvidia-173-modaliases nvidia-177-modaliases
  nvidia-180-modaliases nvidia-195-kernel-source nvidia-195-libvdpau
  nvidia-195-modaliases nvidia-96-modaliases nvidia-common nvidia-glx-
  195 nvidia-settings obex-data-server odbcinst1debian1 okular okular-
  extra-backends openbsd-inetd openoffice.org-base-core
  openoffice.org-calc openoffice.org-common openoffice.org-core
  openoffice.org-draw openoffice.org-emailmerge openoffice.org-impress
  openoffice.org-kde openoffice.org-math openoffice.org-style-crystal
  openoffice.org-style-human openoffice.org-writer openssh-server
  openssl parted parted-doc passwd patch perl perl-base perl-modules
  perlmagick phonon-backend-xine php-pear php5-cli php5-common php5-
  curl php5-gd php5-mysql pkg-config pluto-add-software pluto-app-
  server pluto-asterisk pluto-audi-database pluto-avwizard pluto-
  avwizard-skin-basic pluto-avwizard-sounds pluto-avwizard-src pluto-
  bluetooth-dongle pluto-boot-scripts pluto-capture-card-scripts
  pluto-cddb-ident pluto-chromoflex pluto-cm11a pluto-cm15a pluto-
  confirm-dependencies pluto-convert-mac pluto-createdevice pluto-
  database-settings pluto-dcecommon pluto-dcegen pluto-dcerouter
  pluto-devel-dependencies pluto-dhcpd-plugin pluto-disc-drive-
  functions pluto-disk-drive pluto-disk-monitor pluto-dummy-console-
  tools pluto-dynamic-dns pluto-eib pluto-ffmpeg pluto-
  firewire2video4linux pluto-gc100 pluto-generic-serial-device pluto-
  hal-device-finder pluto-hald pluto-hald-src pluto-hdhomerun pluto-
  hvr-1600 pluto-install-scripts pluto-irbase pluto-irtrans-ethernet
  pluto-irtrans-wrapper pluto-libbd pluto-libresolution pluto-
  libserial pluto-lirc-wrapper pluto-local-database pluto-makerelease
  pluto-marbella-database pluto-mcr-remote pluto-media-database pluto-
  messagesend pluto-messagetrans pluto-motion-wrapper pluto-mplayer
  pluto-mplayer-player pluto-msiml-disp-butt pluto-mythtv-includes
  pluto-mythtv-player pluto-mythtv-plugin pluto-network-storage pluto-
  newmdinteractor pluto-nvidia-video-drivers pluto-orbiter pluto-
  orbitergen pluto-orbiterinstaller pluto-photo-screen-saver pluto-
  plcbus pluto-pluto-main-db pluto-pluto-media-db pluto-pluto-
  security-db pluto-pluto-telecom-db pluto-plutodhcp pluto-plutoutils
  pluto-pnp-detection pluto-powerfile-c200 pluto-proxy-orbiter pluto-
  qos pluto-ra pluto-raid-tools pluto-remoteassistance pluto-sample-
  media pluto-sdl-helpers pluto-security-database pluto-serializeclass
  pluto-shiftstate pluto-simplephone pluto-skins-basic pluto-slim-
  server-streamer pluto-slimserver-plugin pluto-sound-card-scripts
  pluto-sql2cpp pluto-sqlcvs pluto-src-app-server pluto-src-asterisk
  pluto-src-bluetooth-dongle pluto-src-cddb-ident pluto-src-chromoflex
  pluto-src-cm11a pluto-src-cm15a pluto-src-confirm-dependencies
  pluto-src-convert-mac pluto-src-createdevice pluto-src-dce-wrap
  pluto-src-dcegen pluto-src-dcerouter pluto-src-disk-drive pluto-src-
  disk-drive-functions pluto-src-eib pluto-src-generic-serial-devic
  pluto-src-hal-device-finder pluto-src-irtrans-ethernet pluto-src-
  irtrans-wrapper pluto-src-libbd pluto-src-libdce pluto-src-libirbase
  pluto-src-libplutoutils pluto-src-libresolution pluto-src-libserial
  pluto-src-libserializeclass pluto-src-makerelease pluto-src-
  messagesend pluto-src-messagetranslation pluto-src-motion-wrapper
  pluto-src-mplayer-player pluto-src-mythtv-player pluto-src-mythtv-
  plugin pluto-src-network-storage pluto-src-newmdinteractor pluto-
  src-orbiter pluto-src-orbitergen pluto-src-photo-screen-saver pluto-
  src-pluto-main pluto-src-pluto-media pluto-src-pluto-security pluto-
  src-pluto-telecom pluto-src-plutodhcp pluto-src-powerfile-c200
  pluto-src-proxy-orbiter pluto-src-remoteassistance pluto-src-sdl-
  helpers pluto-src-shiftstate pluto-src-slim-server-streamer pluto-
  src-slimserver-plugin pluto-src-splitter pluto-src-sql2cpp pluto-
  src-sqlcvs pluto-src-std-plugins pluto-src-test-serial-port pluto-
  src-text-to-speech pluto-src-tribunetv pluto-src-updatemedia pluto-
  src-usb-uirt-0038 pluto-src-utilities pluto-src-vdr pluto-src-vdr-
  plugin pluto-src-vipshared pluto-src-vloopback pluto-src-voicemail-
  monitor pluto-src-x-scripts pluto-src-xine-player pluto-src-xine-
  plugin pluto-src-xml-data-plugin pluto-std-plugins pluto-storage-
  devices pluto-system-database pluto-telecom-database pluto-test-
  serial-port pluto-text-to-speech pluto-tribunetv pluto-updateentarea
  pluto-updatemedia pluto-usb-uirt-0038 pluto-vdr pluto-vdr-plugin
  pluto-vipshared pluto-vloopback pluto-voicemail-monitor pluto-
  website-admin pluto-windowsce-libraries pluto-x-scripts pluto-xine-
  player pluto-xine-plugin pluto-xml-data-plugin pluto-zwave-lighting
  pm-utils po-debconf policykit-gnome poppler-utils portmap ppp procps
  pwgen python-apport python-cairo python-gconf python-glade2 python-
  gnome2 python-gnomecanvas python-gst0.10 python-gtk2 python-gtkhtml2
  python-kde4 python-launchpad-integration python-libxml2 python-
  mythtv python-numeric python-problem-report python-pyorbit python-
  sexy python-software-properties python-uno python-vte python2.5
  python2.5-minimal qt3-dev-tools qt4-qtconfig ruby1.8 samba samba-
  common scons scrollkeeper setserial sgml-data shoutcast-src-radio-
  plugin smbclient smbfs software-properties-gtk software-properties-
  kde splix squashfs-tools squeezeboxserver squeezeslave ssh
  subversion sudo svdrpservice-dev synaptic syslinux systemsettings
  tasksel tasksel-data tcl8.4 tee-pluto tk8.4 traceroute ttf-dejavu
  ttf-dejavu-extra ttf-opensymbol tzdata ubufox udev ufw unixodbc
  update-manager-core update-manager-kde upnp-server-configuration
  v4l2-firmware v4l2-modules vdpau-driver-all vdr vdr-addon-noad vdr-
  dbg vdr-dev vdr-plugin-control vdr-plugin-dvbsddevice vdr-plugin-
  examples vdr-plugin-iptv vdr-plugin-remotetimers vdr-plugin-
  streamdev-client vdr-plugin-streamdev-server vdr-plugin-svdrpservice
  vdr-plugin-vompserver vdr-plugin-wirbelscan vdr-plugin-xineliboutput
  video-wizard-videos vim vim-common vim-runtime vim-tiny vorbis-tools
  wget whiptail whois x11proto-core-dev x11proto-fixes-dev x11proto-
  input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev
  x11proto-xext-dev x11proto-xinerama-dev xbitmaps xfonts-scalable
  xineliboutput-fbfe xineliboutput-sxfe xkb-data xorg-driver-fglrx
  xserver-common xserver-xorg-core xserver-xorg-input-evdev xserver-
  xorg-input-vmmouse xserver-xorg-video-ati xserver-xorg-video-intel
  xserver-xorg-video-radeon xterm xtrans-dev xulrunner-1.9 xutils-dev
  zaptel-modules-2.6.27-14-generic zaptel-modules-2.6.27-15-generic
  zaptel-modules-2.6.27-16-generic zaptel-modules-2.6.27-17-generic
  zlib1g-dev

 Wrote 1085 entries to output Packages file.
I never quit... I just ping out.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Update/upgrade MD's from core not internet?
« Reply #21 on: June 15, 2011, 05:32:30 pm »
The backup/restore process is a little more tricky. 

The database is updated as the core is upgraded...  Subsequent MD updates may have minor updates/changes applied to the database.  Restoring the database from a backup would mean that the database information will be out of sync with the installed packages on the core.  So a database restore should only be performed if the CORE packages would be restored to their original state as well.  This is probably best done, by the user, through a clonezilla image or other external backup system.  Perhaps there is a way to store a list of the upgraded packages to restore them at the same time as a database restore...  This seems like it'd be pretty flaky.

Restoring a 'live' MD (one that is running) that had been upgraded through SSH means that the MD in question cannot simply be 'restored' from the backup directly.  The machine would have to be powered down for the /usr/pluto/diskless/XX directory to be removed and then un-tar'd.  Tricky, especially if someone is using the MD in question at the time.

Restoring an MD that is not running (updated through chroot) is trivial.  The directory can be removed and restored from the .tar archive.  Unless the MD is booted partway through the update/restore process...  This would present an issue.

Yes. I have to do something much more substantial to prevent this from occurring. I am intending now to use the General_Info_Plugin to show progress in pending tasks, and I need to lock certain tasks like reboots, and work out a scheme to prevent MD booting while this process happens.

I think there are some big issues that would need to be addressed before any kind of restore capability could be implemented.

I think you are right. That is now backburner, and once I get everything else licked I will look at it again.

Other notes:
Use a variable for the DATE in your script, otherwise it is possible for a user to start the script one day and have the initial tar-ing of the backup archive, or the upgrades, take long enough it rolls over to the next day.  For instance, lets say I start the script at 11:55pm, it tars for 20 minutes, and upgrades for 20 minutes.  Later in the script the backup archive and the backed-up sources.list files will not be found because the date has rolled over to the next day...  Perhaps just don't use the date in the backup name, unless you see a need for it to be there.

The problem I was trying to overcome by using the date, was in which people did an upgrade, and it did not produce the desired results, and they ran it again, it would hose the good backup. The worst thing to happen from the backup not being found, over the midnight hour, would be that a second backup would occur. This also protects the original sources.list from being overwritten... of course that could happen a different way.

Code: [Select]
mv /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d{,.lmce-update}
mv /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon{,.lmce-update}
echo -en '#!/bin/bash\necho "WARNING: fake invoke-rc.d called"\n' > /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d
echo -en '#!/bin/bash\necho "WARNING: fake start-stop-daemon called"\n' > /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon
chmod +x /usr/sbin/invoke-rc.d
chmod +x /sbin/start-stop-daemon

The first 4 lines, above, affect the desired scripts in the MDs directories.  The 2 final 'chmod' lines unfortunately are affecting the files on the core, not the MDs where you just created the diversion scripts.  Those two lines need to point to the /usr/pluto/diskless/XX/... structure so the appropriate files are affected.

Yes... I thought I fixed that... and I am also moving those on the core because I believe something in them affects the MDs... but I was confused on this issue. I will figure out exactly what they do and what I need to do. Thank you very much.

Code: [Select]
rsh moon$moonDir apt-get update || /bin/true
rsh moon$moonDir apt-get -f -y upgrade
rsh moon$moonDir apt-get upgrade -f -y --force-yes

In this code the middle line should be 'apt-get upgrade -f -y install', rather than the two 'upgrade' commands.

Yes... yes it should.

Code: [Select]
cat /usr/pluto/diskless/$moonDir/etc/apt/sources.list-`date +%Y%m%d`.bak > /usr/pluto/diskless/$moonDir/etc/apt/sources.list

Are you using 'cat' here for a specific purpose?  I would use 'mv' here rather than cat.  Unless you see a need to maintain lots of chronological backup files.  Again, perhaps drop the date portion and use another file extension (such as .lmce-update) or something else.  This can be done with the 'mv' command and using {..}, like the backup of the scripts.

I tend to use cat to avoid confirmation issues. That just overwrites the file.

Code: [Select]
cp -ru /var/cache/apt/archives/* /usr/pluto/deb-cache

This line doesn't need the 'r' option.  I would also alter this and 'mv' (move) the files rather than duplicating them and comsuming the extra HD space.  The only files that need to be affected here are the '*.deb' files, you don't want to move any sub-directories from ../apt/archives/ to ../pluto/deb-cache/ -- just the .deb files.

I had a weirdo nVidia folder so I did for good measure... I went back and forth on cp vs mv. I am not a big fan of duplication. I will change it.

The cleanup trap should probably umount the bound deb-cache folder for the chroot updated MDs.

Wow, lots to look at!  Keep it up!

J.

You are right... it should. I thought:
Code: [Select]
            umount /usr/pluto/diskless/$moonDir/usr/pluto/deb-cachewould do that.
It is so incredibly helpful to have fresh eyes reading giving feedback.

The latest script has a cheap global alert up to remind not to interfere with the process. I actually built a ridiculous graphic progress meter for it... but didn't bother including it because I need to do it the right way.

http://svn.linuxmce.org/trac.cgi/ticket/341
« Last Edit: June 16, 2011, 02:13:57 am by l3mce »
I never quit... I just ping out.