2017年11月22日 星期三

Make openWRT出現util-linux-2.24.1.tar.xz錯誤

Make openWRT出現底下錯誤,無法下載util-linux-2.24.1.tar.xz

/home/victor/Workspace/openwrt-sdk/scripts/download.pl "/home/victor/Workspace/openwrt-sdk/dl" "util-linux-2.24.1.tar.xz" "88d46ae23ca599ac5af9cf96b531590f" "@KERNEL/linux/utils/util-linux/v2.24"
--2017-11-22 17:03:38--  ftp://ftp.all.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.1.tar.xz
           => '-'
Resolving ftp.all.kernel.org (ftp.all.kernel.org)... failed: Name or service not known.
wget: unable to resolve host address 'ftp.all.kernel.org'
Download failed.

因下載位置已改變,修改download.pl描述的下載路徑,

push @mirrors, "http://ftp.all.kernel.org/pub/$dir";
改為
push @mirrors, "http://www.kernel.org/pub/$dir";

2017年11月7日 星期二

DOCSIS & MoCA

DOCSIS: Data Over Cable Service Interface Specification
MoCA: Multimedia over Coax

2017年7月24日 星期一

WinCE Eboot Boot-up Sequence


  1. F:\WINCE500\PLATFORM\COMMON\SRC\ARM\INTEL\PXA27X\STARTUP\startup.s
    StartUp[Start] -> PreInit -> Put CPU in SVC mode and disable IRQ, FIQ ->
    Disable MMU, caches, write-buffer and flush -> RCSR_HARD_RESET(2.) ->
    RCSR_GPIO_RESET(3.) -> Continue_StartUp(4.)
       
  2. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\BOOTLOADER\EBOOT\startup.s
    OALStartUp -> Init_HexLEDs -> Copy the bootloader image from flash to RAM ->
    jump to the RAM image -> Enable the MMU -> Jump to main.c(5.)
       
  3. F:\WINCE500\PLATFORM\COMMON\SRC\ARM\INTEL\PXA27X\STARTUP\startup.s
    RCSR_GPIO_RESET -> xlli_mem_init -> Continue_StartUp(4.)
       
  4. F:\WINCE500\PLATFORM\COMMON\SRC\ARM\INTEL\PXA27X\STARTUP\startup.s
    Continue_StartUp -> xlli_intr_init(15.) -> EnableClks -> xlli_mem_Tmax(15.) ->
    xlli_mem_restart(15.) -> OALXScaleSetFrequencies(16.)->
    xlli_mem_Topt(15.) -> xlli_mem_restart(15.) -> xlli_ost_init(15.) ->
    xlli_pwrmgr_init(15.) -> xlli_IMpwr_init(15.) -> OALStartUp(2.)
       
  5. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\BOOTLOADER\EBOOT\main.c
    main -> BootloaderMain(6.)
       
  6. F:\WINCE500\PLATFORM\COMMON\SRC\COMMON\BOOT\BLCOMMON\blcommon.c
    BootloaderMain -> KernelRelocate -> OEMDebugInit(7.) -> OEMPlatformInit(9.) ->
    OEMPreDownload(10.) -> BL_DOWNLOAD(11.) -> BL_JUMP(14.)
       
  7. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\BOOTLOADER\EBOOT\main.c
    OEMDebugInit -> FlashInit -> InitDebugSerial(8.)
       
  8. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\COMMON\DBGSERIAL\dbgserial.c
    InitDebugSerial -> Return
       
  9. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\BOOTLOADER\EBOOT\main.c
    OEMPlatformInit -> Create menu -> InitSpecifiedEthDevice(Download image) -> Return
       
  10. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\BOOTLOADER\EBOOT\main.c
    OEMPreDownload -> Return
       
  11. F:\WINCE500\PLATFORM\COMMON\SRC\COMMON\BOOT\BLCOMMON\blcommon.c
    DownloadImage(BL_DOWNLOAD) -> OEMReadData(12.)
       
  12. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\BOOTLOADER\EBOOT\utils.c
    OEMReadData -> EbootEtherReadData(13.)
       
  13. F:\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\ETHDBG\EBOOT\ebsimp.c
    EbootEtherReadData -> OEMLaunch(14.)
       
  14. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\BOOTLOADER\EBOOT\main.c
    OEMLaunch[End]
       
  15. F:\WINCE500\PUBLIC\COMMON\OAK\CSP\ARM\INTEL\PXA27X\XLLP\SOURCE\
    xlli_lowlev_init.s
    xlli_intr_init; xlli_mem_Tmax; xlli_mem_restart; xlli_mem_Topt; xlli_mem_restart;
    xlli_ost_init; xlli_pwrmgr_init; xlli_IMpwr_init; xlli_GPIO_init
       
  16. F:\WINCE500\PLATFORM\MAINSTONEII\SRC\COMMON\FREQ\freq.s
    OALXScaleSetFrequencies -> xlli_GPIO_init -> xlli_GPIO_init(15.)

2017年5月10日 星期三

縮小VDI檔案大小

於客體端
  1. sudo apt-get install zerofree
  2. 重開機進入Recovery Mode
  3. mount -n -o remount,ro -t ext3 /dev/sda1 /
  4. zerofree -v /dev/sda1
於主體端
  • VBoxManage modifymedium XXX.vdi --compact

2017年4月25日 星期二

chroot測試SDK出現cat /proc/cpuinfo錯誤

用chroot測試SDK,make時出現下面的錯誤
cat: /proc/cpuinfo: No such file or directory

解決,

sudo mount --bind /proc <chroot dir>/proc

2017年4月21日 星期五

Build openWRT Image



  1. sudo tar -Jxv -f xxx-openwrt-sdk-xxx.tar.bz2  
  2. apt-get install subversion
    apt-get install wget

    apt-get install libncurses5-dev

    apt-get install zlib1g-dev

    apt-get install gawk

    apt-get install unzip

    apt-get install python

    apt-get install git

    apt-get install file
     
  3. git init
  4. cp util-linux-2.24.1.tar.xz到dl目錄
  5. make menuconfig 
  6. make V=s (第一次要連網)
P.S.
  1. util-linux-2.24.1.tar.xz已從server拿掉,自行下載copydl目錄。
  2. 遇到底下錯誤要先做git init
    ramips_mt7621/base-files/ipkg-ramips_24kec/base-files/etc/banner

    cat: /home/work/openwrt-sdk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7621/base-files/ipkg-ramips_24kec/base-files/etc/sdk.version: No such file or directory

Build openWRT發生base-files/etc/sdk.version: No such file or directory



下"git init"即可解決

測試SDK是否能在不同版本的Ubuntu使用(chroot)

使用chroot測試
  1. sudo apt-get install schroot debootstrap
  2. 增加下面描述至/etc/schroot/schroot.conf
    [xenial]
    description=Ubuntu Xenial (LTS)
    directory=/home/XXX/xenial
    users=XXX        //主體使用者名稱
    groups=XXX      //主體使用者群組
    root-groups=root
    aliases=unstable,default
  3. mkdir /home/XXX/xenial
  4. sudo debootstrap --variant=buildd --arch amd64 xenial /home/XXX/xenial http://archive.ubuntu.com/ubuntu/
    or
    sudo debootstrap --arch amd64 xenial /home/XXX/xenial http://archive.ubuntu.com/ubuntu/
  5. sudo mkdir /home/XXX/xenial/home/XXX
  6. schroot -c xenial -u XXX
  7. exit
  8. 安裝sudo and language
    sudo chroot /home/XXX/xenial
    apt-get install sudo
    export LANGUAGE=en_US.UTF-8
    export LANG=en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    locale-gen en_US.UTF-8
    dpkg-reconfigure locales
    exit
  9. 增加user and group
    sudo chroot /home/XXX/xenial /bin/bash
    groupadd XXX
    useradd -g XXX XXX
    passwd XXX
    exit 
Ubuntu 10.04
sudo debootstrap --arch amd64 --keyring=/etc/apt/trusted.gpg lucid /home/victor/Workspace/hisilicon http://old-releases.ubuntu.com/ubuntu/

Bind Filesystem
/etc/fstab
/dev /home/XXX/xenial/dev auto bind 0 0
/dev/pts /home/XXX/xenial/dev/pts auto bind 0 0
/proc /home/XXX/xenial/proc auto bind 0 0

2017年3月9日 星期四

Compile出現error: incompatible types when assigning to type &int * from type &kuid_t * pOSFSInfo->fsuid = current_fsuid();錯誤

主要是新版linux kernel,current_fsuid() function有修改。

這function定義在
/usr/src/linux-headers-X.XX.X-XX/include/linux/cred.h
struct cred {
...
kuid_t fsuid;   /* UID for VFS ops */
kgid_t fsgid; /* GID for VFS ops */

/usr/src/linux-headers-3.19.0-32/include/linux/uidgid.h
typedef struct {
uid_t  val;
} kuid_t;

可依下面方式更改解決此問題。
os/linux/xxx_linux.c
pOSFSInfo->fsuid = current_fsuid().val;
pOSFSInfo->fsgid = current_fsgid().val;
或是

include/os/xxx_linux.h
typedef struct _OS_FS_INFO_
{
kuid_t                     fsuid;
  kgid_t                     fsgid;
  mm_segment_t      fs;
} OS_FS_INFO;

2017年3月8日 星期三

Compile出現arm-none-eabi-gcc: not found /bin/sh: 4:錯誤

一直以為這訊息是沒有找到這檔案,
但檔案明明有在 ><
查了Google後才知道並不是指檔案沒找到 Orz

原來是自己的Ubuntu是64位元版本,
而gcc是32位元版本,才出現這樣的錯誤訊息。

安裝ia32-libs就解決了 ...

判斷Linux執行檔為32-bit或64-bit



> file filename

2017年1月10日 星期二

VirtualBox發生Start tag expected, '<' not found錯誤

VirtualBox執行時顯示Start tag expected, '<' not found,
無法開啟VirtualBox。

刪除
C:\Users\account\.VirtualBox\VirtualBox.xml

C:\Users\victorlin.TWNB15035\.VirtualBox\VirtualBox.xml-prev
更名為
C:\Users\account\.VirtualBox\VirtualBox.xml