#5211: [patch] detect host sfdisk --------------------------+------------------------------------------------- Reporter: mmadia | Owner: mmu_man Type: bug | Status: assigned Priority: normal | Milestone: Component: Build System | Version: R1/Development Keywords: | Blockedby: Platform: All | Blocking: --------------------------+------------------------------------------------- Comment(by mmadia): It seems [http://www.freebsd.org/cgi/cvsweb.cgi/ports/sysutils/sfdisk/ FreeBSD's sfdisk] is not the same as [http://linux.die.net/man/8/sfdisk linux's sfdisk]. {{{ [FreeBSD]$ /usr/local/sbin/sfdisk usage: fdisk [-n] [-d] $disk }}} from u-boot/Jamfile: {{{ echo -e '$(SDIMAGE_FDISK_SCRIPT)' | $(SDIMAGE_FDISK) -f -D \ -H $(SDIMAGE_FDISK_H) -S $(SDIMAGE_FDISK_S) \ -u$(SDIMAGE_FDISK_UNIT) $(<) }}} Turns out FreeBSD provides a [http://www.freebsd.org/cgi/cvsweb.cgi/ports/sysutils/linuxfdisk/ sysutils/linuxfdisk/]. When the above attached patch is applied, the following is part of the output of {{{ jam -qj1 -sHAIKU_BOOT_BOARD=verdex haiku.mmc }}} {{{ BuildUBootSDImage1 haiku.mmc 256+0 records in 256+0 records out 268435456 bytes transferred in 3.747654 secs (71627599 bytes/sec) Warning: haiku.mmc is not a block device Disk haiku.mmc: cannot get size Disk haiku.mmc: cannot get geometry Disk haiku.mmc: 0 cylinders, 255 heads, 63 sectors/track sfdisk: ERROR: sector 0 does not have an msdos signature haiku.mmc: unrecognized partition Old situation: No partitions found Warning: given size (40) exceeds max allowable size (0) New situation: Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End MiB #blocks Id System haiku.mmc1 0+ 39- 40- 40131 c Win95 FAT32 (LBA) haiku.mmc2 0 - 0 0 eb BeOS fs haiku.mmc3 0 - 0 0 0 Empty haiku.mmc4 0 - 0 0 0 Empty Warning: partition 2 has size 0 but is not marked Empty Warning: partition 1 extends past end of disk Successfully wrote the new partition table Re-reading the partition table ... If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).) Partitions 1 and 2 badly ordered or overlapping Warning: inconsistent partition table Possibly unpartitioned device *** Maybe try without partition=1 in device definition *** If this is a PCMCIA card, or a disk partitioned on another computer, this message may be in error: add mtools_skip_check=1 to your .mtoolsrc file to suppress this warning Partitions 1 and 2 badly ordered or overlapping Warning: inconsistent partition table Possibly unpartitioned device *** Maybe try without partition=1 in device definition *** If this is a PCMCIA card, or a disk partitioned on another computer, this message may be in error: add mtools_skip_check=1 to your .mtoolsrc file to suppress this warning ...updated 46 target(s)... [mmadia@amd-939 /storage/rewrite2/output/generated.arm]$ }}} -- Ticket URL: <http://dev.haiku-os.org/ticket/5211#comment:2> Haiku <http://dev.haiku-os.org> Haiku - the operating system.