用chroot測試SDK,make時出現下面的錯誤
cat: /proc/cpuinfo: No such file or directory
解決,
sudo mount --bind /proc <chroot dir>/proc
2017年4月25日 星期二
2017年4月21日 星期五
Build openWRT Image
- sudo tar -Jxv -f xxx-openwrt-sdk-xxx.tar.bz2
- 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 - git init
- cp util-linux-2.24.1.tar.xz到dl目錄
- make menuconfig
- make V=s (第一次要連網)
- 因util-linux-2.24.1.tar.xz已從server拿掉,自行下載copy到dl目錄。
-
遇到底下錯誤要先做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
測試SDK是否能在不同版本的Ubuntu使用(chroot)
使用chroot測試
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
- sudo apt-get install schroot debootstrap
- 增加下面描述至/etc/schroot/schroot.conf
[xenial]
description=Ubuntu Xenial (LTS)
directory=/home/XXX/xenial
users=XXX //主體使用者名稱
groups=XXX //主體使用者群組
root-groups=root
aliases=unstable,default - mkdir /home/XXX/xenial
- 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/ - sudo mkdir /home/XXX/xenial/home/XXX
- schroot -c xenial -u XXX
- exit
- 安裝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 - 增加user and group
sudo chroot /home/XXX/xenial /bin/bash
groupadd XXX
useradd -g XXX XXX
passwd XXX
exit
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 */
…
struct cred {
...
kuid_t fsuid; /* UID for VFS ops */
kgid_t fsgid; /* GID for VFS ops */
…
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就解決了 ...
但檔案明明有在 ><
查了Google後才知道並不是指檔案沒找到 Orz
原來是自己的Ubuntu是64位元版本,
而gcc是32位元版本,才出現這樣的錯誤訊息。
安裝ia32-libs就解決了 ...
訂閱:
文章 (Atom)
