Project

General

Profile

Bug #2899

Install DragonFly to SD card

Added by dpostolov about 1 year ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04/07/2016
Due date:
% Done:

0%


Description

Hi to all DragonFly BSD developers and Community!

Sorry for my bad English...

I am try to install DragonFly BSD to my mini-PC Intel NUC5PPYH CPU Intel N3700, latest at this time BIOS 0050, to SD card Sony 32GB. NUC5PPYH BIOS supports booting Linux/FreeBSD from SD card.

uname -a
DragonFly dfw-7732.localdomain 4.5-DEVELOPMENT DragonFly v4.5.0.763.g541aa16-DEVELOPMENT #0: Tue Mar 29 10:54:30 UTC 2016 :/usr/obj/usr/src/sys/X86_64_GENERIC x86_64

FreeBSD 10.3 successfully installed and works from SD card, but DragonFly is not. As I am understand, DragonFly detected SD, but Dfly Installer cant support geometry of this mmcsd0.

How I can install DragonFly BSD to SD card?

I am booted from USB stick and can installing Dfly to USB stick or HDD (later, afrer buying new HDD after failed previous), DragonFly Installer: Select a disk on which to install DragonFly BSD.
<da8: 7643MB (15654848 512 byte sectors: 255 63S/T 974C) > # This is bootable USB stick-installer
<mmcsd0> [void space]

If select mmcsd0, then Dfly Installer say about error. As I am understand, Installer cant recognized geometry of SD.

ls /dev/mmc* # on mmcsd0 installed version of FreeBSD 10.3
/dev/mmcsd0 /dev/mmcsd0s0 /dev/mmcsd0s1 /dev/mmcsd0s2

pciconf -lv
sdhci_pci0@pci0:0:18:0 class=0x080501 card=0x20608086 chip=0x22968086 rev 0x21 hdr=0x00
vendor = 'Intel Corporation'
class = base peripherial
subclass = SD host controller

dmesg | grep sd
sdhci_pci0:< Generic SD HCI > mem 0x8141b000 - 0x8141bfff irq 18 at device 18.0 on pci0
sd hci_pci0:1slot(s) allocated
mmc0:<MMC/SD bus> on sdhci_pci0
mmcsd0:29GB < SDHC Memory Card > at mmc0 50Mhz/4bit

On FreeBSD different output data is:

dmesg | grep sd
mmcsd0:32GB < SDHC SD32G 3.0 SN7C400885 MFG 02/2015 by 39 PH > at mmc0 50Mhz/4bit/65535-block

---

best regards,
Dmitry Postolov

History

#1 Updated by swildner 11 months ago

What's the exact error the installer is giving upon selecting mmcsd0 as target disk?

The error dialog should have an option to view the log. Please check it for the error and give us a screenshot or photo of the screen, please.

Best regards,
Sascha

#2 Updated by dpostolov 11 months ago

Hi swildner!

I am downloaded new snapshot of DragonFly and test again:

#uname -a
DragonFly 4.5-Development v4.5.0.1066.gd5657 Sun May 29 14:21:34 UTC 2016 X86_64_Generic

#dmesg | grep mmcsd0
mmcsd0: 29GB <SDHC Memory Card> at mmc0 50Mhz/4bit
#diskinfo -q /dev/mmcsd0
/dev/mmcsd0 blksize=512 off=0 size=00077a000000 30624.00MB

Now I am try to select mmcsd0 as target disk, but size of mmcsd0 is void:
DragonFly screenshot mmcsd0 void size - photo image: https://yadi.sk/i/M1PMTBK8s7jEq

View Log:
Executing '/usr/bin/grep -w '^mmcsd0 [0-9]*MB' /var/run/dmesg.boot >> /tmp/survey.txt || /bin/echo 'mmcsd0' >> /temp/survey.txt'

I am think, that Installer try to find the string "MB", but SD card in dmesg detected as "GB" size, then Installer print void space about SD card parameters.

If manually edit /var/run/dmesg.boot and to replace "29GB" to "30624MB" then:
DragonFly screenshot mmcsd0 full size photo image: https://yadi.sk/i/53JcmC65s7jER

Lets to go Step by step to find a solution:
1. Correct value of mmcsd0 parameters in Installer target disk menu
2. Installation DragonFly to SD card.

If to select mmcsd0 as target disk, Installer try to format mmcsd0 and print:
"The sole primary partition of the disk mmcsd0 was not correctly formatted, and may now be in on inconsistent state. We recommend re-formatting the disk before attempting to install DragonFly BSD on it."

P.S. On FreeBSD bsdinstall successfully install FreeBSD to this SD card.
FreeBSD screenshot mmcsd0 full size photo image: https://yadi.sk/i/IboxUjYOs7jFN

#3 Updated by swildner 11 months ago

Thanks for the info. I'll dig out my Laptop that has a PCI attached SD controller and try to find the issue.

#4 Updated by swildner 11 months ago

I've pushed a commit that hopefully fixes the disk size detection issue you're seeing with mmcsd(4). See the commit msg for further details.

http://lists.dragonflybsd.org/pipermail/commits/2016-May/500527.html

If you need an ISO or IMG with that fix, wait a day or two and it should show up in our snapshots: http://avalon.dragonflybsd.org/snapshots/x86_64/

I haven't done any further testing with it yet.

Please report results. :)

Regards,
Sascha

#5 Updated by dpostolov 11 months ago

I am test Dfly Development image from 4 jun. Detection size of mmcsd0 in MB is OK, but installation to sd card is failure. Maybe Dfly installer have problems with detection sd card geometry?

Log:

Installer started
-----------------
+ Creating DFUI connection on ``9999''

+ Connecting on ``9999''

,-<<< Executing `/bin/sh /tmp/extract_vars >/tmp/extracted_vars.txt'
`->>> Exit status: 0

+ Starting installer state machine
,-<<< Executing `/bin/echo 'da0: 476940MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/da0 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s da0 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'da8: 14816MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/da8 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s da8 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'mmcsd0: 30624MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/mmcsd0 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s mmcsd0 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn0: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn0 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn0 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn1: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn1 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn1 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn2: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn2 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn2 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn3: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn3 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn3 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -BI mmcsd0'
| ******* Working on device /dev/mmcsd0 *******
| Warning: ending cylinder wraps, using all 1's
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'da0: 476940MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/da0 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s da0 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'da8: 14816MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/da8 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s da8 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'mmcsd0: 30624MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/mmcsd0 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s mmcsd0 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn0: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn0 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn0 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn1: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn1 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn1 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn2: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn2 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn2 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'vn3: 0MB' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `if /bin/test -d /dev/serno; then /bin/ls -l /dev/serno | /usr/bin/grep "`/bin/ls -l /dev/vn3 | /usr/bin/awk '{print $5, $6;}'`" | /usr/bin/awk '{print $10;}' >>/tmp/survey.txt; fi'
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -s vn3 2>/dev/null >>/tmp/survey.txt || /bin/echo '' >>/tmp/survey.txt'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'g c3888 h256 s63' >/tmp/new.fdisk'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'p 1 165 63 62717697' >>/tmp/new.fdisk'
`->>> Exit status: 0

,-<<< Executing `/bin/echo 'a 1' >>/tmp/new.fdisk'
`->>> Exit status: 0

,-<<< Executing `/bin/cat /tmp/new.fdisk'
| g c3888 h256 s63
| p 1 165 63 62717697
| a 1
`->>> Exit status: 0

,-<<< Executing `/sbin/fdisk -v -f /tmp/new.fdisk mmcsd0'
| fdisk: WARNING line 1: number of cylinders (3888) may be out-of-range
| (must be within 1-1024 for normal BIOS operation, unless the entire disk
| is dedicated to DragonFly)
| fdisk: WARNING: adjusting size of partition 1 from 62717697 to 62705601
| to end on a cylinder boundary
| ******* Working on device /dev/mmcsd0 *******
| Warning: ending cylinder wraps, using all 1's
| parameters extracted from device are:
| cylinders=3888 heads=256 sectors/track=63 (16128 blks/cyl)
|
| Figures below won't work with BIOS for partitions not in cyl 1
| parameters to be used for BIOS calculations are:
| cylinders=3888 heads=256 sectors/track=63 (16128 blks/cyl)
|
| Information from DOS bootblock is:
| 1: sysid 165,(DragonFly/FreeBSD/NetBSD/386BSD)
| start 63, size 62705601 (30617 Meg), flag 80 (active)
| beg: cyl 0/ head 1/ sector 1;
| end: cyl 1023/ head 255/ sector 63
| 2: <UNUSED>
| 3: <UNUSED>
| 4: <UNUSED>
`->>> Exit status: 0

,-<<< Executing `/bin/rm -f /tmp/install.disklabel.mmcsd0s1'
`->>> Exit status: 0

,-<<< Executing `/sbin/disklabel64 -W mmcsd0s1'
`->>> Exit status: 0

,-<<< Executing `/bin/dd if=/dev/zero of=/dev/mmcsd0s1 bs=32k count=16'
| dd: /dev/mmcsd0s1: short write on character device
| dd: /dev/mmcsd0s1: end of device
| 1+0 records in
| 0+1 records out
| 32256 bytes transferred in 0.358280 secs (90030 bytes/sec)
`->>> Exit status: 1

#6 Updated by swildner about 1 month ago

There have been fixes to mmcsd etc. in recent times and just today I pushed another fix. If you still have this setup lying around, can you try with a current snapshot again (my fix should be on it too in a day or two)?

#7 Updated by dpostolov about 1 month ago

I am sorry, but now I am use only one NUC DN2820FYKH without cardreader. NUC5PPYH with cardreader in reservation.

Also available in: Atom PDF