Changes between Version 13 and Version 14 of debirf


Ignore:
Timestamp:
Mar 13, 2007 11:13:18 PM (6 years ago)
Author:
jrollins
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • debirf

    v13 v14  
    11= debirf = 
    22 
    3 The goal of this project is to create a [http://www.tux.org/pub/people/kent-robotti/looplinux/rip/ RIP]-style kernel and initramfs that leaves the user in a functional debian system. 
     3The goal of this project is to create a [http://www.tux.org/pub/people/kent-robotti/looplinux/rip/ RIP]-style kernel and initramfs that leaves the user in a functional Debian system. 
    44 
    5 == creating root: == 
     5We have succeeded in creating a very minimal Debian system that loads entirely into ram.  At the moment, it relies on a [http://www.tux.org/pub/people/kent-robotti/looplinux/rip/inittmpfs-2.6.14.diff.gz kernel patch] that Kent Robotti (RIP developer) is using to allow for overmounting a tmpfs on the initial initrd.  Hopefully we can either get something working without the patched kernel, or get the patch into the Debian mainline. 
    66 
    7 {{{ 
    8 $ mkdir -p debirf/root 
    9 $ cd debirf 
    10 $ /usr/sbin/debootstrap --exclude=aptitude etch ./root http://ftp.debian.org/debian 
    11 $ cd root 
    12 $ chroot . 
    13 chroot$ echo debirf > /etc/hostname 
    14 chroot$ apt-get update 
    15 chroot$ echo 'do_initrd = Yes' >> /etc/kernel-img.conf 
    16 (modify /etc/kernel-img.conf to not do symlinks?) 
    17 chroot$ apt-get install linux-image-2.6-486 
     7The benefit of the this patched kernel method, though, is that it's "stupid simple".  The initrd is nothing more than a cpio gzip'd (initramfs) of the desired filesystem, with a couple of simple tweaks.  The initial executed script just /sbin/init.  We feel that this is really how it should be.  No crazy init gymnastics to get a root filesystem mounted. The initrd ''is'' the root filesystem. 
    188 
    19 * should be able to remove locales 
    20 $ find /usr/share/locale -maxdepth 1 -mindepth 1 -type d ! -iname 'en*' -exec rm -rf '{}' \; 
     9== download == 
    2110 
    22 chroot$ apt-cache clean 
    23 chroot$ rm /var/cache/apt/*.bin 
    24 chroot$ rm -rf /var/lib/apt/lists/* 
    25 chroot$ mkdir /var/lib/apt/lists/partial 
    26 chroot$ exit 
    27 }}} 
     11[wiki:dkg] is posting debirf.cgz initramfs files and patched kernels for various architectures up on his site: 
    2812 
    29 extract kernel and initramfs: 
    30 {{{ 
    31 mv boot/vmlinuz-* ../ 
    32 mv boot/initrd.img-* ../ 
    33 }}} 
     13 * http://lair.fifthhorseman.net/~dkg/debirf/ 
    3414 
    35 == stupid simple method == 
     15== notes: == 
    3616 
    37 clean etc/mtab 
    38 {{{ 
    39 > etc/mtab 
    40 }}} 
    41  
    42 edit etc/fstab: 
    43 {{{ 
    44 proc /proc proc defaults 0 0 
    45 dev /dev tmpfs size=10M,mode=0755 0 0 #necessary? 
    46 }}} 
    47  
    48 link sbin/init to init: 
    49 {{{ 
    50 ln -s sbin/init init 
    51 }}} 
    52  
    53 archive/gzip filesystem: 
    54 {{{ 
    55 find * | cpio -H newc --create  | gzip > ../debirf.cgz 
    56 }}} 
    57  
    58 ...not quite working.  get mount errors about /dev... 
    59  
    60 == tweaked initramfs method == 
    61  
    62 add debirf script to scripts/debirf (either directly or through mkinitramfs): 
    63 {{{ 
    64 # debirf.top 
    65 cat scripts/debirf <<EOF 
    66 mountroot() { 
    67  rootmnt="/" 
    68 } 
    69 }}} 
    70  
    71 make bin/run-init: 
    72 {{{ 
    73 #!/bin/sh 
    74 if [ "$1" != "/" ] ; then 
    75   exec /usr/lib/klibc/bin/run-init "$@" 
    76 else 
    77   MOUNT_POINT="$1" 
    78   INIT="$2" 
    79   shift 2 
    80   exec "$INIT" "$@" 
    81 fi 
    82 }}} 
    83 {{{ 
    84 chmod a+x bin/run-init 
    85 }}} 
    86  
    87 archive/gzip filesystem and append to initramfs: 
    88 {{{ 
    89 mv ../{initrd-img-*,debirf.cgz} 
    90 find * | cpio -H newc --create  | gzip >> ../debirf.cgz 
    91 }}} 
    92  
    93 give the following boot parameter: 
    94 {{{ 
    95 boot=debirf 
    96 }}} 
    97  
    98 == things to do: == 
    99  
    100  * [wiki:debirf/bootlogs] 
    10117 * [wiki:debirf/commands] 
    102  
    103 == potentially useful commands: == 
    104  
    105 {{{ 
    106 dpkg-query -W --showformat='${Priority}: ${Package}\n' | grep ^required 
    107 }}} 
    108  
    109 == notes == 
    110  
    111 at the moment, our naive approach is failing with  
    112 {{{ 
    113 No filesystem could mount root, tried:  ext2 cramfs 
    114 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0) 
    115 }}} 
    116  
    117 and the main difference between debirf and  RIP is that RIP says 
    118 {{{ 
    119 Overmounted tmpfs  
    120 }}} 
    121 just before 
    122 {{{ 
    123 Freeing initrd memory 
    124 }}} 
    125  
    126 This seems to be from a [http://www.tux.org/pub/people/kent-robotti/looplinux/rip/inittmpfs-2.6.14.diff.gz kernel patch] that Kent Robotti is using.  Can we get this to work without patching the kernel?  Can we avoid the attempted mount? 
    127  
    128 the kernel patch is not sufficient.  I tried patching the stock debian kernel so that it "overmounted tmpfs", and the boot still fails with the same error message. 
    129  
    130 We're booting with the same kernel parameters, so what does the RIP kernel do that the stock debian one does not at boot time?  Could we stuff the filesystem we want into a standard debian initramfs instead and loopmount it or something? 
    131  
    132 {{{ 
    133 mkinitramfs -o ../debirf.cgz -r root 
    134 zcat /special-boot/debirf/debirf.cgz | cpio --quiet --extract 
    135 }}}