Index: config/userspace/deployment.lkc =================================================================== --- config/userspace/deployment.lkc (revision 8449) +++ config/userspace/deployment.lkc (working copy) @@ -15,6 +15,11 @@ help build a jffs2 flash filesystem image + config DEPLOYMENT_YAFFS2 + bool "yaffs2" + help + build a yaffs2 flash filesystem image + config DEPLOYMENT_RAMDISK bool "ext2.gz ramdisk" help @@ -49,9 +54,21 @@ area is always available endchoice +if CAP_DEPLOYMENT_ELF && (DEPLOYMENT_JFFS2 \ + || DEPLOYMENT_YAFFS2 \ + || DEPLOYMENT_RAMDISK) +config DEPLOYMENT_ELF + bool "Create a combined ELF image" + help + Create an ELF file that contains u-boot and the kernel. + If the deployment is "ramdisk", then link in the ramdisk + image as well. +endif + config SYSCFG_DEPLOYMENT_STYLE string default JFFS2 if DEPLOYMENT_JFFS2 + default YAFFS2 if DEPLOYMENT_YAFFS2 default RAMDISK if DEPLOYMENT_RAMDISK default CRAMFS if DEPLOYMENT_CRAMFS default ROMFS if DEPLOYMENT_ROMFS @@ -113,7 +130,7 @@ default n config SYSCFG_TMPFS_SIZE - depends SYSCFG_READONLY_FS || DEPLOYMENT_JFFS2 + depends SYSCFG_READONLY_FS || DEPLOYMENT_JFFS2 || DEPLOYMENT_YAFFS2 string "tmpfs size" default "512k" help @@ -124,10 +141,10 @@ from the total available RAM to the system. config SYSCFG_RAM_DIRS - depends SYSCFG_READONLY_FS || DEPLOYMENT_JFFS2 + depends SYSCFG_READONLY_FS || DEPLOYMENT_JFFS2 || DEPLOYMENT_YAFFS2 string "Place these dirs in writable RAM" default "/tmp /etc /var" if SYSCFG_READONLY_FS - default "/tmp /var" if DEPLOYMENT_JFFS2 + default "/tmp /var" if DEPLOYMENT_JFFS2 || DEPLOYMENT_YAFFS2 help Flash may only be erased a finite number of times (of the order of 100000 times for a NOR device). If you deploy to Flash, @@ -256,7 +273,7 @@ .ko are stripped like this. config DEPLOYMENT_PADDING_KB - depends ! DEPLOYMENT_NFS && ! DEPLOYMENT_JFFS2 + depends ! DEPLOYMENT_NFS && ! DEPLOYMENT_JFFS2 && ! DEPLOYMENT_YAFFS2 default "0" string "Allocate extra space (Kbytes)" help Index: bin/Ltibutils.pm =================================================================== --- bin/Ltibutils.pm (revision 8401) +++ bin/Ltibutils.pm (working copy) @@ -103,10 +103,18 @@ return $hr; } +# +# gm_yyyymmdd can return the date, either in GMT, or in localtime. +# Usefull when the local timezone is far away from GMT. sub gm_yyyymmdd { - my($day, $month, $year) = (gmtime)[3,4,5]; - return sprintf("%04d%02d%02d", $year+1900, $month+1, $day); + if ($cf->{use_localtime}) { + my ($day, $month, $year) = (localtime)[3,4,5]; + return sprintf("%04d%02d%02d", $year+1900, $month+1, $day); + } else { + my ($day, $month, $year) = (gmtime)[3,4,5]; + return sprintf("%04d%02d%02d", $year+1900, $month+1, $day); + } } sub parse_config @@ -661,6 +669,7 @@ my $x = $verbose ? '-x' : ''; my $v = $verbose ? '-v' : ''; my $cmd; + my $cur_date = gm_yyyymmdd(); system_nb(<{DEPLOYMENT_YAFFS2}" = "y" ] +then + rm -f $tdir/rootfs.yaffs2 +fi if [ "$pcf->{DEPLOYMENT_CRAMFS}" = "y" ] then rm -f $tdir/cramfs.* @@ -869,6 +882,11 @@ mkfs.jffs2 -n $pad_opt -D $dev_tab -U $endian -e $pcf->{DEPLOYMENT_ERASE_BLOCK_SIZE} -d $stage -o $tdir/rootfs.jffs2 ln -sf $tdir/rootfs.jffs2 $tdir/rootfs_image fi +if [ "$pcf->{DEPLOYMENT_YAFFS2}" = "y" ] +then + mkfs.yaffs2 -r -p $stage/etc/passwd -N -D $dev_tab $endian $stage $tdir/rootfs.yaffs2 + ln -sf $tdir/rootfs.yaffs2 $tdir/rootfs_image +fi if [ "$pcf->{DEPLOYMENT_CRAMFS}" = "y" ] then mkfs.cramfs -q -D $dev_tab $endian $stage $tdir/rootfs.cramfs @@ -927,6 +945,20 @@ ln -sf $tdir/initramfs.cpio.gz.uboot $tdir/rootfs_image fi fi +if [ "$pcf->{DEPLOYMENT_ELF}" = "y" ] +then + elf_image="linux-demo-$pcf->{PLATFORM_ELF}-$cur_date.elf" + if [ "$pcf->{DEPLOY_RAMDISK_AND_ELF}" = "y" ] + then + echo "creating elf file that contains u-boot, kernel, ramdisk" + make -C \$PLATFORM_PATH/elf-image elf-with-rootfs UBOOT=$cf->{top}/rootfs/boot/u-boot.bin KERNEL=$cf->{top}/rootfs/boot/uImage ROOTFS=$cf->{top}/rootfs.ext2.gz.uboot IMAGE=$cf->{top}/\$elf_image + else + echo "creating elf file that contains u-boot, kernel, rootfs assumed elsewhere" + make -C \$PLATFORM_PATH/elf-image elf-without-rootfs UBOOT=$cf->{top}/rootfs/boot/u-boot.bin KERNEL=$cf->{top}/rootfs/boot/uImage IMAGE=$cf->{top}/\$elf_image + fi + ln -sf \$elf_image image.elf +fi + if [ "$pcf->{DEPLOYMENT_ROOTFS_KEEPSTAGE}" = "y" ] then echo "Saving temporary staging directory: $stage" Index: ltib =================================================================== --- ltib (revision 8441) +++ ltib (working copy) @@ -799,6 +799,11 @@ # needed if the lpp moves and links break unlink($tgt); + # if $src is relative, then prefix it with "$cf->{top}/" + # to make the rpm/SOURCE/$tgt symbolic link absolute + if ($src !~ m/^\//) { + $src = "$cf->{top}/$src"; + } symlink($src, $tgt) or die("symlink $cf->{lpp}/$file, $tgt: $!"); } Index: config/platform/host/ltib.preconfig =================================================================== --- config/platform/host/ltib.preconfig (revision 8401) +++ config/platform/host/ltib.preconfig (working copy) @@ -377,7 +377,7 @@ # CONFIG_PKG_XORG_X11_XKB_UTILS is not set # CONFIG_PKG_XORG_X11_TWM is not set # CONFIG_PKG_XTERM is not set -# CONFIG_PKG_YAFFS_UTILS is not set +CONFIG_PKG_YAFFS_UTILS=y # CONFIG_PKG_ZAPTEL is not set # CONFIG_PKG_ZLIB is not set Index: dist/lfs-5.1/yaffs-utils/yaffs-utils.spec =================================================================== --- dist/lfs-5.1/yaffs-utils/yaffs-utils.spec (revision 8401) +++ dist/lfs-5.1/yaffs-utils/yaffs-utils.spec (working copy) @@ -12,6 +12,7 @@ Patch0 : yaffs_mxc.patch Patch1 : yaffs_utils-20060418-mtd-include.patch Patch2 : yaffs_utils-20060418-include-order.patch +Patch3 : yaffs_utils-20060418-mkyaffs2image.patch BuildRoot : %{_tmppath}/%{name} Prefix : %{pfx} @@ -26,14 +27,15 @@ %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %Build -make KERNELDIR=$DEV_IMAGE/usr/src/linux -C yaffs/utils +make KERNELDIR=$DEV_IMAGE/usr/src/linux -C yaffs2/utils %Install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/bin -make -C yaffs/utils install DESTDIR=$RPM_BUILD_ROOT/%{pfx} SBINDIR=%{_prefix}/bin +make -C yaffs2/utils install DESTDIR=$RPM_BUILD_ROOT/%{pfx} SBINDIR=%{_prefix}/bin %Clean rm -rf $RPM_BUILD_ROOT