On Wednesday 23 May 2007, Felix Fietkau wrote: > David Goodenough wrote: > > One possible thought is that we should always build an initramfs with > > a basic minimum of bits in it (busybox for starters) and a few install > > and restore scripts (like cf2nand and wget2nand) there is always > > something to fall back on when the "on flash" root fails. > > > > It would also help with things like the need to specify kernel parameters > > as those could be built into the relevant /init script. > > > > However, it would really be useful to have some thoughts on this, as > > otherwise installing OpenWrt on the RB1xx series is going to be an uphill > > struggle for many users, having to have two configs, one for netboot and > > the other for running. > > I think it could work like this: > > We change the kernel tree so that it can build an initramfs version and > a non-initramfs version in one pass. We can call them > openwrt-...-vmlinux.elf and openwrt-...-vmlinux_initramfs.elf > It's probably just a matter of changing a few build scripts in the > kernel tree (and later some stuff in target/linux/*/image/Makefile) I think that the initramfs is attached in usr/Makefile (in the kernel tree). We either need to include a dummy one (there is apparently a problem in the kernel do they always put /dev/console in there so that the initramfs is not empty), or we put ours. The only problem with this is that we only need a bit of what it in root, basically busybox and (for the rb1xx) wget2nand and cf2nand (for the rb5xx), we do not want all the other packages that the user might have selected.
The default image is (I think) provided as usr/initramfs_data.S, so I guess that the Makefile looks to see if a user directory has been specified (in our case ../../root) and if not it uses the default. We also need to set the command line for the non-initramfs kernel, to include root=/dev/mtdblock1 rootfs=yaffs, but not for the initramfs one. We can probably do that using patch_cmdline. David > > Wasting flash on stuff that is unnecessary for an already flashed image > does not seem like a good option to me. > > > - Felix > _______________________________________________ > openwrt-devel mailing list > [email protected] > http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel _______________________________________________ openwrt-devel mailing list [email protected] http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
