lichee-pi_zero v3s Windows 环境下 USB FEL 下载到 RAM 运行 OpenWrt 19.07.1 测试

Windows 环境下通过 USB 下载到 RAM 里运行,无需烧写 flash 和插入 SD 卡,下载脚本如下:
注意 [color=#FF0000]initrd=0x41B00000,12M[/color],12M表示 rootfs.cpio 大小,小于实际大小将导致 rootfs 挂载错误。

[code]
"..toolssunxi-felsunxi-fel.exe" -p uboot u-boot-sunxi-with-spl.bin write 0x41000000 zImage write 0x41800000 ..u-bootsun8i-v3s-licheepi-ethernet.dtb write 0x41B00000 rootfs.cpio

@echo "setenv bootargs console=ttyS0,115200 initrd=0x41B00000,12M; bootz 0x41000000 - 0x41800000"
[/code]

测试文件:
roots 文件取致 docker_hub >> openwrtorg/imagebuilder:sunxi-cortexa7-19.07.1 >> make image 输出 rootfs.squashfs
由于 kernel,驱动,rootfs 未完全正确配置,仅作运行 openwrt 体验测试.

运行日志:
[code]

U-Boot SPL 2020.01 (Mar 12 2020 - 17:57:35 +0800)
DRAM: 64 MiB
Trying to boot from FEL

U-Boot 2020.01 (Mar 12 2020 - 17:57:35 +0800) Allwinner Technology

CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero Ethernet
DRAM: 64 MiB
MMC: mmc@01c0f000: 0
Loading Environment from FAT... Card did not respond to voltage select!
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
Net: No ethernet found.
starting USB...
No working controllers found
Hit any key to stop autoboot: 0
Card did not respond to voltage select!
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No working controllers found
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi-sunxi
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
starting USB...
No working controllers found
No ethernet found.
No ethernet found.
=>
=> setenv bootargs console=ttyS0,115200 initrd=0x41B00000,12M; bootz 0x41000000 - 0x41800000

Flattened Device Tree blob at 41800000

Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dff8b8 ... OK

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.105 (iron@iron-debian-ipason) (gcc version 8.3.0 (Buildroot 2019.11.1-g23989e8-dirty)) #1 SMP Thu Mar 12 17:59:02 +08 2020
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Zero Ethernet
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Failed to reserve 16 MiB
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] random: get_random_bytes called from start_kernel+0x9c/0x408 with crng_init=0
[ 0.000000] percpu: Embedded 15 pages/cpu s30476 r8192 d22772 u61440
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=ttyS0,115200 initrd=0x41B00000,12M
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 42652K/65536K available (6144K kernel code, 420K rwdata, 1528K rodata, 1024K init, 242K bss, 22884K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (7136 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 421 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 243 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000020] Switching to timer-based delay loop, resolution 41ns
[ 0.000212] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000437] Console: colour dummy device 80x30
[ 0.000495] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000512] pid_max: default: 32768 minimum: 301
[ 0.000677] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000695] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001470] CPU: Testing write buffer coherency: ok
[ 0.001961] /cpus/cpu@0 missing clock-frequency property
[ 0.001990] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002742] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.002992] rcu: Hierarchical SRCU implementation.
[ 0.003803] smp: Bringing up secondary CPUs ...
[ 0.003825] smp: Brought up 1 node, 1 CPU
[ 0.003834] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.003842] CPU: All CPU(s) started in HYP mode.
[ 0.003847] CPU: Virtualization extensions available.
[ 0.004688] devtmpfs: initialized
[ 0.007668] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.007954] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.007989] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.008217] pinctrl core: initialized pinctrl subsystem
[ 0.009278] NET: Registered protocol family 16
[ 0.009730] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.010992] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.011012] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.022576] SCSI subsystem initialized
[ 0.023267] usbcore: registered new interface driver usbfs
[ 0.023339] usbcore: registered new interface driver hub
[ 0.023447] usbcore: registered new device driver usb
[ 0.023687] pps_core: LinuxPPS API ver. 1 registered
[ 0.023698] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.023719] PTP clock support registered
[ 0.023981] Advanced Linux Sound Architecture Driver Initialized.
[ 0.025171] clocksource: Switched to clocksource arch_sys_counter
[ 0.035939] NET: Registered protocol family 2
[ 0.036606] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[ 0.036644] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.036667] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.036691] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.036841] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.036893] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.037111] NET: Registered protocol family 1
[ 0.037964] RPC: Registered named UNIX socket transport module.
[ 0.037986] RPC: Registered udp transport module.
[ 0.037993] RPC: Registered tcp transport module.
[ 0.037999] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.038300] Unpacking initramfs...
[ 0.187059] Initramfs unpacking failed: junk in compressed archive
[ 0.199590] Freeing initrd memory: 12288K
[ 0.201624] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.208998] NFS: Registering the id_resolver key type
[ 0.209053] Key type id_resolver registered
[ 0.209060] Key type id_legacy registered
[ 0.210829] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[ 0.210855] io scheduler noop registered
[ 0.210863] io scheduler deadline registered
[ 0.211069] io scheduler cfq registered (default)
[ 0.211084] io scheduler mq-deadline registered
[ 0.211092] io scheduler kyber registered
[ 0.211876] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 0.215765] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.278274] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.281407] console [ttyS0] disabled
[ 0.301685] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 30, base_baud = 1500000) is a U6_16550A
[ 0.915558] console [ttyS0] enabled
[ 0.921714] libphy: Fixed MDIO Bus: probed
[ 0.925921] CAN device driver interface
[ 0.930159] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD0
[ 0.936052] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD1
[ 0.941883] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD2
[ 0.947731] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD3
[ 0.953558] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD4
[ 0.959398] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD5
[ 0.965235] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD7
[ 0.971062] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD8
[ 0.976898] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD9
[ 0.982725] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD10
[ 0.988648] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD12
[ 0.994561] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD13
[ 1.000483] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD15
[ 1.006412] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD16
[ 1.012325] sun8i-v3s-pinctrl 1c20800.pinctrl: unknown pin PD17
[ 1.018503] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 1.024294] dwmac-sun8i 1c30000.ethernet: No regulator found
[ 1.030518] dwmac-sun8i 1c30000.ethernet: Current syscon value is not the default 38000 (expect 58000)
[ 1.039916] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[ 1.047157] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[ 1.054372] dwmac-sun8i 1c30000.ethernet: COE Type 2
[ 1.059345] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[ 1.066138] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[ 1.071790] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[ 1.077673] libphy: stmmac: probed
[ 1.081769] dwmac-sun8i 1c30000.ethernet: Found internal PHY node
[ 1.088123] libphy: mdio_mux: probed
[ 1.091729] dwmac-sun8i 1c30000.ethernet: Switch mux to internal PHY
[ 1.098133] dwmac-sun8i 1c30000.ethernet: Powering internal PHY
[ 1.108828] libphy: mdio_mux: probed
[ 1.112700] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.119358] ehci-platform: EHCI generic platform driver
[ 1.124697] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.130978] ohci-platform: OHCI generic platform driver
[ 1.137540] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[ 1.144339] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.149139] i2c /dev entries driver
[ 1.153820] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.162468] sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.2
[ 1.195210] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.203772] usbcore: registered new interface driver usbhid
[ 1.209452] usbhid: USB HID core driver
[ 1.215395] NET: Registered protocol family 17
[ 1.219884] can: controller area network core (rev 20170425 abi 9)
[ 1.226230] NET: Registered protocol family 29
[ 1.230677] can: raw protocol (rev 20170425)
[ 1.234944] can: broadcast manager protocol (rev 20170425 t)
[ 1.240648] can: netlink gateway (rev 20170425) max_hops=1
[ 1.246474] Key type dns_resolver registered
[ 1.250835] Registering SWP/SWPB emulation handler
[ 1.263293] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.274231] usb_phy_generic usb_phy_generic.0.auto: Linked as a consumer to regulator.0
[ 1.282874] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.288725] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 1.297844] hub 1-0:1.0: USB hub found
[ 1.301811] hub 1-0:1.0: 1 port detected
[ 1.308483] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:07:27 UTC (447)
[ 1.316968] ALSA device list:
[ 1.319948] No soundcards found.
[ 1.325460] Freeing unused kernel memory: 1024K
[ 1.330200] Run /init as init process
[ 1.375476] init: Console is alive
[ 1.379208] init: - watchdog -
[ 1.386185] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 1.393761] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 1.403639] init: - preinit -
[ 1.544378] random: jshn: uninitialized urandom read (4 bytes read)
[ 1.579390] random: jshn: uninitialized urandom read (4 bytes read)
[ 1.604300] random: jshn: uninitialized urandom read (4 bytes read)
[ 1.629396] Generic PHY 0.1:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0.1:01, irq=POLL)
[ 1.640565] dwmac-sun8i 1c30000.ethernet eth0: No Safety Features support found
[ 1.647965] dwmac-sun8i 1c30000.ethernet eth0: No MAC Management Counters available
[ 1.655652] dwmac-sun8i 1c30000.ethernet eth0: PTP not supported by HW
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 4.779625] mount_root: mounting /dev/root
[ 4.788965] urandom-seed: Seed file not found (/etc/urandom.seed)
[ 4.822172] procd: - early -
[ 4.826303] procd: - watchdog -
[ 5.648485] procd: - watchdog -
[ 5.652013] procd: - ubus -
[ 5.659878] urandom_read: 1 callbacks suppressed
[ 5.659890] random: ubusd: uninitialized urandom read (4 bytes read)
[ 5.705582] random: ubusd: uninitialized urandom read (4 bytes read)
[ 5.712395] random: ubusd: uninitialized urandom read (4 bytes read)
[ 5.719743] procd: - init -
Please press Enter to activate this console.
[ 5.998354] kmodloader: loading kernel modules from /etc/modules.d/*
[ 6.016215] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 6.027208] urngd: v1.0.2 started.
[ 6.078768] random: crng init done
[ 6.082196] random: 3 urandom warning(s) missed due to ratelimiting

BusyBox v1.30.1 () built-in shell (ash)

_ __ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|

      |__| W I R E L E S S   F R E E D O M

-----------------------------------------------------

OpenWrt 19.07.1, r10911-c155900f66

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password

in order to prevent unauthorized SSH logins.

root@OpenWrt:/# [ 31.845166] vcc3v0: disabling
[ 31.848160] vcc3v3: disabling
[ 31.851125] vcc5v0: disabling

root@OpenWrt:/# ifconfig
lo Link encap:Local Loopback

      inet addr:127.0.0.1  Mask:255.0.0.0
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:64 errors:0 dropped:0 overruns:0 frame:0
      TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:4352 (4.2 KiB)  TX bytes:4352 (4.2 KiB)

root@OpenWrt:/# ifconfig -a
eth0 Link encap:Ethernet HWaddr 02:03:AE:96:27:E8

      BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
      Interrupt:31 

lo Link encap:Local Loopback

      inet addr:127.0.0.1  Mask:255.0.0.0
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:64 errors:0 dropped:0 overruns:0 frame:0
      TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:4352 (4.2 KiB)  TX bytes:4352 (4.2 KiB)

root@OpenWrt:/# ifup eth0
Interface eth0 not found
root@OpenWrt:/# ifconfig eth0 up
[ 79.462208] Generic PHY 0.1:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0.1:01, irq=POLL)
[ 79.473288] dwmac-sun8i 1c30000.ethernet eth0: No Safety Features support found
[ 79.480734] dwmac-sun8i 1c30000.ethernet eth0: No MAC Management Counters available
[ 79.488421] dwmac-sun8i 1c30000.ethernet eth0: PTP not supported by HW
root@OpenWrt:/# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 02:03:AE:96:27:E8

      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
      Interrupt:31 

root@OpenWrt:/# dhcpc eth0
/bin/ash: dhcpc: not found
root@OpenWrt:/# udhcpc eth0
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
[ 126.325651] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx

udhcpc: sending select for 192.168.2.176
udhcpc: lease of 192.168.2.176 obtained, lease time 43200
udhcpc: ifconfig eth0 192.168.2.176 netmask 255.255.255.0 broadcast 192.168.2.255
udhcpc: setting default routers: 192.168.2.1
root@OpenWrt:/#
root@OpenWrt:/# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 02:03:AE:96:27:E8

      inet addr:192.168.2.176  Bcast:192.168.2.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:12 errors:0 dropped:0 overruns:0 frame:0
      TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:1879 (1.8 KiB)  TX bytes:1026 (1.0 KiB)
      Interrupt:31 

root@OpenWrt:/# cat /etc/hostname
licheepi-zero-xwiron
root@OpenWrt:/# netsta -tunpl
/bin/ash: netsta: not found
root@OpenWrt:/# netstat -tunpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.2.176:53 0.0.0.0:* LISTEN 331/dnsmasq
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 331/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 368/dropbear
netstat: /proc/net/tcp6: No such file or directory
udp 0 0 192.168.2.176:53 0.0.0.0:* 331/dnsmasq
udp 0 0 127.0.0.1:53 0.0.0.0:* 331/dnsmasq
netstat: /proc/net/udp6: No such file or directory
root@OpenWrt:/#

[/code]

Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。Linux下的Samba服务主要用于Windows平台和linux平台下载局域网内实现文件共享。

一、Samba安装 

  以下操作均是在root权限进行的 

  apt-get install Samba 安装

二、创建共享目录以及修改权限

  1、mkdir /mnt/share   //这里的/home/coin/share我自己测试用的你们可以根据自己的需求建立相应目录

  2、chmod 777 /mnt/share //这里的权限可以根据自己的需求修改

三、创建 Samba 账户

  1、touch /etc/samba/smbpasswd

  2、smbpasswd -a [user] //在这里会提示输入两次密码这个用户也是系统用户

四、配置Samba配置文件

  1、vim /etc/Samba/smb.conf

  在smb.conf最后添加上

  [share]

  path = /mnt/share //需要共享的本地路径,必须使用绝对路径

  available = yes

  browsealbe = yes

  valid users = test //在这里添加前面创建的一个用户叫test

  public = yes

create mask = 0777

  writable = yes

  到这里smb.conf就配置好了然后

五、启动Samba服务器

  /etc/init.d/samba restart

六、windows网络访问

输入服务器的IP地址ip地址或是添加映射都可以

出于低功耗、封装限制等种种原因,以前的一些ARM处理器没有独立的硬件浮点运算单元,需要手写软件来实现浮点运算。
随着技术发展,现在高端的ARM处理器基本都具备了硬件执行浮点操作的能力。这样,新旧两种架构之间的差异,就产生了两个不同的嵌入式应用程序二进制接口(EABI)——软浮点与矢量浮点(VFP)。但是软浮点(soft float)和硬浮点(hard float)之间有向前兼容却没有向后兼容的能力,也就是软浮点的二进制接口(EABI)仍然可以用于当前的高端ARM处理器。

1 fpu单元

Cortex-A9-chip-diagram-300x251.png

在ARM体系架构内核中,有些有浮点运算单元(fpu,floating point unit),如上图,有些没有。对于没有fpu内核,是不能使用armel和armhf的。在有fpu的情况下,就可以通过gcc的选项-mfloat-abi来指定使用哪种,有如下三种值:

  1. soft:不用​fpu计算,即使有fpu浮点运算单元也不用。
  2. armel:(arm eabi little endian)也即softfp,用fpu计算,但是传参数用普通寄存器传,这样中断的时候,只需要保存普通寄存器,中断负荷小,但是参数需要转换成浮点的再计算。
  3. armhf:(arm hard float)也即hard,用fpu计算,传参数用fpu中的浮点寄存器传,省去了转换性能最好,但是中断负荷高。
  4. arm64:64位的arm默认就是hard float的,因此不需要hf的后缀。

    kernel、rootfs和app编译的时候,指定的必须保持一致才行。使用softfp模式,会存在不必要的浮点到整数、整数到浮点的转换。而使用hard模式,在每次浮点相关函数调用时,平均能节省20个CPU周期。对ARM这样每个周期都很重要的体系结构来说,这样的提升无疑是巨大的。在完全不改变源码和配置的情况下,在一些应用程序上,虽然armhf比armel硬件要求(确切的是指fpu硬件)高一点,但是armhf能得到20-25%的性能提升。对一些严重依赖于浮点运算的程序,更是可以达到300%的性能提升。

2 armel与armhf

之前EABI中,armel(低端ARM硬件,支持armv4以上版本),在执行浮点运算之前,浮点参数必须首先通过整数寄存器,然后传递到浮点运算单元。新的EABI ,也就是armhf,通过直接传递参数到浮点寄存器优化了浮点运算的调用约定。相比我们熟悉的armel,armhf代表了另一种不兼容的二进制标准。在一些社区的支持下,armhf目前已经得到了很大的发展。像Ubuntu,已经计划在之后的发行版中放弃armel,转而支持armhf编译的版本。正如目前依然很火热的Raspberry Pi(ARM11),由于ubuntu只支持armv7架构的编译,Raspberry Pi将不能直接安装ubuntu系统。而 BB Black(Cortex-A8)和 Cubietruct(Cortex-A7)则同时支持ubuntu的armel与armhf的编译。

3 安装armel和armhf

以上就是armel与armhf的比较。相信大家也应该有个大概的了解了。在Ubuntu系统下,如何根据需求分别实现两种交叉编译器的安装呢?

3.1 arm-linux-gnueabi的安装

sudo apt-get install gcc-arm-linux-gnueabi

按操作下载即可,没啥好说的。

3.2 arm-linux-gnueabihf的安装

两种方法:

  • linaro开源组织有相关的交叉工具链下载,点击进入网页选择下载即可,地址:https://launchpad.net/linaro-toolchain-binaries
  • 到本站工具链页面下载,地址:http://www.veryarm.com/arm-linux-gnueabihf-gcc

然后就是解压到自定义目录中,并添加bin环境变量。

4 armhf 使用

armhf的开启需要硬件的支持,在Debian的wiki上要求 ARMv7 CPUThumb-2 指令集以及 VFP3D16 浮点处理器。在 gcc 的编译参数上,使用 -mfloat-abi=hard -mfpu=vfp 即可。

在工具上,CodeSourcery最早支持hard模式。或者,也可已自己编译工具链。

sudo 出现 unable to resolve host 解决方法

Ubuntu环境, 假设这台机器名字叫abc(机器的hostname), 每次执行sudo 就出现这个警告讯息:

sudo: unable to resolve host <host_name>

虽然sudo 还是可以正常执行, 所以就直接从/etc/hosts 设定, 让abc(hostname) 可以解回127.0.0.1 的IP 即可.

在127.0.0.1 localhost 后面加上主机名称(hostname) 即可:

127.0.0.1       localhost <host_name>

1.修改内核配置选项
进入内核源码目录linux-2.6.32.2目录

cp config_mini2440_x35 .config

make menuconfig ARCH=arm

(1).打开配置菜单,修改两个配置项,分别是:
a):General setup-->选择 Initial RAM filesystem and RAM disk...... 项
b):Device Drivers-->Block devices-->选择 RAM block device support 项

c):并检查Optimize for size是否被选中,如果没有则选中,此项优化内核大小,根据需要进行配置。
d):device driver->block device里的一个选项,‍Default Ramdisk 设置ramdisk的大小.16384

Note:修改(8192)Default RAM disk size kbytes选项为(4096)Default RAM disk size kbytes, 之所以修改是因为我之后制作的ramdisk是4096KB大小的。当然如果你想制作8192KB大小的ramdisk,这里就要对应为8192了,以此 类推。但是最小系统嘛,是不用那么大的ramdisk的。此项的默认配置就是(4096),以前我改过这个配置,所以是(8192)了。如果这个大小和你 做的ramdisk不匹配,则启动时仍然会出现kernel panic内核恐慌,提示ramdisk格式不正确,挂载不上ramdisk。

(2).进入File systems菜单,选上<*> Second extended fs support
ramdisk是一种内存虚拟磁盘技术,实质上并不是一种文件系统,它使用的文件系统时ext2文件系统。
这样就为内核添加好了ramdisk启动功能和ramdisk的驱动支持了。

2.修改内核启动参数
方法有二:
a):修改.config的第310行,修改CONFIG_CMDLINE=""的定义
修改为CONFIG_CMDLINE="initrd=0x31000000,0x400000 root=/dev/ram0 rw init=/linuxrc console=ttySAC0 mem=64M"
保存。
意思为从ramdisk启动,ramdisk压缩文件起始地址在内存地址0x31000000处,文件大小为0x400000。
此参数也可以在make menuconfig ARCH=arm时进入Boot options菜单,然后在Default kernel command string里修改。效果是一样的

b):或者不修改.config的的第310行CMDLINE定义,而是用u-boot的bootargs环境变量来传递启动参数。
同样也是修改该环境变量为bootargs=initrd=0x31000000,0x400000 root=/dev/ram0 rw init=/linuxrc console=ttySAC0 mem=64M
并saveenv保存u-boot环境变量
以上a),b)的效果是一样的。

4.编译内核

make zImage ARCH=arm CROSS_COMPILE=arm-linux-

编译完成后在当前目录下就出现了zImage内核映像了。

5.其实 uImage就是在zImage的开头部分增加了一个64字节的内核映像说明。说明一下:zImage是ARM Linux常用的一种压缩映像文件,uImage是U-boot专用的映像文件,它是在zImage之前加上一个长度为0x40的“头”,说明这个映像文 件的类型、加载位置、生成时间、大小等信息。换句话说,如果直接从uImage的0x40位置开始执行,zImage和uImage没有任何区别。另 外,Linux2.4内核不支持uImage,Linux2.6内核加入了很多对嵌入式系统的支持,但是uImage的生成也需要设置。

5.制作uImage内核映像
由于使用的Bootloader是u-boot,所以要将zImage转化为uImage,方法如下:
1.把zImage 拷到uboot 的tools 目录下

  1. ./mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008040 -n "Linux kernel Image" -d zImage uImage-ramdisk

说明:mkimage工具是u-boot格式uImage内核映像制作工具。如果成功编译u-boot之后,它会在u-boot源码树下的tools目录 之下。建议将其拷贝到宿主机的/sbin/目录下,以方便使用。

6.还有一个是启动到最后面,会提示

RAMDISK: Compressed image found at block 0
RAMDISK: incomplete write (2270 != 32768)

之类,这问题就是上面说的内核配置的ramdisk大小不对,要去修改一下内核配置
我将它修改成12288(1024的整数倍)