Results 1 to 9 of 9

Thread: Fix update-notifier in BT4 pre-final

  1. #1
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default Fix update-notifier in BT4 pre-final

    Community,

    ---
    ATTENTION: This topic lasted a LOT longer than expected. If you're just interested in a quick Fix, please skip the "Foreword" and go straight to the second subsequent post (Mods, I'm pretty sorry for these subsequent posts but this topic turned out to be that tricky, that it's nearly impossible to write a single post without losing readability)
    ---


    UPDATE: Forget this WIP state, I finally managed to fix the update-notifier in BT4 pre-final without any remaining issues. I'm going to post a straightforward solution below (sorry for a subsequent posting, but that's urgently needed to ensure readability)

    this is currently WIP but the major steps are done, thus I decided to share it now. I'll post updates once available.

    Problem description: update-notifier in BT4 pre-final is somewhat broken. In Intrepid (and therefore BT4) the root user is not allowed to execute the notifier and thus it'll not show up in ksystray by default. In Jaunty this is fixed and thus I decided to backport these changes to BT4 pre-final.

    Solution: I rebuilt the Intrepid source package of update-notifier by customizing the update-notifier.c source code appropriately. With my custom update-notifier packages, you'll be able to use the notifier whether you're logged in as root or not.

    Remaining issue: There's a weird dpkg-divert local diversion introduced and I currently don't know where it's coming from. This is the reason I tag this Fix as WIP for now.

    EDIT: First install the original update-notifier from BT4 repos to pull dependencies
    Code:
    # apt-get install update-notifier
    You can wget my custom packages for BT4 pre-final as of now (...) and install them with dpkg
    Code:
    # wget http://piranha.klashed.net/private/update-notifier_0.71.8_i386.deb
    # wget http://piranha.klashed.net/private/update-notifier-common_0.71.8_all.deb
    In addition to that I provide the modified update-notifier.c to give you the possibility to verify the changes I introduced (diff is your friend)
    Code:
    # wget http://piranha.klashed.net/private/update-notifier.c
    As of the dpkg-divert issue: You can either remove the local diversion of apt-check or you move the diverted file manually after installing my custom packages. This issue will (hopefully) be fixed later on. Suggestions are certainly welcome!
    Code:
    # mv /usr/lib/update-notifier/apt-check.distrib /usr/lib/update-notifier/apt-check
    You can start the notifier with
    Code:
    # update-notifier --force
    EDIT: Be sure not to update update-notifier and update-notifier-common from BT4 repos. This will obviously break the Fix again (use the Lock in Synaptic to prevent this)

  2. #2
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default [DONE] Fix update-notifier in BT4 pre-final

    Here is a straightforward method to fix the somewhat broken update-notifier in BT4 pre-final (for a more detailed problem description, please see above).

    This Fix addresses the following issues:
    - update-notifier in BT4 pre-final isn't usable as root user
    - there's a local diversion of apt-check
    - update-notifier won't work with KDE's autostart mechanism

    Step 1: Remove the local diversion of apt-check
    Code:
    # dpkg-divert --remove /usr/lib/update-notifier/apt-check
    --- begin additional information
    EDIT: After investigating this part for quite a long time, I'd like to share my findings, i.e. an explanation why there's a local diversion of apt-check in BT4 pre-final. This one was really hard to find out, but I finally got it. The local diversion of apt-check is due to the casper boot process in BT4 pre-final. There's a script at /usr/share/initramfs-tools/scripts/casper-bottom/31disable_update_notifier where all the magic takes place. Let me cite the interesting part of that script
    # For GNOME, we divert away apt-check to avoid a regular 'apt-get update'
    # equivalent in the live session. We want to run update-notifier for crash
    # report handling.
    chroot /root dpkg-divert --add --rename --quiet \
    /usr/lib/update-notifier/apt-check
    ln -s /bin/true /root/usr/lib/update-notifier/apt-check
    This is the reason the local diversion gets re-introduced upon every reboot (this is a very important finding). To BT devs: If you'd decide to introduce my Fix to BT4 final, I'd like to encourage you "fixing" casper appropriately as well (I've done this now - see UPDATE2)
    --- end additional information

    Step 2: Install update-notifier from BT4 repos to pull dependencies
    Code:
    # apt-get install update-notifier
    Step 3: Download my custom update-notifier packages and install them utilizing dpkg (I bumped the version number to address the conflict with the original update-notifier from BT4 repos)
    Code:
    # wget http://piranha.klashed.net/private/BT4-pre-final/update-notifier/update-notifier-common_0.71.8.1_all.deb
    # dpkg -i update-notifier-common_0.71.8.1_all.deb
    # wget http://piranha.klashed.net/private/BT4-pre-final/update-notifier/update-notifier_0.71.8.1_i386.deb
    # dpkg -i update-notifier_0.71.8.1_i386.deb
    The update-notifier will be autostarted from now on with your KDE session - no user-interaction is required at all. Have fun!

    UPDATE: Community, I'm sorry, but there's still an issue with the local diversion of apt-check after rebooting the system (see additional information above). This update-notifier/casper combination seems to be a REAL beast - WTF? I made some progress here, but JFYI, this part is still not 100% solved. Will post updates as available though.

    ---
    UPDATE2: After another round of investigating I come closer to the conclusion that I'm trying to solve an un-solvable problem (awesome, is it?). While this is just loud thinking, from my perspective it's as follows: The script /usr/share/initramfs-tools/scripts/casper-bottom/31disable_update_notifier (part of the casper deb package) is responsible for the re-creation of the local diversion of apt-check upon reboot. So far so good. Therefore I rebuilt casper without that script, BUT (and now it comes) as I'm working in a persistent LiveUSB environment this would never work out. Why? The script in question is an initramfs script and gets executed pretty early during the boot process - even too early for the aufs overlay to show up (that's my current estimation), thus an upgrade to a modified casper deb package without the initramfs script doesn't help too much to get rid of the local diversion of apt-check - at least not in a live environment (not without rebuilding the ISO). While this is all speculation at this point, I ASSUME that it COULD work (install a modified casper deb package) in a harddrive installation environment though. Interested parties could try this kind of Fix if desired - modified casper deb packages are uploaded already
    Code:
    # wget http://piranha.klashed.net/private/BT4-pre-final/casper/ubiquity-casper_1.152.1_all.deb
    # dpkg -i ubiquity-casper_1.152.1_all.deb
    # wget http://piranha.klashed.net/private/BT4-pre-final/casper/casper_1.152.1_i386.deb
    # dpkg -i casper_1.152.1_i386.deb
    If this works out (please tell me if you tried it - I would obviously be damn interested in the outcome) you're a lucky guy as you (most likely) reached the long-awaited end of the update-notifier Fix (cannot verify this though - no harddrive installation available).
    Another ASSUMPTION in regard of a harddrive installation would be that you don't have to deal with the re-creation of the local diversion of apt-check upon reboot at all as casper is just part of a Live environment. Please be patient with me - I just have no harddrive installation available.
    I'm focusing on an init script solution now - be patient and watch out for UPDATE3 (hopefully the last one)
    ---

    I'd appreciate very much if that Fix would be considered by BT devs for BT4 final - if you'd decide to do so, I'd be happy to provide the particular changes to the update-notifier sourcecode and explain these if desired. Let me know!

  3. #3
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    THE FINAL SOLUTION aka UPDATE3

    The major issue I had to face was the local diversion of apt-check introduced by casper. Therefore this solution is divided into 2 parts, the "persistent LiveUSB" case and the "real install" case.

    1. the "persistent LiveUSB" case
    Code:
    # dpkg-divert --remove /usr/lib/update-notifier/apt-check
    # apt-get update
    # apt-get install update-notifier
    # wget http://piranha.klashed.net/private/BT4-pre-final/update-notifier/update-notifier-common_0.71.8.1_all.deb
    # dpkg -i update-notifier-common_0.71.8.1_all.deb
    # wget http://piranha.klashed.net/private/BT4-pre-final/update-notifier/update-notifier_0.71.8.1_i386.deb
    # dpkg -i update-notifier_0.71.8.1_i386.deb
    Create an init-script /etc/rcS.d/S99update-notifier.sh with the following content
    Code:
    #!/bin/sh
    if [ -e /usr/lib/update-notifier/apt-check.distrib ]; then
    mv /usr/lib/update-notifier/apt-check.distrib /usr/lib/update-notifier/apt-check
    fi
    Don't forget to make the init-script executable
    Code:
    # chmod 755 /etc/rcS.d/S99update-notifier.sh
    Yeah, this init-script is a nasty hack, but it's HONESTLY the only possible solution in a LiveUSB environment. Now, reboot the system and update-notifier will autostart with your KDE session the next time you login.

    2. the "real install" case (this is still untested - no "real install" available - but due to some info I got on IRC, I'm 99% sure about it)
    Code:
    # apt-get update
    # apt-get install update-notifier
    # wget http://piranha.klashed.net/private/BT4-pre-final/update-notifier/update-notifier-common_0.71.8.1_all.deb
    # dpkg -i update-notifier-common_0.71.8.1_all.deb
    # wget http://piranha.klashed.net/private/BT4-pre-final/update-notifier/update-notifier_0.71.8.1_i386.deb
    # dpkg -i update-notifier_0.71.8.1_i386.deb
    To summarize: it's most likely (99%) pretty much the same as the "persistent LiveUSB" case, but you won't have to deal with the local diversion of apt-check at all - lucky you!

    Success stories about the "real install" case are certainly welcome (obviously for the "persistent LiveUSB" case as well, although I'm 100% sure about this)

  4. #4
    Junior Member
    Join Date
    Jun 2009
    Posts
    26

    Default

    worked fine

  5. #5
    Just burned his ISO imported_h4x0r's Avatar
    Join Date
    Mar 2006
    Posts
    18

    Default

    worked fine too (real-instal case)
    thanks a lot or4n9e for ur investigation's and explanation.

    but now i'f got a noobie question:
    if i start the update manager it say's me, that a new distro-release is available (9.04). will this upgrade my bt4 to ubuntu 9.04 or to a newer bt4 ;?)
    in the synaptic it doesn't say me this.

  6. #6
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    if i start the update manager it say's me, that a new distro-release is available (9.04). will this upgrade my bt4 to ubuntu 9.04 or to a newer bt4 ;?)
    in the synaptic it doesn't say me this.
    DO NOT UPGRADE to Jaunty! To disable the notification: open Synaptic, Settings, Repositories, Updates tab and select "Never" under "Release Upgrade", then reload update-manager.

  7. #7
    Just burned his ISO imported_h4x0r's Avatar
    Join Date
    Mar 2006
    Posts
    18

    Default

    thanks 4 the info
    will bt4pf updated a day to final automatic ;?)

  8. #8
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    Quote Originally Posted by h4x0r View Post
    thanks 4 the info
    will bt4pf updated a day to final automatic ;?)
    Let's say it that way: If "apt-get update && apt-get upgrade" followed by "apt-get dist-upgrade" from BT4PF to BT4F will be possible, update-notifier/update-manager will be able to do the same :-)
    But IF that'll be possible is certainly the responsibility of the BT devteam.

  9. #9
    Just burned his ISO imported_h4x0r's Avatar
    Join Date
    Mar 2006
    Posts
    18

    Default

    Quote Originally Posted by or4n9e View Post
    But IF that'll be possible is certainly the responsibility of the BT devteam.

    thanks
    i will hope so

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •