Results 1 to 10 of 21

Thread: [howto] tweaking a livecd in order to blacklist offending kernel modules

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Beans
    841

    [howto] tweaking a livecd in order to blacklist offending kernel modules

    ive got one of the laptops affected by the following bug: http://bugzilla.kernel.org/show_bug.cgi?id=9905

    with more info here:

    https://bugs.launchpad.net/ubuntu/+s...ux/+bug/187671


    there has been a patch released to fix the issue, but the likeliness of it being included in the intrepid release is small, so ive decided to jump ahead and make a livecd that will boot in these laptops.

    the procedure consist on the following:

    • download a livecd
    • extract it with archive manager
    • use squashfs to uncompress the livecd filesystem
    • edit /etc/modprobe/blacklist to blacklist the offending modules
    • repack the livecd filesystem
    • create a bootable iso
    • burn


    first things first: you need to have squashfs-tools and genisoinage, so
    Code:
    $ sudo apt-get install squashfs-tools genisoimage

    now we begin: download the livecd you wish to be able to boot.

    then extract the contents of the livecd to a folder in your desktop called isofs using the archive manager.

    next, open a terminal by pressing [alt]-[f2] and typing
    Code:
    gnome-terminal
    and execute:
    Code:
    $ cd ~/Desktop
    $ sudo unsquashfs ~/Desktop/isofs/casper/filesystem.squashfs
    which will uncompress the livecd filesystem so that we can modify it.

    now we edit the blacklist file with
    Code:
    $ sudo gedit ~/Desktop/squashfs-root/etc/modprobe.d/blacklist
    and add to the end of the file the following lines:
    Code:
    blacklist sdhci
    blacklist sdhci-pci

    next step involves rebuilding the squashfs

    Code:
    $ sudo rm ~/Desktop/isofs/casper/filesystem.squashfs
    $ sudo mksquashfs ~/Desktop/squashfs-root ~/Desktop/isofs/casper/filesystem.squashfs
    and we make sure we can read the file when creating the iso:
    Code:
    $ sudo chmod a+r ~/Desktop/isofs/casper/filesystem.squashfs
    next step involves creating the bootable cdrom image:

    Code:
    $ cd ~/Desktop/isofs
    $ mkisofs -o ~/Desktop/livecd_nosdhci.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J ~/Desktop/isofs/
    finally, burn the image livecd_nosdhci.iso with brasero, and test it
    Last edited by eldragon; October 25th, 2008 at 03:06 PM.

  2. #2
    Join Date
    May 2008
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    I haven't tried following your instructions, but I've spotted two little mistakes:

    First, by "open a terminal, [alt]-[f2] and type ..." I think you mean "open a terminal by pressing [alt]-[f2] and typing ..." (else you open a terminal and from there you open a terminal..).

    Second, ~\Documents should be ~/Documents.

    I'll let you know if I try this out and find any other hiccups (this will be in a week's time).

    Thanks for doing this.

  3. #3
    Join Date
    Aug 2006
    Beans
    841

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    Quote Originally Posted by pablomme View Post
    I haven't tried following your instructions, but I've spotted two little mistakes:

    First, by "open a terminal, [alt]-[f2] and type ..." I think you mean "open a terminal by pressing [alt]-[f2] and typing ..." (else you open a terminal and from there you open a terminal..).

    Second, ~\Documents should be ~/Documents.

    I'll let you know if I try this out and find any other hiccups (this will be in a week's time).

    Thanks for doing this.
    thanks, i fixed both mistakes.

    i did manage to get a working live cd with this

  4. #4
    Join Date
    May 2008
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    Ok, I've tried this now. Here is a slightly modified howto which uses sudo only when strictly required, and incorporates some tips from the Ubuntu Wiki page on liveCD customization.

    1. Open a terminal

    You can open it from Applications > Accessories > Terminal, or alternatively pressing Alt+F2 and typing gnome-terminal in it.

    2. Enter sudo password

    Type
    Code:
    sudo -v
    and enter your password.

    3. Install things

    To make sure you have all the programs you need, type
    Code:
    sudo apt-get install squashfs-tools genisoimage fakeroot file-roller
    4. Set up

    Type this, changing the values of the variables to specify what you want to do:
    Code:
    ORIG_IMAGE=~/Desktop/ubuntu-8.10-rc-desktop-i386.iso
    MOD_IMAGE=~/Desktop/ubuntu-8.10-rc-desktop-i386-nosdhci.iso
    MOD_LABEL="Ubuntu 8.10 i386"
    TEMP_DIR=~/tmp
    ORIG_IMAGE should point at the ISO file you already have, and MOD_IMAGE says where to put the modified ISO. MOD_LABEL and TEMP_DIR can be safely left alone.

    5. Proceed

    Copy this and paste it into your terminal verbatim:
    Code:
    mkdir -p "$TEMP_DIR/mod-distrib/ISO"
    cd "$TEMP_DIR/mod-distrib"
    file-roller -e ISO "$ORIG_IMAGE"
    sudo unsquashfs ISO/casper/filesystem.squashfs
    #START MODIFICATIONS
    echo "# Local blacklist" > squashfs-root/etc/modprobe.d/blacklist.local
    echo "blacklist sdhci" >> squashfs-root/etc/modprobe.d/blacklist.local
    echo "blacklist sdhci-pci" >> squashfs-root/etc/modprobe.d/blacklist.local
    #END MODIFICATIONS
    rm ISO/casper/filesystem.squashfs
    sudo mksquashfs squashfs-root ISO/casper/filesystem.squashfs -nolzma
    sudo chown $USER ISO/casper/filesystem.squashfs
    rm -rf squashfs-root
    cd ISO
    rm md5sum.txt
    find . -type f -print0 | xargs -0 md5sum > md5sum.txt
    fakeroot mkisofs -D -r -V "$MOD_LABEL" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o "$MOD_IMAGE" .
    cd .. && rm -rf ISO
    cd && rmdir "$TEMP_DIR/mod-distrib"
    After a little wait the modified ISO will be on your desktop (or wherever you decided to place it), and all the messy temporary bits should have been cleared away. You can burn your ISO to a CD by double-clicking on it (provided you haven't explicitly modified this behaviour!)

    If you need to do any other straight-forward modifications to the distribution (ie. add, remove or modify configuration files), do them between "#START MODIFICATIONS" and "#END MODIFICATIONS" above. Anything involving installing/removing packages requires a more sophisticated approach using a chroot cage as described in the relevant wiki page, but the rest should remain valid.
    Last edited by pablomme; January 25th, 2009 at 07:36 PM. Reason: Method wouldn't work - bad file permissions in squashfs image.

  5. #5
    Join Date
    Aug 2006
    Beans
    841

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    much cleaner aproach, thanks for the time..

    ive installed intrepid and im having loads of problems in this laptop. have you had the chance to test intrepid out?

    im starting to believe my cdrom might be on its way out and some files didnt copy correctly.

  6. #6
    Join Date
    May 2008
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    I tried the live CD. The only thing I noticed was that network-manager (and its applet) had failed to start, after which I turned off the computer since there was little I could do without an internet connection..

  7. #7
    Join Date
    Jul 2008
    Beans
    17

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    i just tried this but I get an error when using file-roller that the image type isn't supported.

    I also went thru the original HowTo also and noticed a couple of mistakes in that.

    Quote Originally Posted by pablomme View Post
    Ok, I've tried this now. Here is a slightly modified howto which uses sudo only when strictly required, and incorporates some tips from the Ubuntu Wiki page on liveCD customization.

    1. Open a terminal

    You can open it from Applications > Accessories > Terminal, or alternatively pressing Alt+F2 and typing gnome-terminal in it.

    2. Enter sudo password

    Type
    Code:
    sudo -v
    and enter your password.

    3. Install things

    To make sure you have all the programs you need, type
    Code:
    sudo apt-get install squashfs-tools genisoimage fakeroot file-roller
    4. Set up

    Type this, changing the values of the variables to specify what you want to do:
    Code:
    ORIG_IMAGE=~/Desktop/ubuntu-8.10-rc-desktop-i386.iso
    MOD_IMAGE=~/Desktop/ubuntu-8.10-rc-desktop-i386-nosdhci.iso
    MOD_LABEL="Ubuntu 8.10 i386"
    TEMP_DIR=~/tmp
    ORIG_IMAGE should point at the ISO file you already have, and MOD_IMAGE says where to put the modified ISO. MOD_LABEL and TEMP_DIR can be safely left alone.

    5. Proceed

    Copy this and paste it into your terminal verbatim:
    Code:
    mkdir -p "$TEMP_DIR/mod-distrib/ISO"
    cd "$TEMP_DIR/mod-distrib"
    file-roller -e ISO "$ORIG_IMAGE"
    sudo unsquashfs ISO/casper/filesystem.squashfs
    #START MODIFICATIONS
    echo "# Local blacklist" > squashfs-root/etc/modprobe.d/blacklist.local
    echo "blacklist sdhci" >> squashfs-root/etc/modprobe.d/blacklist.local
    echo "blacklist sdhci-pci" >> squashfs-root/etc/modprobe.d/blacklist.local
    #END MODIFICATIONS
    rm ISO/casper/filesystem.squashfs
    sudo mksquashfs squashfs-root ISO/casper/filesystem.squashfs -nolzma
    sudo chown $USER ISO/casper/filesystem.squashfs
    rm -rf squashfs-root
    cd ISO
    rm md5sum.txt
    find . -type f -print0 | xargs -0 md5sum > md5sum.txt
    fakeroot mkisofs -D -r -V "$MOD_LABEL" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o "$MOD_IMAGE" .
    cd .. && rm -rf ISO
    cd && rmdir "$TEMP_DIR/mod-distrib"
    After a little wait the modified ISO will be on your desktop (or wherever you decided to place it), and all the messy temporary bits should have been cleared away. You can burn your ISO to a CD by double-clicking on it (provided you haven't explicitly modified this behaviour!)

    If you need to do any other straight-forward modifications to the distribution (ie. add, remove or modify configuration files), do them between "#START MODIFICATIONS" and "#END MODIFICATIONS" above. Anything involving installing/removing packages requires a more sophisticated approach using a chroot cage as described in the relevant wiki page, but the rest should remain valid.

  8. #8
    Join Date
    Aug 2006
    Beans
    841

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    Quote Originally Posted by steffi View Post
    i just tried this but I get an error when using file-roller that the image type isn't supported.

    I also went thru the original HowTo also and noticed a couple of mistakes in that.
    explain further

  9. #9
    Join Date
    Apr 2007
    Beans
    28

    Re: [howto] tweaking a livecd in order to blacklist offending kernel modules

    i wanted to boot the jaunty livecd but the kernel freezes. I found out that it came from my sound card "ess maestro" and that the bug can be worked arround by blacklisting radio_maestro. ( https://bugs.launchpad.net/ubuntu/+s...ux/+bug/357724 )

    i have tried the first method. I only changed one bit:

    Quote Originally Posted by eldragon View Post
    ive got one of the laptops affected by the following bug: http://bugzilla.kernel.org/show_bug.cgi?id=9905

    now we edit the blacklist file with
    Code:
    $ sudo gedit ~/Desktop/squashfs-root/etc/modprobe.d/blacklist
    to

    Code:
    $ sudo gedit ~/Desktop/squashfs-root/etc/modprobe.d/blacklist.conf
    because otherwise it creates an non existing file blacklist. I haven't tried it like that but using blacklist.conf works.

    Quote Originally Posted by steffi View Post
    i just tried this but I get an error when using file-roller that the image type isn't supported.
    I also experienced that problem. It was easily fixed because eventhou i putted the iso on the desktop, the link to the desktop was not ~/desktop/xxx.iso but ~/bureaublad/xxx.iso due to a translated ubuntu.

    i have also tried the second method. That didn't work for me.
    The first time i have tried that i specified my ~/tmp to another partition. That gave me errors about UID changes that couldn't be performed. So the ~/tmp has to be on the same partition.

    the second time i putted the ~/tmp on the same partition but now i got that the modifications could not be made to the blacklist.local I haven't tried it again but i suspect that it is because blacklist.local doesn't exist for the jaunty iso. I don't know if it existed on intrepid.
    I will try it again with
    Code:
    echo "blacklist radio_maestro" >> squashfs-root/etc/modprobe.d/blacklist.conf
    when the iso of the new crunchbang linux arrives and let you know.

Bookmarks

Posting Permissions

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