LINUX.ORG.RU

Сообщения GrukhvinEV

 

Ремонт видеорегистратора

Добрый день. Есть два регистратора, 1 рабочий, на втором сгорел процессор HI3520D. Процессор нашел, перепаял. Но родное яро на нем перестало грузиться. Слил с обоих регеров прошивки, сравнил, идентичные. Левое ядро какое то нашел,залил, работает, но естественно не так как надо. Почему перестало грузиться родное ядро ? Это защита какая то ? Как она реализована ? Лог рабочего:

U-Boot 2010.06 (Dec 05 2013 - 16:53:16)

Check spi flash controller v350... Found
Spi(cs1) ID: 0xC2 0x20 0x19 0xC2 0x20 0x19
Spi(cs1): Block:64KB Chip:32MB Name:"MX25L25635E/735E/635F"
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
32768 KiB hi_sfc at 0:0 is now current device

mmu_enable
<<imgwidth=1024, imgheight=768, linebytes=2048>>
decode success!!!!
dev 0 set background color!
dev 2 set background color!
dev 0 opened!
dev 2 opened!
graphic layer 0 opened!
graphic layer 2 opened!
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
32768 KiB hi_sfc at 0:0 is now current device

## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.0.8
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1567336 Bytes = 1.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 3.0.8 (root@sqy-desktop) (gcc version 4.4.1 (Hisilicon_v100(gcc4.4-290+uclibc_0.9.32.1+eabi+linuxpthread)) ) #81 Fri Oct 17 16:20:03 CST 2014
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: hi3520d
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 37338
Kernel command line: mem=147M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=squashfs mtdparts=hi_sfc:320K(uboot),1536K(kernel),4M(rfs),25792K(app),768K(config),256K(logo)
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 147MB = 147MB total
Memory: 144904k/144904k available, 5624k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc9800000 - 0xfe000000   ( 840 MB)
    lowmem  : 0xc0000000 - 0xc9300000   ( 147 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0023000   ( 108 kB)
      .text : 0xc0023000 - 0xc03b0000   (3636 kB)
      .data : 0xc03b0000 - 0xc03cbac0   ( 111 kB)
       .bss : 0xc03cbae4 - 0xc0418020   ( 306 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:128 nr_irqs:128 128
sched_clock: 32 bits at 82MHz, resolution 12ns, wraps every 52060ms
Console: colour dummy device 80x30
Calibrating delay loop... 1318.91 BogoMIPS (lpj=6594560)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Serial: AMBA PL011 UART driver
uart:0: ttyAMA0 at MMIO 0x20080000 (irq = 40) is a PL011 rev2
console [ttyAMA0] enabled
uart:1: ttyAMA1 at MMIO 0x20090000 (irq = 41) is a PL011 rev2
uart:2: ttyAMA2 at MMIO 0x200a0000 (irq = 42) is a PL011 rev2
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource timer1
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
L2cache cache controller enabled
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.16)
msgmni has been set to 283
encryption fail
no ack
sha204_sn is 1
sha204_sn is 23
sha204_sn is 16
sha204_sn is 86
sha204_sn is 4e
sha204_sn is a9
sha204_sn is 9
sha204_sn is 46
sha204_sn is ee
no ack
count is 255
no ack
no ack
no ack
no ack
no ack
count is 255
no ack
no ack
no ack
no ack
no ack
count is 255
no ack
no ack
no ack
no ack
no ack
count is 255
no ack
no ack
no ack
no ack
no ack
count is 255
no ack
no ack
no ack
no ack
no ack
count is 255
no ack
no ack
no ack
no ack
no ack
count is 255
no ack
no ack
no ack
no ack
sha204_devinfo  is 44 i is 0
sha204_devinfo  is 56 i is 1
sha204_devinfo  is 52 i is 2
sha204_devinfo  is 32 i is 3
sha204_devinfo  is 33 i is 4
sha204_devinfo  is 35 i is 5
sha204_devinfo  is 31 i is 6
sha204_devinfo  is 35 i is 7
sha204_devinfo  is 30 i is 8
sha204_devinfo  is 34 i is 9
sha204_devinfo  is 1 i is 10
sha204_devinfo  is 55 i is 11
sha204_devinfo  is 11 i is 12
g_sha204_delay_time is 20
sha204_sn is 1
sha204_sn is 23
sha204_sn is 16
sha204_sn is 86
sha204_sn is 4e
sha204_sn is a9
sha204_sn is 9
sha204_sn is 46
sha204_sn is ee
sha204_devinfo  is 44 i is 0
sha204_devinfo  is 56 i is 1
sha204_devinfo  is 52 i is 2
sha204_devinfo  is 32 i is 3
sha204_devinfo  is 33 i is 4
sha204_devinfo  is 35 i is 5
sha204_devinfo  is 31 i is 6
sha204_devinfo  is 35 i is 7
sha204_devinfo  is 30 i is 8
sha204_devinfo  is 34 i is 9
sha204_devinfo  is 1 i is 10
sha204_devinfo  is 55 i is 11
sha204_devinfo  is 0 i is 12
sha204_devinfo  is 0 i is 13
sha204_devinfo  is 0 i is 14
sha204_devinfo  is 0 i is 15
TempKey  is 9
TempKey  is 69
TempKey  is 29
TempKey  is 64
TempKey  is b9
TempKey  is 67
TempKey  is 2
TempKey  is 4e
TempKey  is 17
TempKey  is df
TempKey  is a9
TempKey  is 4e
TempKey  is 3d
TempKey  is 6a
TempKey  is f2
TempKey  is ca
TempKey  is be
TempKey  is 22
TempKey  is 2c
TempKey  is 3
TempKey  is 85
TempKey  is ca
TempKey  is 8d
TempKey  is f6
TempKey  is ba
TempKey  is 21
TempKey  is 86
TempKey  is 2c
TempKey  is 1f
TempKey  is 69
TempKey  is 4e
TempKey  is bc
encryption ok
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered (default)
io scheduler cfq registered
brd: module loaded
loop: module loaded
ahci: SSS flag set, parallel bus scan disabled
ahci ahci.0: AHCI 0001.0200 32 slots 2 ports 3 Gbps 0x3 impl platform mode
ahci ahci.0: flags: ncq sntf stag pm led clo only pmp pio slum part ccc sxs boh
scsi0 : ahci_platform
scsi1 : ahci_platform
ata1: SATA max UDMA/133 mmio [mem 0x10080000-0x1008ffff] port 0x100 irq 52
ata2: SATA max UDMA/133 mmio [mem 0x10080000-0x1008ffff] port 0x180 irq 52
Spi id table Version 1.22
Spi(cs1) ID: 0xC2 0x20 0x19 0xC2 0x20 0x19
SPI FLASH start_up_mode is 3 Bytes
Spi(cs1):
Block:64KB
Chip:32MB
Name:"MX25L25635E/735E/635F"
spi size: 0x33554432
chip num: 1
6 cmdlinepart partitions found on MTD device hi_sfc
Creating 6 MTD partitions on "hi_sfc":
0x000000000000-0x000000050000 : "uboot"
0x000000050000-0x0000001d0000 : "kernel"
0x0000001d0000-0x0000005d0000 : "rfs"
0x0000005d0000-0x000001f00000 : "app"
0x000001f00000-0x000001fc0000 : "config"
0x000001fc0000-0x000002000000 : "logo"
Fixed MDIO Bus: probed
ata1: SATA link down (SStatus 0 SControl 300)
himii: probed
ata2: SATA link down (SStatus 0 SControl 300)
Invalid HW-MAC Address: 00:00:00:00:00:00
Set Random MAC address: 42:D5:2B:5E:7B:6C
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
hiusb-ehci hiusb-ehci.0: HIUSB EHCI
hiusb-ehci hiusb-ehci.0: new USB bus registered, assigned bus number 1
hiusb-ehci hiusb-ehci.0: irq 53, io mem 0x100b0000
hiusb-ehci hiusb-ehci.0: USB 0.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
hiusb-ohci hiusb-ohci.0: HIUSB OHCI
hiusb-ohci hiusb-ohci.0: new USB bus registered, assigned bus number 2
hiusb-ohci hiusb-ohci.0: irq 54, io mem 0x100a0000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usbcore: registered new interface driver cdc_wdm
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
mousedev: PS/2 mouse device common for all mice
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
registered taskstats version 1
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing init memory: 108K

            _ _ _ _ _ _ _ _ _ _ _ _
            \  _  _   _  _ _ ___
            / /__/ \ |_/
           / __   /  -  _ ___
          / /  / /  / /
  _ _ _ _/ /  /  \_/  \_ ______
___________\___\__________________

[RCS]: /etc/init.d/S00devs
[RCS]: /etc/init.d/S01udev
Jan  1 00:00:03 udevd (487): /proc/487/oom_adj is deprecated, please use /proc/487/oom_score_adj instead.
udevd[487]: main: error opening /dev/null: No such file or directory
[RCS]: /etc/init.d/S03ants
init hotplug
start hotplug ok
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01361ba0: 0xc859 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01361ba4: 0x1004 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01361ba8: 0x7d7d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01361bac: 0x0080 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01361bb0: 0xa529 instead
SDK_TYPE type is 8d1
Hisilicon Media Memory Zone Manager
hi3520D_base: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
Hisilicon UMAP device driver interface: v3.00
load sys.ko for Hi3520D...OK!
Load tde.ko ...OK!
load venc.ko for Hi3520D...OK!
load group.ko for Hi3520D...OK!
load chnl.ko for Hi3520D...OK!
load h264e.ko for Hi3520D...OK!
load rc.ko for Hi3520D...OK!
load jpege.ko for Hi3520D...OK!
load viu.ko for Hi3520D...OK!
load vou.ko ....OK!
load vpss.ko ....OK!
load vda.ko ....OK!
load region.ko ....OK!
rm: can't remove '/root/DeviceDisplay.xml': No such file or directory
rm: can't remove '/root/res_xml/DeviceDisplay.xml': No such file or directory
rm: can't remove '/root/DeviceDisplay.xml': No such file or directory
load vdec.ko ....OK
load vhd firmware.ko OK
load hdmi.ko ....OK!
Load jpeg6b.ko success.         (SDK_VERSION:[jpeg6bv1.0] Build Time:[Jul 30 2013, 17:13:35])
HISI_IRDA-MF @Hi3520Dv100R00
hiir: init ok. ver=Nov 26 2013, 15:14:13.
USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems
rtusb init rt2870 --->
usbcore: registered new interface driver rt2870
PPP generic driver version 2.4.2
rm: can't remove '/usr/etc/config.tar.gz': No such file or directory
mkdir: can't create directory '/usr/etc/tmp': File exists
mkdir: can't create directory '/usr/etc/var': File exists
mkdir: can't create directory '/usr/etc/var/run': File exists
mkdir: can't create directory '/usr/etc/var/lock': File exists
mkdir: can't create directory '/usr/etc/ppp': File exists
mkdir: can't create directory '/usr/etc/ppp/peers': File exists
rm: can't remove '/usr/etc/tmp/qtembedded-0/fonts/fontdb': No such file or directory
ln: /usr/etc/web/web: File exists
cp: can't stat '/usr/sbin/wcdma-chat-disconnect': No such file or directory
/etc/init.d/S03ants: line 56: /etc/startusb: not found
[RCS]: /etc/init.d/S80network
Auto login as root ...
Sep 13 09:11:15 login[818]: root login on 'ttyS000'
Welcome to HiLinux.
# begin dvr//////////////////////////////////////////////////////////////
argc 2, argv ./ants_dvr
 open /usr/etc/mycfg.xml

 open /root/res_xml/Keyboard.xml

 open /tmp/qtembedded-0//fonts//fontdb.tmp

 open /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/gulim_17_50.qpf2

 open /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/microsoft_sans_serif_12_75.qpf2

 open /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/yh_17_50.qpf2

DBG[embedded/qscreenlinuxfb_qws.cpp connect▒▒350]       QLinuxFbScreen::connect :0
DBG[embedded/qscreenlinuxfb_qws.cpp connect▒▒379]
 open /dev/fb0

DBG[embedded/qscreenlinuxfb_qws.cpp connect▒▒397]       open device /dev/fb0 success
DBG[embedded/qscreenlinuxfb_qws.cpp connect▒▒425]
 open /usr/etc/mycfg.xml

 open /root/DeviceDisplay.xml
и т.д.
Лог нерабочего:
U-Boot 2010.06 (Dec 05 2013 - 16:53:16)

Check spi flash controller v350... Found
Spi(cs1) ID: 0xC2 0x20 0x19 0xC2 0x20 0x19
Spi(cs1): Block:64KB Chip:32MB Name:"MX25L25635E/735E/635F"
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
32768 KiB hi_sfc at 0:0 is now current device

mmu_enable
<<imgwidth=1024, imgheight=768, linebytes=2048>>
decode success!!!!
dev 0 set background color!
dev 2 set background color!
dev 0 opened!
dev 2 opened!
graphic layer 0 opened!
graphic layer 2 opened!
(Re)start USB...

## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.0.8
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1567336 Bytes = 1.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 3.0.8 (root@sqy-desktop) (gcc version 4.4.1 (Hisilicon_v100(gcc4.4-290+uclibc_0.9.32.1+eabi+linuxpthread)) ) #81 Fri Oct 17 16:20:03 CST 2014
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: hi3520d
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 37338
Kernel command line: mem=147M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=squashfs mtdparts=hi_sfc:320K(uboot),1536K(kernel),4M(rfs),25792K(app),768K(config),256K(logo)
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 147MB = 147MB total
Memory: 144904k/144904k available, 5624k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc9800000 - 0xfe000000   ( 840 MB)
    lowmem  : 0xc0000000 - 0xc9300000   ( 147 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0023000   ( 108 kB)
      .text : 0xc0023000 - 0xc03b0000   (3636 kB)
      .data : 0xc03b0000 - 0xc03cbac0   ( 111 kB)
       .bss : 0xc03cbae4 - 0xc0418020   ( 306 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:128 nr_irqs:128 128
sched_clock: 32 bits at 82MHz, resolution 12ns, wraps every 52060ms
Console: colour dummy device 80x30
Calibrating delay loop... 1318.91 BogoMIPS (lpj=6594560)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Serial: AMBA PL011 UART driver
uart:0: ttyAMA0 at MMIO 0x20080000 (irq = 40) is a PL011 rev2
console [ttyAMA0] enabled
uart:1: ttyAMA1 at MMIO 0x20090000 (irq = 41) is a PL011 rev2
uart:2: ttyAMA2 at MMIO 0x200a0000 (irq = 42) is a PL011 rev2
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource timer1
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
L2cache cache controller enabled
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.16)
msgmni has been set to 283
encryption fail
count is 0
sha204p_receive_response failed
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0
count is 0

 , ,

GrukhvinEV
()

Как скопировать данные прошивки на флэшку

Добрый день! Мне надо скопировать /dev/root (получается что здесь хранится прошивка с которой поднимается система ?) на флэшку. Пробую так:

# fdisk -l

Disk /dev/sda: 3876 MB, 3876225024 bytes

255 heads, 63 sectors/track, 471 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sda1 * 1 471 3783276 7 HPFS/NTFS

# df -h

Filesystem Size Used Available Use% Mounted on

/dev/root 90.0M 56.6M 33.4M 63% /

tmpfs 91.7M 4.0K 91.7M 0% /dev

tmpfs 91.7M 4.0K 91.7M 0% /tmp

# dd if=/dev/root of=/dev/sda

dd: can't open '/dev/root': No such file or directory

не работает....

Погуглил, вроде какое то отношение к этому делу имеет файл /ect/fstab

Вот его содержимое:

proc /proc proc defaults 0 0

sysfs /sys sysfs defaults 0 0

tmpfs /dev tmpfs defaults 0 0

tmpfs /tmp tmpfs defaults 0 0

 ,

GrukhvinEV
()

Как скопировать образ системы через tftp сервер

Есть устройство работающее на linux. (none) login: root Password: Welcome to HiLinux. None of nfsroot found in cmdline. # fdisk -l

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System /dev/sda1 1 1306 10490413+ 83 Linux /dev/sda2 1307 243201 1943021587+ 5 Extended /dev/sda5 1308 243201 1943013523+ b Win95 FAT32 # Как мне скопирвовать содержимое /dev/sda или /dev/sda1,/dev/sda2,/dev/sda5 в файл и отправить все это дело на tftp сервер ?

 ,

GrukhvinEV
()

Защита от копирования прошивки

Добрый день! Убил китайскую ip камеру при прошивке. Долго разбирался но все таки снял дамп flash памяти с точно такой же камеры, записал ее. Вроде заработало, но ругается мол нелигальное копирование и не работает! Как можно починить и как реализована такая защита ? Вот лог загрузки:

U-Boot 2010.06 (Aug 28 2014 - 14:32:48)

Check spi flash controller v350... Found
Spi(cs1) ID: 0xC8 0x40 0x17 0xC8 0x40 0x17
Spi(cs1): Block:64KB Chip:8MB Name:«GD25Q64»
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0 
8192 KiB hi_sfc at 0:0 is now current device

## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Linux-3.0.8
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1162812 Bytes = 1.1 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 3.0.8 (root@localhost.localdomain) (gcc version 4.4.1 (Hisilicon_v100(gcc4.4-290+uclibc_0.9.32.1+eabi+linuxpthread)) ) #7 Tue Apr 29 09:48:55 CST 2014
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: hi3518
Memory policy: ECC disabled, Data cache writeback
AXI bus clock 200000000.
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 7620
Kernel command line: mem=30M console=ttyAMA0,115200 root=/dev/mtdblock3 rootfstype=squashfs mtdparts=hi_sfc:256K(boot),1280k(kernel),512K(dataBlock),6144K(rootfs)
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 30MB = 30MB total
Memory: 27500k/27500k available, 3220k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc2000000 - 0xfe000000   ( 960 MB)
    lowmem  : 0xc0000000 - 0xc1e00000   (  30 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc001f000   (  92 kB)
      .text : 0xc001f000 - 0xc02b6000   (2652 kB)
      .data : 0xc02b6000 - 0xc02c80a0   (  73 kB)
       .bss : 0xc02c80c4 - 0xc02d49f0   (  51 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:32 nr_irqs:32 32
sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949ms
Calibrating delay loop... 218.72 BogoMIPS (lpj=1093632)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Serial: AMBA PL011 UART driver
uart:0: ttyAMA0 at MMIO 0x20080000 (irq = 5) is a PL011 rev2
console [ttyAMA0] enabled
uart:1: ttyAMA1 at MMIO 0x20090000 (irq = 5) is a PL011 rev2
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Switching to clocksource timer1
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.16)
msgmni has been set to 53
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered (default)
io scheduler cfq registered
TS82 driver for HI3518C
Can not pass authentication ... ...
Can not pass authentication ... ...
brd: module loaded
Spi id table Version 1.22
Spi(cs1) ID: 0xC8 0x40 0x17 0xC8 0x40 0x17
SPI FLASH start_up_mode is 3 Bytes
Spi(cs1): 
Block:64KB 
Chip:8MB 
Name:«GD25Q64»
spi size: 8MB
chip num: 1
4 cmdlinepart partitions found on MTD device hi_sfc
Creating 4 MTD partitions on «hi_sfc»:
0x000000000000-0x000000040000 : «boot»
0x000000040000-0x000000180000 : «kernel»
0x000000180000-0x000000200000 : «dataBlock»
0x000000200000-0x000000800000 : «rootfs»
Fixed MDIO Bus: probed
himii: probed
PHY himii:01 not found
hieth:hieth_platdev_probe_port:669: 
connect to phy_device himii:01 failed!
hieth:hieth_plat_driver_probe:798: 
no dev probed!

PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
NET: Registered protocol family 24
TCP cubic registered
NET: Registered protocol family 17
registered taskstats version 1
�SQUASHFS error: Xattrs in filesystem, these will be ignored
SQUASHFS error: unable to read xattr id index table
VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
Freeing init memory: 92K
init started: BusyBox v1.16.1 (2014-05-26 14:04:26 CST)
starting pid 235, tty ": '/etc/init.d/rcS'

            _ _ _ _ _ _ _ _ _ _ _ _
            \  _  _   _  _ _ ___
            / /__/ \ |_/
           / __   /  -  _ ___
          / /  / /  / /
  _ _ _ _/ /  /  \_/  \_ ______
___________\___\__________________

[RCS]: /etc/init.d/S00devs
[RCS]: /etc/init.d/S01udev
udevd (247): /proc/247/oom_adj is deprecated, please use /proc/247/oom_score_adj instead.
*** Board tools : ver0.0.1_20120501  *** 
[debug]: {source/utils/cmdshell.c:166}cmdstr:himm
0x200f0008: 0x00000000 --> 0x00000001 
[END]
*** Board tools : ver0.0.1_20120501  *** 
[debug]: {source/utils/cmdshell.c:166}cmdstr:himm
0x200f0018: 0x00000000 --> 0x00000001 
[END]
*** Board tools : ver0.0.1_20120501  *** 
[debug]: {source/utils/cmdshell.c:166}cmdstr:himm
0x200f001c: 0x00000000 --> 0x00000001 
[END]
*** Board tools : ver0.0.1_20120501  *** 
[debug]: {source/utils/cmdshell.c:166}cmdstr:himm
0x200f0124: 0x00000000 --> 0x00000000 
[END]
*** Board tools : ver0.0.1_20120501  *** 
[debug]: {source/utils/cmdshell.c:166}cmdstr:himm
0x20140400: 0x00000038 --> 0x00000002 
[END]
*** Board tools : ver0.0.1_20120501  *** 
[debug]: {source/utils/cmdshell.c:166}cmdstr:himm
0x201403fc: 0x00000034 --> 0x00000002 
[END]
Hisilicon Watchdog Timer: 0.01 initialized. default_margin=30 sec (nowayout= 0, nodeamon= 1)
hi_i2c init is ok!
ADC_CH0 driverInit 
IRCUT ADC
TS8x driver for HI3535
Check authentication TS8x :
crypto chip type invalid...
Can not pass ts8x authentication ...
try read e2prom data...
d2 a3 08 87 68 f2 01 1e fe c2 06 69 5d 57 62 f7 
cb 67 65 80 71 36 6c 19 e7 83 12 84 3e a8 0b 9d 
27 2b d3 89 5a 7a da 10 cc 4a dd 67 6f df b9 f9 
f6 00 00 08 ff ff ff ff ff ff ff ff 5a f5 6f ff 
b6 80 f7 8a 4f 14 ec 49 79 32 ad dd be 13 f9 64 
13 ab ec 0d 42 0c 4f 47 01 79 93 63 c4 8e 22 58 
c3 ca d1 14 a7 35 b9 49 9f d0 53 69 94 5c 1e 43 
94 ac e0 68 e6 ed 3d 18 b5 5c cb ef a9 e7 7f ef 
16 b0 58 03 0d b8 01 d4 94 be 31 58 c0 ad 72 bc 
24 3a 7f 50 12 c2 df 9b 5c f3 6c fb 5d 61 1d 44 
8d ad 18 2c 2c 7f e5 a2 d7 a4 ad 37 bc a5 d3 f8 
cf 70 41 0a 50 44 37 ee 75 90 9a 59 8f 8b 0a a3 
fa 8a 08 73 1e d9 63 e2 5a 2d 55 7e db 86 5d 9c 
3f 36 0e eb 85 67 07 72 13 57 00 05 82 4a bf 95 
14 7a b8 e2 ae 2b b1 7b 38 1b b6 0c 9b 8e d2 92 
0d be d5 e5 b7 ef dc 7c 21 df db 0b d4 d2 d3 86 
key_pos = 19, data_pos = 37
check e2prom data error(ffffffff).exit;
create device inode...
/etc/init.d/rcS: cd: line 51: can't cd to /home/Hi3518_ITTB_MPP_V1.0.8.1
/etc/init.d/rcS: line 52: ./HiIspTool.sh: not found
starting pid 285, tty ": '/bin/login'
Warning: this device is an illegal copy to TOPSEE IPNC!!!
(none) login: Warning: this device is an illegal copy to TOPSEE IPNC!!!
Warning: this device is an illegal copy to TOPSEE IPNC!!!

 ,

GrukhvinEV
()

Как записать новый образ linux в устройство

Добрый день! Сделали из IP камеры при прошивки кирпич, но решил не сдаваться и восстановить ее. Заводская прошивка есть. Нашел у нее UART подцепился к ней, вижу загрузку: C-Kermit> set line /dev/ttyUSB0

C-Kermit> set speed 115200

C-Kermit> set serial 8N1

C-Kermit> set carrier-watch off

C-Kermit> set flow-control none

C-Kermit> set prefixing all

C-Kermit> set modem none

C-Kermit> set file type bin

C-Kermit> set file name lit

C-Kermit> connect

Check spi flash controller v350... Found

Spi(cs1) ID: 0xC8 0x40 0x17 0xC8 0x40 0x17

Spi(cs1): Block:64KB Chip:8MB Name:«GD25Q64»

In: serial

Out: serial

Err: serial

Hit any key to stop autoboot: 0

8192 KiB hi_sfc at 0:0 is now current device

## Booting kernel from Legacy Image at 81000000 ...

Image Name: Linux-3.0.8

Image Type: ARM Linux Kernel Image (uncompressed)

Data Size: 1162812 Bytes = 1.1 MiB

Load Address: 80008000

Entry Point: 80008000

Loading Kernel Image ... OK

OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Linux version 3.0.8 (root@localhost.localdomain) (gcc version 4.4.1 (Hisilicon_v100(gcc4.4-290+uclibc_0.9.32.1+eabi+linuxpthread)) ) #7 Tue Apr 29 09:48:55 CST 2014

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

CPU: VIVT data cache, VIVT instruction cache

Machine: hi3518

Memory policy: ECC disabled, Data cache writeback AXI bus clock 200000000. Built 1 zonelists in Zone order, mobility grouping on. Total pages: 18796

Kernel command line: mem=74M console=ttyAMA0,115200 root=/dev/mtdblock3 rootfstype=squashfs mtdparts=hi_sfc:256K(boot),1280k(kernel),512K(dataBlock),6144K(rootfs)

PID hash table entries: 512 (order: -1, 2048 bytes)

Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)

Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)

Memory: 74MB = 74MB total

Memory: 72132k/72132k available, 3644k reserved, 0K highmem

Virtual kernel memory layout:

vector : 0xffff0000 - 0xffff1000 ( 4 kB)

fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)

DMA : 0xffc00000 - 0xffe00000 ( 2 MB)

vmalloc : 0xc5000000 - 0xfe000000 ( 912 MB)

lowmem : 0xc0000000 - 0xc4a00000 ( 74 MB)

modules : 0xbf000000 - 0xc0000000 ( 16 MB)

.init : 0xc0008000 - 0xc001f000 ( 92 kB)

.text : 0xc001f000 - 0xc02b6000 (2652 kB)

.data : 0xc02b6000 - 0xc02c80a0 ( 73 kB)

.bss : 0xc02c80c4 - 0xc02d49f0 ( 51 kB)

SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

NR_IRQS:32 nr_irqs:32 32

sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949ms

Calibrating delay loop... 218.72 BogoMIPS (lpj=1093632)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

NET: Registered protocol family 16

Serial: AMBA PL011 UART driver

uart:0: ttyAMA0 at MMIO 0x20080000 (irq = 5) is a PL011 rev2

console [ttyAMA0] enabled

uart:1: ttyAMA1 at MMIO 0x20090000 (irq = 5) is a PL011 rev2

bio: create slab <bio-0> at 0

SCSI subsystem initialized

Switching to clocksource timer1

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 4096 (order: 3, 32768 bytes)

TCP bind hash table entries: 4096 (order: 2, 16384 bytes)

TCP: Hash tables configured (established 4096 bind 4096)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

squashfs: version 4.0 (2009/01/31) Phillip Lougher

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

fuse init (API version 7.16)

msgmni has been set to 140

Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)

io scheduler noop registered

io scheduler deadline registered (default)

io scheduler cfq registered

TS82 driver for HI3518C

Can not pass authentication ... ...

Can not pass authentication ... ...

brd: module loaded

Spi id table Version 1.22

Spi(cs1) ID: 0xC8 0x40 0x17 0xC8 0x40 0x17

SPI FLASH start_up_mode is 3 Bytes

Spi(cs1):

Block:64KB

Chip:8MB

Name:«GD25Q64»

spi size: 8MB

chip num: 1

4 cmdlinepart partitions found on MTD device hi_sfc

Creating 4 MTD partitions on «hi_sfc»:

0x000000000000-0x000000040000 : «boot»

0x000000040000-0x000000180000 : «kernel»

0x000000180000-0x000000200000 : «dataBlock»

0x000000200000-0x000000800000 : «rootfs»

Fixed MDIO Bus: probed

himii: probed

PPP generic driver version 2.4.2

PPP Deflate Compression module registered

PPP BSD Compression module registered

NET: Registered protocol family 24

TCP cubic registered

NET: Registered protocol family 17

registered taskstats version 1

�SQUASHFS error: Xattrs in filesystem, these will be ignored

SQUASHFS error: unable to read xattr id index table

SQUASHFS error: unable to read inode lookup table

List of all partitions:

1f00 256 mtdblock0 (driver?)

1f01 1280 mtdblock1 (driver?)

1f02 512 mtdblock2 (driver?)

1f03 6144 mtdblock3 (driver?)

f000 256 romblock0 (driver?)

f001 1280 romblock1 (driver?)

f002 512 romblock2 (driver?)

f003 6144 romblock3 (driver?)

No filesystem could mount root, tried: squashfs

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)

Backtrace: [<c00235a0>] (dump_backtrace+0x0/0x10c) from [<c022a7f4>] (dump_stack+0x18/0x1c)

r6:c001b4bc r5:c02c8370 r4:c02c8370 r3:0000000a

[<c022a7dc>] (dump_stack+0x0/0x1c) from [<c022a85c>] (panic+0x64/0x190) [<c022a7f8>] (panic+0x0/0x190) from [<c0008ed4>] (mount_block_root+0x26c/0x2bc) r3:c441ff2c r2:80000000 r1:c441ff60 r0:c028418c r7:00000009 [<c0008c68>] (mount_block_root+0x0/0x2bc) from [<c0008f78>] (mount_root+0x54/0x6c) [<c0008f24>] (mount_root+0x0/0x6c) from [<c00090f0>] (prepare_namespace+0x160/0x1b8) r5:c001b4d1 r4:c02c8140 [<c0008f90>] (prepare_namespace+0x0/0x1b8) from [<c0008458>] (kernel_init+0xe8/0x11c) r5:c001aca8 r4:c001aca8 [<c0008370>] (kernel_init+0x0/0x11c) from [<c003309c>] (do_exit+0x0/0x700) r5:c0008370 r4:00000000

Есть загрузчик: U-Boot 2010.06 (Jun 04 2014 - 14:06:51)

hisilicon # ? ? - alias for 'help'

base - print or set address offset

bootm - boot application image from memory

bootp - boot image via network using BOOTP/TFTP protocol

cmp - memory compare

cp - memory copy

crc32 - checksum calculation

ext2load- load binary file from a Ext2 filesystem

ext2ls - list files in a directory (default /)

fatinfo - print information about filesystem

fatload - load binary file from a dos filesystem

fatls - list files in a directory (default /)

getinfo - print hardware information

go - start application at address 'addr'

help - print command description/usage

loadb - load binary file over serial line (kermit mode)

loady - load binary file over serial line (ymodem mode)

loop - infinite loop on address range

md - memory display

mii - MII utility commands

mm - memory modify (auto-incrementing address)

mtest - simple RAM read/write test

mw - memory write (fill)

nm - memory modify (constant address)

ping - send ICMP ECHO_REQUEST to network host

printenv- print environment variables

rarpboot- boot image via network using RARP/TFTP protocol

reset - Perform RESET of the CPU

saveenv - save environment variables to persistent storage

setenv - set environment variables

sf - SPI flash sub-system

tftp - tftp - download or upload image via network using TFTP protocol

usb - USB sub-system

usbboot - boot from USB device

version - print monitor version

А вот заводская прошивка: root@kali:~# file orig.bin

orig.bin: data

root@kali:~# binwalk orig.bin

DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 1556 0x614 uImage header, header size: 64 bytes, header CRC: 0x25C2417B, created: Tue Apr 29 05:48:58 2014, image size: 1162812 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0xD56C3525, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: «Linux-3.0.8» 1164432 0x11C490 Squashfs filesystem, little endian, version 4.0, compression:lzma (non-standard type definition), size: 6221278 bytes, 670 inodes, blocksize: 131072 bytes, created: Thu Dec 4 12:27:11 2014

На камеру закидываю ее вот так: hisilicon # loadb

## Ready for binary (kermit) download to 0x80008000 at 115200 bps...

(Back at kali)

----------------------------------------------------

(/root/) C-Kermit>send orig.bin

(/root/) C-Kermit>connect

Connecting to /dev/ttyUSB0, speed 115200

Escape character: Ctrl-\ (ASCII 28, FS): enabled

Type the escape character followed by C to get back,

or followed by ? to see other options. ----------------------------------------------------

## Total Size = 0x003ea37e = 4105086 Bytes

## Start Addr = 0x80008000

А вот дальше ума не приложу че делать, так как в linux не соображаю нифига. Пишите пожалуйста подробно. Спасибо!

 

GrukhvinEV
()

Проверка CRC32

Добрый день! Вопрос такой, проверяю CRC32 файла из по винды, говорит:0x9E5A7DB8 Проверяю под linux root@kali:~# crc32 origfs, говорит:0x9E5A7DB8 А поскольку вот так намного удобнее и по частям можно файлы смотреть $ python

from zlib import crc32
d=open(«origfs», «r»).read()
hex(crc32(d[0:6221824])

говорит другую непонятную сумму! почему ? что не так ? как проверить CRC32 последним методом ? размер файла 6221824байт

 

GrukhvinEV
()

Как отредактировать squashfs в прошивке

Добрый день, хочу отредактировать прошивку, а конкретно файл в образе squashfs, после этого собрать все как было. Распаковать прошивку и изменить файл можно и 7-zip, но как собрать все как было, чтоб устройство ее приняло ?

root@kali:~# binwalk orig.bin

DECIMAL HEXADECIMAL DESCRIPTION --------------------------------------------------------------------------------

1556 0x614 uImage header, header size: 64 bytes, header CRC: 0x25C2417B, created: Tue Apr 29 05:48:58 2014, image size: 1162812 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0xD56C3525, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: «Linux-3.0.8»

1164432 0x11C490 Squashfs filesystem, little endian, version 4.0, compression:lzma (non-standard type definition), size: 6221278 bytes, 670 inodes, blocksize: 131072 bytes, created: Thu Dec 4 12:27:11 2014

 ,

GrukhvinEV
()

Распаковка прошивки IP камеры

Добрый день, помогите распаковать прошивку IP камеры. Как выдернуть из нее файл образа ? Я так понимаю это не zip архив, распаковать не выходи, пытался сделать так root@xc:~/firmware# dd bs=1 skip=1556 if=orig.img of=orig.cramfs, пишет superblock magic not found. В крации толком не соображаю, пальцем в небо тычу. Спасибо!

root@kali:~# file orig.bin orig.bin: data root@kali:~# binwalk orig.bin

DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 1556 0x614 uImage header, header size: 64 bytes, header CRC: 0x25C2417B, created: Tue Apr 29 05:48:58 2014, image size: 1162812 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0xD56C3525, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: «Linux-3.0.8» 1164432 0x11C490 Squashfs filesystem, little endian, version 4.0, compression:lzma (non-standard type definition), size: 6221278 bytes, 670 inodes, blocksize: 131072 bytes, created: Thu Dec 4 12:27:11 2014

 , ,

GrukhvinEV
()

RSS подписка на новые темы