Eldk mit Initrd booten

Notizen

  • kernel mit tmpfs kompilieren und /tmp damit mounten
  • in der fstab wird usr nochmal uebermounted.

Beschreibung bootvorgang

  • Starten u-boot
  • initialisierung dhcp. Hierbei laden des kernels per tftp
  • laden von initd in ram
  • ausfuehren von kernel mit initrd
  • initrd entpacken und als rootfs mounten
  • /sbin/init ausfuehren. Dies ist ein shellscript. Es konfiguriert das netz und initialisiert erneut per dhcp (diesmal in der initrd). Options werden in /tmp gespeichert
  • userprompt ob man den weiteren bootvorgang abbrechen will. 10sek timeout. Wenn ja exec von /bin/sh, sonst exec von /sbin/init_nfs.sh
  • lesen der dhcp options in /tmp
  • starten von rpcbind und rpc.statd
  • mounten NFS Dateisystem als NVSv3 mit locks nach /nfs
  • DNS Settings ins NFS kopieren
  • /nfs/ld.so.cache loeschen
  • /var/run per mount-bind in das NFS mounten. Da liegen die rpc sockets und locks drin
  • pivot_root und chroot ausfuehren um ins nfs zu wechseln.
  • exec von /nfs/sbin/init und damit der normale eldk bootvorgang

Erstellen einer initrd

TODO: Beschreibung und aufrufe mkinitrd

aus dem self ($ELDK_ROOT/images) die ramdisk holen, auspacken, etc nach DENX Anleitung. http://www.denx.de/wiki/view/DULG/RootFileSystemDesignAndBuilding

Modifikation ELDK (gegenueber dem skel von 2009-12)

Die mount und reboot vorgaenge im ELDK werden modifiziert
diff /etc/rc.sysinit /etc/rc.sysinit.org
25,27c25,28
< [ -e /proc/version ] || mount -n -t proc /proc /proc
< [ -e /sys/kernel ]   || mount -n -t sysfs /sys /sys >/dev/null 2>&1
<
---
> if [ ! -e /proc/mounts ]; then
>       mount -n -t proc /proc /proc
>       mount -n -t sysfs /sys /sys >/dev/null 2>&1
> fi

Damit proc und sys nicht nochmals gemounted werden, sind diese aus der fstab zu entfernen. Gleiches fuer das rootfilesystem bleibt also
fsl00t.acc.gsi.de:/common/usr/eldk-4.2/ppc_6xx/usr      /usr    nfs     defaults 1 2
fsl00t.acc.gsi.de:/common/usr/eldk-4.2/ppc_6xx/home     /home   nfs     defaults 1 2
fsl00t.acc.gsi.de:/common/usr/eldk-4.2/ppc_6xx/opt/acc/eqp      /opt/acc/eqp    nfs     defaults 1 2
fsl00t.acc.gsi.de:/common/usr/eldk-4.2/ppc_6xx/opt/acc/sys      /opt/acc/sys    nfs     defaults 1 2
# compile tmpfs for kernel to get this
# tmpfs                   /tmp            tmpfs   defaults        0 0

Shutdown
diff etc/init.d/halt etc/init.d/halt.org
193,195d192
< echo "Sycning remaining filesystems... hoping for the best"
< sync
<

Die mtab geschichte
cd $ELDK_ROOT
rm -f etc/mtab*
ln -s /proc/mounts etc/mtab
touch proc/mounts

Damit das eldk nicht an der mtab herumschreibt
diff /etc/init.d/netfs /etc/init.d/netfs.org
41c41
<           action $"Mounting NFS filesystems: " mount -n -a -t nfs,nfs4
---
>           action $"Mounting NFS filesystems: " mount -a -t nfs,nfs4

This topic: Frontend > PPCDevelopments > EldkInitrd
Topic revision: 22 Dec 2009, ChristophHandel
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback