|
发表于 2023-1-18 09:18:32
|
显示全部楼层
转发:我好像解决部分猫盘刷群晖后掉IP的问题了; ]0 m4 G1 m! |2 n: T" D& |
9 q% i9 B- X2 I
aquila995$ q! f* l2 H5 n) I# t9 s
. ~/ @# X/ m7 j9 r
于 2020-06-24 16:37:11 发布
/ H( o/ Z3 G; c$ f) R
2 }7 `* l) {2 |. |8 x13215
; \( j+ i" P! I7 T4 d! J. c! b 收藏 13
3 o/ _8 Z& D. H( ~* t分类专栏: 群晖
4 l. }" [! U' c/ {版权
) l( g4 c1 Z6 m: Z
! M2 {6 h: J O& L* L群晖
' Q9 g, O+ A* R* f$ g8 p专栏收录该内容+ v% V2 A8 b2 M5 [6 @4 a
1 篇文章0 订阅
* |( t# w+ L# @订阅专栏5 a1 z4 c& ?8 ^( h; v* A
我好像解决部分猫盘刷群晖后掉IP的问题了
/ O! w+ q1 e" O! [; _
" G# g) h; I# L$ \我好像解决部分猫盘刷群晖后掉IP的问题了. `! c6 f* [2 Z6 o
, n# q& B* U5 C4 O9 D: }& v: H先说我的情况,xianyu上的,到手发现刷群晖后第一次没挂硬盘时可见ip,关机,上硬盘,再开机就一直见不到ip了,没敢一直重启,心疼硬盘。
; S& U& n J# R3 M9 \2 L; L然后刷个X3P用了一段时间,还是想用群晖。上了块固态,试了多次后,应该解决掉IP的问题了,现在挂的是500G普通盘,一直正常。
4 O# ~0 Z" e5 t$ w* Z& r d: E. s6 ?; W
跳过刷机说重点,每次重刷完群晖都是可以连上的,但重启后就不行了,所以应该不是所谓的虚焊问题,应该是某个设置没有达到,网卡没有工作。8 Z* j' R0 k0 W5 `
7 a* f6 r$ G L& B5 l然后发现的情况是,如果进到env环境(我也不知道叫什么,反正就是在xshell下一直按回车的环境),网卡是工作的,只是再进到群晖启动时没有工作。( I% @8 y5 Q. a2 {# j4 a# L
5 z$ k. @0 I U# E( v7 w先看了下有什么可用的命令:
) J( w/ Y9 R6 W e& l, t6 ?% a" P # t) s& W. _6 n: u m
Marvell>> help/ p% o. \! a! }
? - alias for 'help'! N) M$ x' e k# r! M
base - print or set address offset& L. X4 b: i- K$ f6 c8 c
bdinfo - print Board Info structure3 p3 x" C( @; ]+ f# w2 o
blkcache- block cache diagnostics and control8 e7 u3 k, f; r' T0 V; t
boot - boot default, i.e., run 'bootcmd'; k& d/ A( [+ b* h+ y4 m# N: t t. z
bootd - boot default, i.e., run 'bootcmd'
. q) O, [& b6 i. z! |bootefi - Boots an EFI payload from memory) y" L- y/ ?% s* ]
bootelf - Boot from an ELF image in memory( _% G6 n/ e6 n( R- x; ?
booti - boot arm64 Linux Image image from memory
9 e. Q1 f! X( \$ [0 v& Qbootm - boot application image from memory
# y6 x# r- v4 @) w# I$ d============================================================( j, q* @8 r# C& Z
bootp - boot image via network using BOOTP/TFTP protocol+ t) p( \3 n2 K% }7 Y" i
============================================================/ _% C% Y- P! v1 u9 z( M% [' h
bootvx - Boot vxWorks from an ELF image7 o' S# e4 Z% N1 r2 S0 E% M# |. t
bubt - Burn a u-boot image to flash0 O7 k4 k9 C- s/ A3 q# Z8 b
cmp - memory compare
8 a3 m0 I0 E3 U9 A9 o. o& j" k' M' Wconinfo - print console devices and information% W1 [/ k- K- q) i5 a6 [
cp - memory copy
- n6 y$ ]0 y0 {$ Jcrc32 - checksum calculation; u" L+ K0 U9 X+ N7 J% |4 S" @
dcache - enable or disable data cache6 y: J1 O0 E9 B3 s# }& p. ]5 L$ n
-------------------------------------------------------------1 }$ f" f1 |9 Z/ ~, J4 |* }
dhcp - boot image via network using DHCP/TFTP protocol
_' D6 v5 x/ L: e' G-------------------------------------------------------------) m0 x9 Z* |$ N% k8 t6 V% ]
dm - Driver model low level access- y0 d5 N/ m' l. A
echo - echo args to console4 a$ H" H& Q8 s* p" b3 l# c
editenv - edit environment variable P. r& n/ I, d( K
env - environment handling commands4 H6 J- Y; L% N+ D2 g
exit - exit script P7 K6 [- I6 {! e! a
ext2load- load binary file from a Ext2 filesystem
% Q5 t* L/ W; U5 Wext2ls - list files in a directory (default /)
: Z, [' ~% w: }3 o* {+ N! [0 Zext4load- load binary file from a Ext4 filesystem5 D$ [% }. `) |8 A/ \
ext4ls - list files in a directory (default /)6 M) t- E2 _& h3 q$ R" R
ext4size- determine a file's size5 n3 r4 D. Q; g0 N" b, j( m
ext4write- create a file in the root directory! |1 e& w8 d0 v. r" i
false - do nothing, unsuccessfully
3 _1 S3 ?3 ~) b. [5 sfatinfo - print information about filesystem
$ E! R' j' H, \. ]( R- s$ r( @fatload - load binary file from a dos filesystem
/ H3 a2 Q& T* I A4 f$ jfatls - list files in a directory (default /)! _$ x. ]" ^, H
fatsize - determine a file's size
; t- ^8 M7 t, Ufdt - flattened device tree utility commands
3 d8 ]" h( S2 lfstype - Look up a filesystem type
+ D8 @* S5 o/ h) ago - start application at address 'addr'
4 ]: ^. S V8 f8 zgpio - query and control gpio pins6 p( x# ^9 L8 a$ q( n: M! {
help - print command description/usage
$ J+ S0 g# ^/ h, Q* o4 l# M6 p! ri2c - I2C sub-system
* }5 \1 J7 B" c- Picache - enable or disable instruction cache& a: n% \5 L; j2 L7 K H
iminfo - print header information for application image- w. I7 u3 \- |3 G; B0 I
ir - ir - Reading and changing internal register values.( m& \' O5 a" b! g' U, v+ \
8 H" l3 N: w4 \, _# | : X7 s5 H1 } p5 ^
itest - return true/false on integer compare* v, t1 z1 J& J7 q# a7 t. y; l
load - load binary file from a filesystem* p! G9 z2 i a& `
loadb - load binary file over serial line (kermit mode)) t& I& H$ w4 H) w6 l* F
loads - load S-Record file over serial line
; x$ U# K$ M9 g: R* J* v+ Q3 sloadx - load binary file over serial line (xmodem mode)- j3 a8 Y8 p; h- [2 S7 N+ ]# l
loady - load binary file over serial line (ymodem mode)/ v+ R/ ?) k# l( P# \" V0 R
loop - infinite loop on address range
. ~/ R: r8 `2 I l6 o6 uls - list files in a directory (default /)
5 |0 m1 f8 M1 i. n& Rlzmadec - lzma uncompress a memory region' R) O1 X+ F+ s* m2 O
md - memory display
3 i9 F5 Y# ^; Ymdio - MDIO utility commands
( d! Y0 L, A! g! u3 o$ I- O4 V5 n- ymii - MII utility commands' ~) G4 m% m4 O
mm - memory modify (auto-incrementing address)
+ w4 O8 R+ X' H! Y/ f) Wmmc - MMC sub system
. h# }! V! f* `6 Kmmcinfo - display MMC info
' S* s" w1 Q- h; |! Z& z# {mw - memory write (fill)# y1 u' ]1 Q' t! [4 E0 f
nfs - boot image via network using NFS protocol) e% ]# k! h6 b2 t* p. I5 N
nm - memory modify (constant address)3 j9 w6 }7 b% Q
part - disk partition related commands2 A: p& j, T; B6 }# Q- k
ping - send ICMP ECHO_REQUEST to network host
* x, ]4 X" m; Y$ h5 ~printenv- print environment variables
* m' o J4 l7 {) N. l" `pxe - commands to get and boot from pxe files. V2 e+ V3 ], l- {/ |
regulator- uclass operations# S! c0 a2 Y9 Y- n5 H
reset - Perform RESET of the CPU
+ x- F( i( c! X# Yrun - run commands in an environment variable; |. r b- V9 \" p7 K
save - save file to a filesystem/ w6 |- Q0 D% V" T4 u
saveenv - save environment variables to persistent storage; a& @" \4 f" A
scsi - SCSI sub-system# |* a8 r C+ w0 z
scsiboot- boot from SCSI device# T. b3 G6 `( N$ }
setenv - set environment variables
/ s$ y# S1 g( a& y6 W% c7 \, Esf - SPI flash sub-system
' S$ h9 ^% e lshowvar - print local hushshell variables
5 Q0 K7 m/ }' K% ksize - determine a file's size
& h. a) ~5 b$ D- dsleep - delay execution for some time" ], P2 C/ X5 t( H3 s- r' F
source - run script from memory
0 M {. q/ y' j1 k: X. zsspi - SPI utility command
7 o4 ^! p0 W& j" n7 N! G% nsysboot - command to get and boot from syslinux files
6 F) _5 v: y2 s7 d* P- Atest - minimal test like /bin/sh0 m& g- r( _: S3 u0 y' `- U
tftpboot- boot image via network using TFTP protocol/ L+ s" x8 U. C' m- h1 C! |5 z
time - run commands and summarize execution time
! Q$ m' b3 `8 l$ v8 a6 atrue - do nothing, successfully2 D1 l- ?/ q0 Z
usb - USB sub-system2 a3 h3 x4 k) {1 V, w _% E2 d' q$ L: R
usbboot - boot from USB device
0 t& t; R5 J* s" L) Nversion - print monitor, compiler and linker version2 e" \3 P1 `* P
% W& s/ ]8 ^) B8 r) N, f发现了gpio
% }# {! Y z6 N& v7 f$ _, s 5 s p+ o+ G- g
arvell>> gpio$ T7 J7 Y& }9 ?4 C" p( c
gpio - query and control gpio pins" Q: q; N3 ~" p' y! m7 M
1 X1 A: Q; |- p. o4 o$ D
8 G) s( W8 q( z: y L; x- Z
Usage:1 B; w$ F, _' T4 }. A
gpio <input|set|clear|toggle> <pin>; J/ H; v6 O7 E3 y& E
- input/set/clear/toggle the specified pin
% ?) [: r6 X6 D$ ]8 d' }% jgpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs8 O' z" Y8 c# a: t2 g- d
9 A: |# ^! _# S8 S
2 v% y( i; [0 T8 Z, hMarvell>> gpio status7 q; O1 D2 T/ \6 t+ e: t8 A
Bank GPIO2:
% l3 ~- N& S9 QGPIO20: output: 1 [x] sata_pwr
( C' |& d* J0 o8 E8 p' uGPIO221: output: 1 [x] phy_reset7 t; [; o; b& k" g
u9 n& o |) d
可见的io脚: N0 \3 w0 h2 E& k+ R0 Y5 m: k
- U$ `8 {* s$ z1 @) J# h: y, C
Marvell>> gpio status -a3 y& q$ A- W4 Y
Bank GPIO1:/ _: R; b# E* M; y4 d+ b
GPIO10: input: 0 [ ]5 H7 [7 e2 {; x- S7 R9 c: @+ _
GPIO11: input: 0 [ ]4 W% V! E+ y; [$ v" ^0 Y! l, X; F! S
GPIO12: input: 1 [ ]
# E/ N/ T: ?2 x/ j) w3 D2 v& \GPIO13: input: 1 [ ]# r) \3 E& ~1 z1 x0 c
GPIO14: input: 1 [ ]6 t) N. F4 N; B" `
GPIO15: input: 1 [ ]
3 s- K6 E% i: g2 _7 R9 P% S7 NGPIO16: input: 0 [ ]* K/ f9 ]9 \5 A! P. s# S- Z
GPIO17: input: 0 [ ]6 h( c: ~9 v8 Q/ D" l
GPIO18: input: 0 [ ]
8 x/ ?/ C) f' cGPIO19: input: 0 [ ]
$ F% n0 j9 T: Q. K XGPIO110: input: 1 [ ]" F" Q: Z* C0 e1 }
GPIO111: input: 0 [ ]
4 q* @2 G" `, o* H. n3 YGPIO112: input: 0 [ ]" i. W! i) E: ?3 C1 G6 {/ `$ x$ k
GPIO113: input: 0 [ ]
! q# d) g7 ~* Z" f* ~GPIO114: input: 0 [ ]" j4 b! K# l' ?2 y, [+ n; F: ~4 `! W
GPIO115: input: 1 [ ]
+ A8 p' y- m' tGPIO116: input: 1 [ ]
( q& L* F9 w3 U- JGPIO117: input: 1 [ ]; }" Y( s: M& S6 _8 A# t
GPIO118: input: 1 [ ]
, R" i' h J4 C/ |: o% k TGPIO119: input: 1 [ ]
7 l' B- \- b, L7 MGPIO120: input: 0 [ ]
1 t! ~5 o7 D7 ~" e0 @4 bGPIO121: input: 0 [ ]/ ?* [: T k& h0 g$ P" Z
GPIO122: input: 0 [ ]
8 c, a2 H/ R" u0 P) q, mGPIO123: input: 0 [ ]
S" u0 l# M' |GPIO124: input: 0 [ ]
! J$ G6 u# L" [6 g. _) ?GPIO125: input: 0 [ ]
+ B( h, q+ I" \ M% y& ~- p- [GPIO126: input: 0 [ ]
3 w. E( x. L/ [GPIO127: input: 0 [ ]
1 r3 C3 q! d8 C4 ]* r+ J5 GGPIO128: input: 0 [ ]
9 Z! b, W# b& m8 VGPIO129: input: 0 [ ]5 O6 P# z" ~, W) {. h* [
GPIO130: input: 0 [ ]
5 `# u' I! M: {' J* b' S. DGPIO131: input: 0 [ ]( K0 d$ t7 t0 A: ], F5 K
GPIO132: input: 0 [ ]
u b& B, {) s% M4 D9 N! Q) cGPIO133: input: 0 [ ]
7 u! |- ?1 h0 L* X' gGPIO134: input: 0 [ ]
' G9 M" F9 Y3 }6 [" j! q: z% NGPIO135: input: 0 [ ]
4 v- Y; l: w7 H' T; B5 j * { \$ y+ H5 O1 E, m
/ X4 S) H- Q+ g1 O
Bank GPIO2:4 o4 U. ?- W) H+ {
GPIO20: output: 1 [x] sata_pwr" C1 L/ t+ |; j% e* G7 G- k, {
GPIO21: input: 0 [ ], x# F6 l1 f- S
GPIO22: input: 1 [ ]
4 L: z# I4 | K4 ]- N9 D- oGPIO23: input: 1 [ ]
0 k* I# e$ N: ^+ H5 H) vGPIO24: input: 1 [ ]" Y' i0 h( B; e w" l' ?+ J
GPIO25: input: 1 [ ]
7 I. h2 U- a9 IGPIO26: input: 0 [ ]
" i% N# X a+ ^9 a/ j& V) tGPIO27: input: 1 [ ]8 ~3 }9 q* u) x
GPIO28: input: 1 [ ]
4 K- m" l# \3 c+ OGPIO29: input: 1 [ ]( K2 m, u% d' ~+ @) T
GPIO210: input: 1 [ ]
9 b5 }3 ?: m% R' r- v hGPIO211: input: 1 [ ]4 Q v; w' k4 N! z* f; G" P p
GPIO212: input: 0 [ ]
* R* e* G/ c/ Q7 A5 \7 a! TGPIO213: input: 0 [ ]
2 v7 [; e, K9 @9 qGPIO214: input: 1 [ ]
5 d6 m: g: s/ \7 k9 MGPIO215: input: 1 [ ]% L/ L& z* [0 r4 n" i/ p
GPIO216: input: 1 [ ]% A) w0 V2 g) @4 o- I/ G) S
GPIO217: input: 1 [ ]8 H7 d; A" N+ u& W+ X5 o
GPIO218: input: 1 [ ]
9 e8 _# d3 q% D: a4 Y' \GPIO219: input: 1 [ ]
- z3 d: P3 X2 ~4 b FGPIO220: input: 0 [ ]2 R9 q1 u0 z2 J! |# E# k
GPIO221: output: 1 [x] phy_reset e( h7 ~1 m# p6 x( c k! K4 w
GPIO222: input: 1 [ ]* g9 M1 N% m- _1 S
GPIO223: input: 1 [ ]7 b$ l+ P2 {9 _4 o
GPIO224: input: 1 [ ]
; f# q \2 Z9 \2 A2 r, eGPIO225: input: 1 [ ]3 E9 Q; I: z6 R9 ]: g
GPIO226: input: 1 [ ]
0 k' d3 N: P) A+ l2 _; e* s2 _6 I1 T3 `GPIO227: input: 0 [ ]
% Q, G H) x, b2 wGPIO228: input: 0 [ ]
2 Y' |- A7 P8 K& n9 ^GPIO229: input: 0 [ ]
4 X* W9 a$ g5 D 2 H+ E7 f/ S- N8 H1 \
别的看不懂,只看到一个是硬盘的供电,一个是phy_reset,不知道干什么的。
* h( D- q4 w2 g- p9 F/ w; ?
: h8 N8 I% E! n0 u9 YMarvell>> gpio5 H4 {+ Q$ {: a% c
gpio - query and control gpio pins3 v" k1 v/ _* S* H
" ` S* O L/ N3 \* l5 x
7 p/ b4 t$ _! z* nUsage:
2 z5 G2 m9 B/ vgpio <input|set|clear|toggle> <pin>- H9 F! ], @! \" l9 ^
- input/set/clear/toggle the specified pin
5 g, S3 S- {6 ~! dgpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs
, z& s4 i. S7 t
3 }1 P8 F! Q+ l# [0 yset是置1,clear是置0,toggle八成就是翻转(初中级英语,没办法,全靠猜), v3 L% [2 P( Y2 R* {$ R1 G# e( T
% {' z2 T. X$ ?1 T& O2 ?# P然后看到env有地方是参数设置,类似dos的环境变量吧7 ]/ M6 V2 b$ {5 l4 v. U+ _! J
- p% z, b( F" U2 i7 {( j* Q! k) m8 U0 B
Marvell>> env print
1 @' V! j$ `3 I. A, I# ?, Iarch=arm
: f2 p4 s+ \6 u$ ]0 ^ K& Z6 a/ h9 {baudrate=115200
& n a5 C7 ~# ]. O, eboard=mvebu_armada-37xx9 ^: q% T$ s( n# R8 y
board_name=mvebu_armada-37xx( ~. u% X# X% e
boot_mmc0p1= setenv bootdev mmc 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};9 B& E+ e7 \4 w9 w) ]2 |
boot_mmc0p2= setenv bootdev mmc 0:2; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};4 `: ^/ Y% w& j5 o
boot_sata=scsi scan; setenv bootdev scsi 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};. `* D- H' ^; } q* m
boot_targets=usb mmc0p1 mmc0p2 sata
+ J9 F) g( m% `* ?boot_usb=usb start; setenv bootdev usb 0:1; ext4load ${bootdev} ${scriptaddr} /boot/boot.scr && source ${scriptaddr};/ s6 `7 U7 h& e' N/ k4 ^
bootcmd=gpio input GPIO23; if test $? = 0 ;then echo "Enter button mode";run bootcmd_button;else echo "Enter nomal Mode";run bootcmd_normal;fi
: W) |% t- K) I( b7 Lbootcmd_button=for target in ${boot_targets};do run boot_${target}; done;8 d! e$ U$ G2 | @. l6 ]2 m1 O
bootcmd_normal=run bootcmd_syno;' {. l& `9 h. H4 m" P
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;
1 I1 e9 U2 M' P. G; o. hbootdelay=1: m+ d3 c, X2 a7 @
bootdev=scsi 0:10 _; V, ^) Q0 P# z0 R
console=console=ttyMV0,115200 earlycon=ar3700_uart,0xd00120003 n/ x: ?, W4 f9 j# e
cpu=armv8
9 I4 y/ c$ j {- zethact=neta@300001 [0 _% f/ D! E4 o
ethaddr=00:11:32:11:22:00
, u0 P" g' R8 o3 Tethprime=eth06 e. P0 ]6 r2 ], X
fdt_addr=0x6000000" K7 k! P' r9 }8 s6 j
fdt_high=0xffffffffffffffff/ E) |: S# W2 w+ u; b
fdtcontroladdr=1f6437d09 m, m6 c/ h4 ~7 r8 Z$ K) V% e
gatewayip=192.168.1.254( b2 M0 ^' D* a
hostname=catdrive
' N+ s6 |2 |. J. Y2 K* n9 \image_name=/vmlinuz
7 C+ ~, v8 C+ X8 minitrd_addr=0x1100000
9 a' u$ e; j0 m( m; n% X2 _) B F5 }initrd_size=0x2000000
3 H9 L+ A3 W; V) m4 |0 qipaddr=192.168.1.119
) t! p: z; @& `& m9 t+ ~& {kernel_addr=0x7000000
, ~- E- m1 l( O- D" s# B0 }loadaddr=0x80000000 \9 p6 R0 t+ W& b* n$ m6 e! I
netdev=eth0
: T4 R) ^% y+ mnetmask=255.255.255.0& n- |4 s2 F1 P+ e) D( U
rootpath=/srv/nfs/
5 ]- P5 y' e E" S& B$ U4 ~scriptaddr=0x6d00000
' Y! M% G2 w6 z0 q: x) r3 k2 H+ aserverip=192.168.1.254
6 B6 a* H" J; U! vsoc=mvebu2 Z; L4 X6 Q8 g
stderr=serial@12000
! y3 o9 Y/ f* `! s/ Sstdin=serial@12000
8 N2 ^. T/ d, M" o+ Qstdout=serial@120008 j* P0 M+ x+ l/ T
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. K* U- l% B' A& |
vendor=Marvell e( L" ]1 f3 J9 U
# o& {/ _4 {, q! @8 Y ' @) \8 h; \1 r g8 f
Environment size: 2001/8188 bytes' Z5 E( E) r1 ~0 {
Marvell>>
/ e- r3 S$ }! N& |6 i
9 ~ B+ g. j1 P" I看到有一个GPIO23,试了下,原来是reset按钮检测,没什么用。但它有两个启动项,主要是bootcmd_normal,而这又指向bootcmd_syno./ Q. L8 i3 f9 ]+ y7 S2 y
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;" [/ \# q+ c& I+ M" r
# N3 o, o, Y* b: b这里好像是群晖引导,一条一条的命令,我又不会改linux的启动呀内核呀,只能在这儿动手了
: m8 Z9 L4 S( m/ B. C* `2 Jbootdelay=10 ,启动等待时间,1秒,太少,我都来不及按,改成10秒1 a1 s L& o+ P8 w3 M3 j# U; H
, \+ ^% x) C) i2 n0 a# Z+ E# Q/ H
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;
- s# K8 d! {$ y9 k2 g+ Y7 g \ ) ?2 w# J9 Z! h- T
注意我划掉的那部分,是先给硬盘断电,一会儿再通电,在固态硬盘可用,可能因为固态硬盘启动电流小,冲击小,当用普通盘时,有一定几率会死机,所以用普通盘时,我去掉了。; r( b1 [* c7 b: u* g, m) z
思路是:
+ c3 l! q; o, k5 [7 h/ N启动前先把phy那个=0,等10秒,关硬盘,等10秒,phy那个置1,开硬盘。之后正常启动。) s4 ~, G3 d* _. k; L: W. ]
8 Y7 ?9 j/ J* d
这样有时能得到IP,但还是会有一定几率不行,所以又加上了网上流行的ping 60秒不通时重启7 C9 J5 ?1 T6 `( c0 E
+ }- K: V3 N! f) a2 }
控制面板,任务计划-新增-触发的任务-用户定义脚本,开机启动,开机60秒得不到ip 重启3 R1 }: S9 t3 Y! w, S$ J# a) [
#!/bin/bash
; G" ^$ O; b) c8 h @0 o- a/ pdt=`date '+%d/%m/%Y %H:%M:%S'`4 v* P0 w: A2 [- y% t6 Z
echo "$dt"' J- z' z0 f/ q1 R
sleep 60$ b- t8 Y) u* w- Z) p! F% k, k
num=`ping -c20 114.114.114.114 | tail -2 | head -1 | cut -f 3 -d"," | cut -f 1 -d"%" | cut -f 2 -d" "`
# [; k% @1 v F+ l+ z6 techo $num, u& p/ _' a. Q: g( G; Z
echo $?& x; G# w) T/ _7 u
if [ $? -eq 0 -a $num -eq 0 ]; then3 D1 U# T2 D6 c* \# |
echo "$dt ok" >> /result.txt7 c" u+ E2 |7 f( B8 n f
else: `* d5 M+ e2 w- \+ j
echo "$dt noip loss $num reboot" >> /result.txt* m S/ c+ t+ B2 D4 o9 z9 H( Y3 |
reboot& ^ Z! M" s" L0 p T, U" N9 a6 \. F
fi
# D$ N- v% t) ^$ Y ' G) S' T* Q9 Q7 V8 L. c( `' c
第五行,ping后边的IP自己改,我用了一个外网的IP。8 G: v8 Z* [, M/ ^0 x+ [# `. p
; a6 j- b: U/ U5 J3 U% i总是思路就是,第一次刷完群晖会有ip,挂着硬盘,装系统,设置60秒脚本,重启,如果找不到IP,改bootcmd_syno,再重启等着进系统。
( G* p) j! P4 [5 ^
4 Q7 b& V* K1 ^# V6 P1 p7 ^8 o5 j( a6 V我反正试了几天,刚上电,等一会儿根本没有IP,60秒后,会重启,这次绝对有IP。但总要用ttl+shell盯着测试太麻烦,所以又加了一个正常启动后闪led灯的脚本,从网上抄的,忘记上谁发的了,侵权见谅。. ?$ t% _. C; B ]0 j
' N, s! D/ |9 Z8 z8 }& g5 b2 t
还是上边60秒的地方,再加一条
9 [8 t k- x- O& B9 t& U- d 5 D. G R" @2 M2 U+ D/ x
* ?" L, o: Q' m6 H# Y2cset -y -f 0 0x45 0x00 0x55; X Q% y. t% D9 |- o F
i2cset -y -f 0 0x45 0x01 0x01
0 i3 L7 F& [) l( di2cset -y -f 0 0x45 0x30 0x07+ }6 U5 _/ Q; @4 m8 ^7 O
i2cset -y -f 0 0x45 0x31 0x72
+ L# S+ ?, L/ _9 Hi2cset -y -f 0 0x45 0x32 0x72
" \7 h7 E/ {7 O* L+ l" _ {i2cset -y -f 0 0x45 0x33 0x72
: ]( n5 t2 c! H' ]5 a+ g3 Y#调节三个灯灯每周期上升沿和最高亮度时间" e1 {* |) h2 U) r1 G! c
#想要白色的话,把三个灯时间改为一样的就可以了,比如全部设为0x44
+ Q' z+ G* K7 L/ J: {# @% mi2cset -y -f 0 0x45 0x37 0x445 H( u9 W( C1 q& L5 m; F
i2cset -y -f 0 0x45 0x3a 0x55
q! U1 t5 ^& [& ci2cset -y -f 0 0x45 0x3d 0x66% i) i# h: S, {) X1 v" p k7 m
#调节三个灯每周期下降沿时间和关机时间% R' n" ]5 a0 O
i2cset -y -f 0 0x45 0x38 0x44
3 J- m" t# j" f, r ?i2cset -y -f 0 0x45 0x3b 0x557 J* B! J6 S, M1 |
i2cset -y -f 0 0x45 0x3e 0x66
$ y# x |4 Q$ Qi2cset -y -f 0 0x45 0x39 0x40! a6 R& w5 X7 c5 J( w, Q
i2cset -y -f 0 0x45 0x3c 0x40
7 P* W7 K! {/ w; Ki2cset -y -f 0 0x45 0x3f 0x40 h# v! |( Q+ M$ N2 J% S7 T( d
# 0-255,更亮9 |( Q/ v& ?; I9 V# @, a, Y
i2cset -y -f 0 0x45 0x34 128
# x( M+ q/ S3 |: Ji2cset -y -f 0 0x45 0x35 128
1 i; Z. _$ p% Z. ~* d3 S9 o, ei2cset -y -f 0 0x45 0x36 128% E& E+ n1 a* y7 ~' P1 D8 C; o: `
! v) E; _6 L, p' x+ V然后在这条设置里有一个“先行任务”,设置成上边的60秒,也就是60秒那条执行完才执行这条。而60秒那条,没有ip就会重启,有ip就完成了,就会执行亮灯& A1 d- J. m% d! j
m) ?& A# g- E
# }$ K0 O- I& g0 \7 G4 I l我知道很多大神会做内核解决各种问题,我也知道看起来很小的问题,工作量是非常大的,可能要几个月才能解决,所以大神做的东西是不可能轻易免费发出来的,人家也要吃饭,不可能靠爱发电(我也在公司做简单的技术,知道技术无价的道理)。我从99年学电脑开始,绝大部分的东西都是从网上找来学的,所以非常感谢所有把知识发到网上共享的大神们。& B8 H9 Y' H e% V/ o, o; V
% {: I6 z) t( \' N7 e# c
希望大家有条件能测试一下这个方法,如果可行,请发出去让更多的人看到,如果有改进的方法,也请共享出来,因为这个方法换盘好像不方便。4 j Z5 u; X7 e, O% t \
|
|