Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Knoppix 7.0.2-EN DVD notes & comments

  1. #11
    Moderator Moderator
    Join Date
    Mar 2004
    Location
    Menlo Park, California
    Posts
    674

    NTFS 3G patch for Knoppix 7.0.2

    Hello,
    In the Knoppix forum (links below) there was some discussion about how to add
    the ntfs-3g support to Knoppix 7.0.2 as it is missing from the official released DVD:
    http://lists.debian.org/debian-knopp.../msg00002.html
    http://lists.debian.org/debian-knopp.../msg00005.html
    http://lists.debian.org/debian-knopp.../msg00013.html
    Please find below a link to a simple patch type solution which does not require remastering:
    http://knoppix.net/forum/threads/115...l=1#post126975
    Please note that this technique can also be used to live patch Knoppix with whatever
    other feature you may need. Hope this helps. Please provide some feedback...
    Best Regards,
    Gilles
    Last edited by ruymbeke; 06-11-2012 at 03:04 AM.

  2. #12
    Moderator Moderator
    Join Date
    Mar 2004
    Location
    Menlo Park, California
    Posts
    674

    64 bits patch for Knoppix 7.0.2

    Hello,
    Please find below a link to a live patch to add 64 bits support (run-time + gcc) to Knoppix 7.0.2.
    http://knoppix.net/forum/threads/115...l=1#post127058
    Hope this helps and please provide some feedback...
    Best Regards,
    Gilles

  3. #13
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    802

    apt-get crash: "A copy of the C library was found in an unexpected directory"

    Quote Originally Posted by klaus2008 View Post
    Hi Gilles,

    I have successfully tried the following with Knoppix V7.0.2.

    You have to replace the packages libc-bin, libc-dev-bin, libc6, libc6-dev with those of the unstable branch.

    Open a terminal an issue
    Code:
    sudo apt-get update
    sudo apt-get -d -t unstable install libc-bin libc-dev-bin libc6 libc6-dev
    sudo chvt 1
    init 2
    apt-get -t unstable install libc-bin libc-dev-bin libc6 libc6-dev
    chroot /UNIONFS/
    apt-get -t unstable -f install
    exit
    init 5
    chvt 5
    Now you can install the current packages gcc-4.6-multilib and g++-4.6-multilib from the unstable branch.
    Code:
     sudo apt-get -y -t unstable install gcc-4.6-multilib g++-4.6-multilib
    Download and extract pi_quick_start.tar.gz

    Change to your pi_quick_start directory and load start.sh into a text editor. Replace all occurances of "cc" with "gcc -m64". Save the file and exit the text editor.

    Set the environment variable CFLAGS:
    Code:
    export CFLAGS=-m64
    Run the script:
    Code:
    ./start.sh
    Best Regards
    Last week this recipe worked perfectly, but now it hangs, seemingly in the check_dir() function in libc:i386.preinst. Is there any way to get around this? The script is found in /var/lib/dpkg/info/libc6:i386.preinst, but editing this doesn't seem to help.

    For me, this is a very serious problem.
    Here is what seems to be the culprit:

    Code:
    # Sanity check.
    # If there are versions of glibc outside of the normal installation
    # location (/lib, /lib64, etc.) then things may break very badly
    # as soon as ld.so is replaced by a new version.  This check is not
    # foolproof, but it's pretty accurate.  This script ignores libraries
    # with different sonames, and libraries incompatible with the 
    # to-be-installed ld.so.
    check_dir () {
        msg=$1
        dir=$2
    
        # Follow symlinks
        dir=$(readlink -e $dir || true)
    
        # Ignore inexistent directories
        if ! test -d "$dir" ; then
            return
        fi
      
        # Detect possible candidates
        files=$(ls $dir | egrep '^(ld|lib(d|c|m|pthread|rt|dl))-2.*.so' 2>/dev/null || true)
        if test -z "$files" ; then
            return
        fi
      
        for file in $files ; do
            lib=$dir/$file
    
            # Skip if it is a symlink (as installed by lsb-core)
            if test -L "$lib" ; then
                continue
            fi
    
            # Skip if it is the currently dynamic loader
            if test "$lib" = "$ldfile" ; then
                continue
            fi
    
            # See if the found libraries are compatible with the system ld.so;
            # if they aren't, they'll be ignored. Check e_ident, e_type (which
            # will just be ET_DYN), and e_machine. If a match is found, there
            # is a risk of breakage.
            libbytes=`head -c 20 $lib | od -c`
            if test "$ldbytes" != "$libbytes" ; then 
              continue
            fi
    
            # Binaries owned packages are considered to do the right thing
            # First try a quick lookup which should catch all cases on a 
            # normal system
            if echo $libcfiles | grep -q "[ ^]$lib[ $]" ; then 
                continue
            fi
    
            # Slower lookup to confirm
            if dpkg-query -S "$lib" >/dev/null 2>&1 ; then
                continue
            fi
    
            # Output an error message and exit
            echo
            echo "A copy of the C library was found $msg:"
            echo "  '$lib'"
            echo "It is not safe to upgrade the C library in this situation;"
            echo "please remove that copy of the C library or get it out of"
            echo "'$dir' and try again."
            echo
            exit 1
        done
    }
    "A copy of the C library was found in an unexpected directory /UNIONFS/lib/libc-2.13.so..." And we are asked to remove it.

    Code:
    # Try to detect copies of the libc library in the various places
    # the dynamic linker uses.
        ldfile=$(readlink -e /lib/ld-linux.so.2)
        ldbytes=$(head -c 20 /lib/ld-linux.so.2 | od -c)
        libcfiles=$(dpkg-query -L $(package_name) 2>/dev/null)
    
        dirs="/lib/i386-linux-gnu /lib /lib/tls /lib32 /lib64 /usr/local/lib /usr/local/lib32 /usr/local/lib64"
        for dir in $dirs ; do
            check_dir "in an unexpected directory" $dir
        done

  4. #14
    Moderator Moderator
    Join Date
    Mar 2004
    Location
    Menlo Park, California
    Posts
    674

    Is the "libc6_2.13-33_i386.deb" package corrupted on the Debian repository ?

    Quote Originally Posted by Capricorny View Post
    Last week this recipe worked perfectly, but now it hangs... Is there any way to get around this ? ... For me, this is a very serious problem...
    Hello Capricorny,
    I don't have any problem using the script below:

    Code:
    #!/bin/sh
    sudo apt-get update
    sudo apt-get -y -d -t unstable install libc-bin libc-dev-bin libc6 libc6-dev gcc-4.6-multilib g++-4.6-multilib
    sudo apt-get -y -t unstable --reinstall install libc-bin libc-dev-bin libc6 libc6-dev
    sudo chroot /UNIONFS/ apt-get -y -t unstable -f install
    sudo apt-get -y -t unstable --reinstall install gcc-4.6-multilib g++-4.6-multilib
    After booting Knoppix 7.0.2 from the DVD and using the 64 bits kernel
    I can compile and execute 64 bits libraries and applications such as Pi
    cf: http://h2np.net/pi/pi_record_e.html
    (after editing the start.sh script to add the "-m64" parameter on the two lines using "cc" to compile "v" and "pi")

    That being said, during the install I get a very worrying error message:

    Code:
    apt-get -y -t unstable --reinstall install  libc-bin libc-dev-bin libc6 libc6-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 4 reinstalled, 0 to remove and 1453 not upgraded.
    Need to get 0 B/10.2 MB of archives.
    After this operation, 0 B of additional disk space will be used.
    (Reading database ... 430147 files and directories currently installed.)
    Preparing to replace libc-bin 2.13-33 (using .../libc-bin_2.13-33_i386.deb) ...
    Unpacking replacement libc-bin ...
    Processing triggers for man-db ...
    Setting up libc-bin (2.13-33) ...
    (Reading database ... 430147 files and directories currently installed.)
    Preparing to replace libc6:i386 2.13-33 (using .../libc6_2.13-33_i386.deb) ...
    
    A copy of the C library was found in an unexpected directory:
      '/UNIONFS/lib/i386-linux-gnu/libc-2.13.so'
    It is not safe to upgrade the C library in this situation;
    please remove that copy of the C library or get it out of
    '/UNIONFS/lib/i386-linux-gnu' and try again.
    
    dpkg: error processing /var/cache/apt/archives/libc6_2.13-33_i386.deb (--unpack):
     subprocess new pre-installation script returned error exit status 1
    Errors were encountered while processing:
     /var/cache/apt/archives/libc6_2.13-33_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    ==> dpkg: error processing /var/cache/apt/archives/libc6_2.13-33_i386.deb (--unpack): <==
    Is it possible that the "libc6_2.13-33_i386.deb" package be corrupted on the Debian repository ?
    Even with that error, it looks like that I can still compile and execute 64 bits code...

    BTW, did you try my patch yet ?
    Best Regards,
    Gilles
    Last edited by ruymbeke; 06-24-2012 at 08:46 AM.

  5. #15
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    802
    Quote Originally Posted by ruymbeke View Post
    Hello Capricorny,
    I don't have any problem using the script below:

    Code:
    #!/bin/sh
    sudo apt-get update
    sudo apt-get -y -d -t unstable install libc-bin libc-dev-bin libc6 libc6-dev gcc-4.6-multilib g++-4.6-multilib
    sudo apt-get -y -t unstable --reinstall install libc-bin libc-dev-bin libc6 libc6-dev
    sudo chroot /UNIONFS/ apt-get -y -t unstable -f install
    sudo apt-get -y -t unstable --reinstall install gcc-4.6-multilib g++-4.6-multilib
    After booting Knoppix 7.0.2 from the DVD and using the 64 bits kernel
    I can compile and execute 64 bits libraries and applications such as Pi
    cf: http://h2np.net/pi/pi_record_e.html
    (after editing the start.sh script to add the "-m64" parameter on the two lines using "cc" to compile "v" and "pi")

    That being said, during the install I get a very worrying error message:

    Code:
    apt-get -y -t unstable --reinstall install  libc-bin libc-dev-bin libc6 libc6-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 4 reinstalled, 0 to remove and 1453 not upgraded.
    Need to get 0 B/10.2 MB of archives.
    After this operation, 0 B of additional disk space will be used.
    (Reading database ... 430147 files and directories currently installed.)
    Preparing to replace libc-bin 2.13-33 (using .../libc-bin_2.13-33_i386.deb) ...
    Unpacking replacement libc-bin ...
    Processing triggers for man-db ...
    Setting up libc-bin (2.13-33) ...
    (Reading database ... 430147 files and directories currently installed.)
    Preparing to replace libc6:i386 2.13-33 (using .../libc6_2.13-33_i386.deb) ...
    
    A copy of the C library was found in an unexpected directory:
      '/UNIONFS/lib/i386-linux-gnu/libc-2.13.so'
    It is not safe to upgrade the C library in this situation;
    please remove that copy of the C library or get it out of
    '/UNIONFS/lib/i386-linux-gnu' and try again.
    
    dpkg: error processing /var/cache/apt/archives/libc6_2.13-33_i386.deb (--unpack):
     subprocess new pre-installation script returned error exit status 1
    Errors were encountered while processing:
     /var/cache/apt/archives/libc6_2.13-33_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    ==> dpkg: error processing /var/cache/apt/archives/libc6_2.13-33_i386.deb (--unpack): <==
    Is it possible that the "libc6_2.13-33_i386.deb" package be corrupted on the Debian repository ?
    Even with that error, it looks like that I can still compile and execute 64 bits code...

    BTW, did you try my patch yet ?
    Best Regards,
    Gilles
    Thank you very much for your response, Gilles!

    First, my current working version is remastering #4, so I havent tried out your patch. As told, I also already did this successfully, but in another "branch", which has been overwritten.

    The important observation for me is that you get precisely the same error message as me, effective halting the upgrading of libc6, leaving a "broken" package from apt's point of view. And I pointed out the approximate location of the error in the preinst script -it's corrupted logic, not corrupted files. The ordinary upgrade of libc6 stable also crashes the same way.

    To fix the problem, we must have access to and patch the offending downloaded .deb packages. This may be accomplished in a number of ways, right now I tend to support the more drastical ones, to be able to stop Debian apt madness on the spot when needed.

  6. #16
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    802

    A general method for stopping apt preinst/postinst madness, here: install libc6

    Quote Originally Posted by Capricorny View Post
    To fix the problem, we must have access to and patch the offending downloaded .deb packages. This may be accomplished in a number of ways, right now I tend to support the more drastical ones, to be able to stop Debian apt madness on the spot when needed.
    Here is a general solution to the problem, found on github:gist, https://gist.github.com/1729559

    It amounts to running a script on the troublesome downloaded .deb package, to remove the associated pre/postrm scripts. I think it should be fairly safe to use, and in any case far safer than the default dive-into-it Debian "method", which may leave us with a broken system even if everything is correct, because the scripts are buggy - as they very often tend to be.

    The script is called stripdeb.sh, and I installed it in /usr/local/bin:
    Code:
    #!/bin/bash
    # Usage: stripdeb.sh something.deb
    # From: https://gist.github.com/1729559
    # Patch /etc/apt.conf.d/70debconf: DPkg::Pre-Install-Pkgs {"xargs -rL1 bash /usr/local/bin/stripdeb.sh 2>&1 | logger -t stripdeb"}
    # 20120624  tay: This patching didn't seem to work, and using on a regular basis may not be that smart either. 
    # Safer to run it only on individual packages basis: 
    # #> sudo stripdeb.sh /var/cache/apt/archives/libc6_2.13-33_i386.deb
    # Don't use apt-get afterwards, it may notice something is changed and download the old madness again
    # #> dpkg -i /var/cache/apt/archives/libc6_2.13-33_i386.deb
    
    echo "Args: $*"
    echo "Stripping $1 of pre/post maintainer scripts"
    tmpdir=$(mktemp -d)
    
    [ ! -f $1 ] && exit 1
    
    genldconfigscript() {
      # Maybe we should just make the always run 'ldconfig'
      cat << EOF
    #!/bin/sh
    [ "\$1" = "configure" ] && ldconfig
    [ "\$1" = "remove" ] && ldconfig
    true
    EOF
    }
    
    # The .deb is an 'ar' archive, grab the control files.
    ar -p $1 control.tar.gz | tar -C $tmpdir -zxf -
    
    # Kill the stupid package scripts, but log what we do.
    for i in $tmpdir/{post,pre}{rm,inst} ; do
    if [ -f $i ] ; then
    
        # Linux sucks, so we have to run ldconfig on any library changes.
        # So if the post/pre script includes ldconfig
        if grep -q ldconfig $i ; then
    echo "$1: Replacing $i with a generic 'ldconfig' script"
          genldconfigscript > $i
          chmod 755 $i
        else
    echo "$1: Stripping $(basename $i)"
          rm $i
        fi
    fi
    done
    
    # Rebuild the control tarball
    tar -C $tmpdir -zcf control.tar.gz .
    
    # And replace the old one with the stripped one back into the .deb
    ar -r $1 control.tar.gz
    
    # Clean up
    rm control.tar.gz
    So, to get around the Debian package bugs, I ran the script before chvt'ing, and used dpkg instead of apt-get after init 2. The modified version of Klaus2008's recipe thus becomes:


    Code:
    sudo apt-get update 
    sudo apt-get -d -t unstable install libc-bin libc-dev-bin libc6 libc6-dev 
    sudo stripdb.sh /var/cache/apt/archives/libc6_2.13-33_i386.deb
    
    sudo chvt 1
    init 2
    dpkg -i libc-bin libc-dev-bin libc6 libc6-dev 
    
    chroot /UNIONFS/ 
    apt-get -t unstable -f install 
    exit 
    init 5 
    chvt 5
    
    sudo apt-get -y -t unstable install gcc-4.6-multilib g++-4.6-multilib
    It worked for me, and with due modifications it ought to work more generally.
    We must of course be pretty sure that the scripts aren't really needed for the particular package.

  7. #17
    Moderator Moderator
    Join Date
    Mar 2004
    Location
    Menlo Park, California
    Posts
    674
    Hi Capricorny,
    Thank you very much for offering a fix proposal. I tried it and I found two problems:

    Quote Originally Posted by Capricorny View Post
    sudo stripdb.sh /var/cache/apt/archives/libc6_2.13-33_i386.deb
    The first one is a typo in your modified Klaus2008's recipe: stripdb.sh ==> stripdeb.sh
    (to match the location of the /usr/local/bin/stripdeb.sh script)

    Quote Originally Posted by Capricorny View Post
    dpkg -i libc-bin libc-dev-bin libc6 libc6-dev
    The second: dpkg -i complains about not finding the archive, please see the log below:

    dpkg -i libc-bin libc-dev-bin libc6 libc6-dev
    dpkg: error processing libc-bin (--install):
    cannot access archive: No such file or directory
    dpkg: error processing libc-dev-bin (--install):
    cannot access archive: No such file or directory
    dpkg: error processing libc6 (--install):
    cannot access archive: No such file or directory
    dpkg: error processing libc6-dev (--install):
    cannot access archive: No such file or directory
    Errors were encountered while processing:
    libc-bin
    libc-dev-bin
    libc6
    libc6-dev
    Best Regards,
    Gilles
    Last edited by ruymbeke; 06-24-2012 at 01:27 PM.

  8. #18
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    802
    Right you are, Gilles!
    This reporting was very quickly done, a bit too fast.
    What I actually ran was

    Code:
    sudo apt-get update  
    sudo apt-get -d -t unstable install libc-bin libc-dev-bin libc6 libc6-dev  
    sudo stripdeb.sh /var/cache/apt/archives/libc6_2.13-33_i386.deb  
    
    sudo chvt 1 
    init 2
    # The other libs were correctly installed already, next line implicit - didn't run it
    # sudo apt-get -y -t unstable --reinstall install libc-bin libc-dev-bin libc6-dev 
    
    # Give dpkg exact file address
    dpkg -i /var/cache/apt/archives/libc6_2.13-33_i386.deb 
    
    chroot /UNIONFS/ 
    apt-get -t unstable -f install  
    exit  
    
    init 5  
    chvt 5  
    
    sudo apt-get -y -t unstable install gcc-4.6-multilib g++-4.6-multilib
    But I wasn't able to copy from the chvt 1 commands, thus only edited the line from the recipe. apt-get may possibly be used, but told not to download again? It just downloaded the unmodified .deb libc6 over the modified one for me.
    The most robust thing to do might be to adjust the dpkg command.

    PS: The autoformatting here REALLY SUCKS!
    Last edited by Capricorny; 06-24-2012 at 01:47 PM.

  9. #19
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    802
    After another round with the recipe (I maintain squashfs and cloop remasterings separately), I 'm pretty sure that this way of handling install problems will normally be OK when there are no underlying problems. But, turning off all scripts is a rather drastical measure, and a more careful way of handling it would be to patch the offending script(s). Which I think in this case would be quite simple, the main problem is getting access to it. Here, the technique in the stripdeb.sh script could be useful.

    For example, instead of removing the script, a patch could be applied to it. In the actual case here, inserting a simple "continue" statement could be enough. In other cases I have come across, running checks on non-used (but installed by default) components like new grub have lead to problems, and the irrelevant checks should be omitted.

  10. #20
    Moderator Moderator
    Join Date
    Mar 2004
    Location
    Menlo Park, California
    Posts
    674
    Hello,
    Please find below my latest script working with the latest Debian repository changes (using gcc 4.7.1):
    Code:
    sudo apt-get update
    sudo apt-get -y -d -t unstable install libc-bin libc-dev-bin libc6 libc6-dev gcc-4.6-multilib g++-4.6-multilib
    sudo apt-get -y -t unstable --reinstall install libc-bin
    sudo stripdeb.sh /var/cache/apt/archives/libc6_2.13-33_i386.deb
    sudo dpkg -i /var/cache/apt/archives/libc6_2.13-33_i386.deb
    sudo apt-get -y -t unstable --reinstall install libc-dev-bin libc6-dev
    sudo chroot /UNIONFS/ apt-get -y -t unstable -f install
    sudo apt-get -y -t unstable --reinstall install gcc-4.6-multilib g++-4.6-multilib
    It is using the /usr/local/bin/stripdeb.sh script from Capricorny, see above:
    http://knoppix.net/forum/threads/298...l=1#post127069
    Best Regards,
    Gilles

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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


Cisco SG95-16 16-Port Gigabit Switch SG95-16-KR picture

Cisco SG95-16 16-Port Gigabit Switch SG95-16-KR

$47.00



Cisco SG110 8 Port Gigabit Ethernet Switch SG110D-08-BR picture

Cisco SG110 8 Port Gigabit Ethernet Switch SG110D-08-BR

$39.00



Cisco MS120-48FP - 52 Ports Fully Managed Ethernet Switch UNCLAIMED picture

Cisco MS120-48FP - 52 Ports Fully Managed Ethernet Switch UNCLAIMED

$449.00



Cisco SG110 24 Port Gigabit Ethernet Switch w/ 2 x SFP SG110-24 picture

Cisco SG110 24 Port Gigabit Ethernet Switch w/ 2 x SFP SG110-24

$117.00



Linksys SE3008 8 Ports Rack Mountable Gigabit Ethernet Switch picture

Linksys SE3008 8 Ports Rack Mountable Gigabit Ethernet Switch

$18.99



New Linksys SE3005 5-port Gigabit Ethernet Switch picture

New Linksys SE3005 5-port Gigabit Ethernet Switch

$15.99



NETGEAR 5-Port Gigabit Ethernet Unmanaged Switch (GS305) - NEW IN BOX picture

NETGEAR 5-Port Gigabit Ethernet Unmanaged Switch (GS305) - NEW IN BOX

$18.99



Juniper 48-Port GbE PoE+ & 4-Port 10GB SFP+ Network Switch EX3300-48P w/ License picture

Juniper 48-Port GbE PoE+ & 4-Port 10GB SFP+ Network Switch EX3300-48P w/ License

$49.99



*NETGEAR PROSAFE (JGS524V2) 24-Port Gigabit Ethernet Switch *NO AC* picture

*NETGEAR PROSAFE (JGS524V2) 24-Port Gigabit Ethernet Switch *NO AC*

$29.99



Fortinet FortiSwitch FS-124D-POE 24 Port Gigabit Ethernet Switch UNREGISTERED picture

Fortinet FortiSwitch FS-124D-POE 24 Port Gigabit Ethernet Switch UNREGISTERED

$89.97