Changeset 914


Ignore:
Timestamp:
Jan 12, 2008 1:07:55 AM (5 years ago)
Author:
dkg
Message:

debirf: handling break={top,preunpack,bottom} from kernel command line within nest. (closes #55)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debirf/fs/usr/bin/debirf

    r909 r914  
    135135    # copy needed executables into nest 
    136136    cp -f /bin/{busybox,cpio} "$NEST_ROOT"/bin/ 
    137     for util in sh mkdir mount ls gunzip grep awk free ; do 
     137    for util in sh mkdir mount ls gunzip grep awk free grep umount; do 
    138138        ln "$NEST_ROOT"/bin/busybox "$NEST_ROOT"/bin/"$util" 
    139139    done 
     
    152152    cat > "$NEST_ROOT"/init <<EOF 
    153153#!/bin/sh 
     154mkdir /proc 
     155mount -t proc proc /proc 
     156if (grep -q break=top /proc/cmdline); then 
     157  echo "honoring break=top kernel arg" 
     158  /bin/sh 
     159fi 
    154160mkdir /newroot 
    155161MEMSIZE=\$(free | grep 'Mem:' | awk '{ print \$2 }') 
    156162mount -t tmpfs -o size=\${MEMSIZE}k tmpfs /newroot 
     163if (grep -q break=preunpack /proc/cmdline); then 
     164  echo "honoring break=preunpack kernel arg" 
     165  /bin/sh 
     166fi 
    157167cd /newroot 
    158168echo unpacking rootfs... 
     
    160170# busybox cpio returns "need to fix this" when unpacking hard links 
    161171gunzip - < /rootfs.cgz | /bin/cpio -i 
     172if (grep -q break=bottom /proc/cmdline); then 
     173  echo "honoring break=bottom kernel arg" 
     174  /bin/sh 
     175fi 
     176umount /proc 
    162177echo running /sbin/init... 
    163178exec /bin/run-init . /sbin/init < ./dev/console > ./dev/console 
Note: See TracChangeset for help on using the changeset viewer.