[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#559593: initramfs-tools: The kernel image can be in a subdirectory of $BOOTDIR



Package: initramfs-tools
Version: 0.93.4
Severity: wishlist

Hello,

I have problem in building and updating automatically the initramfs of
my custom kernels.

I use kernel-package to build them and I define the IMAGEDIR variable in
/etc/kernel-pkg.conf to keep my /boot clean:

--8<---------------cut here---------------start------------->8---
# Clean /boot with one sub-directory by kernel version
# /boot/2.6.26.2+gaia.1/ for exemple
IMAGEDIR = /boot/$(version)
--8<---------------cut here---------------end--------------->8---

You can find my kernel-subdirs branch at
http://www.baby-gnu.org/~nebu/archives/debian/initramfs-tools.git

--8<---------------cut here---------------start------------->8---
git log 3d1da4511ab62173d457b78a243fdc001b648911..8f450c414eb5fb95b4a0003ae6a9a8677ea2fda7
commit 8f450c414eb5fb95b4a0003ae6a9a8677ea2fda7
Author: Daniel Dehennin <dad@hati.baby-gnu.org>
Date:   Sat Dec 5 16:19:56 2009 +0100

    The kernel image can be in a subdirectory of $BOOTDIR.
    
    * update-initramfs (get_linux_dir): Set variable linux to the absolute path
      of the kernel and linux_dir to its directory.
      (set_initramfs): Set initramfs in $linux_dir.
      (set_current_version): Test initramfs in $linux_dir.

git diff --stat 3d1da4511ab62173d457b78a243fdc001b648911..8f450c414eb5fb95b4a0003ae6a9a8677ea2fda7
  update-initramfs |   12 ++++++++++--
  1 files changed, 10 insertions(+), 2 deletions(-)
--8<---------------cut here---------------end--------------->8---

Regards.

-- Package-specific info:
-- /proc/cmdline
BOOT_IMAGE=/2.6.31.5+hati.1/vmlinuz-2.6.31.5+hati.1 root=/dev/sda2 ro video=radeonfb:1600x1200-24@80 quiet

-- /proc/filesystems
	ext3
	ext2
	vfat
	ext4
	iso9660

-- lsmod
Module                  Size  Used by
isofs                  33640  1 
zlib_inflate           14488  1 isofs
ext4                  230640  0 
jbd2                   65840  1 ext4
crc16                   2216  1 ext4
nls_iso8859_15          5832  0 
nls_cp850               6104  0 
vfat                   11208  0 
fat                    53080  1 vfat
ipt_MASQUERADE          2936  0 
iptable_nat             6648  0 
nf_nat                 21340  2 ipt_MASQUERADE,iptable_nat
nf_conntrack_ipv4       9768  3 iptable_nat,nf_nat
nf_defrag_ipv4          2296  1 nf_conntrack_ipv4
xt_state                2456  0 
nf_conntrack           75888  5 ipt_MASQUERADE,iptable_nat,nf_nat,nf_conntrack_ipv4,xt_state
ipt_REJECT              3352  0 
xt_tcpudp               3464  0 
iptable_filter          3928  0 
ip_tables              18392  2 iptable_nat,iptable_filter
x_tables               25120  6 ipt_MASQUERADE,iptable_nat,xt_state,ipt_REJECT,xt_tcpudp,ip_tables
bridge                 55688  0 
stp                     2924  1 bridge
llc                     7392  2 bridge,stp
iTCO_wdt               13232  1 
iTCO_vendor_support     4268  1 iTCO_wdt
cpufreq_userspace       3612  0 
cpufreq_conservative     8296  0 
cpufreq_powersave       1768  0 
cpufreq_stats           4428  0 
kvm_intel              44776  0 
kvm                   171568  1 kvm_intel
ext2                   68248  1 
pl2303                 18700  0 
usbhid                 32032  0 
hid                    37068  1 usbhid
coretemp                6184  0 
acpi_cpufreq            8840  0 
firewire_sbp2          16504  0 
loop                   17188  2 
rtc                     8512  0 
usbserial              40064  1 pl2303
sha256_generic         10392  0 
aes_x86_64              9064  12 
aes_generic            28328  1 aes_x86_64
xts                     3800  4 
gf128mul                9128  1 xts
dm_crypt               14032  4 
dm_mod                 76248  62 dm_crypt
usb_storage            63592  1 
snd_hda_codec_realtek   269532  1 
snd_emu10k1_synth       7096  0 
snd_emux_synth         33544  1 snd_emu10k1_synth
snd_seq_virmidi         6744  1 snd_emux_synth
snd_seq_midi_emul       6392  1 snd_emux_synth
snd_emu10k1           147760  1 snd_emu10k1_synth
snd_seq_midi            7280  0 
snd_seq_midi_event      8472  2 snd_seq_virmidi,snd_seq_midi
snd_rawmidi            23448  3 snd_seq_virmidi,snd_emu10k1,snd_seq_midi
snd_hda_intel          28632  3 
snd_ac97_codec        125192  1 snd_emu10k1
snd_hda_codec          70888  2 snd_hda_codec_realtek,snd_hda_intel
ac97_bus                2168  1 snd_ac97_codec
snd_util_mem            5064  2 snd_emux_synth,snd_emu10k1
snd_pcm                85200  5 snd_emu10k1,snd_hda_intel,snd_ac97_codec,snd_hda_codec
snd_hwdep               8576  2 snd_emux_synth,snd_emu10k1
snd_seq                56912  5 snd_emux_synth,snd_seq_virmidi,snd_seq_midi_emul,snd_seq_midi,snd_seq_midi_event
snd_seq_device          8140  5 snd_emu10k1_synth,snd_emu10k1,snd_seq_midi,snd_rawmidi,snd_seq
firewire_ohci          23804  0 
sg                     31856  0 
snd_timer              23432  4 snd_emu10k1,snd_pcm,snd_seq
firewire_core          53096  2 firewire_sbp2,firewire_ohci
snd_page_alloc         10184  3 snd_emu10k1,snd_hda_intel,snd_pcm
snd                    63800  17 snd_hda_codec_realtek,snd_emux_synth,snd_seq_virmidi,snd_emu10k1,snd_rawmidi,snd_hda_intel,snd_ac97_codec,snd_hda_codec,snd_pcm,snd_hwdep,snd_seq,snd_seq_device,snd_timer
sr_mod                 15572  0 
evdev                  11408  10 
crc_itu_t               2264  1 firewire_core
uhci_hcd               23280  0 
parport_pc             35368  0 
ehci_hcd               35480  0 
soundcore               2016  1 snd
sky2                   50220  0 
asus_atk0110            8248  0 
i2c_i801                9780  0 
thermal                17176  0 
processor              39828  1 acpi_cpufreq
parport                38752  1 parport_pc
cdrom                  35448  1 sr_mod
hwmon                   3448  2 coretemp,asus_atk0110
button                  6824  0 

-- /etc/kernel-img.conf
# Kernel Image management overrides
# See kernel-img.cnf(5) for details

# On ne veut pas de lien �a racine qui pointe vers l'image noyo
# C'est utile lorsque l'on a plus que 2 noyos et que l'on �boot
# sur une partoche �art.
do_symlinks = No
postinst_hook = update-grub
postrm_hook = update-grub

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
BOOT=local
DEVICE=eth0
NFSROOT=auto

-- /etc/crypttab
# <target name>	<source device>		<key file>	<options>
swap     /dev/sda3      /dev/urandom  swap,cipher=aes-xts-essiv:sha256
tmp      /dev/hati/ctmp /dev/urandom  tmp,cipher=aes-xts-essiv:sha256


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (90, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31.5+hati.1 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages initramfs-tools depends on:
ii  cpio                          2.10-1     GNU cpio -- a program to manage ar
ii  findutils                     4.4.2-1    utilities for finding files--find,
ii  klibc-utils                   1.5.15-1   small utilities built with klibc f
ii  module-init-tools             3.11-1     tools for managing Linux kernel mo
ii  udev                          148-2      /dev/ and hotplug management daemo

Versions of packages initramfs-tools recommends:
pn  busybox | busybox-initramfs   <none>     (no description available)

initramfs-tools suggests no packages.

-- no debconf information

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

diff --git a/update-initramfs b/update-initramfs
index 255265f..7f61c7d 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -88,9 +88,16 @@ version_exists()
 	return $?
 }
 
+get_linux_dir()
+{
+	linux=$(find ${BOOTDIR} -type f -name "vmlinu[xz]-$1" 2>/dev/null)
+	linux_dir=$(dirname $linux)
+}
+
 set_initramfs()
 {
-	initramfs="${BOOTDIR}/initrd.img-${version}"
+	get_linux_dir ${version}
+	initramfs="${linux_dir}/initrd.img-${version}"
 }
 
 
@@ -332,7 +339,8 @@ get_sorted_versions()
 
 set_current_version()
 {
-	if [ -f /boot/initrd.img-`uname -r` ]; then
+	get_linux_dir `uname -r`
+	if [ -f ${linux_dir}/initrd.img-`uname -r` ]; then
 		version=`uname -r`
 	fi
 }

Attachment: pgpO5ftOvQd7E.pgp
Description: PGP signature


Reply to: