#!/bin/ash # # /linuxrc: init script to load initrd kernel modules # # # 02-Nov-04 amo Create a minimal initrd.gz to load the rootfs.gz as / # # # Define the path # PATH="/sbin:/bin:/usr/sbin:/usr/bin" # # # Remove for "chroot xxx /linuxrc" testing # ---------------------------------- # mount -n proc /proc -t proc # # # Load the kernel modules if any # # for module in /lib/modules/`uname -r`/*.*o ; do # insmod $module # done # # # Mount the compact flash ( CF:/boot/rootfs.gz ) # ----------------------------------------------- mount /dev/hda1 /mnt/hda # # # for debugging # df ls -laR /dev /mnt # # # Copy the rootfs ( / ) into memory # --------------------------- # dd if=/mnt/hda/boot/rootfs of=/dev/ram0 bs=1k # # unmount the compact flash umount /dev/hda1 # # # Run linux in /dev/ram # --------------------- # mount -o rw,remount /dev/ram0 / # # # Execute from ramdisk ( memory ) # -------------------- # chroot / # # # End of file