From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MKMn0-0006Cs-IU for garchives@archives.gentoo.org; Sat, 27 Jun 2009 01:33:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2CD3CE04F2; Sat, 27 Jun 2009 01:32:51 +0000 (UTC) Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.244]) by pigeon.gentoo.org (Postfix) with ESMTP id DDE11E04EF; Sat, 27 Jun 2009 01:32:50 +0000 (UTC) Received: by rv-out-0708.google.com with SMTP id b17so752698rvf.46 for ; Fri, 26 Jun 2009 18:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=CwO3Va1gg63LuGZ8qncmDjeiIgpiCV3FLkkZ9DZPRZY=; b=n6NLu0DmdkuOppt1H7WXrJN1Cifxfv8pmSRDYKuG7ED45y1eXOwpWHiEPmXSEvJRY5 BnE0AHrShjWx4aZmUFv/L4KQVc74HQlj1k8FCHwDQ3vJBKb+poB8svN9t+pjCwvnQlBZ 13OtfnCHPtyrfhqIocY2OR1IL59xgO5QQpog8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=erV1RV9InxdnY7e/0OL/0yFwBneJz8Dgj0Zc2F1ieIMXvvRVMRjIJCY5Lc1S1NVGHj MrcEGl9kb8P36X16PGlJHz6Y4VoBU+0oxBw437j8SFEkpM2hBe3D0FTE2Bd/Hs9RBErb 8keaXJ8KMtH6TyVnmME6hD7sK1YRQlyYOzmig= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.140.199.16 with SMTP id w16mr3607486rvf.226.1246066370495; Fri, 26 Jun 2009 18:32:50 -0700 (PDT) Date: Sat, 27 Jun 2009 09:32:50 +0800 Message-ID: <53e35fd50906261832h34fc472at65cada9042585194@mail.gmail.com> Subject: [gentoo-user] Self created initramfs cannot work From: David Shen To: gentoo-china@googlegroups.com, gentoo-amd64@lists.gentoo.org, gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 918a9d3e-be3e-45b3-ad89-f2bab8313989 X-Archives-Hash: cf578346d25e50080fa55046d5405b80 Hi, I build by gentoo kernel without genkernel, and I want to create the initramfs by hand. Following is the steps I did: Build the kernel with initramfs support; mkdir -p /usr/src/initramfs{dev,bin,sbin,etc,root,proc,sys} cp -aL /bin/bb /usr/src/initramfs/bin # copy the busybox cp -a /sbin/lvm /usr/src/initramfs/sbin # i created my root on lvm cp -a /dev/{hda,hda1,hda2,ram0} /usr/src/initramfs/dev # i am not sure if i am correct here vim /usr/src/initramfs/init # create the init script, it based on http://en.gentoo-wiki.com/wiki/Initramfs #!/bin/busybox sh # Mount the /proc and /sys filesystems. mount -t proc none /proc mount -t sysfs none /sys # Do your stuff here. echo "This script mounts rootfs and boots it up, nothing more!" # active lvm lvm vgscan lvm vgchange -ay # Mount the root filesystem. mount -o ro /dev/vgsys/root /mnt/root # Clean up. umount /proc umount /sys # Boot the real thing. exec switch_root /mnt/root /sbin/init ##################################################### chmod +x /usr/src/initramfs/init then I use find /usr/src/initramfs/init | cipo -oHnewc | gzip -9 > /boot/initramfs.gz But when I try to boot my system, I got kernel panic, and it says it cannot find the init script. If I remove the 'initrd' instruction from the grub.conf file, the error message does different, which means the system WAS trying to process the initramfs. But I do not know why it cannot find the init script. I modified the initramfs that the genkernel generated before, and the system works fine after that. But I never created a initramfs from scratch before -- Best Regards, David Shen http://twitter.com/davidshen84