|
发表于 2023-1-18 09:18:32
|
显示全部楼层
转发:我好像解决部分猫盘刷群晖后掉IP的问题了
4 x3 Q% m$ d2 C; E- p/ P) V) K0 i* V/ M
aquila995
! D% O; k3 c% k& P5 F* A8 e: `, p Z/ r8 k! G( }4 Y
于 2020-06-24 16:37:11 发布 M! B C6 `& r+ w: t
0 L- a" s" T: X* e6 V7 n9 S0 i* H' L13215
7 e" b' N, p7 g R, I1 I7 \% V 收藏 13
: l/ \; ^ V0 {+ w$ T分类专栏: 群晖 R& f$ P- K7 q1 z. F. _" n; {
版权% a/ S, P) R$ O9 J4 O
; S. l! U0 q$ ~! ~: d群晖+ z; U( K* O6 o2 O% Z% P
专栏收录该内容
! y7 r- k Q) q% X9 i* b1 H1 篇文章0 订阅
5 k5 ~& Y5 f: N8 R订阅专栏
' c. f. s/ L( L9 W我好像解决部分猫盘刷群晖后掉IP的问题了0 a; b$ m v- c
. D/ ~* v5 T& j: v我好像解决部分猫盘刷群晖后掉IP的问题了/ s. i4 t/ u3 R4 P/ J& m% b: @
5 j( i3 u8 p! W1 z8 [( t0 Q先说我的情况,xianyu上的,到手发现刷群晖后第一次没挂硬盘时可见ip,关机,上硬盘,再开机就一直见不到ip了,没敢一直重启,心疼硬盘。
! j. p% t q& v- |然后刷个X3P用了一段时间,还是想用群晖。上了块固态,试了多次后,应该解决掉IP的问题了,现在挂的是500G普通盘,一直正常。
$ ] p9 Y! d+ M$ E `. c8 Y , K6 X* ?( E6 g( b( W
跳过刷机说重点,每次重刷完群晖都是可以连上的,但重启后就不行了,所以应该不是所谓的虚焊问题,应该是某个设置没有达到,网卡没有工作。
+ @: x/ h& b1 C) o6 ^
9 ~4 n/ O& z( c/ a" t' h7 Z. A然后发现的情况是,如果进到env环境(我也不知道叫什么,反正就是在xshell下一直按回车的环境),网卡是工作的,只是再进到群晖启动时没有工作。
5 ^4 O, B5 F" ]2 c j8 _ ' B# p' t, i9 O! S* p, `; }. f
先看了下有什么可用的命令:# ]: ]$ Y7 s1 i l7 z
- u9 i# U# v3 U U+ ]
Marvell>> help
. y2 W0 T$ K7 D? - alias for 'help'
& w$ b: g8 Q. r9 g% U9 z5 J- mbase - print or set address offset
! l" U5 Y2 `( A/ L2 {bdinfo - print Board Info structure0 N* _- s* c1 \7 ?, j6 Z3 L2 M' ~
blkcache- block cache diagnostics and control
% C# A* M, A* e# u+ C* x) jboot - boot default, i.e., run 'bootcmd'4 g# H8 ?/ Z# g
bootd - boot default, i.e., run 'bootcmd'
2 R( O2 ]& Z; X, |bootefi - Boots an EFI payload from memory
/ A1 l i# t' x4 i t, L2 dbootelf - Boot from an ELF image in memory3 A5 h0 }5 q* c9 C; u5 a
booti - boot arm64 Linux Image image from memory7 x1 h: B: t/ \7 o6 B
bootm - boot application image from memory0 k8 c1 \2 W3 y( H# a
============================================================/ X7 [' u) y- p; O& G
bootp - boot image via network using BOOTP/TFTP protocol
" a/ X1 S6 N" u============================================================
) U. O, L' j$ @% Kbootvx - Boot vxWorks from an ELF image
: P3 d( t0 |, lbubt - Burn a u-boot image to flash, ~: R* l7 [: Q; F2 Q
cmp - memory compare
7 p g' z( N; Sconinfo - print console devices and information4 Z! b- X) O1 Z) \' {$ u/ U
cp - memory copy
k1 Y4 c* b: E% M6 xcrc32 - checksum calculation
) ? c5 W/ b! ?* z/ ]dcache - enable or disable data cache) L/ C5 k5 |; o, t5 @, [
-------------------------------------------------------------! I5 N: E9 u! d# H( }, o0 g3 [+ f& v( e
dhcp - boot image via network using DHCP/TFTP protocol6 i0 G& J' w: ~# t: a1 | O4 s
-------------------------------------------------------------
7 y( R) y+ q# D, G0 G5 M% I. D8 jdm - Driver model low level access0 @, X7 y i5 @% j4 ?
echo - echo args to console+ x4 ^ W8 p {0 l$ ]
editenv - edit environment variable* A1 v2 D6 l& D1 Y! ]
env - environment handling commands
; T! ^ r9 B& }' d" b2 _6 K# ]exit - exit script
2 \: J) h) ^* X( l5 i8 X7 m7 Gext2load- load binary file from a Ext2 filesystem
9 C1 W% \# c* j% A- s! r* eext2ls - list files in a directory (default /)
: c/ X R, m, N* A4 Zext4load- load binary file from a Ext4 filesystem) X) N/ R6 h5 D R; y
ext4ls - list files in a directory (default /)8 N- ^6 B2 [& H2 N N# x
ext4size- determine a file's size
# c5 Z$ Q7 N4 ^! P0 G" o# l6 }ext4write- create a file in the root directory. r5 F3 ]+ [6 v5 q+ D
false - do nothing, unsuccessfully
{* s3 F( Y+ b% bfatinfo - print information about filesystem3 a" \0 P5 M, n4 E& P
fatload - load binary file from a dos filesystem
" b4 g9 |4 F8 ~" {2 W# _fatls - list files in a directory (default /)
' T* |8 h6 ~2 Efatsize - determine a file's size
2 O' e& F. o/ [7 hfdt - flattened device tree utility commands
; v2 c6 G. I7 e/ n, vfstype - Look up a filesystem type
: X$ a: |# Z ygo - start application at address 'addr'
2 Q! T9 d4 p6 e1 S- Jgpio - query and control gpio pins
& G; F" P( P5 ghelp - print command description/usage$ C) c+ M: p) E; v& K
i2c - I2C sub-system
* T7 U, W" Z/ f% B6 R: C7 E1 }icache - enable or disable instruction cache: ^% J/ x7 y4 r! R4 E" B
iminfo - print header information for application image
e3 D p1 |8 K* b9 X6 }ir - ir - Reading and changing internal register values.
% J3 a& W4 O4 S2 b- I# f! p' Q) M5 K & ~0 L: M4 o* S( C$ r( @
' j3 w1 v, Z& k, d, U/ b# ]itest - return true/false on integer compare) ?( x2 q$ }* D$ k0 a
load - load binary file from a filesystem
Z$ Q" t; l% u; H3 l2 |1 iloadb - load binary file over serial line (kermit mode), l5 a3 ^/ B3 A
loads - load S-Record file over serial line9 u: U7 W4 P/ p. f
loadx - load binary file over serial line (xmodem mode)
5 g- f* [2 K) j& n$ _; {( ^loady - load binary file over serial line (ymodem mode)
4 H9 u( I6 M! ^! ~$ lloop - infinite loop on address range- ^0 b* E" I+ m( \: @
ls - list files in a directory (default /)0 S; b; ` O2 t( Q8 d4 t9 y: n: S
lzmadec - lzma uncompress a memory region
' P( L ~' A7 u# Z& ^md - memory display
- ^8 N0 I3 h, |6 ]: omdio - MDIO utility commands
7 ^( _* k% ^9 z0 \7 M. s8 Qmii - MII utility commands3 F& o' ~! [8 D' N- g; z
mm - memory modify (auto-incrementing address)$ g0 E5 c* N( P. P4 w8 D6 R
mmc - MMC sub system* } x, B# E9 V; l
mmcinfo - display MMC info' y9 i8 s$ n [2 p+ `+ I7 V
mw - memory write (fill)
3 U8 }2 d4 I) t. Y% fnfs - boot image via network using NFS protocol( H2 x5 w! O7 ^! m ~
nm - memory modify (constant address)
2 {) g5 m$ N$ Y& f& F! `part - disk partition related commands
% ?7 |% o) a, @4 r$ H6 ^* xping - send ICMP ECHO_REQUEST to network host+ |/ x, c2 y7 k
printenv- print environment variables; X8 ^8 ?& m0 K6 h
pxe - commands to get and boot from pxe files
% _' U9 }0 E8 w' ^regulator- uclass operations
' e, H. H6 X3 D5 {4 M- Xreset - Perform RESET of the CPU( z8 E! a3 t3 X9 f
run - run commands in an environment variable2 v, Y/ l& ^6 I/ n
save - save file to a filesystem0 F3 e, u! _: U( K: Z, B8 Y* e% U
saveenv - save environment variables to persistent storage
1 s0 p) I1 Q. [5 z/ Mscsi - SCSI sub-system# X: O. u. [8 a8 f0 h2 q1 ~. ]" K
scsiboot- boot from SCSI device
5 E5 s/ Y9 G' _setenv - set environment variables
. c: V; x+ ]6 b& k; X0 _sf - SPI flash sub-system
" C7 j, f6 F' A g& ]showvar - print local hushshell variables
1 b, }9 F+ ]( d/ C3 psize - determine a file's size
4 K5 Q% O& F, B5 |sleep - delay execution for some time! N8 j" k4 Z6 Y0 ]+ I( a
source - run script from memory
' R* q5 s7 V' }/ H; p/ e5 zsspi - SPI utility command# F" `0 n& G7 v* }6 V8 I* w
sysboot - command to get and boot from syslinux files% z: {* E0 C, P6 B7 C6 F# c
test - minimal test like /bin/sh% g- r4 g5 z$ _# C/ ~ H$ v* w
tftpboot- boot image via network using TFTP protocol" s* ?; ?& U3 G# t" F7 H. W
time - run commands and summarize execution time
/ h/ i5 \# ]+ E4 p$ ytrue - do nothing, successfully |3 H. O3 W7 V
usb - USB sub-system3 O( v2 ^5 X1 @9 N& V
usbboot - boot from USB device3 {3 {: Z% @1 y
version - print monitor, compiler and linker version. x. A3 y7 i! B' m2 f1 H
/ P b9 ^2 h& t+ M$ E8 Y+ J
发现了gpio
4 X. \% v, A3 [. Q2 H: w4 N 6 D! D4 q9 B7 ]9 V( K4 S) c
arvell>> gpio
* x( e. u6 C( Vgpio - query and control gpio pins
/ q# s# \! f0 M, ]) u - ?4 a5 l. a5 ?3 \
. |) y- V7 i* b" p: S0 lUsage:! x: N, h6 V4 `2 N* Z+ M- O- N
gpio <input|set|clear|toggle> <pin>
! {9 q1 W- |! i6 V* m2 Q+ W7 F - input/set/clear/toggle the specified pin
, D( |3 y5 J- {" n4 Z9 ~gpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs) U" A# ~6 M& \% P: c' x% o; b0 X
6 e w4 P2 k Q
8 S3 B1 K( _7 n! H2 z0 X LMarvell>> gpio status/ V8 ^4 W% b& X+ g7 F
Bank GPIO2:/ J' V" g7 G$ p; C. p2 j6 Y
GPIO20: output: 1 [x] sata_pwr
$ u' X( u, c0 h. U/ D3 IGPIO221: output: 1 [x] phy_reset' L7 `9 `$ Y+ M: v9 [
: z: q7 N; k3 ~/ s可见的io脚
8 t& Z/ |( x6 O8 @9 y, k # K) \, C0 K' t2 X% k+ m
Marvell>> gpio status -a
8 ]2 {/ ]9 {7 w3 J/ Z" y; pBank GPIO1:; ^. [. O; M2 U. H3 h5 H. S. K- Z
GPIO10: input: 0 [ ]* f, H3 x* H: E& U* r) M+ U% {8 b8 ]
GPIO11: input: 0 [ ]" l9 H2 s" [1 V' a8 u' [; ?
GPIO12: input: 1 [ ]
9 I' u6 U2 |& J& ^8 Y2 M: u5 a+ u9 nGPIO13: input: 1 [ ]
7 B" G+ y" h$ e+ Y4 `+ R7 _GPIO14: input: 1 [ ]* w% Y, b6 D! F! @( W! M8 ?1 h9 h
GPIO15: input: 1 [ ]( v. Q! T0 t& H% [ V0 w; C7 F
GPIO16: input: 0 [ ]) k! o1 w6 @8 V/ _3 U7 h# U
GPIO17: input: 0 [ ], M; g0 @: n# a4 z0 p
GPIO18: input: 0 [ ]
) ?8 H) v* @- qGPIO19: input: 0 [ ]% Y! O- O+ B" k6 x6 t t6 Q
GPIO110: input: 1 [ ]
& C1 C# p% N Z6 f' i: zGPIO111: input: 0 [ ]& J+ O5 B; ]; |. j M- ]1 P+ t
GPIO112: input: 0 [ ]
: J; I Z h% _4 h- H: hGPIO113: input: 0 [ ]
8 Z( b5 M7 q3 o6 D; Q( a( q$ I0 eGPIO114: input: 0 [ ]6 o# x" P; o! U
GPIO115: input: 1 [ ]$ l3 C4 A' E0 D% ^, Z* H& [
GPIO116: input: 1 [ ]
: u. O+ `4 I- E1 ]7 HGPIO117: input: 1 [ ]
, Z, `) O5 n5 i+ l$ _GPIO118: input: 1 [ ]: H! |2 e: x7 O3 y# A/ I
GPIO119: input: 1 [ ]
7 V1 W& F# u, e4 B: `9 h9 P' Z& ZGPIO120: input: 0 [ ]" Z& A. b6 @6 U5 ?: G
GPIO121: input: 0 [ ]
! B! I+ {5 H' DGPIO122: input: 0 [ ]
1 ?( A/ X$ c2 A3 SGPIO123: input: 0 [ ]7 F1 g, w h5 a) [- s
GPIO124: input: 0 [ ]
* U3 }. A9 ?! Z1 Q1 aGPIO125: input: 0 [ ]- x& Q( u3 _) r1 w! X6 d
GPIO126: input: 0 [ ]2 F' q1 q3 k7 c9 R4 n
GPIO127: input: 0 [ ]0 @ C2 m/ V1 l4 l2 z/ ]
GPIO128: input: 0 [ ]5 _" V5 D i3 l |% Y) }' K( t
GPIO129: input: 0 [ ]
. v8 }' `5 X# XGPIO130: input: 0 [ ]
! Q: B3 }* ]7 o( b/ I0 _" NGPIO131: input: 0 [ ]
; z' J0 i' @/ rGPIO132: input: 0 [ ]
) O% u5 c" W' {6 v: nGPIO133: input: 0 [ ]# t; |" k- U1 C# l/ D
GPIO134: input: 0 [ ]) w) N! E4 F3 I
GPIO135: input: 0 [ ]
3 I4 N/ S; ^& g, i \" l0 i4 |' F& B 0 Q- \* y. T, h2 q, m
8 j+ e0 `7 d4 ~2 B& MBank GPIO2:4 }" p# q4 }( C" S- Y2 ]! X' A0 ~5 W
GPIO20: output: 1 [x] sata_pwr
) j& ]* f$ F2 |5 t2 [1 t' o4 IGPIO21: input: 0 [ ] R2 s8 T* i7 C
GPIO22: input: 1 [ ]& W# f. i4 J; W) Y
GPIO23: input: 1 [ ]/ {! F1 H& B, B: h; h6 S4 a, N
GPIO24: input: 1 [ ]) u9 K5 m/ S& ?" ?& p5 h5 ?: M
GPIO25: input: 1 [ ]: d# p: v# w. M$ c% l0 R, F3 S
GPIO26: input: 0 [ ]# S9 t6 l. c2 V
GPIO27: input: 1 [ ]+ u( a* S! ? V4 f6 N. I; V
GPIO28: input: 1 [ ]( `) h$ z0 g: Y0 y# M1 l
GPIO29: input: 1 [ ]
. T. @& M$ M. g. ?, g; Y, V) [GPIO210: input: 1 [ ]
0 _$ S2 U& B6 b/ U) E& _% ]GPIO211: input: 1 [ ]
# T( a' ]3 c" X! ~GPIO212: input: 0 [ ]
7 W1 v5 }$ t o& CGPIO213: input: 0 [ ]/ q0 y& ~5 u% d1 n$ I# p% J
GPIO214: input: 1 [ ]; ~: x# I' s& G* P3 M4 Z' O
GPIO215: input: 1 [ ]; b$ K8 [+ z" H
GPIO216: input: 1 [ ]
* U( t% P9 I& Y. Q3 a6 sGPIO217: input: 1 [ ]6 U8 Q y% A1 v" s6 p
GPIO218: input: 1 [ ]$ K: }" l) \9 l6 k9 Q7 ~0 L
GPIO219: input: 1 [ ]
3 h: [* J# q5 A: X/ o& g% KGPIO220: input: 0 [ ]
( U+ H' V! ~' x1 q, R3 fGPIO221: output: 1 [x] phy_reset9 Y0 z' g; c. n2 c' q
GPIO222: input: 1 [ ]: _7 p( \, y; _* I0 [: _, _
GPIO223: input: 1 [ ]) f5 m1 h) W( n- l4 [
GPIO224: input: 1 [ ]6 b1 _" m7 w1 X% T8 e# D
GPIO225: input: 1 [ ]
- L- m: }: E: K/ {# |- WGPIO226: input: 1 [ ]9 z' U/ a- f) N5 n
GPIO227: input: 0 [ ]5 i+ B; p' ?4 w! n- {! x. ?
GPIO228: input: 0 [ ]
4 s4 z8 H' N2 NGPIO229: input: 0 [ ]* i5 v% z( \8 y! f8 d8 I- `) R
5 l! l- I9 T# R4 p1 B/ c3 |$ c' ~别的看不懂,只看到一个是硬盘的供电,一个是phy_reset,不知道干什么的。
5 ^! I8 P6 c) h4 q8 G, W( Q! C 5 n) m( `6 d* ^/ [. _
Marvell>> gpio
" _4 H, B8 d! N$ o; G9 L, T/ Xgpio - query and control gpio pins, ^# t* _+ g' ^+ {$ f- F* Y6 g
2 Z1 L: {, k2 N3 b6 l, {
5 T! N4 O$ ~9 @! n. p8 wUsage:4 K( d/ u$ ~8 S1 {0 b# }
gpio <input|set|clear|toggle> <pin>
( Q2 R* }: c# g2 d - input/set/clear/toggle the specified pin
* s' p/ Z, H; u! rgpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs4 @$ b) [ J8 F8 H
1 h6 {, z/ ]8 C# b' L; d" r/ |
set是置1,clear是置0,toggle八成就是翻转(初中级英语,没办法,全靠猜)
! I$ B e+ k0 q2 a; J
5 X9 K5 S& y5 }" ~% A6 c7 [0 K5 c然后看到env有地方是参数设置,类似dos的环境变量吧
. d- @ B( F u! k8 @
$ F' P/ u) V2 ?# KMarvell>> env print3 D3 Z% j7 o8 Y! P0 M! \
arch=arm
& `$ H5 w5 P. z8 W3 Ybaudrate=115200+ x2 Z5 z/ G% S2 f
board=mvebu_armada-37xx
Z% @3 W: ?4 K* y6 B: \0 fboard_name=mvebu_armada-37xx
- r& b$ O, n3 `# z Cboot_mmc0p1= setenv bootdev mmc 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
/ Q' \3 p. M; G( B2 O. E! Lboot_mmc0p2= setenv bootdev mmc 0:2; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
% s6 r7 C9 b5 Hboot_sata=scsi scan; setenv bootdev scsi 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
' [$ g7 \( p6 F- b, ?$ ]boot_targets=usb mmc0p1 mmc0p2 sata
; q. U2 z# W4 Zboot_usb=usb start; setenv bootdev usb 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
# e1 v' \# a0 P7 O* X8 F5 I0 g: wbootcmd=gpio input GPIO23; if test $? = 0 ;then echo "Enter button mode";run bootcmd_button;else echo "Enter nomal Mode";run bootcmd_normal;fi: }2 ?2 x. C8 {: @' y
bootcmd_button=for target in ${boot_targets};do run boot_${target}; done;3 s) Y! l. S2 i( ~& i+ q5 ]. {- t! W
bootcmd_normal=run bootcmd_syno;
5 i7 A% C: @ u$ P3 R& J' U2 [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;& \" g A8 \( F P# c
bootdelay=1
/ X; i# O* a, Y/ l/ hbootdev=scsi 0:1
& t$ k8 l1 p4 \ m/ vconsole=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000
1 j+ R' w7 p% B9 S3 ]- m B' _cpu=armv8% l {0 S" `1 n" w6 `8 S6 p
ethact=neta@30000* o4 a2 Q6 ?; P% T
ethaddr=00:11:32:11:22:00- Q4 X$ f! ]4 i
ethprime=eth02 Y9 \5 N& a) O) q
fdt_addr=0x6000000
% d* s' _: O3 {( K2 Yfdt_high=0xffffffffffffffff: Z/ m# X. L: d% Y
fdtcontroladdr=1f6437d00 l) p2 z6 P3 [( @( j o3 B' K
gatewayip=192.168.1.254
" |9 s2 U/ X/ n( s7 [2 r; `hostname=catdrive
/ U* q# v- a8 ^% l3 Q0 B) r+ a4 zimage_name=/vmlinuz) P% ]* P% W, V/ h2 I3 u
initrd_addr=0x1100000
7 n7 D2 Y. c4 F$ N: i% x! }3 m- vinitrd_size=0x2000000& n$ {4 f0 y1 L) y) H' U
ipaddr=192.168.1.119
6 @7 V5 F) ^! Q0 g% Zkernel_addr=0x7000000- A, l5 |" l0 z' u. I) ^0 _
loadaddr=0x8000000+ F$ v2 u- M9 a! U* C
netdev=eth0
4 [! F( p0 Q, E) V4 [netmask=255.255.255.0
{* m& c' y4 ?rootpath=/srv/nfs/
. N x$ U" g7 J4 r' nscriptaddr=0x6d00000
2 H/ H( P8 Z: }2 Y! Bserverip=192.168.1.254
& X/ [9 Z. [; h1 M0 X! E# tsoc=mvebu
: V3 g7 O' e! r0 Rstderr=serial@12000# d$ b& b' k2 ]* y: O
stdin=serial@120001 e' V* l9 l( A. A% e
stdout=serial@12000' ?6 B/ b: ^% [* D+ g& H( {
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
! v- B4 I9 C9 M% avendor=Marvell/ S8 m; g& X2 }% j& d& `
- ^, F |. x# s! J % l! d" ^5 d- C
Environment size: 2001/8188 bytes( s2 w5 M3 ?- P1 r. v
Marvell>>( U9 ~2 V% y5 X' I/ a4 b& t1 ?4 `
/ a% R/ J' m/ S$ }1 s看到有一个GPIO23,试了下,原来是reset按钮检测,没什么用。但它有两个启动项,主要是bootcmd_normal,而这又指向bootcmd_syno.7 D0 [: W" U# D1 f V+ g3 K
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;
0 v- @. p# d" C 8 `, `8 B0 ]8 C
这里好像是群晖引导,一条一条的命令,我又不会改linux的启动呀内核呀,只能在这儿动手了. h$ ~" ]% a- b" i0 _8 Q. N
bootdelay=10 ,启动等待时间,1秒,太少,我都来不及按,改成10秒( w% B; j6 l* T& Z3 G" L; l( K2 c
8 w7 v! `' ?0 j0 q
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;
! u& A3 O2 U' _1 K: I9 t7 f' j " V" M4 s9 V& | y" ^! v/ {
注意我划掉的那部分,是先给硬盘断电,一会儿再通电,在固态硬盘可用,可能因为固态硬盘启动电流小,冲击小,当用普通盘时,有一定几率会死机,所以用普通盘时,我去掉了。
& r- n. b7 @, c, b& M. }6 x# y$ C H思路是:3 C% L' `# I# a4 Z
启动前先把phy那个=0,等10秒,关硬盘,等10秒,phy那个置1,开硬盘。之后正常启动。2 F/ R f8 _( ^0 {1 |, t
d' @) ?! f3 @6 \9 i% p这样有时能得到IP,但还是会有一定几率不行,所以又加上了网上流行的ping 60秒不通时重启
6 P' O$ t! J d+ \! y3 C 8 a& U! O3 e: e: _7 _% o9 a
控制面板,任务计划-新增-触发的任务-用户定义脚本,开机启动,开机60秒得不到ip 重启
6 \& M" X/ v' |9 @3 d#!/bin/bash4 L& t' t* W+ r( E; B
dt=`date '+%d/%m/%Y %H:%M:%S'`2 F2 m+ R; S: @6 R$ \& w, Y
echo "$dt"! b- G b) U/ m% c4 f( |4 O5 V
sleep 60* ~+ ]. Y/ `+ ?3 j# X
num=`ping -c20 114.114.114.114 | tail -2 | head -1 | cut -f 3 -d"," | cut -f 1 -d"%" | cut -f 2 -d" "`
% F) b) q* r( {7 vecho $num! A/ Q7 {' |' U4 {; \( \5 X2 z
echo $?
5 u: @) e- g. I* S. W+ Wif [ $? -eq 0 -a $num -eq 0 ]; then
, F+ d1 s/ m: b1 U* K6 S& W% ~! W3 ^ echo "$dt ok" >> /result.txt
" i2 t5 t+ X8 @# ~else
1 A% J5 E7 w/ p7 t9 O echo "$dt noip loss $num reboot" >> /result.txt- C- m# c% g3 f2 J
reboot) w/ |" q0 Q6 g$ g/ E8 L9 e/ p
fi/ U1 Y4 n7 T& h+ b) |
) q& k1 p6 n8 W/ ?% ]
第五行,ping后边的IP自己改,我用了一个外网的IP。
9 R7 O; i3 ~6 u8 ~( ]. O) U
$ N4 G5 P8 G! l2 Z总是思路就是,第一次刷完群晖会有ip,挂着硬盘,装系统,设置60秒脚本,重启,如果找不到IP,改bootcmd_syno,再重启等着进系统。1 i, V% D; A6 J- Z
' g! w: p& }! l$ [
我反正试了几天,刚上电,等一会儿根本没有IP,60秒后,会重启,这次绝对有IP。但总要用ttl+shell盯着测试太麻烦,所以又加了一个正常启动后闪led灯的脚本,从网上抄的,忘记上谁发的了,侵权见谅。
& Z2 ]3 m' e5 W Y& `% \! k
* u7 y4 T5 V# B% q' }还是上边60秒的地方,再加一条/ l0 Z; A! y: r( q6 m
6 J! E1 P: b! ^- ~
+ \4 O' c9 C3 J( W Y
2cset -y -f 0 0x45 0x00 0x55
4 [( ^; p1 k, W- j1 Ki2cset -y -f 0 0x45 0x01 0x01
$ V+ m, x: W* S$ B. b% Y" L, x h* ]i2cset -y -f 0 0x45 0x30 0x07' B3 _0 }% o% N) Y
i2cset -y -f 0 0x45 0x31 0x72
Z- z* x. r G, g) u, si2cset -y -f 0 0x45 0x32 0x72
* O) T& _& x. Xi2cset -y -f 0 0x45 0x33 0x72
3 ]1 D3 i# v% O2 Q( J- G' g#调节三个灯灯每周期上升沿和最高亮度时间8 Q+ Y. w { l* Q6 C' E3 ^. u+ {
#想要白色的话,把三个灯时间改为一样的就可以了,比如全部设为0x44# k" R* s( }% q- ^( @7 Z
i2cset -y -f 0 0x45 0x37 0x44
9 Y6 {7 q8 J1 N a# [2 y# i" ~9 J; fi2cset -y -f 0 0x45 0x3a 0x55% n# q' U$ o3 |, s: \ X
i2cset -y -f 0 0x45 0x3d 0x669 ~ D+ Y5 |1 t" ^& r/ L4 A
#调节三个灯每周期下降沿时间和关机时间1 }' m: f4 s3 O( H7 Q
i2cset -y -f 0 0x45 0x38 0x447 B9 Z0 U4 F c) p4 x* i
i2cset -y -f 0 0x45 0x3b 0x550 x$ H8 r3 m6 {( Q' w
i2cset -y -f 0 0x45 0x3e 0x66
" H, ?7 Z! n/ `9 vi2cset -y -f 0 0x45 0x39 0x40; F" |! [+ J" L3 s( \7 p5 `
i2cset -y -f 0 0x45 0x3c 0x40: M/ P. ^3 M: Q2 P# z
i2cset -y -f 0 0x45 0x3f 0x40" s6 J$ ~8 D K% j6 i* k
# 0-255,更亮
+ R8 m" j2 c7 G! m+ @* Y: _i2cset -y -f 0 0x45 0x34 128
' k: N& j0 |5 W$ a; v+ _ _i2cset -y -f 0 0x45 0x35 1280 C: M3 r7 y: {) U- S% u3 u7 K2 V
i2cset -y -f 0 0x45 0x36 128
/ D3 U% P( O6 h# s( f1 Z: N ' y6 s/ G9 ? f$ t3 P" C
然后在这条设置里有一个“先行任务”,设置成上边的60秒,也就是60秒那条执行完才执行这条。而60秒那条,没有ip就会重启,有ip就完成了,就会执行亮灯; O$ }5 W8 K( q2 x4 @ T
1 ^- J' }/ Z( x/ L& n
* H4 w, u5 o5 e我知道很多大神会做内核解决各种问题,我也知道看起来很小的问题,工作量是非常大的,可能要几个月才能解决,所以大神做的东西是不可能轻易免费发出来的,人家也要吃饭,不可能靠爱发电(我也在公司做简单的技术,知道技术无价的道理)。我从99年学电脑开始,绝大部分的东西都是从网上找来学的,所以非常感谢所有把知识发到网上共享的大神们。# C0 M7 e4 r: J6 P
1 }, a7 w6 ]/ G! s9 V. c, Y
希望大家有条件能测试一下这个方法,如果可行,请发出去让更多的人看到,如果有改进的方法,也请共享出来,因为这个方法换盘好像不方便。! D2 K l2 E/ u9 J" p
|
|