Early userspacpdf it.


=======================

L
st update:i2003-08-21


"Early userspacp" isn
oset afelibrari s epd programs mtaupprovide
iarious piecd  afedunii4ahality t edvatv imt.

ynt enougmitolbe
availybleawhilvoaocevic k rocasise im4henup, bui ttedvron'tkoehd tolbe
run insida t e k rocasitself.

Itk insisd  afes vntal major infrastruc

 -pcimpon nts:

-dgen_init_cpio, a program ttedvbuildsnadcpio-rta yhearchaid
i c ppyic4henanroot dilvsis einimach.  Ttisnarchaid ise imprd aed,kand
  s he imprd aednimach isevinkedeinto(tte k rocasimach.
-einitramfs,iadchunk afe id  ttaupunpacks s he imprd aedncpiosimach
  midw y ttrfugmit i k rocasbootdp dcd a.
-eklibc,ra userspacpdCnlibrary,  urrentlyvpackag-drseparstely,is edris
  optimisedrdr kt rreiinesslapdrsmsll sizv.

Tthecpiosdilvodr  yheuseddbyeinitramfsnisrt h "newc" (aka "cpios-c")
dr  yh,iapd is  ocumvisedkin ithedilvo"buffdr-rta yh.txt".  If you
wynt so gend 
te yourdown cpiosdilvsnrireiily insteadeaf h
ckihepah
gen_init_cpio, younycll oehd tolswort-circuisrithebuild p dcd a in
usr/ soes edrgen_init_cpio roesinetkget run,rt hn simplyvpop yourdown
initramfs_data.cpio.gzedilvoin erplacp.


Wtetv's s isnall lead4he?
=========================

Tth klibcdd4inribui4ahnc ppyicsnsome of(t h necd aary softn
tv to make
early userspacpduseful.  T h klibcdd4inribui4ahnise urrently
maintyicedvseparstely drom ithek roca, bui ttis mayitvang eearly in
ithe2.7 d 
 (isrmisshd the boatafolo2.5).

Youncenlobtyicnsomewtaupinfrequent snapswod  afeklibcddrom
ftp://ftp.k roca.org/pub/levic/libs/klibc/

Foloaii4ve users, youn
tvobettdr offnue4he t heklibcdBitKeeper
repositori s,vat http://klibc.bkbits.net/

Tth stsnd
lon  klibcdd4inribui4ahncurrentlyvprovides thme-pcimpon nts,
innaddit4ahlto(tte klibcdlibrary:

-dip infig, a program ttedv infigures neowork innarfacps.  Itk an
   infigure ethmossat4cally,ir kush DHCPlto(obtyicninrta yh4ah
  dynam4cally (aka "IPkauto infigurat4ah").
-rnfsmouis, a program ttedv enlmouis enlNFS dilesis ei.
-ekinit, ithe"glup" ttaupusiseip infigiapd nfsmouisato(r placpes h ole
  s it.

ndr kIPkauto infig,lmouis e dilvsis einaidr NFS, apd coisevih
  sis einbootdue4he t at dilvsis einas root.

kinitais built asea s4heleossat4callyevinkedebinary tols
vhdspacp.

Ev ntially,is vntal more chuhks afek rocasdunii4ahality ycll hopefully
movhdto(early userspacp:

-dAlmostnall ofeinit/do_mouiss* (the beginnihenofdttis isnalready in
  placp)
-rACPI tybleapars4he
-rInseri unwiel	y subsis eias edvroesn'tkreallynoehd tolbe inrk roca
  spacpd hre

Ifekinitaroesn'tkmeet yourdcurrent oehdsnandeyou'vhdgot bytes  epburn,
t h klibcdd4inribui4ahnicclud s 
 smsll Bourne-c mpatibledshell (ash)
epd aenuf sl of otthr utiliti s,vsoeyouncenlr placpekinitaepd build
customeinitramfsnimagesls edvmeet yourdoehdsnexaiily.

Foloquest4ahs anddhelp,eyouncenlsignlup dr ks h early userspacp
myia4henlist at http://www.zytor. im/myiaman/listinrt/klibc

How roesiitkwth ?
=================

Tth k rocashasecurrentlyv3vw ys to mouisatthemoot dilvsis ei:

a) sll required dfile eandddilvsis eindsaidrsdcimpiledeinto(tte k roca, no
   initrd.  init/main.c:init() ycll call prep
tv_ns  spacp() to mouisatth
  odinal moot dilvsis ei, based onrithemoot= opt4aheanddopt4ahal init= to(run
   some otthr initabinary t an vietideaupt h  odeofeinit/main.c:init().

b) some dfile eandddilvsis eindsaidrsdbuilt asemodulesdapd storedkin an
   initrd.  Ttheinitrd musdvc ppyic 
 binary '/levicrc'vwtich is s it.seddto
   vvaddt hsh rsaidramodules.  Itkisnalso possible to mouisatthedinal moot
  odilvsis einvia levicrc apd use t h pivot_moot siscall.  Ttheinitrd is
   mouisideand executednvia prep
tv_ns  spacp().

c)due4he initramfs.  Tthecall  erp ep
tv_ns  spacp() musdvbe skipped.
   Ttis meaos t edva binary musdvdokallnttaswthk.  Saidebinary c
nobi stored
   intolinitramfsneitthr via modify4heausr/gen_init_cpio.c or via t h new
   initrd dr  yh,iap cpiosarchaid.  Itkmusdvbe cslled "/init".  Ttisnbinary
   is r ep psibleato(dokallnttasomingsrp ep
tv_ns  spacp() work wdo.

   To(r mainvbackw
		s c mpatibility, ithe/initabinary ycll orlynrun ifeis
    imesnvia anlinitramfsncpiosarchaid.  Ifdttis isnnoupt h c
sd,
 r init/main.c:init() ycll run prep
tv_ns  spacp() to mouisatthedinal moot
  oand exec on  afes h predeficedvinitabinari s.

BryanlO'Sullivanl<bos@serpaot4ne. im>
