WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to rebuild initrd  (Read 4728 times)

Offline core-bozo

  • Newbie
  • *
  • Posts: 3
How to rebuild initrd
« on: September 15, 2009, 02:15:44 AM »
Hi all. I'm new commer, core-bozo. I'm respecting TC!
Any recipies for rebuilding init ramdisk avail in FAQ or Wiki?

I wanna rebuild TC initrd(tinycore.gz), so unpack it and repack it.
like this:
$cd /home/tc/initrd/
$zcat /boot/tinycore.gz | cpio -d -i
$ls -lat ./
$find . | cpio -c -o | gzip -c > /boot/tcinitrd.gz
this is, simplly, unpack, nothing do, repack.

but I cannot boot with this repacked initrd.
I'm booting from GRUB, kernel decomp looks good, reading initrd may failed.
that messages:
RAMDISK: Compressed image found at block 0
List of all partitions:
<IDE-drives-lists>
No filesystem could mount root, tried: ext3 ext2 cramfs iso9660 fuseblk
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,3)

this is, my repacked initrd wrong.
the original initrd(tinycore.gz) can boot fine. nothing errors.
what's wrong in my repacking?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14816
Re: How to rebuild initrd
« Reply #1 on: September 15, 2009, 02:43:38 AM »

Offline core-bozo

  • Newbie
  • *
  • Posts: 3
Re: How to rebuild initrd
« Reply #2 on: September 15, 2009, 03:28:02 AM »
Thank you, Juanito.

Yes, I've already check!
but....

> find | sudo cpio -o -H newc | gzip -2 > ../tinycore.gz
> advdef -z4 tinycore.gz
I dropped this part. X-o
May that is! I'll try soon.
Thanks your help.

Offline core-bozo

  • Newbie
  • *
  • Posts: 3
Re: How to rebuild initrd
« Reply #3 on: September 15, 2009, 05:09:46 AM »
Juanito, and wathcers.

Helps of Juanito and Wiki's, I can made up correct initrd.  :D
Thank you!

good result:
$cd /home/tc/initrd/
$zcat /boot/tinycore.gz | cpio -d -i -H newc
$ls -lat ./
$find | sudo cpio -o -H newc | gzip -2 > /boot/rm-tcinitrd.gz
this is on TC system.

I've try re-packing commands like this too,
$find | sudo cpio -o -H newc | gzip -11 > /boot/another-rm-tcinitrd.gz
but, created initrd files are identical. same md5sum value.
Anyway, I can boot from remastered initrd.  ;D

background:
I'm using TC on some NOTE-PC.
and now, I'll try to boot TC on too obsolated NOTE.
It's 486DX2-16MB, non-PCI, non-USB, non-CDROM.
Officially, TC team not recommands one.  :P
The reason why, I want to reduce initrd volume to save system memory.
I'll try it.

Thank you. Let's have fun TC.
core-bozo, from Japan, far east.