|
|
发表于 2023-1-18 09:18:32
|
显示全部楼层
转发:我好像解决部分猫盘刷群晖后掉IP的问题了
# T. V) ~) ^1 p7 K
5 ^3 ?; t/ x7 |& x- Baquila995) F# b9 f3 k5 m8 }% y( K* k
; b' S' O0 D5 V" M" o; i
于 2020-06-24 16:37:11 发布- ]; y6 w' w; I& [$ _
( h6 @; a, F% b1 L/ ?9 g* t# j132151 h: O' g2 y1 f, J1 }5 F4 l2 n
收藏 13
( F- H( \$ x' E6 i5 O1 t8 M+ P分类专栏: 群晖+ v5 f8 d' d, ]7 P M7 H- [$ V7 W
版权% x. y+ a3 ?, z0 D5 k+ }1 k
4 \; c" D+ } C1 Q& F
群晖
( b& N( k- `) n8 m专栏收录该内容: W& t/ j0 ?( q3 g
1 篇文章0 订阅
# \) z6 {& D7 ^订阅专栏
* S- a) S8 p, d- C9 T. Z8 L! e# v我好像解决部分猫盘刷群晖后掉IP的问题了
5 v' }" O" i7 ~8 w2 E( a4 H. _
6 M/ k3 E' X0 E. n# j! w0 |我好像解决部分猫盘刷群晖后掉IP的问题了6 `4 T% P4 Q2 ^' n' O# y A
$ N w: q" o' M) @6 D; n先说我的情况,xianyu上的,到手发现刷群晖后第一次没挂硬盘时可见ip,关机,上硬盘,再开机就一直见不到ip了,没敢一直重启,心疼硬盘。% S3 z0 H- k8 P. O! I& F7 J
然后刷个X3P用了一段时间,还是想用群晖。上了块固态,试了多次后,应该解决掉IP的问题了,现在挂的是500G普通盘,一直正常。
1 T; h' l3 @+ W" J6 T 0 c! R/ m$ l; K
跳过刷机说重点,每次重刷完群晖都是可以连上的,但重启后就不行了,所以应该不是所谓的虚焊问题,应该是某个设置没有达到,网卡没有工作。
7 }& Y& {* w$ ]4 M 6 i, W- C4 U. v5 t7 K o4 P
然后发现的情况是,如果进到env环境(我也不知道叫什么,反正就是在xshell下一直按回车的环境),网卡是工作的,只是再进到群晖启动时没有工作。
* i* d% d4 e9 X
. ^2 W% p: d% l先看了下有什么可用的命令:
! P& a8 W6 c& a$ W' J ! o C- U7 S: V4 I% k: K6 p
Marvell>> help
- P3 F0 n3 q$ u8 ]? - alias for 'help'8 [9 r7 \% n; m4 r2 Z" e' v
base - print or set address offset
3 a5 }& }7 K4 Ubdinfo - print Board Info structure
: Z+ o* U ^' ~. tblkcache- block cache diagnostics and control% k, _9 D0 g5 z2 G- {: S5 w3 D5 y: t
boot - boot default, i.e., run 'bootcmd'" p: c" h' j6 C: M. o+ o0 B
bootd - boot default, i.e., run 'bootcmd'4 |; r$ ~# C6 P
bootefi - Boots an EFI payload from memory9 J, L3 |# Y" }4 J; I
bootelf - Boot from an ELF image in memory
* W5 a8 Y+ Q' x; H* q1 _booti - boot arm64 Linux Image image from memory
, m, ?) p9 }( S4 `bootm - boot application image from memory/ M0 |, Y2 z+ C3 a) U; r
============================================================
6 P% c5 u7 U+ S B9 Q6 ?% ^bootp - boot image via network using BOOTP/TFTP protocol2 D8 z' Q- j5 R; Y; z R
============================================================! q/ x$ h% S& |7 {2 r' O1 P) m( H
bootvx - Boot vxWorks from an ELF image; N/ J l( w9 }0 i1 m9 x& c4 ?
bubt - Burn a u-boot image to flash3 x4 O% o* n7 {* ?8 Z' i
cmp - memory compare6 x" J* s% f; ]: ^; M- D/ d
coninfo - print console devices and information* T6 v/ M$ i& N- a# b1 M
cp - memory copy4 [* g% K$ O m; t s3 |9 Q
crc32 - checksum calculation( x2 {5 d$ B& w2 \
dcache - enable or disable data cache
' a2 g1 r; d/ {8 u-------------------------------------------------------------* \. Q- l! ?/ k1 |2 S+ ~
dhcp - boot image via network using DHCP/TFTP protocol
u8 M I3 _- Z$ T-------------------------------------------------------------
: k7 a+ z- x0 ]/ idm - Driver model low level access7 b$ l! p. Q' Z2 i& y# f$ N0 Z0 }
echo - echo args to console
6 C+ t1 Y; V6 s$ Neditenv - edit environment variable
! l5 W. e* J% z+ ]6 ~$ ^' ^' b& Zenv - environment handling commands2 P# M: N$ f# K( r/ M
exit - exit script
& R! X6 G) V: K4 y( X0 ~ext2load- load binary file from a Ext2 filesystem
}+ a) H+ r6 c, m" uext2ls - list files in a directory (default /)
% r; R6 w% l& T$ ?, Lext4load- load binary file from a Ext4 filesystem
) @+ |4 f% K; O1 g; k& ~ext4ls - list files in a directory (default /)
7 E! H$ c; b; `; u6 y, aext4size- determine a file's size
$ ?4 [2 q9 B( X9 rext4write- create a file in the root directory5 z& p: J0 ]& J& D$ ]
false - do nothing, unsuccessfully* d" ~, i( a8 H% S1 b& `5 [
fatinfo - print information about filesystem4 M N& }; E( ? S5 L" }' h
fatload - load binary file from a dos filesystem, a( e7 e* i( b% B' B4 `- x3 F) s
fatls - list files in a directory (default /)- X' p9 j* \3 J- l" H
fatsize - determine a file's size9 C0 E5 }% M% k1 [
fdt - flattened device tree utility commands
/ y# G! m6 x( I* D+ A* G: Cfstype - Look up a filesystem type; |0 v: L4 |$ o" x0 n9 l% C' H
go - start application at address 'addr'
- ?+ m+ X: O O" lgpio - query and control gpio pins
M7 K4 L; H2 w9 Mhelp - print command description/usage
: M6 ~! g# i5 m2 R/ m0 }! Vi2c - I2C sub-system& r6 {* T: V9 t+ q, H
icache - enable or disable instruction cache a* M5 Y2 a+ i# |" G( v# `2 f0 b9 Y
iminfo - print header information for application image% H+ x* Z, V- T( u' a w
ir - ir - Reading and changing internal register values.1 i* X, i1 P) J0 a7 U
_, ^1 w1 n+ W. J' A. {) l- ?
. s7 ~2 K8 J& q" J t2 Eitest - return true/false on integer compare# s+ j6 z* {& m, t1 O6 G. [# T# A
load - load binary file from a filesystem
! T1 E7 i& H- h- yloadb - load binary file over serial line (kermit mode)0 G! ?% l# W% x1 i* |$ @7 S
loads - load S-Record file over serial line6 g( U, [3 x. n. l& }4 X5 U7 Q a
loadx - load binary file over serial line (xmodem mode)
6 k- t& `/ i; s) t X# aloady - load binary file over serial line (ymodem mode)
3 y' r$ F) ?4 s7 j/ sloop - infinite loop on address range' C* N5 v. o8 ^
ls - list files in a directory (default /)
& a2 b! q g( ~$ o# N5 k1 G& qlzmadec - lzma uncompress a memory region7 {7 u4 `9 p5 ?& U* M( |3 u# M. j6 ?
md - memory display
& O' o0 O" l+ bmdio - MDIO utility commands
/ \2 H' B) a# ]& Pmii - MII utility commands
( ~; [! V/ _6 e; r9 vmm - memory modify (auto-incrementing address); P4 G) r" m9 c( y% Z1 w" O' E
mmc - MMC sub system
! Q6 A( h6 g& P4 E; Y8 S( k+ g- |mmcinfo - display MMC info# p1 k6 t$ A! }6 ~8 P6 q( F1 U
mw - memory write (fill)3 K( j5 o' W) s! `% I( B$ `5 y
nfs - boot image via network using NFS protocol9 _3 J- r" q4 ] s% m9 ~( M
nm - memory modify (constant address)
4 Z+ L! n+ b8 ^/ Zpart - disk partition related commands
6 u! L0 @6 o7 g9 y! {ping - send ICMP ECHO_REQUEST to network host
" D; ]3 m0 v" ?+ @: c3 o& w& Qprintenv- print environment variables: a; H8 }9 `' O
pxe - commands to get and boot from pxe files
: K) ?; `5 E7 K) |4 vregulator- uclass operations/ ?, x% y( q9 h& ~
reset - Perform RESET of the CPU
1 H. y' V V% t3 `* o$ U5 v' N. w' H$ T2 Trun - run commands in an environment variable5 i( D$ ^# S( u& r; J$ X* ]
save - save file to a filesystem
0 J/ u) V1 E+ Qsaveenv - save environment variables to persistent storage W2 B1 Q& x9 @$ H b
scsi - SCSI sub-system
, o H* w( y9 w' O) m) cscsiboot- boot from SCSI device
' f3 K `; ]+ Q) v3 ?3 H# h3 e; Wsetenv - set environment variables
) E. ^. J9 M! a$ \) I8 tsf - SPI flash sub-system
: _: V8 A/ @- e' E" y, vshowvar - print local hushshell variables7 Q* |9 w' b/ e$ e. z
size - determine a file's size
$ V! b9 B6 i5 E7 Ssleep - delay execution for some time8 e' ~2 M: [& O4 K% _
source - run script from memory
3 g" J$ u% c! n' h0 O+ ^sspi - SPI utility command
% Y4 y, f3 t) R f+ L( y$ o5 B jsysboot - command to get and boot from syslinux files( Z* \5 G' Q4 o4 L9 w
test - minimal test like /bin/sh o* ~6 U2 @; b
tftpboot- boot image via network using TFTP protocol
`: o3 X1 r( v$ i* o& htime - run commands and summarize execution time
3 D) r1 I9 f/ ?! }2 Htrue - do nothing, successfully
! |1 ?% u: n& I4 q* Y8 lusb - USB sub-system) B% l" U2 y, o' I0 ^
usbboot - boot from USB device
. O/ |: _2 w/ {% T3 D6 _% Nversion - print monitor, compiler and linker version% G$ j! M- _7 |- U8 x) @$ l
# M6 O" A9 t! o6 }7 }: J发现了gpio
" E' t( i! M( [1 x& ]" ]% C 1 Z0 x5 O; ~3 K X j1 [4 R
arvell>> gpio
3 Z( v7 m8 R# I- y+ k% z) @5 y0 Cgpio - query and control gpio pins+ g. F: @3 W5 u4 S( P
3 J/ ]8 d/ m8 ^4 p& @+ [ 6 l2 n2 Y( E9 T
Usage:. X: V! B" w1 k( j1 P
gpio <input|set|clear|toggle> <pin>
! c8 O9 Z1 k9 ~$ {& x; W) B - input/set/clear/toggle the specified pin
2 |# y, R" X" \3 [0 Z. ygpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs! @( ] j- c2 L- K! r2 j- D7 b
- V6 J, B+ [8 b9 k3 }' e
2 T; Q9 K% m' M) I3 {
Marvell>> gpio status
4 o3 J8 n$ g, rBank GPIO2:, O3 V5 t0 I/ N
GPIO20: output: 1 [x] sata_pwr, m3 p2 ]) Z8 h3 m. u
GPIO221: output: 1 [x] phy_reset4 n# A/ Z3 g, q- p% W# @
, i8 H0 p+ G. z j可见的io脚
- t" I6 U t3 S! w8 \ 4 [9 ^' t& R& U4 `" a% V
Marvell>> gpio status -a. l/ T9 x; w3 M
Bank GPIO1:
5 p! D# ?1 u, q e9 qGPIO10: input: 0 [ ]
# G: A! \9 l0 u8 ^1 o2 v) LGPIO11: input: 0 [ ]3 h+ ~ L- h2 p7 [7 Z. I
GPIO12: input: 1 [ ]# u" J. X' r' o
GPIO13: input: 1 [ ]
: E v7 B: ]0 T* b0 f+ F& C( zGPIO14: input: 1 [ ]8 ~1 b& C/ t8 o+ G3 \
GPIO15: input: 1 [ ]. g7 K) ~$ l' M* T
GPIO16: input: 0 [ ]
' [& P0 R- S' KGPIO17: input: 0 [ ]# x4 e, l: Y& f' }, {) M l. \/ J. ?& G1 \
GPIO18: input: 0 [ ]- u" I- l m, z% u0 U4 m
GPIO19: input: 0 [ ]
; \) T( t# M& BGPIO110: input: 1 [ ]2 Q. j5 k7 D$ E, _, m! X( N9 D
GPIO111: input: 0 [ ]! H+ q" K7 S8 v0 p5 M. c
GPIO112: input: 0 [ ]
7 A6 F, X3 b: J2 f# ~GPIO113: input: 0 [ ]
. B" [% B# M8 W% ~& i8 c( a+ YGPIO114: input: 0 [ ]+ o; e; E+ G5 s- O) _
GPIO115: input: 1 [ ]
o, D' N2 h1 l' qGPIO116: input: 1 [ ]' _) e0 Q" P4 o
GPIO117: input: 1 [ ]7 s3 _, x n9 W+ A" |) s4 z
GPIO118: input: 1 [ ]% }) R C& g O: u, Z
GPIO119: input: 1 [ ]; L& P$ f+ R4 M: B, Y* o7 @' R
GPIO120: input: 0 [ ]
7 R% G. B D. Z' k& CGPIO121: input: 0 [ ]
4 H* x+ N. G1 d2 KGPIO122: input: 0 [ ]1 x% |0 z9 p. S `: [/ \
GPIO123: input: 0 [ ]
# @& r6 w8 q( s5 J4 }: E5 dGPIO124: input: 0 [ ]2 O" R8 L P3 A( f! |: M
GPIO125: input: 0 [ ]
1 a& g5 `# |" M- k; E' C$ gGPIO126: input: 0 [ ]! J# @. s# b; v1 I6 p8 }/ {5 c9 n
GPIO127: input: 0 [ ]
, R% y+ b Z P3 OGPIO128: input: 0 [ ]
. I9 ]2 i7 w* ? v, k+ g+ gGPIO129: input: 0 [ ]
# a; d8 A0 u0 WGPIO130: input: 0 [ ]
4 L0 M* p( _/ Q4 \2 n/ NGPIO131: input: 0 [ ]5 J+ _0 ?* X1 ?8 s
GPIO132: input: 0 [ ]
1 P+ G; ~* N2 b0 `$ @GPIO133: input: 0 [ ]
/ Z7 {5 o- I; ]+ mGPIO134: input: 0 [ ]1 u5 E$ F8 Q9 C/ {/ t
GPIO135: input: 0 [ ]
' ~: V0 w1 z! I& x8 j' j3 u
6 S+ F, _" Y* u$ ^8 s& t+ r6 e; H F/ \) U7 |( \2 X$ a
Bank GPIO2:
& _; C* X$ g' k) B, \& e. \+ ~3 tGPIO20: output: 1 [x] sata_pwr
g# s Y1 d, ?# mGPIO21: input: 0 [ ]
2 y+ T( p3 _) F) qGPIO22: input: 1 [ ]
- L0 [' H5 p' q4 L( n) GGPIO23: input: 1 [ ]
+ |1 j# S5 \0 k( XGPIO24: input: 1 [ ]9 T8 s' Y1 B x1 U
GPIO25: input: 1 [ ]
9 y# m7 l2 y3 n+ G: zGPIO26: input: 0 [ ], a4 V! k. p5 s/ ?" d
GPIO27: input: 1 [ ]
. B V# o0 _! j0 I w. |, vGPIO28: input: 1 [ ]: n% L/ N, G7 m. n! n# y
GPIO29: input: 1 [ ]5 i# @( e% i m$ c: A
GPIO210: input: 1 [ ]% z3 `' x$ z" g4 a6 h1 Z
GPIO211: input: 1 [ ]/ ^' U3 c; s O7 _4 B$ x% _
GPIO212: input: 0 [ ]
1 k4 v& v7 Z. b" a' X" ]GPIO213: input: 0 [ ]5 P; S4 `7 L' E" G% R( s
GPIO214: input: 1 [ ]3 |) K# G1 y) ]9 D! f2 J
GPIO215: input: 1 [ ]
. k9 K) [( U: W& J, qGPIO216: input: 1 [ ]- s5 V5 A4 X* Y
GPIO217: input: 1 [ ]. J4 o4 T# o2 {$ b: g% L
GPIO218: input: 1 [ ]1 O( V" A8 j: B/ L( ?; B9 R: i
GPIO219: input: 1 [ ]# f1 Y! i7 o9 e c: o$ C
GPIO220: input: 0 [ ]
5 Q# ~, f* ?+ ?" b" PGPIO221: output: 1 [x] phy_reset/ Y8 b( }# O$ r: g. L: Y
GPIO222: input: 1 [ ]
, k2 l4 }6 s5 E! k, \) }GPIO223: input: 1 [ ]
8 f5 U* B* v* l7 A; t- k" h) nGPIO224: input: 1 [ ]
/ ~- z7 @: y) U1 K" LGPIO225: input: 1 [ ]
2 O/ }# F* k7 Y; c/ ~: Z* g0 ~ lGPIO226: input: 1 [ ]% p- x" b& x) R: K) b
GPIO227: input: 0 [ ]0 T' ~7 i) P; \ f5 {+ w
GPIO228: input: 0 [ ]3 j d, d# b) X8 \( E6 q
GPIO229: input: 0 [ ]
0 G' B+ H; A& h , a0 s6 s* C! o6 B$ b- Q, D' l
别的看不懂,只看到一个是硬盘的供电,一个是phy_reset,不知道干什么的。
: ^( ~( M5 r/ k & i {5 \3 C/ ^9 t5 ^
Marvell>> gpio6 |* ], c8 j8 n4 ~& B0 [- L) p
gpio - query and control gpio pins- c6 ]$ \) H6 c2 }; G0 M1 p* g; W
& @9 P2 E! m- W
" X5 Y& r9 x% _
Usage:
+ v6 N5 N; j- k: r+ i3 ?gpio <input|set|clear|toggle> <pin>
: x/ E( l3 B7 I - input/set/clear/toggle the specified pin
# g. l7 {6 Q+ }4 D; w/ Jgpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs; F7 }2 {+ ?3 F1 S4 n2 E, ?! m# @
4 r3 P! y) u/ N J/ I, [% iset是置1,clear是置0,toggle八成就是翻转(初中级英语,没办法,全靠猜)# N5 V% I' v: ?% ?. ` i4 z4 e
& o$ w6 ]1 v/ g
然后看到env有地方是参数设置,类似dos的环境变量吧- M% d/ J. G1 a( Z) F5 ?3 C
: m5 H' ^9 z& Y
Marvell>> env print
5 Z- `, Z* e3 g% @" c, E& zarch=arm
7 V; n' f+ N' Tbaudrate=115200
4 M) p% s) j$ B* v1 g5 Q5 Rboard=mvebu_armada-37xx
# M3 p" \# h& I3 |1 |board_name=mvebu_armada-37xx' q1 G5 {, F0 G5 u( g
boot_mmc0p1= setenv bootdev mmc 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};% h0 _4 `* i4 w" P
boot_mmc0p2= setenv bootdev mmc 0:2; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
; h _2 N1 d0 I& Z8 e+ P, Iboot_sata=scsi scan; setenv bootdev scsi 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
7 u+ T9 L6 ?3 w! N& q: p2 J: T5 Pboot_targets=usb mmc0p1 mmc0p2 sata
) ~+ v/ K* B/ W- W- e5 Oboot_usb=usb start; setenv bootdev usb 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
% u( V* I! N- q/ @7 @# H7 I! m7 N5 bbootcmd=gpio input GPIO23; if test $? = 0 ;then echo "Enter button mode";run bootcmd_button;else echo "Enter nomal Mode";run bootcmd_normal;fi3 l# ~ M# A o' P* B
bootcmd_button=for target in ${boot_targets};do run boot_${target}; done;
+ b8 A7 B6 U* |6 a7 Vbootcmd_normal=run bootcmd_syno;
& V& c! T7 R8 w$ Q' l- N* sbootcmd_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;
' x h) o8 }- E0 {5 {, `; ^bootdelay=15 P }: s. v/ j: R/ e0 f7 f# }
bootdev=scsi 0:1
& @, h! M' x7 l) q. Vconsole=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000
' V5 _: K3 s% n) F2 C: Gcpu=armv8 f' F) O# w4 L0 V! q# C
ethact=neta@30000
& S% r; ]0 M7 K/ vethaddr=00:11:32:11:22:008 M8 y9 r2 G* T! d! Z# q: n6 d' l: ]
ethprime=eth0. e# K% }2 [8 a' p8 U* ` X
fdt_addr=0x6000000# t F) f9 Z6 \) G1 w% i/ K
fdt_high=0xffffffffffffffff
/ J* J) W3 i7 z! u# K# ofdtcontroladdr=1f6437d0
. ^5 ?8 O/ ?; D5 p4 j5 ~gatewayip=192.168.1.254$ m }. |' J0 H' y V4 O
hostname=catdrive. \. K. ^+ X& U& ]: z( S a
image_name=/vmlinuz
" b0 y4 F+ I8 B, finitrd_addr=0x1100000
1 `) v, }+ d/ y; w6 G: _* k0 Sinitrd_size=0x2000000' A% Q# \: R; J5 B, Q6 Z& H1 J
ipaddr=192.168.1.119
3 t1 o/ g6 j4 Wkernel_addr=0x7000000
9 x y, c1 |2 xloadaddr=0x80000006 J2 [/ i: ~' ?( }2 V7 X
netdev=eth0
8 i2 Z0 I Z8 Lnetmask=255.255.255.0! ?" h B; j1 j; |0 t
rootpath=/srv/nfs/
' k. \% U" p+ Q. W+ @scriptaddr=0x6d000007 P6 \0 a( B# o U4 l
serverip=192.168.1.254
+ [1 {: M- g6 lsoc=mvebu
7 B H* ?0 ^6 c$ gstderr=serial@12000
# w. ~- k& T) kstdin=serial@12000
1 |6 |' `( b% A% S2 Q2 i9 pstdout=serial@12000
! e3 |/ T# o2 d9 X3 X( t8 A# z2 d2 Msyno_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=Marvell9 ^# o& ^ x" P/ {0 ~, d' K9 z
vendor=Marvell7 a( ^ D: Q, t, _) X# J0 s) S: k" y
& y3 q; S5 s1 \; R/ V/ `) }$ Q
9 T- U5 [) V; H7 jEnvironment size: 2001/8188 bytes
- S# E3 Q5 W$ g4 }; {Marvell>>
+ T. @7 }$ ^9 [- X, e X$ a5 x
2 j1 V3 I }# F; N; U. M8 [看到有一个GPIO23,试了下,原来是reset按钮检测,没什么用。但它有两个启动项,主要是bootcmd_normal,而这又指向bootcmd_syno.
2 x" }7 L7 z1 X& |9 `, wbootcmd_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;* l# J0 L, r' ~! M, ~# \2 Y4 T
( v& e% T5 h% x; K' N% W1 B5 s这里好像是群晖引导,一条一条的命令,我又不会改linux的启动呀内核呀,只能在这儿动手了
# Y# V0 u; F( K3 U1 r& dbootdelay=10 ,启动等待时间,1秒,太少,我都来不及按,改成10秒
4 r% C' U; e9 c5 L& \/ L
8 \% @2 T* J* ?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;
* j+ G/ A0 X$ N9 A8 R, S$ E3 E3 { ; _3 @# X' A: F+ L
注意我划掉的那部分,是先给硬盘断电,一会儿再通电,在固态硬盘可用,可能因为固态硬盘启动电流小,冲击小,当用普通盘时,有一定几率会死机,所以用普通盘时,我去掉了。$ n4 y* k; E7 g
思路是:
8 t) t5 _$ w7 G6 h8 M/ P: T启动前先把phy那个=0,等10秒,关硬盘,等10秒,phy那个置1,开硬盘。之后正常启动。7 ?( A9 Y% M1 g/ z! [
4 V7 M0 a& S9 H2 ~这样有时能得到IP,但还是会有一定几率不行,所以又加上了网上流行的ping 60秒不通时重启 n7 B O/ _; u1 p: A0 r$ [( y
. m# t! F2 d8 U, z( y" H控制面板,任务计划-新增-触发的任务-用户定义脚本,开机启动,开机60秒得不到ip 重启
1 _; S" f$ K5 b' _+ P5 F" ?8 E% v#!/bin/bash S& h4 f u) ^
dt=`date '+%d/%m/%Y %H:%M:%S'`9 G4 d. {9 h! S, z7 K
echo "$dt"% ~9 H% E3 C6 Z' o2 a3 o$ Y
sleep 60
" K2 ~& ]7 v1 f* A$ L5 B1 P" F+ `num=`ping -c20 114.114.114.114 | tail -2 | head -1 | cut -f 3 -d"," | cut -f 1 -d"%" | cut -f 2 -d" "`: x$ @, h( C% q8 P
echo $num n1 t( u. B1 O9 o
echo $?
1 k* g" ? C8 k6 t; p4 Iif [ $? -eq 0 -a $num -eq 0 ]; then
7 d5 m" q3 ~5 p+ T6 ^ echo "$dt ok" >> /result.txt- N4 [' Z5 j! G1 p7 V1 B8 V9 Q& W
else7 b) W9 h3 a6 B$ d% l
echo "$dt noip loss $num reboot" >> /result.txt9 p7 A" t& N6 C" B
reboot! K. I/ {4 s/ m. h+ }( i9 o& z4 s
fi
" s. ~# D2 g. [( v( e: T
: c1 n6 f6 }! ]9 n7 q第五行,ping后边的IP自己改,我用了一个外网的IP。3 } p3 i* [( y" M2 k* v
& n2 u7 H% P! S" l总是思路就是,第一次刷完群晖会有ip,挂着硬盘,装系统,设置60秒脚本,重启,如果找不到IP,改bootcmd_syno,再重启等着进系统。- N" T$ J" P9 g: p( H
8 {" u. n8 q; \9 o5 @1 N0 F
我反正试了几天,刚上电,等一会儿根本没有IP,60秒后,会重启,这次绝对有IP。但总要用ttl+shell盯着测试太麻烦,所以又加了一个正常启动后闪led灯的脚本,从网上抄的,忘记上谁发的了,侵权见谅。
# f v- V% A- \% [/ m0 }
9 `' \* ]1 v, E6 ~, n0 O8 I还是上边60秒的地方,再加一条
( H2 y/ @# \& |7 U% H- o& b
+ t2 w3 c2 \+ a& I1 d3 |$ y ) z5 {# j& I+ Q9 W9 u6 [
2cset -y -f 0 0x45 0x00 0x55$ h! B; k& B7 W) d6 u G) n; } y
i2cset -y -f 0 0x45 0x01 0x018 O0 R7 o: R" V. u/ ^& ^3 v
i2cset -y -f 0 0x45 0x30 0x07
7 u" f. V3 k4 v/ W7 ti2cset -y -f 0 0x45 0x31 0x72/ c; [, M% x& f# L1 K* D' y" q
i2cset -y -f 0 0x45 0x32 0x721 \% ?* K. Z( O$ }' f2 K5 P- }
i2cset -y -f 0 0x45 0x33 0x72
6 F2 }6 I4 Q5 O' e#调节三个灯灯每周期上升沿和最高亮度时间: Y. m4 i% Z. l2 o/ K7 @( s9 M
#想要白色的话,把三个灯时间改为一样的就可以了,比如全部设为0x44, O5 C) v- a6 A/ `2 v7 U
i2cset -y -f 0 0x45 0x37 0x44
, t9 u; A; T" j! k0 Li2cset -y -f 0 0x45 0x3a 0x555 }( L4 H% t7 A; C( r' ~
i2cset -y -f 0 0x45 0x3d 0x66
. f4 C C2 V5 p# p9 P% _4 t#调节三个灯每周期下降沿时间和关机时间/ m6 l" x) ?1 o$ X
i2cset -y -f 0 0x45 0x38 0x44
' k' k" ~/ I+ g0 e* S1 qi2cset -y -f 0 0x45 0x3b 0x55
, q4 f5 l% e) Z4 s: Ti2cset -y -f 0 0x45 0x3e 0x66
" K! x5 P* J- A" Ai2cset -y -f 0 0x45 0x39 0x40( q7 O$ g& q1 Y: P
i2cset -y -f 0 0x45 0x3c 0x40! j0 j+ q. Q5 d6 ]% U
i2cset -y -f 0 0x45 0x3f 0x40! l8 J& ?4 @( a
# 0-255,更亮2 \% U- }* i/ A, g' {
i2cset -y -f 0 0x45 0x34 128+ ~6 n, z, M1 C) T& C% O$ F3 I0 T- |
i2cset -y -f 0 0x45 0x35 128! P; D( {0 s( S* O& f* S5 W9 B8 l
i2cset -y -f 0 0x45 0x36 128, N; \8 a/ ^6 [2 ?4 ^
9 v- F; M8 g4 O, Q& I. n+ m然后在这条设置里有一个“先行任务”,设置成上边的60秒,也就是60秒那条执行完才执行这条。而60秒那条,没有ip就会重启,有ip就完成了,就会执行亮灯
" a& G+ H6 T$ P/ C; o
; J# A& S) \3 f; ]& S " u1 c. j$ O& [ i& R
我知道很多大神会做内核解决各种问题,我也知道看起来很小的问题,工作量是非常大的,可能要几个月才能解决,所以大神做的东西是不可能轻易免费发出来的,人家也要吃饭,不可能靠爱发电(我也在公司做简单的技术,知道技术无价的道理)。我从99年学电脑开始,绝大部分的东西都是从网上找来学的,所以非常感谢所有把知识发到网上共享的大神们。
- ?9 Q, {- J" [2 f
+ b9 Y. j( R6 j% Q希望大家有条件能测试一下这个方法,如果可行,请发出去让更多的人看到,如果有改进的方法,也请共享出来,因为这个方法换盘好像不方便。
' X: L( D6 z) | I% ^ |
|