|
发表于 2023-1-18 09:18:32
|
显示全部楼层
转发:我好像解决部分猫盘刷群晖后掉IP的问题了+ k6 e2 ~9 m7 l
2 M* g* U9 [4 q# [! ^aquila995' ? l! N) u' g' H
" e/ f8 Y/ z2 a; J8 a. c
于 2020-06-24 16:37:11 发布
, c( D0 z8 {" ]. g& F) k* A% Y4 A9 Y" f. z/ p& p4 I# T% y% o. F
13215% @* |; ~8 ^5 ^$ j7 e& n
收藏 13* H& B u- ^: M) R" j2 R; v9 }
分类专栏: 群晖
& `6 p- B' G3 A8 b* V. D8 m, G/ C0 Z版权
+ ?4 I _! w4 [/ d A- R0 E: p
群晖& Z( j! U) I/ D C/ l7 |* {
专栏收录该内容! E9 S) M) [: B! s" |3 w
1 篇文章0 订阅$ T" I0 h, S( {7 q j' q, X
订阅专栏
' { K! u P0 @% \% a; c我好像解决部分猫盘刷群晖后掉IP的问题了
% Y/ O8 K; R0 V" c# x # U: l, q4 }9 [7 R$ |3 N
我好像解决部分猫盘刷群晖后掉IP的问题了
$ q) }$ a: `) N/ r3 k3 }
, Z/ {. ^( j& d2 b2 _ ^先说我的情况,xianyu上的,到手发现刷群晖后第一次没挂硬盘时可见ip,关机,上硬盘,再开机就一直见不到ip了,没敢一直重启,心疼硬盘。
0 ?' m5 B% h! I! u `$ b6 m# g. n" b然后刷个X3P用了一段时间,还是想用群晖。上了块固态,试了多次后,应该解决掉IP的问题了,现在挂的是500G普通盘,一直正常。
9 l" o# | N8 j: w/ ]
0 {$ ^& r6 w8 ]+ M跳过刷机说重点,每次重刷完群晖都是可以连上的,但重启后就不行了,所以应该不是所谓的虚焊问题,应该是某个设置没有达到,网卡没有工作。
1 c7 d& @8 J( ~, L
& z+ w6 _, K q, L然后发现的情况是,如果进到env环境(我也不知道叫什么,反正就是在xshell下一直按回车的环境),网卡是工作的,只是再进到群晖启动时没有工作。
+ y! j% ?: i- Z1 H5 P0 e + D1 U5 c% N/ ?" _8 c2 n5 ~
先看了下有什么可用的命令:/ C J2 j! @! K9 x/ N
h- T4 ~' H7 r, NMarvell>> help
* c$ J2 ^4 p& y6 v/ Q% H2 R? - alias for 'help'
0 H M7 i0 T! R% e$ N- v) E/ b& [base - print or set address offset( G- n, b- k! j6 _" }4 s% }6 g0 u
bdinfo - print Board Info structure
0 E' g, N* d! Q% \8 Gblkcache- block cache diagnostics and control
4 Q- x, u# m) }( e# x+ |6 xboot - boot default, i.e., run 'bootcmd'
: j% C9 e5 A# K- U( nbootd - boot default, i.e., run 'bootcmd'! ]- f. t& W4 c! h$ V7 A
bootefi - Boots an EFI payload from memory S/ O4 W7 @5 Q3 \2 x# \
bootelf - Boot from an ELF image in memory o# P, `6 H/ I
booti - boot arm64 Linux Image image from memory
% `/ W' X1 J7 O1 d8 c( gbootm - boot application image from memory7 ?, B: l6 ~1 m* j: Y$ T
============================================================1 T3 k& i# C/ @' ]1 h
bootp - boot image via network using BOOTP/TFTP protocol/ ?+ i; t/ W# P
============================================================0 n+ i% O, I9 v R6 ~& ?# \: j" A3 i
bootvx - Boot vxWorks from an ELF image
, c1 y6 `1 E& u% C% {8 Dbubt - Burn a u-boot image to flash
1 ]$ Y0 t2 X. B- j) M Bcmp - memory compare, Q9 L1 j/ Y3 U. V, l) u
coninfo - print console devices and information; f, ]: a- W, @7 ]$ O$ } w
cp - memory copy- E5 D6 Q) M8 r& R% `6 x ]1 C- d
crc32 - checksum calculation7 e8 j' {1 s( E# n
dcache - enable or disable data cache% J% p+ k2 s( c0 m6 E! x4 |
-------------------------------------------------------------
' }# n$ b9 q+ K9 ]5 tdhcp - boot image via network using DHCP/TFTP protocol9 P" w0 X( K4 E" t# M/ i
-------------------------------------------------------------
* R5 w$ D: C: {' fdm - Driver model low level access G% H8 _2 G4 F& e; e6 B
echo - echo args to console. h1 F6 ~# B4 C0 o* b& J/ {# i
editenv - edit environment variable0 h. K( O& L# ?& }
env - environment handling commands8 x' X9 {& X5 e+ O+ N. w
exit - exit script
8 \1 S4 k9 J2 r/ |% Y1 p+ [ext2load- load binary file from a Ext2 filesystem
; }) d! L! I# {( mext2ls - list files in a directory (default /)# f8 d% D1 t( x6 |. x9 w8 H& s4 ?
ext4load- load binary file from a Ext4 filesystem l- w3 l' Y$ N* C4 c v% h
ext4ls - list files in a directory (default /)/ ]. j0 E) R/ F) G. H8 @
ext4size- determine a file's size: v% Z3 x" L: o
ext4write- create a file in the root directory
$ r# h; l5 y9 F' T0 Dfalse - do nothing, unsuccessfully
% G0 \/ L( G7 z) j* h* n* _, o; dfatinfo - print information about filesystem
: P7 M" }1 R; i& q8 ifatload - load binary file from a dos filesystem
2 Z0 e4 V6 F. M( s* ]6 tfatls - list files in a directory (default /). C/ q" R2 w" a; M; E5 [7 t
fatsize - determine a file's size
& U) c. f; v2 nfdt - flattened device tree utility commands
$ Z8 h0 b1 g# |5 T9 j) Lfstype - Look up a filesystem type
9 K4 A( y3 Q; I* y: B ~$ j+ fgo - start application at address 'addr'' L2 [+ m; H& c: h+ h
gpio - query and control gpio pins
1 V# K) V% _+ Zhelp - print command description/usage$ ?/ o! S9 q! `
i2c - I2C sub-system
& n/ b* c$ R( G' _icache - enable or disable instruction cache
; b2 K/ F$ _6 B) r, L8 C7 Oiminfo - print header information for application image
2 l( f* [. u6 O9 Rir - ir - Reading and changing internal register values.
% X4 ^* E, o G4 E' g/ [+ o5 r 2 @4 B( [* Y/ S' z
) Q8 X$ ^$ X4 _2 m
itest - return true/false on integer compare
. I3 }/ B, u$ q* iload - load binary file from a filesystem
( Z0 ~& U! C* \/ v0 B0 Dloadb - load binary file over serial line (kermit mode)
]8 b9 F" y9 R k1 Gloads - load S-Record file over serial line
* l4 p q/ j$ u1 i8 V4 Floadx - load binary file over serial line (xmodem mode)3 \, y; }& {* C) Q! w/ v5 o0 y' A
loady - load binary file over serial line (ymodem mode)( Z5 g9 O9 v3 ]* U% L; M! g, o9 z* r
loop - infinite loop on address range7 c+ f$ W8 r( B" a* M; e' M, v
ls - list files in a directory (default /)
( K; H! s8 ~! C* P7 q K2 v: D0 alzmadec - lzma uncompress a memory region3 E" H# p) ^% B, ?4 T5 ^
md - memory display
" i4 @; ^ I4 F$ z, y6 `8 C. ~mdio - MDIO utility commands; p) M( g% A$ P9 A
mii - MII utility commands
( i6 n: T) T: |5 Z& M# \mm - memory modify (auto-incrementing address)
! L! L0 S# M# n1 E8 }& M& rmmc - MMC sub system
* g- f" g% h. u! p$ j' Rmmcinfo - display MMC info& w9 K% J$ G; ^+ s" z& O
mw - memory write (fill)
/ D7 Z, p( u O: @1 lnfs - boot image via network using NFS protocol
0 X" B0 y6 w% V" r% |; e$ ynm - memory modify (constant address)6 c: b& j+ B/ f+ A
part - disk partition related commands
2 p1 }7 G: o& fping - send ICMP ECHO_REQUEST to network host- B9 E4 N2 }' y5 ]
printenv- print environment variables( ~( ~$ D# I Y: \: K( P
pxe - commands to get and boot from pxe files
7 \* n. B) S) l/ Iregulator- uclass operations* I3 Z2 w8 T, J
reset - Perform RESET of the CPU% x6 g6 v# t/ D& G5 X+ R
run - run commands in an environment variable
7 L0 w, b! A/ L& n9 Q5 m2 q* O5 D% T* wsave - save file to a filesystem/ `! |. u/ [! L% W( V+ k6 o( [
saveenv - save environment variables to persistent storage" d0 `8 [+ S9 F( u* V+ p
scsi - SCSI sub-system8 S4 o1 h ]8 B$ d
scsiboot- boot from SCSI device7 J4 v9 c' D' q, A
setenv - set environment variables
: M% {$ M8 z2 P: h3 e1 dsf - SPI flash sub-system
2 n0 S& v* N$ g- Vshowvar - print local hushshell variables7 ?$ m) p- y1 ^) O$ o. M8 c& C( m
size - determine a file's size
) |* C+ ^6 q& [; H! Bsleep - delay execution for some time
3 j- m& C9 e/ R. a3 l) p) D! psource - run script from memory
. n/ o, o$ T7 w% ^' Zsspi - SPI utility command" P* ?2 U2 ~/ l5 S8 w
sysboot - command to get and boot from syslinux files
' ^* {) T6 }5 h$ _0 N; h& ntest - minimal test like /bin/sh* _6 l) n' Z+ N& C! |) V \6 ]
tftpboot- boot image via network using TFTP protocol/ x2 L7 d+ `6 o7 L* D
time - run commands and summarize execution time1 U. T5 @: @: Z; a. Y
true - do nothing, successfully
* p" x/ Y7 `& t. V9 K% ~usb - USB sub-system
: Q; V D( N( x# z- fusbboot - boot from USB device
# |' A6 X t4 Gversion - print monitor, compiler and linker version& `3 `' E+ G, M5 D
; P) a% \8 [9 |/ K0 ~ y! O
发现了gpio
# d& D1 t, _" h& `8 ?: n
) D5 \* z4 u3 H' }% H- uarvell>> gpio
+ a# L- Z7 F& x! y/ I. xgpio - query and control gpio pins& }$ W# s+ d* d3 o+ v
0 }# l: e/ H2 a
5 n- W5 B# |& J& v
Usage:1 c& _, D W% i+ _) H
gpio <input|set|clear|toggle> <pin>
3 S2 \, q& A9 d0 D9 K2 T- A% q2 S8 F - input/set/clear/toggle the specified pin n! U Z+ b- b1 o
gpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs
. d$ T* T& ]8 |& T" B8 ]
; T8 R7 _/ b W; e2 a c% @
- G% H i m( sMarvell>> gpio status
6 {; `' V4 I; b* {Bank GPIO2:
: ?& ?; y# C3 i9 ^3 L' M4 IGPIO20: output: 1 [x] sata_pwr
* S+ n J1 o" {. eGPIO221: output: 1 [x] phy_reset G) h. D5 L7 v* L) l7 v
2 x( W% ?/ W5 W. K* B9 J1 L
可见的io脚
- Y: e8 j1 G* V+ q) t8 X ( ], p7 P# \) m0 o. {" I
Marvell>> gpio status -a; L: v9 K3 x; T0 m
Bank GPIO1:
% o& t, u- M" g1 c& q2 A4 k: Q E, LGPIO10: input: 0 [ ]# f2 h' X1 ^- N4 C: E2 R
GPIO11: input: 0 [ ]+ f. e% F8 \$ G* {& N
GPIO12: input: 1 [ ]
- E1 W; R" {/ Z7 j" x4 k1 c, nGPIO13: input: 1 [ ]/ c, D- f7 q! Z. A. J# @) i
GPIO14: input: 1 [ ]' N7 [0 p# C, f7 U- w
GPIO15: input: 1 [ ]: A3 b: r% d% R: `3 L/ ~ ~- O
GPIO16: input: 0 [ ]
3 U! x0 H1 s% Z9 B. lGPIO17: input: 0 [ ]
) C1 C* X$ c. M+ Z0 rGPIO18: input: 0 [ ]; Q [7 u; R6 ]/ f9 B" ~+ H( e) k
GPIO19: input: 0 [ ]
) X# G: q7 q0 qGPIO110: input: 1 [ ]
6 L' |# u' E6 Y" a9 JGPIO111: input: 0 [ ]: X u+ t. |" d1 c0 V) O! I
GPIO112: input: 0 [ ]4 u' R9 j8 i& Z
GPIO113: input: 0 [ ]
0 \& Y3 g) R8 A3 \! |3 y$ F4 jGPIO114: input: 0 [ ]$ O L, V z8 l1 O- j, A
GPIO115: input: 1 [ ]
0 ~7 k a9 S; F6 L: D; l2 j ZGPIO116: input: 1 [ ]
% ~6 _3 ]8 X( H% q) ?& r& qGPIO117: input: 1 [ ]
) H7 u9 l- n M& `GPIO118: input: 1 [ ]6 x7 ?* D2 ~0 z1 e
GPIO119: input: 1 [ ]' w' c/ Z# L/ I w H# m
GPIO120: input: 0 [ ]
# {5 F, L# d, W* B: k# o6 e/ vGPIO121: input: 0 [ ]
! I$ A' \6 J$ OGPIO122: input: 0 [ ]
" g! S. j; L; B5 l/ k( a2 MGPIO123: input: 0 [ ]% w/ i1 g# K. S) W0 Z6 T
GPIO124: input: 0 [ ]. O; P2 ]3 {: |8 W* c4 q* K
GPIO125: input: 0 [ ]: ]/ h: G- {9 m
GPIO126: input: 0 [ ]
1 y* G7 V5 v6 W* h) x( YGPIO127: input: 0 [ ]
" \4 U) Q' \2 E0 i4 JGPIO128: input: 0 [ ]- M* w9 i) O; k
GPIO129: input: 0 [ ]
8 i d2 C' U& B' D" i! O7 g9 oGPIO130: input: 0 [ ]
% ~5 o+ S6 Z: h9 u5 j! s1 c* J NGPIO131: input: 0 [ ]
' k3 a6 P2 d6 j0 }5 bGPIO132: input: 0 [ ]
2 x( A7 y0 f* @) tGPIO133: input: 0 [ ]9 A8 F( k; A" ~( G
GPIO134: input: 0 [ ]
( }* e- v6 s9 ?1 L7 O$ xGPIO135: input: 0 [ ]1 [+ I2 X3 @2 {% i+ J7 m
" ? c; C. R+ ^/ @ / v' U' m) _4 \9 P [) X
Bank GPIO2:
* }) i$ n; z6 \' ^ s/ ^! C! j4 [GPIO20: output: 1 [x] sata_pwr0 |! I. S4 C+ H6 E7 t2 s
GPIO21: input: 0 [ ]! l4 N3 K( J6 N
GPIO22: input: 1 [ ]
; a. P2 B/ p% z6 TGPIO23: input: 1 [ ]( J& c; X1 V3 N$ h5 P- ~) m
GPIO24: input: 1 [ ]
& p% {6 Y7 |# EGPIO25: input: 1 [ ]% @' Y+ @0 V' _/ p$ @( n1 e% ~& T
GPIO26: input: 0 [ ]
# k) I0 T; D. q# ?. a- uGPIO27: input: 1 [ ]
: u/ [6 i% y6 k, E0 S1 ^4 K! d. fGPIO28: input: 1 [ ]( M, _" e: p S) F
GPIO29: input: 1 [ ]
. \# F C, F" e8 D$ I# ^: vGPIO210: input: 1 [ ]. {. D/ p, w! m
GPIO211: input: 1 [ ]
) u1 Z- z. N$ u5 FGPIO212: input: 0 [ ]
- @7 y8 ?7 T' y' Q, ^GPIO213: input: 0 [ ]* [4 @# e, q+ J+ t) r4 V, M" j
GPIO214: input: 1 [ ]2 b5 }' ~0 p n9 T
GPIO215: input: 1 [ ]: u2 o3 v5 k9 S Q8 G- f
GPIO216: input: 1 [ ]/ E, Z3 `) [+ L2 |) S& \
GPIO217: input: 1 [ ]% @& }6 b: R2 c9 i6 q
GPIO218: input: 1 [ ]( i/ R0 V6 r' k6 ^
GPIO219: input: 1 [ ]* [+ H1 Q# E1 A8 U( V& G$ o
GPIO220: input: 0 [ ]- W0 V9 I" F' u$ p
GPIO221: output: 1 [x] phy_reset
# S* t; M" G P9 c! W% O9 OGPIO222: input: 1 [ ]+ J0 H. m1 E Y% h
GPIO223: input: 1 [ ]" A1 I! ]! U7 A% G5 x
GPIO224: input: 1 [ ]
4 B, z4 T! h4 _9 B' q# i$ ]1 |GPIO225: input: 1 [ ]9 j$ N3 k9 |& N9 J8 z
GPIO226: input: 1 [ ]: ?. s( s1 g( R* E, r
GPIO227: input: 0 [ ]
% N+ a% [3 X. bGPIO228: input: 0 [ ]' S& e( ?7 F G7 {' F3 l
GPIO229: input: 0 [ ]
( ^) a5 H9 A0 D2 l# u3 |/ q3 g, n
9 x7 _& d) e* J9 d* N3 K& e- b4 @7 m别的看不懂,只看到一个是硬盘的供电,一个是phy_reset,不知道干什么的。
. W0 A9 g2 l9 E0 W" B$ n. e* ] " `6 }9 T5 D; ~; P
Marvell>> gpio$ ?8 G+ {5 _9 N6 h
gpio - query and control gpio pins5 P! @4 S$ v4 O# E
/ d! X3 y6 [, F , ^- ^# d. ?; P% ^
Usage:
) P9 x \7 f# y* G( cgpio <input|set|clear|toggle> <pin>. x$ o; S' S4 y# w
- input/set/clear/toggle the specified pin; ]0 u/ ^- ]) t- y3 _7 I5 D' Q' I
gpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs
# s5 P8 ~' F0 t {( L7 K0 ]
& Y$ v8 T7 @8 q; v! ~set是置1,clear是置0,toggle八成就是翻转(初中级英语,没办法,全靠猜)' I9 x& W: k4 }( i" x5 t# w
# \) N4 j1 C" e [" q) t0 z, I然后看到env有地方是参数设置,类似dos的环境变量吧
: g0 y& J! a: {) m. P! [
. g0 f4 c( S' ?6 Q, R1 Y# MMarvell>> env print: s! Z$ ~; P8 }$ r# `
arch=arm4 ~3 \( i/ D4 F$ T9 ^. c& }
baudrate=115200
2 [' y' d& v+ x% T+ J* Bboard=mvebu_armada-37xx
0 `" z- d, }) k! _board_name=mvebu_armada-37xx& m |/ \( G7 f) ?6 h
boot_mmc0p1= setenv bootdev mmc 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};% p. Z$ z7 `3 l, _! c' u8 j [
boot_mmc0p2= setenv bootdev mmc 0:2; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};3 @ l0 [4 L4 f; T- C) R
boot_sata=scsi scan; setenv bootdev scsi 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};6 F6 N% v* {) L0 i( _
boot_targets=usb mmc0p1 mmc0p2 sata( j+ f: [6 d N, }/ k5 d3 m
boot_usb=usb start; setenv bootdev usb 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};+ L' W1 h+ y5 E o6 @$ V
bootcmd=gpio input GPIO23; if test $? = 0 ;then echo "Enter button mode";run bootcmd_button;else echo "Enter nomal Mode";run bootcmd_normal;fi
' o- ?5 o: _! u( Pbootcmd_button=for target in ${boot_targets};do run boot_${target}; done;2 X: o3 B& P( B8 k( _- l+ e2 w
bootcmd_normal=run bootcmd_syno;
/ B8 V7 ?0 n: L x8 ybootcmd_syno=run syno_bootargs;sf probe;sf read $loadaddr 0x0D5000 0x306000;echo "syno: start decompressing kernel... ";lzmadec $loadaddr $kernel_addr;sf read $initrd_addr 0x3DB000 0x410000;sf read $fdt_addr 0xd2000 0x3000;booti $kernel_addr $initrd_addr $fdt_addr;
; ?4 { K; C B ^- y3 A8 Dbootdelay=1: C% K) H( s; Z3 e3 x
bootdev=scsi 0:1
4 ]: }# r+ @6 _" j/ Wconsole=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000; e9 r `: S$ x4 s! `" u6 n4 X' ~
cpu=armv80 M/ @! d% q( ~3 U
ethact=neta@300003 L: u& E" }; L+ b
ethaddr=00:11:32:11:22:00# K5 \5 v/ R; Y
ethprime=eth0
2 }& j0 m. @% r+ _4 B/ D- Efdt_addr=0x6000000
$ P, [9 _8 E, g4 Wfdt_high=0xffffffffffffffff
9 T2 b W; r3 p. J. p; r5 m" Mfdtcontroladdr=1f6437d0
& w0 Z9 ]4 M3 M! U8 `4 zgatewayip=192.168.1.254
; @2 J" z. `& a% J6 F1 n2 r' vhostname=catdrive# a# p$ R9 ^# s0 a) X8 f$ l
image_name=/vmlinuz
' p7 C' {2 X5 T) ^# ]; Y" }initrd_addr=0x1100000
( e. @5 K" n2 a7 N5 M4 }) v6 winitrd_size=0x2000000
* @/ u) i& Y+ Nipaddr=192.168.1.1192 J' ?; S$ G" S. j
kernel_addr=0x70000007 M% O( ]7 O1 k( O, n
loadaddr=0x8000000
G! c( b4 b# K$ \% N4 T7 r' `netdev=eth02 l C* I) x4 z P0 A8 L2 n- i8 S8 o* B
netmask=255.255.255.07 u' N4 c( f/ z8 p* n) z
rootpath=/srv/nfs/4 S% f2 R- m# U7 @
scriptaddr=0x6d00000* U! T, \. S: o& ^
serverip=192.168.1.254
7 }1 T% @. _+ E( G2 W- {0 osoc=mvebu
8 o% G, n$ @* z, }stderr=serial@12000
, h7 U" T: M3 Z7 q9 Sstdin=serial@12000
+ b/ \& f) N3 f* ]stdout=serial@12000' E9 b! {7 n0 J8 `; W A7 b
syno_bootargs=setenv bootargs console=ttyS0,115200 ip=off root=/dev/sda1 rw swiotlb=2048 syno_hw_version=DS119j syno_fw_version=M.246 syno_hdd_powerup_seq=1 ihd_num=1 netif_num=1 syno_hdd_enable=40 syno_hdd_act_led=10 flash_size=8 vendor=Marvell
: Q2 A; l3 S/ Z) {7 k5 ^vendor=Marvell% g9 g& o- n. T
3 b' q& o) v- Q" {# h+ @
) K- c" ]$ R9 i+ I6 BEnvironment size: 2001/8188 bytes" x6 L6 D1 w* X5 a1 A' l
Marvell>>) x- j- H; E( |6 @4 \' @
; Y Z) w& q! W0 |3 Z. u看到有一个GPIO23,试了下,原来是reset按钮检测,没什么用。但它有两个启动项,主要是bootcmd_normal,而这又指向bootcmd_syno., F1 ? U W. q. F2 G( I* {
bootcmd_syno=run syno_bootargs;sf probe;sf read $loadaddr 0x0D5000 0x306000;echo "syno: start decompressing kernel... ";lzmadec $loadaddr $kernel_addr;sf read $initrd_addr 0x3DB000 0x410000;sf read $fdt_addr 0xd2000 0x3000;booti $kernel_addr $initrd_addr $fdt_addr;) ], S, g3 e8 @$ i0 l! h
8 a* g+ A- h; d这里好像是群晖引导,一条一条的命令,我又不会改linux的启动呀内核呀,只能在这儿动手了
; f: }# [, d1 u5 x- }2 J+ Kbootdelay=10 ,启动等待时间,1秒,太少,我都来不及按,改成10秒
: B9 L( i2 e3 F0 F + N3 y3 ]! d, E2 W' l( c
bootcmd_syno=gpio clear GPIO221;sleep 10;gpio clear GPIO20;sleep 10;gpio set GPIO221;sleep 10;gpio set GPIO20;sleep 10;run syno_bootargs;sf probe;sf read $loadaddr 0x0D5000 0x306000;echo "syno: start decompressing kernel... ";lzmadec $loadaddr $kernel_addr;sf read $initrd_addr 0x3DB000 0x410000;sf read $fdt_addr 0xd2000 0x3000;booti $kernel_addr $initrd_addr $fdt_addr;6 i& J4 ] ^9 [
5 L8 {. [2 i* e" t( V" q0 B
注意我划掉的那部分,是先给硬盘断电,一会儿再通电,在固态硬盘可用,可能因为固态硬盘启动电流小,冲击小,当用普通盘时,有一定几率会死机,所以用普通盘时,我去掉了。* _* b) f9 ~. o$ j9 q
思路是:% {; N |8 q, E+ O) G& x/ R' d
启动前先把phy那个=0,等10秒,关硬盘,等10秒,phy那个置1,开硬盘。之后正常启动。: ]+ `2 i# K* ^4 ]* o H. _
7 N6 s, b/ c I% Z( i) ~
这样有时能得到IP,但还是会有一定几率不行,所以又加上了网上流行的ping 60秒不通时重启
g6 b7 t- Z2 B2 t- v# {9 P. } 2 P& ^- s3 ~- U7 H/ X, h
控制面板,任务计划-新增-触发的任务-用户定义脚本,开机启动,开机60秒得不到ip 重启
2 q( A+ ^+ L& P2 S1 X4 i# E4 Q& P#!/bin/bash5 z+ d% d# ?0 t5 s; M% ]
dt=`date '+%d/%m/%Y %H:%M:%S'`8 s# o* n1 W/ K) q0 f
echo "$dt"
) Q% Y& E. C/ U! u c- z" f6 wsleep 60
- I: @2 y3 M- knum=`ping -c20 114.114.114.114 | tail -2 | head -1 | cut -f 3 -d"," | cut -f 1 -d"%" | cut -f 2 -d" "`" l$ P6 d* Z; A' G
echo $num
! f7 w% |1 O# }- P7 {; c# u- X$ yecho $?
: T# l' r4 L, @) w" d" s/ oif [ $? -eq 0 -a $num -eq 0 ]; then
8 c( f8 T9 Q3 I; W echo "$dt ok" >> /result.txt
1 h% F: f; k; _) @/ l& @) felse
; S! ]9 B* y c echo "$dt noip loss $num reboot" >> /result.txt
& s9 C1 k9 z9 Q% M, J& X reboot, h3 ?" `5 V1 K5 p* t# ~
fi
: d7 }- _2 z. Z. d) l , c# a( {% G. w& x2 P
第五行,ping后边的IP自己改,我用了一个外网的IP。
- u" Y6 l" t4 {
) E% P2 M, d( ?. |6 }6 {! c9 F总是思路就是,第一次刷完群晖会有ip,挂着硬盘,装系统,设置60秒脚本,重启,如果找不到IP,改bootcmd_syno,再重启等着进系统。- B: ] f: i& g8 c0 P
3 o+ M7 j4 C8 g1 } `- i
我反正试了几天,刚上电,等一会儿根本没有IP,60秒后,会重启,这次绝对有IP。但总要用ttl+shell盯着测试太麻烦,所以又加了一个正常启动后闪led灯的脚本,从网上抄的,忘记上谁发的了,侵权见谅。
2 t- T2 T1 g) K8 c7 c4 t, g- R8 x- y
F- N! w F8 ^$ ^还是上边60秒的地方,再加一条
! r6 x" M+ V2 {1 g 1 X5 Y" ~8 o0 F" }1 [7 a0 r
! c2 c. M/ p# l4 b; E) b
2cset -y -f 0 0x45 0x00 0x55
9 t/ |+ W9 ^5 f" K( U/ ?7 Vi2cset -y -f 0 0x45 0x01 0x01& Z# m8 Y+ |6 y" u7 C
i2cset -y -f 0 0x45 0x30 0x07$ c8 w) {6 z) i4 x5 n8 V
i2cset -y -f 0 0x45 0x31 0x72
@3 j% C( {0 s7 @) bi2cset -y -f 0 0x45 0x32 0x72
# L! d8 I# G) c0 A+ Z+ \" c, Fi2cset -y -f 0 0x45 0x33 0x72# l. f3 Z+ Z& M3 S
#调节三个灯灯每周期上升沿和最高亮度时间
) a) w0 U. S0 g$ t+ w#想要白色的话,把三个灯时间改为一样的就可以了,比如全部设为0x44" _4 l4 c* }: s- L6 C- C/ j
i2cset -y -f 0 0x45 0x37 0x44# x5 e: C( G7 d2 o
i2cset -y -f 0 0x45 0x3a 0x55) g2 n& c1 I; M% s# m( R# W
i2cset -y -f 0 0x45 0x3d 0x66& y$ S7 G+ X/ o+ e8 o
#调节三个灯每周期下降沿时间和关机时间5 \( {7 D: Y! j- Q; e
i2cset -y -f 0 0x45 0x38 0x445 g$ N, {6 _2 n8 e: `$ S6 n
i2cset -y -f 0 0x45 0x3b 0x55
. T( M, s% O5 ^- L; r& N2 p. [i2cset -y -f 0 0x45 0x3e 0x66/ Y" X ?& d9 g5 M3 J
i2cset -y -f 0 0x45 0x39 0x40
; y7 H# V. L$ C+ a3 Ei2cset -y -f 0 0x45 0x3c 0x40
: h3 [+ V' K# I5 o, G4 {i2cset -y -f 0 0x45 0x3f 0x401 A$ Y- b5 o/ |5 q; ^, k
# 0-255,更亮. r/ B( {3 R' i6 W0 q
i2cset -y -f 0 0x45 0x34 128
9 D7 _. Q& K' m& g' _7 D z- oi2cset -y -f 0 0x45 0x35 128- h. s; i) g7 n+ ]8 s/ ^: D, i
i2cset -y -f 0 0x45 0x36 128& K' v% ^ }) c# q$ x9 k
, ?: @2 z9 z/ f然后在这条设置里有一个“先行任务”,设置成上边的60秒,也就是60秒那条执行完才执行这条。而60秒那条,没有ip就会重启,有ip就完成了,就会执行亮灯) G$ }2 w1 Z# U
3 ^# r `. X, l. S9 s& U f/ e# ^ & K/ a0 j1 ^0 d( @
我知道很多大神会做内核解决各种问题,我也知道看起来很小的问题,工作量是非常大的,可能要几个月才能解决,所以大神做的东西是不可能轻易免费发出来的,人家也要吃饭,不可能靠爱发电(我也在公司做简单的技术,知道技术无价的道理)。我从99年学电脑开始,绝大部分的东西都是从网上找来学的,所以非常感谢所有把知识发到网上共享的大神们。
* e, U- F# g6 c9 e8 f) T - R4 i1 Y4 J* |4 H) T5 V
希望大家有条件能测试一下这个方法,如果可行,请发出去让更多的人看到,如果有改进的方法,也请共享出来,因为这个方法换盘好像不方便。
; g. W8 O# E- i |
|