Dpkg reconfigure linux image

update-initramfs is stuck

Today I wanted to install virtualbox (4.2) in Ubuntu 12.10 and went to the Software Center. After clicking on the ‘Install’ button in the USC virtualbox was being downloaded and installed. I waited more than five minutes but nothing happened, and the progress bar didn’t change. After about one hour of waiting I closed the USC and rebooted the PC. Now I have got the problem that whenever I want to install software via sudo apt-get install I get the following error:

quantal@Flubuntu:~$ sudo apt-get install E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? 
quantal@Flubuntu:~$ sudo apt-get install E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct 
update-initramfs: Generating /boot/initrd.img-3.5.0-25-generic 

When I start sudo update-initramfs -k all -u -v in verbose mode it says that it adds many modules, binaries and firmware (which I have not included in the output) but then is stuck after the following six lines:

Adding binary /lib/firmware/radeon/TAHITI_me.bin Adding firmware radeon/TAHITI_me.bin Adding binary /lib/firmware/radeon/TAHITI_pfp.bin Adding firmware radeon/TAHITI_pfp.bin Adding module /lib/modules/3.5.0-23-generic/kernel/drivers/gpu/drm/i2c/sil164.ko Adding module /lib/modules/3.5.0-23-generic/kernel/drivers/gpu/drm/i2c/ch7006.ko 

Blacklisting ch7006 or the module before doesn’t work; I have also tried to manually rename ch7006.ko and sil164.ko (after checking that it isn’t necessary for the system) but then it is stuck at the line before. Many thanks in advance! Further information: NOTE: When booting Ubuntu I get NO errors or so, so the kernel boots but I cannot update it (and apt-get install doesn’t want to install software as long as this problem exists). The output of uname -a :

Linux Flubuntu 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:15:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux 

Источник

ACPIBattery

This page is missing a diagnostic guide to be sure that the problem described here is what is happening to a specific system. If you know how to test for this issue please add such a diagnostic guide.

Introduction

Some Notebooks don’t display the battery status. This HOWTO will show you how to fix this annoying problem. I am aware there are a lot of forum posts on this but none show you how to easily fix the problem.

Note: The Ubuntu kernel already contains the patch that is needed for this to work, so no recompiling of the kernel is needed in this HOWTO!

Prerequisites

We need to compile some stuff along the way, so we need the package build-essential. We also need the packages flex-old (which will replace flex) and bison.

sudo apt-get install build-essential bison flex-old

The DSDT for your notebook

The DSDT (Differentiated System Description Table) sits in your BIOS and gives Linux all the information on your computer. Yours is obviously messed up, so we have to get a new one.

Читайте также:  Astra linux настройка сервера времени

Go to the ACPI page at sourceforge and in the menu on the left click on DSDT and View. Here you can select your manufacturer, model and BIOS version. On the page you will get then, you can download a fixed DSDT for your notebook. If there is none for you notebook, see the links at the end of this document. If there is no DSDT for you BIOS version, update your BIOS (which in fact might already fix the problem).

So copy the download address (to paste it to the console) and in your $HOME do:

mkdir acpi cd acpi wget http://acpi.sourceforge.net/dsdt/tables/Manufacturer/Model/DSDT.asl.gz gzip -d DSDT.asl.gz

(the link after wget has to be replaced with the link to your DSDT)

Obtaining Intel’s iasl compiler

The DSDT has to be compiled. For this we need a special compiler from Intel. Download there Unix source here. You might have to replace the download link in the following.

tar zxf acpica-unix-20050624.tar.gz cd acpica-unix-20050624/compiler make cp iasl ../.. cd ../..

If the make didn’t work I can only assume that bison is not installed or you still have the flex instead of flex-old.

Compiling your DSDT

Since the 2005 versions of iasl are more restrictive than older versions your DSDT might not compile. You can either try to find an older version of iasl (I couldn’t) or fix the DSDT by yourself (I will explain this).

cp yourdsdtfile.asl dsdt.asl # backup ./iasl -tc dsdt.asl # compiling

If this works you should get 0 errors, a couple of warnings and two new files. A .hex and a .aml file. If it doesn’t you will have alot of error messages telling you a ResourceSource string is missing. These errors are easy to fix. Keep the windows with the compile errors open, since we will need the line numbers.

What the errors might look like:

dsdt.asl 1028: 0x0100, 0x00) Error 1094 - ^ Missing ResourceSource string (required) dsdt.asl 1034: 0x00000CF8, 0x00) Error 1094 - ^ Missing ResourceSource string (required) dsdt.asl 1041: 0x0000F300, 0x00) Error 1094 - ^ Missing ResourceSource string (required)

Lets open the .asl file and look at line 1028.

1023 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, 1024 0x0000, /* Address Space Granularity */ 1025 0x0000, /* Address Range Minimum */ 1026 0x00FF, /* Address Range Maximum */ 1027 0x0000, /* Address Translation Offset */ 1028 0x0100, 0x00)

What we have to do is simply remove the 0x00 so that line 1028 looks like

Do this for all missing ResourceSource string errors (they should all be in the same place), save the file and close gedit. Now compile again with ./iasl -tc dsdt.asl and watch the magic.

Some backups

As we don’t want to mess with your working system we’ll work on a backup and add that backup to your bootloader.

sudo -s -H # followed by user pw cp /boot/initrd.img-2.6.10-5-686 /boot/initrd.img-2.6.10-5-386.acpi cp /boot/vmlinuz-2.6.10-5-686 /boot/vmlinuz-2.6.10-5-386.acpi exit

To be able to boot from this kernel-copy we need to add a section for it to the grub bootloader.

Add a section that looks like this (see other sections in your menu.lst for comparison).

title Ubuntu, kernel 2.6.10-5-386 Battery root (hd0,3) kernel /boot/vmlinuz-2.6.10-5-386.acpi root=/dev/hda4 ro quiet splash initrd /boot/initrd.img-2.6.10-5-386.acpi savedefault boot

. and place it where you want it to appear in the bootmenu.

Читайте также:  How to zip directory in linux

Putting your DSDT into initrd

What remains is to actually add the DSDT to your initrd. There are 2 ways of doing this. The first one is to patch the initrd.img file, so that the initrd.img will include the DSDT. (NOTE: if you are a BREEZY user the second method is prefered):

echo -n "INITRDDSDT123DSDT123" >> /boot/initrd.img-2.6.10-5-386.acpi cat dsdt.asl >> /boot/initrd.img-2.6.10-5-386.acpi

The alternative option is to add the DSDT.aml file in a specific place so that the default initrd image will search for it and load it on boot. As a bonus, with every kernel update the DSDT will be loaded. Beware that if the DSDT is incorrect it may lead to a kernel panic.

If you are using HOARY or below: Once you have the DSDT compiled, copy the DSDT.aml in /etc/mkinitrd/DSDT (without the extension, I don’t know if this is necessary):

sudo cp dsdt.aml /etc/mkinitrd/DSDT

Then reconfigure the kernel package you are using:

sudo dpkg-reconfigure linux-image-$(uname -r)

If you are using BREEZY or DAPPER, the location to put the DSDT.aml file has changed, it’s:

WITH the extension! it’s necessary. Then reconfigure the kernel package as before:

sudo dpkg-reconfigure linux-image-$(uname -r)

If you are using EDGY, the location to put the DSDT.aml file has changed, it’s:

WITH the extension! it’s necessary. Then reconfigure the kernel package as before:

sudo dpkg-reconfigure linux-image-$(uname -r)

That’s it. Reboot your computer and pick the newly created bootoption. If it all works out you can savely remove the $HOME/acpi directory and modify the bootmenu as you like (i.e. make the new bootoption default).

acpi.sf.net — ACPI Homepage
Gentoo Forums — How to fix a DSDT yourself
Intel ACPI — Download iasl compiler
gaugusch.at — the kernel patch to make this work

Another possible solution (workaround)

If fixing your DSDT file like suggested avove doesn’t solve your battery monitoring problem, you can try the folowing simple workaround.

To try this solution, do the following:

Open a terminal and enter the following commands, in this order:

sudo rmmod acpi_sbs sudo rmmod battery sudo modprobe battery

if you see someting like this:

Battery 1: charging, 100% Thermal 1: ok, 56.0 degrees C AC Adapter 1: on-line

Then, voila, your battery is now detected and monitored and you now know that this solution works in your case.

I have created special init scripts that I put in /etc/init.d and /etc/acpi/resume.d in order to unload-reload battery module at each boot and resume after hibernation.

In a more detailed way, here’s what I did and what you can do (at your own risk!):

1. Using a text editor, put the following content in a file and save it:

rmmod acpi_sbs rmmod battery modprobe battery

2. Make a copy of this file, name it «modules-load-battery», make it executable (in a console, you can use the command «sudo chmod a+x modules-load-battery») and put this file in /etc/init.d

Читайте также:  Мониторинг сетевого трафика linux

3. Use the Ksysv editor (or whatever it is called in K menu/system or in the «System settings»/System Administration/System services), in order to make this script run at each boot time (you can make it run just before the «kdm» script; it works for me).

4. Make another copy of this file, name it «37-modules-load-battery.sh», make it executable (in a console, you can use the command «sudo chmod a+x 37-modules-load-battery.sh»), and put this file in /etc/acpi/resume.d; it will run at each resume from hibernate state.

ACPIBattery (последним исправлял пользователь localhost 2008-07-24 17:11:07)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Chapter 7. Managing the initial ramfs (initramfs) archive

The booting in Debian is a two-stage process, involving the initial RAM filesystem (initramfs for short, sometimes it is also referred to as initrd, which stands for initial RAM disk). First, the bootloader loads the kernel and initramfs into memory, and passes the execution control to the kernel. After basic initialization the kernel extracts the initramfs archive and mounts it as a temporary root filesystem. initramfs contains kernel modules and userspace programs required to initialize the physical or logical device(s) containing the real root filesystem. The init script on the initramfs loads modules and performs other necessary initialization steps. At the end of this stage run-init deletes the initramfs from memory, mounts the real root filesystem and passes control to the /sbin/init program on it.

Two major goals are achieved with such setup: the kernel size is kept under control by allowing most of the drivers to be compiled as modules (in a initramfs-less setup the drivers necessary for the boot-time initialization of the root device must be compiled into it) and allow the setups which require initialization which cannot be done in-kernel, but is performed by userspace utilities.

7.1. Initramfs generation tools

Since initramfs usually needs to be customized for the particular hardware/device configuration and kernel version, they are not included as a part of any package, but are generated on the fly at kernel installation time. Currently there are two tools in Debian capable of generating an initramfs: update-initramfs provided by initramfs-tools (default) and dracut-update-initramfs provided by the dracut package (experimental).

7.2. Regenerating the initramfs

If changes are desired after the corresponding linux-image has been installed, the initramfs needs to be regenerated. This is achieved by the command

# dpkg-reconfigure linux-image-3.2.0-2-686-pae 

where linux-image-3.2.0-2-686-pae is the name of the kernel package for which the initramfs regeneration is requested.

7.3. Examining the initramfs contents

Occasionally it is useful to examine the contents of initramfs to diagnose a problem or for educational purposes. They are compressed cpio archives, which may be extracted using the command

$ zcat /boot/initrd.img-3.2.0-2-686-pae | cpio -i 

It will unpack the contents of the initramfs into the current directory.

It is also possible to list the contents of an initramfs using the cpio -t option or the command

$ lsinitramfs /boot/initrd.img-3.2.0-2-686-pae 

Источник

Оцените статью
Adblock
detector