|
发表于 2023-1-18 09:18:32
|
显示全部楼层
转发:我好像解决部分猫盘刷群晖后掉IP的问题了
! V( e4 S9 k9 }; x& A) n( X
3 R( m0 c& D6 V* [4 Iaquila995
5 j& |" y: q4 O$ g8 ?9 b8 q3 \. z$ u: Z
@5 ^; c8 w7 _2 c4 `于 2020-06-24 16:37:11 发布 d& ~$ V7 Q L1 @
/ a. R7 O# r3 \* ^$ {+ C
132153 r3 ~7 o# B, G0 f: W/ B0 j9 D8 o# ^ F
收藏 13
' y$ _0 u5 p; F) V分类专栏: 群晖
2 K, N) L. ] Y% c6 ?; j# n$ k版权4 W( O$ `; b% e) d& G" v
3 [2 E$ f' @5 x, K$ `$ V群晖
% n, u0 m7 }5 y6 U; e, H4 Z0 Z专栏收录该内容
4 z" j* U3 s* Q9 W8 v Z' @3 K& R2 q1 篇文章0 订阅
: |5 m, g) } I; C% H订阅专栏+ m$ p9 i: H, e& n
我好像解决部分猫盘刷群晖后掉IP的问题了. a, \7 t# \( C8 d* f
8 x4 {. J7 @1 c5 w( B; O
我好像解决部分猫盘刷群晖后掉IP的问题了
. m2 g$ k ]1 n) X% Q5 A# ? 6 c" [) w- c" x! T4 `% u8 m
先说我的情况,xianyu上的,到手发现刷群晖后第一次没挂硬盘时可见ip,关机,上硬盘,再开机就一直见不到ip了,没敢一直重启,心疼硬盘。# v: z# Z/ c- s" m1 v) t: Q
然后刷个X3P用了一段时间,还是想用群晖。上了块固态,试了多次后,应该解决掉IP的问题了,现在挂的是500G普通盘,一直正常。7 a6 k1 W; H- k
8 u0 d( K6 \& v7 i+ k' t* I跳过刷机说重点,每次重刷完群晖都是可以连上的,但重启后就不行了,所以应该不是所谓的虚焊问题,应该是某个设置没有达到,网卡没有工作。
2 I- ?. i6 p1 D p1 s $ ~3 x6 c1 s1 E6 {9 \
然后发现的情况是,如果进到env环境(我也不知道叫什么,反正就是在xshell下一直按回车的环境),网卡是工作的,只是再进到群晖启动时没有工作。
& x6 M3 g2 t; [# F& y1 l & |; l( t# B6 `! q6 }7 Z7 M; Z
先看了下有什么可用的命令:
: b4 ~0 L: L$ z5 z
$ V$ [9 W% P: _8 v* I3 F7 JMarvell>> help
3 {7 d+ l: v& Q! p& O9 C/ \? - alias for 'help'8 D w2 t$ e7 g9 L4 H" G
base - print or set address offset
) J0 z$ g+ H; ?* dbdinfo - print Board Info structure
, F& G% `. d* l* hblkcache- block cache diagnostics and control( _# u; O- n' Z* }8 x/ f
boot - boot default, i.e., run 'bootcmd'
/ i9 u5 g5 `& Y3 T1 V! Vbootd - boot default, i.e., run 'bootcmd'% y$ f, }4 Q: Y2 H
bootefi - Boots an EFI payload from memory) c& w* x3 b- F0 {
bootelf - Boot from an ELF image in memory
1 |3 y+ O+ N7 H" W+ cbooti - boot arm64 Linux Image image from memory
H: A7 b# ]' hbootm - boot application image from memory
1 [% g( R2 N$ t2 P$ O; K============================================================
( j3 W5 d* p- v( {' Q& vbootp - boot image via network using BOOTP/TFTP protocol: c2 {8 h4 q8 B1 d# V
============================================================- y+ W- Y" D; `, v& ~4 l( ?' n
bootvx - Boot vxWorks from an ELF image7 M u5 m) v: K# i Q; P
bubt - Burn a u-boot image to flash; }+ \* t: |# u% a' l, d+ x
cmp - memory compare
0 m/ `6 C# e9 N* A/ W Mconinfo - print console devices and information
* i! H9 K5 E$ w2 r9 F9 Ycp - memory copy/ o" S* N8 I# n
crc32 - checksum calculation
. E+ z/ Z2 _% ]8 a9 g" u$ r, @5 O# [dcache - enable or disable data cache
- u; |1 _3 _& V4 Z. h-------------------------------------------------------------" E8 U$ f# x+ ^9 Y2 V9 W! x
dhcp - boot image via network using DHCP/TFTP protocol# U& V+ E4 @3 J2 T$ M
-------------------------------------------------------------. q/ H- m# e( q4 d+ P' T( X( R+ P) O
dm - Driver model low level access
3 t1 B+ R7 x8 w3 Secho - echo args to console
) w* J% m5 [8 X' C- y' X& ~4 peditenv - edit environment variable& ]4 ~4 U) d7 S9 n D0 g' u/ `
env - environment handling commands
+ B4 L/ g( a4 C5 X& mexit - exit script
( s! T' \3 K' h2 Y4 l8 ]ext2load- load binary file from a Ext2 filesystem
% q% |6 p: i# g6 H2 u4 I7 t2 Oext2ls - list files in a directory (default /)
+ D& ^) p) b" w( Hext4load- load binary file from a Ext4 filesystem- G& Q" l7 K% M. q" j
ext4ls - list files in a directory (default /)
. K/ V- s8 @/ X3 hext4size- determine a file's size% J! o6 t7 m" b! B. R3 U7 K
ext4write- create a file in the root directory
4 ?9 C) T" l, g. E' Z( zfalse - do nothing, unsuccessfully
# o* W1 r9 ^& l( Qfatinfo - print information about filesystem
% A. M# M0 a; tfatload - load binary file from a dos filesystem7 E+ i. K2 U% O4 z! j
fatls - list files in a directory (default /)! [- D% I0 ^# a! A8 Q, t9 L5 B) }: ~
fatsize - determine a file's size! i v5 Z% ?. P y" R2 K% c! U
fdt - flattened device tree utility commands
- b( }/ s* m5 T2 |4 ofstype - Look up a filesystem type/ i0 Y, s5 o4 `( g, g6 q; o, w6 B- H( ~
go - start application at address 'addr'
# C3 K8 ?0 `" {0 d: V+ ~1 Bgpio - query and control gpio pins! H( t# n: y% J/ k, o
help - print command description/usage
5 U1 g- n4 i( |! k( U/ vi2c - I2C sub-system
8 [- ^9 P3 u' o9 m7 t$ H# M" v J Jicache - enable or disable instruction cache
) w. ~( B/ u) K8 W+ B/ niminfo - print header information for application image5 `6 |7 \ V) C6 N: F$ t
ir - ir - Reading and changing internal register values. I% F' J0 i. A* F2 s n% A
+ y8 C8 B2 d7 ]( i9 T
$ `7 W/ p( o$ G/ n& Zitest - return true/false on integer compare1 y+ a: x2 v( o' M
load - load binary file from a filesystem. G2 Y" ]+ u1 F: C9 t2 o- w; }( S( Q
loadb - load binary file over serial line (kermit mode)
% u: t% o/ W. t3 X$ s9 N; kloads - load S-Record file over serial line
- _. @9 p5 o% [: _7 Z( Eloadx - load binary file over serial line (xmodem mode)
- d1 c' L- I; j6 ~; ?3 F$ k7 r( H* B' Ploady - load binary file over serial line (ymodem mode)0 S3 S) J$ h: i7 x0 z" ]7 j
loop - infinite loop on address range& V+ L) p& V7 t- t9 @
ls - list files in a directory (default /). E2 V8 y6 q) i6 C1 m# }
lzmadec - lzma uncompress a memory region
: c7 \; t* c' H9 Gmd - memory display
% R0 o8 ?2 a$ ]7 O" x+ L1 C& |& Emdio - MDIO utility commands2 b, a* ^' u. Q- l* P! S8 Y9 ]
mii - MII utility commands$ |- r/ o! W% `: u6 D
mm - memory modify (auto-incrementing address)
/ y: Q# S) g1 D' vmmc - MMC sub system
9 N4 b6 V0 E- f v" @& `mmcinfo - display MMC info4 m; F7 S" L% h* J
mw - memory write (fill)9 Q# }- ?; t) X) m
nfs - boot image via network using NFS protocol
( X6 Q4 V% X. ]0 D* anm - memory modify (constant address)2 D/ d% z0 ^& T$ u
part - disk partition related commands
' ^, N" x4 a! I4 T5 f3 Y; a5 E" wping - send ICMP ECHO_REQUEST to network host
, i& r) z- ]) l, d$ Y- W, I e) Iprintenv- print environment variables
, \; J b/ J! |! }5 C; h6 Bpxe - commands to get and boot from pxe files9 J- i' d0 ~0 Q d% i+ z: r
regulator- uclass operations
: A+ j( h y& freset - Perform RESET of the CPU' Q5 x/ }- }0 a g! {0 u
run - run commands in an environment variable
& [8 F; L' b( _save - save file to a filesystem* | m: e9 S+ [" n
saveenv - save environment variables to persistent storage
7 R; A0 g# d; \& X8 qscsi - SCSI sub-system- D' ]7 T2 d6 R
scsiboot- boot from SCSI device% s8 C7 O! ~& g. d- z
setenv - set environment variables) B) o( o2 e, o
sf - SPI flash sub-system) b5 n5 n* P. G) z9 p1 J3 }4 v
showvar - print local hushshell variables
4 B8 s/ d$ u' h9 L( ~" \size - determine a file's size
3 u+ A" ]7 I ]! y3 X& H b# G* N0 h% Lsleep - delay execution for some time5 m+ A8 L f& q( `4 x5 ^
source - run script from memory" k& n2 {$ g% A' P
sspi - SPI utility command. C o7 r: D( B. ~( w' j* B
sysboot - command to get and boot from syslinux files
/ S: q0 b0 D( q' Ytest - minimal test like /bin/sh0 K# M% D/ `$ F% O! b1 q' ^! a: J+ r
tftpboot- boot image via network using TFTP protocol
9 o. n! [' Y- V' rtime - run commands and summarize execution time
6 i9 e. ]' U% otrue - do nothing, successfully
2 e8 ^8 T2 L3 A8 _' d7 k: Tusb - USB sub-system) |1 T$ _/ e$ ?6 @0 \6 w. q9 f
usbboot - boot from USB device# L" H$ B6 @ K8 O7 k8 G
version - print monitor, compiler and linker version
) c6 Z2 O) L; ^
- Z5 H2 N4 }/ w/ x发现了gpio
" Z4 k& }" h3 [4 s
$ I2 f' l- ~2 i' Earvell>> gpio
$ @8 Z0 [& P) c7 z% E$ {" V% xgpio - query and control gpio pins6 W6 B: J7 a, T: z
J0 _: [7 {- F9 t p/ r
3 a- x1 l8 t! \! eUsage:
5 x% N3 a& O$ A) q, h5 Tgpio <input|set|clear|toggle> <pin>
& b% e. u# M. ?/ u5 e$ J* f5 X - input/set/clear/toggle the specified pin) d% f: E7 S" _: o+ O" @9 f& e
gpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs
6 n! I& Q9 K' i' Y + h# ]3 o/ I0 H- B; D' G
- `8 u2 d& l0 E4 ^+ A% {
Marvell>> gpio status* Q6 a! ^: _" S9 C6 I1 d
Bank GPIO2:
) m" O& e! j; ]GPIO20: output: 1 [x] sata_pwr7 I% @) i' W& R7 S* x h$ H# E
GPIO221: output: 1 [x] phy_reset
& N+ ?" R9 B& [0 T% u $ S1 {' `" v, w
可见的io脚
! K ?% V3 X. K! ^
% ~" h1 h% S% L- i) G1 k) BMarvell>> gpio status -a
( L! w b) @& Z* J9 RBank GPIO1:
0 l7 m! l& x$ o8 Q# L. G: V: M0 vGPIO10: input: 0 [ ]
7 o' u6 T7 Q5 A' ^5 X8 H" NGPIO11: input: 0 [ ]: W, b- K+ y A( d' j1 F3 h
GPIO12: input: 1 [ ]
; O$ \% a" p" E$ ^8 cGPIO13: input: 1 [ ]
4 |; i Y$ u; e7 B$ ]GPIO14: input: 1 [ ]4 T, I6 l- o7 K% Q" h% l5 n
GPIO15: input: 1 [ ]
9 J7 ~' M$ U @GPIO16: input: 0 [ ]
( h, M7 [" F$ t( n3 KGPIO17: input: 0 [ ]
$ W" j* x8 ]9 zGPIO18: input: 0 [ ]5 j2 v' @3 p+ t# ]; Q; ], w9 E
GPIO19: input: 0 [ ]
9 m9 w: v" N0 k. h: pGPIO110: input: 1 [ ]
+ }7 ^& L: C3 YGPIO111: input: 0 [ ]' L ] c3 B2 X1 \* U3 j7 Y6 q$ ~
GPIO112: input: 0 [ ]
7 y* V8 x1 \1 I; [7 |& q Y/ CGPIO113: input: 0 [ ]! I' ]) |8 r2 r2 H0 K- _( `1 X9 q
GPIO114: input: 0 [ ]
9 b$ {9 V) y/ {! [& Q' dGPIO115: input: 1 [ ]
8 |! V4 P; F+ i/ \2 ~9 GGPIO116: input: 1 [ ]
4 ~3 j' A* J) M/ q; o0 k$ a; NGPIO117: input: 1 [ ]4 P- V4 ^' J, j
GPIO118: input: 1 [ ]3 P+ v% G1 K& n
GPIO119: input: 1 [ ]
/ {& ]* g+ S# p+ c! gGPIO120: input: 0 [ ]
3 h/ j) F: J9 p) Z5 |# e1 KGPIO121: input: 0 [ ]
$ T& I# [9 ]7 y. E+ l) a, eGPIO122: input: 0 [ ]
I5 B, Q2 i8 j8 `- ]GPIO123: input: 0 [ ]& i3 U$ G; W: T" X
GPIO124: input: 0 [ ]
; l M# j0 ^9 | ~GPIO125: input: 0 [ ]# v# _4 ^2 c p" }$ q) _
GPIO126: input: 0 [ ], B5 |, ^0 C% g
GPIO127: input: 0 [ ]3 L( m* N; H$ R
GPIO128: input: 0 [ ], [4 X2 a0 [( u& ]
GPIO129: input: 0 [ ]
9 ]( e; k' U* G$ u$ S2 p5 f( @GPIO130: input: 0 [ ]. n! s, g+ m! u# F
GPIO131: input: 0 [ ]
1 J. r+ g# w5 g5 n2 a0 QGPIO132: input: 0 [ ]
9 L$ O! l& v, }, @" t/ QGPIO133: input: 0 [ ]
/ ]5 W' x+ a* z {$ @: fGPIO134: input: 0 [ ]( a/ B7 Q8 O% q3 U! ^
GPIO135: input: 0 [ ]
# F2 [1 R8 i' M. B% b
6 w4 x) J5 @! O$ t3 F8 M8 z 0 P$ `9 z# u* P
Bank GPIO2:
, p1 J/ C* z! D2 Q9 xGPIO20: output: 1 [x] sata_pwr
' h2 E% s2 V5 Q* A! \GPIO21: input: 0 [ ]
# [0 Q* f7 ~7 T8 M# i0 n8 q5 jGPIO22: input: 1 [ ]8 C) B C2 O8 x5 y# l# e
GPIO23: input: 1 [ ]
5 H T3 z7 R9 N; z) x# [GPIO24: input: 1 [ ]1 Y5 F- x: i# X) V
GPIO25: input: 1 [ ]
: }9 V) J9 l7 A. mGPIO26: input: 0 [ ]2 r- {3 ^' O r; T3 A
GPIO27: input: 1 [ ]' S7 {9 N" H5 A0 y) I6 _
GPIO28: input: 1 [ ]8 E: O- [& I8 d$ v8 E% i
GPIO29: input: 1 [ ]
; ?; v7 Q( v# a9 x4 `" s% jGPIO210: input: 1 [ ]5 P# G7 B+ h+ X t
GPIO211: input: 1 [ ]. f5 C( `: j- e( Z: K$ k
GPIO212: input: 0 [ ]. {/ Q3 K# y5 G4 e
GPIO213: input: 0 [ ]
$ Y, R5 t: y3 X7 _) h6 ~GPIO214: input: 1 [ ] V4 K9 f3 E1 e) }1 r) M
GPIO215: input: 1 [ ]/ I: \/ d" X, M% P; m
GPIO216: input: 1 [ ]* \* W5 ?6 [ |% I2 `
GPIO217: input: 1 [ ]
& }/ b3 ]. T: VGPIO218: input: 1 [ ]
p# `" R- I( P5 |! w1 D0 rGPIO219: input: 1 [ ]: f: t$ B+ }+ e* y' Y7 s
GPIO220: input: 0 [ ]
; ?( ?' `! s" V% ]+ U- a1 I: OGPIO221: output: 1 [x] phy_reset- X1 M7 m- W& ~$ z9 j
GPIO222: input: 1 [ ]9 Y3 |$ y5 V# F" `
GPIO223: input: 1 [ ]0 X" @2 ?# S" ~9 U7 L3 e
GPIO224: input: 1 [ ]
$ Z t" z5 l: gGPIO225: input: 1 [ ]
3 {1 P6 e+ v* P0 ZGPIO226: input: 1 [ ]
, g& Q) C+ p" Z) \0 _ r' U) HGPIO227: input: 0 [ ]
9 n0 F7 |9 U. _1 C0 a7 V: w* WGPIO228: input: 0 [ ]
& n6 @) g" Y* Y. _1 [1 K* }GPIO229: input: 0 [ ]
* w2 D% X6 P4 g* V4 h, e & b& {8 W& {- p+ t
别的看不懂,只看到一个是硬盘的供电,一个是phy_reset,不知道干什么的。$ c( s" t d2 K5 U8 \
1 p& W" E6 K" [2 G
Marvell>> gpio' \! W$ Z9 ?3 U0 w" [
gpio - query and control gpio pins7 _8 k( }6 D. n) \5 ]- ]
4 Z; }) A6 S; R
7 O; F: v$ W/ g1 a9 Q! s7 rUsage:
5 |$ H7 y/ [! e3 L$ i! H# ^ \gpio <input|set|clear|toggle> <pin>
5 a8 V }2 h& J* {8 Y7 V+ P" d - input/set/clear/toggle the specified pin( O1 \+ N( f1 Z6 d+ F8 [* ]" t
gpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs
" M: L1 l2 h! \7 F& N* q4 o
. ~* M) T' S6 n9 n3 t# F. ?# @set是置1,clear是置0,toggle八成就是翻转(初中级英语,没办法,全靠猜)
9 h3 }8 H; E0 k
" Y8 G V. J: k/ b4 ^! U0 \0 R8 z) A1 `然后看到env有地方是参数设置,类似dos的环境变量吧! h' Z7 \6 B# m# e! G) a, d% H# ^
. c/ ~' S, O$ q" A" R6 XMarvell>> env print/ t6 m* k/ F* x# a' [, H: c/ A
arch=arm! `5 [9 {# V7 {$ t! C
baudrate=115200
@" n( L& F, w L }" Tboard=mvebu_armada-37xx; V' k( N/ Z0 c* H8 A* t% p0 L
board_name=mvebu_armada-37xx' S# c# @& r: R
boot_mmc0p1= setenv bootdev mmc 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
: d* {. M N: {& \! p( h7 qboot_mmc0p2= setenv bootdev mmc 0:2; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
1 C0 ?+ @& K8 A# m* }- S. Yboot_sata=scsi scan; setenv bootdev scsi 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};+ P9 i3 c( q, @* z- Q. Y, `1 i# U
boot_targets=usb mmc0p1 mmc0p2 sata
7 J# h: H7 K# Z' ?" H) q" H; Nboot_usb=usb start; setenv bootdev usb 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};
; D W1 ^& S" p3 x: Y# V6 V8 obootcmd=gpio input GPIO23; if test $? = 0 ;then echo "Enter button mode";run bootcmd_button;else echo "Enter nomal Mode";run bootcmd_normal;fi9 X" E M, L: z. n. M# O9 w
bootcmd_button=for target in ${boot_targets};do run boot_${target}; done;6 X- x0 x; a% D4 @/ q
bootcmd_normal=run bootcmd_syno;4 W% Y0 T; f2 C- U0 c
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;5 J* O: [1 X5 O; ?! {& H, \
bootdelay=1
! I, |' X0 c% A0 vbootdev=scsi 0:13 k' E0 ^% W W( `$ |+ {9 V
console=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000" N7 O Y- D% ~$ K% i" j3 }1 {
cpu=armv8
% @# }1 u! B" Y# T9 ~6 q/ l( @4 {ethact=neta@30000; }- T" D8 E/ A2 }6 o0 h6 ^' \
ethaddr=00:11:32:11:22:00, n4 R6 t. ^! o
ethprime=eth0
$ T5 b7 s* \/ U+ |1 B7 ]0 ?fdt_addr=0x6000000: B( j4 x3 ^( ]
fdt_high=0xffffffffffffffff
2 x: w c/ r! Y! ?8 r) v: l6 n% wfdtcontroladdr=1f6437d04 W. N- X# g3 ~7 \
gatewayip=192.168.1.254
O# C7 Y2 d8 Q1 B. lhostname=catdrive% h8 R$ l+ s/ r# _8 f
image_name=/vmlinuz
7 i5 [7 G$ B! `! A( J1 r# }+ ]" `3 vinitrd_addr=0x1100000
8 x4 F" H5 q$ s4 X( xinitrd_size=0x2000000
" {; V# }' m5 A* }% l! T; Uipaddr=192.168.1.119# F$ _7 `7 P( U
kernel_addr=0x7000000
6 F3 t" N8 D4 n% f* D+ }, Floadaddr=0x8000000
2 \; m9 q7 A {; z( `netdev=eth0! J; I+ O/ a5 T
netmask=255.255.255.0
3 i( P, e5 y* o5 c4 frootpath=/srv/nfs/; _$ i9 Z: I/ l1 k/ G" g# B
scriptaddr=0x6d00000
6 u& R& h& l1 [1 s4 Rserverip=192.168.1.254+ t$ p+ B- X+ m3 i6 r
soc=mvebu# b# B @, W Y9 L
stderr=serial@120009 s8 B9 ]" x6 n. v/ C
stdin=serial@12000/ H' F" k8 m& ?0 Y' `9 L: m
stdout=serial@12000
# o8 Q: G3 } y$ asyno_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=Marvell3 r& Z/ _1 `9 B) Z
vendor=Marvell& s6 q; G! i7 h/ c( R9 r
3 T3 e0 {1 N% d- B3 M
1 l8 f9 x+ `. _0 t, m* T& ?: s' GEnvironment size: 2001/8188 bytes
. B( R' u( a3 V* R$ LMarvell>>+ s& c' m6 v9 S$ L: k4 [9 w
, u1 A/ p/ `! e. p9 d1 K; b
看到有一个GPIO23,试了下,原来是reset按钮检测,没什么用。但它有两个启动项,主要是bootcmd_normal,而这又指向bootcmd_syno.
3 [) k) N4 e8 Bbootcmd_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;
7 `( {& P' ^% Z1 }
% v- W; q; x6 [; }. L* I这里好像是群晖引导,一条一条的命令,我又不会改linux的启动呀内核呀,只能在这儿动手了
1 d9 C' h6 c4 Z, S1 I! J" ?' ]bootdelay=10 ,启动等待时间,1秒,太少,我都来不及按,改成10秒" z: h% R+ z- Z0 L4 v7 z# L
; ]6 B1 s3 ^: Z9 w2 k* kbootcmd_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;! z& B4 i3 d0 ]6 i
2 }1 p* e' Y2 v+ j& I* y( O+ h注意我划掉的那部分,是先给硬盘断电,一会儿再通电,在固态硬盘可用,可能因为固态硬盘启动电流小,冲击小,当用普通盘时,有一定几率会死机,所以用普通盘时,我去掉了。/ o$ u) D9 ]6 i: H' Z& e1 E$ E
思路是:
2 G7 q: _' K. `/ J8 w启动前先把phy那个=0,等10秒,关硬盘,等10秒,phy那个置1,开硬盘。之后正常启动。" f% c7 m3 ?% C/ t$ V
. a* Q' o6 S# |7 x# N1 {& X, h# l这样有时能得到IP,但还是会有一定几率不行,所以又加上了网上流行的ping 60秒不通时重启
7 A1 k5 @. K4 I5 c: N : z% U6 ]# a4 e9 t. D2 O" v
控制面板,任务计划-新增-触发的任务-用户定义脚本,开机启动,开机60秒得不到ip 重启
/ y* C' V& c |4 ]' k% m) T* w#!/bin/bash
& ]9 J2 p y: sdt=`date '+%d/%m/%Y %H:%M:%S'`
7 @. y( V2 ^( X) Recho "$dt"9 O g, n& Z- \- \
sleep 60
7 M( h1 Z) l; V5 ^/ Bnum=`ping -c20 114.114.114.114 | tail -2 | head -1 | cut -f 3 -d"," | cut -f 1 -d"%" | cut -f 2 -d" "`. F( u/ s, m4 E# R( \% \" E
echo $num: b1 J- l0 T- B3 {7 K
echo $?$ o+ h% o9 K1 [
if [ $? -eq 0 -a $num -eq 0 ]; then
2 [- {, p+ i! Z. f1 T/ g echo "$dt ok" >> /result.txt! ?) l3 o! F2 t- e7 K
else. z w! n/ P1 L. @0 }. k0 v
echo "$dt noip loss $num reboot" >> /result.txt% P L) ~4 m5 {8 _+ c' M
reboot
2 e z! I! [/ [0 L- Tfi
4 `" ?6 c' i4 j7 C
3 r" Q! w* p9 Q% P1 D第五行,ping后边的IP自己改,我用了一个外网的IP。
* F# P* j0 P9 Q# k9 Z. ^% Q" [9 u9 A
% V8 r" S# ]. O/ K1 H/ }4 f. e) B( |总是思路就是,第一次刷完群晖会有ip,挂着硬盘,装系统,设置60秒脚本,重启,如果找不到IP,改bootcmd_syno,再重启等着进系统。
: F6 l" U* v- o) { # V% ]% t2 e5 s
我反正试了几天,刚上电,等一会儿根本没有IP,60秒后,会重启,这次绝对有IP。但总要用ttl+shell盯着测试太麻烦,所以又加了一个正常启动后闪led灯的脚本,从网上抄的,忘记上谁发的了,侵权见谅。" [: j* }4 x2 }% b+ s" U9 O3 k
* h7 a* u0 q) s5 W) R6 U
还是上边60秒的地方,再加一条) O s8 r0 v+ O) Y; Y G [# W6 R
4 Z# ?$ `1 r, S# g
2 h8 K- L% ]: N& }; U
2cset -y -f 0 0x45 0x00 0x55$ U, D( o! x3 x6 P! k; L
i2cset -y -f 0 0x45 0x01 0x01! N2 Z6 G( D9 H" Q& G' a' n
i2cset -y -f 0 0x45 0x30 0x079 d3 Y, w7 P, L. g" @' M, m7 G
i2cset -y -f 0 0x45 0x31 0x72+ v" [! W$ T/ a; K
i2cset -y -f 0 0x45 0x32 0x721 P/ u) G e7 E! a( a6 I& e
i2cset -y -f 0 0x45 0x33 0x72
& w, {# I* e. d#调节三个灯灯每周期上升沿和最高亮度时间
9 i& M0 y8 Z$ d* `#想要白色的话,把三个灯时间改为一样的就可以了,比如全部设为0x445 m4 p3 K, C" V
i2cset -y -f 0 0x45 0x37 0x44# b- {% C! o. b( T; a
i2cset -y -f 0 0x45 0x3a 0x556 }9 G) ]; c3 ^; @
i2cset -y -f 0 0x45 0x3d 0x66
/ G) l. n6 N/ x8 t* Z' R7 z; L) U#调节三个灯每周期下降沿时间和关机时间5 F4 q0 M2 @0 i
i2cset -y -f 0 0x45 0x38 0x44
: L( F3 q! Z- G! T7 x2 m2 ]i2cset -y -f 0 0x45 0x3b 0x552 `( k- w I& H5 y
i2cset -y -f 0 0x45 0x3e 0x66* p# U7 G, d1 {) M8 x
i2cset -y -f 0 0x45 0x39 0x40 M1 e+ A: h4 ~% |1 J+ J4 n
i2cset -y -f 0 0x45 0x3c 0x40- B5 j' \5 N) B( F$ |( {
i2cset -y -f 0 0x45 0x3f 0x40
% q" A4 ~/ c6 C# 0-255,更亮# W& R" _0 z# J# _# C: Q6 e) U" Z; M7 k
i2cset -y -f 0 0x45 0x34 128
# C' F( \3 O& L- T, _6 Ti2cset -y -f 0 0x45 0x35 128
- ]6 N: O0 \) @: E! xi2cset -y -f 0 0x45 0x36 1281 D! b9 [% x) N0 Z. f2 Q8 c
$ Z' O# g$ R0 z' a
然后在这条设置里有一个“先行任务”,设置成上边的60秒,也就是60秒那条执行完才执行这条。而60秒那条,没有ip就会重启,有ip就完成了,就会执行亮灯! @7 V6 D b) c: i9 F1 u' j
# u, h+ I# g: J4 `2 \3 k& K
- P! ]. p8 ?3 {0 [3 x( i我知道很多大神会做内核解决各种问题,我也知道看起来很小的问题,工作量是非常大的,可能要几个月才能解决,所以大神做的东西是不可能轻易免费发出来的,人家也要吃饭,不可能靠爱发电(我也在公司做简单的技术,知道技术无价的道理)。我从99年学电脑开始,绝大部分的东西都是从网上找来学的,所以非常感谢所有把知识发到网上共享的大神们。
B' _( | |) Y3 U% w
( Z" h6 j0 i5 Y* p8 P8 A希望大家有条件能测试一下这个方法,如果可行,请发出去让更多的人看到,如果有改进的方法,也请共享出来,因为这个方法换盘好像不方便。7 y+ [( M0 y! L9 K
|
|