PN="mmcBoot" PR="r0" DESCRIPTION="Single file mini-bootloader for iPAQ 214 to boot From MMC card" SECTION="bootloaders" LICENSE="GPL" PROVIDES = "virtual/bootloader" COMPATIBLE_MACHINE = "ipaq214" DEPENDS += "linux-hpipaq214" #command line for kernel: 179:2 = MMC 2nd partition, 31:0 = Flash 1st partition # (Must escape any '/'s here) KERNEL_CMDLINE = "root=179:2 rootdelay=3 rw init=\/sbin\/init" #KERNEL_CMDLINE = "root=31:0 rootfstype=jffs2 rootdelay=3 rw init=\/sbin\/init" SRC_URI="file://mmcBootCrt.S \ file://mmcBoot.lds \ file://mmcBoot.c \ file://tags.c \ file://led.c" do_compile() { #we want to compile in the kernel ln -sf ${DEPLOY_DIR_IMAGE}/zImage-ipaq214.bin ${S}/zImage-ipaq214.bin #insert the kernel command line sed -i "s/#define KERNEL_CMDLINE .*/#define KERNEL_CMDLINE \"${KERNEL_CMDLINE}\"/" ${WORKDIR}/tags.c #TODO: Make this work again # #create a checksum of the kernel to check on boot # CHECKSUM=`./checksum Image | grep checksum | sed "s/checksum: //g"`; # echo "Replacing image checksum with 0x$CHECKSUM"; # sed -i "s/#define KERN_CHECKSUM .*/#define KERN_CHECKSUM 0x$CHECKSUM/" ${WORKDIR}/mmcBoot.c ${CC} -nostdlib -c ${WORKDIR}/mmcBootCrt.S ${CC} -nostdlib -c ${WORKDIR}/mmcBoot.c ${CC} -nostdlib -c ${WORKDIR}/tags.c ${CC} -nostdlib -c ${WORKDIR}/led.c # Object ${S}/mmcBootCrt.o not included in the following line as the link script seems to include it already in OE. # ${LD} -o ${S}/mmcBoot -Ttext 0x83900000 ${WORKDIR}/mmcBoot.lds ${S}/mmcBoot.o ${S}/tags.o ${S}/led.o ${LD} -o ${S}/mmcBoot -Ttext 0x83900000 ${WORKDIR}/mmcBoot.lds ${OBJCOPY} -R .note -R .comment -O binary ${S}/mmcBoot ${S}/mmcBoot.bin } # put in images directory and make a symlink with the name of the file to put on the FAT16 system. MMCBOOT_IMAGE ?= "mmcBoot-${MACHINE}-${PV}-${PR}.bin" MMCBOOT_SYMLINK ?= "BLDIAG.NB0" do_deploy () { install -d ${DEPLOY_DIR_IMAGE} install -m 0644 ${S}/mmcBoot.bin ${DEPLOY_DIR_IMAGE}/${MMCBOOT_IMAGE} cd ${DEPLOY_DIR_IMAGE} rm -f ${MMCBOOT_SYMLINK} ln -sf ${MMCBOOT_IMAGE} ${MMCBOOT_SYMLINK} } do_deploy[dirs] = "${S}" addtask deploy before do_build after do_compile