[lingyun@localhost fulinux]$ clear
[lingyun@localhost fulinux]$ mkdir rootfs
[lingyun@localhost fulinux]$ cd rootfs
[lingyun@localhost rootfs]$ mkdir {bin,dev,etc,lib,mnt,proc,sbin,sys,tmp,usr,var}
[lingyun@localhost rootfs]$ ls
bin dev etc lib mnt proc sbin sys tmp usr var
[lingyun@localhost rootfs]$ cd usr/
[lingyun@localhost usr]$ mkdir {bin,sbin,lib,share}
[lingyun@localhost usr]$ ls
bin lib sbin share
[lingyun@localhost usr]$ cd ..
[lingyun@localhost rootfs]$ tree
.
|-- bin
|-- dev
|-- etc
|-- lib
|-- mnt
|-- proc
|-- sbin
|-- sys
|-- tmp
|-- usr
| |-- bin
| |-- lib
| |-- sbin
| `-- share
`-- var
15 directories, 0 files
[lingyun@localhost rootfs]$ cd ../systools/busybox-1.20.2/
[lingyun@localhost busybox-1.20.2]$ ls
applets Config.in include Makefile.flags selinux
applets_sh configs init Makefile.help shell
arch console-tools INSTALL miscutils sysklogd
archival coreutils libbb modutils testsuite
AUTHORS debianutils libpwdgrp networking TODO
busybox docs LICENSE printutils TODO_unicode
busybox.links e2fsprogs loginutils procps util-linux
busybox_unstripped editors mailutils README
busybox_unstripped.map examples Makefile runit
busybox_unstripped.out findutils Makefile.custom scripts
[lingyun@localhost busybox-1.20.2]$ vt100
[lingyun@localhost busybox-1.20.2]$ make menuconfig
1、
BusyBox 1.20.2 Configuration
-----------------------------------------------------
+------------------------------ Busybox Configuration -------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted |
| letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] |
| built-in [ ] excluded <M> module < > module capable |
| +--------------------------------------------+ |
| | Busybox Settings ---> | |
| | --- Applets | |
| | Archival Utilities ---> | |
| | Coreutils ---> | |
| | Console Utilities ---> | |
| | Debian Utilities ---> | |
| | Editors ---> | |
| | Finding Utilities ---> | |
| | Init Utilities ---> | |
| | Login/Password Management Utilities ---> | |
| | Linux Ext2 FS Progs ---> | |
| | Linux Module Utilities ---> | |
| | Linux System Utilities ---> | |
| | Miscellaneous Utilities ---> | |
| | Networking Utilities ---> | |
| | Print Utilities ---> | |
| | Mail Utilities ---> | |
| | Process Utilities ---> | |
| | Runit Utilities ---> | |
| | Shells ---> | |
| | System Logging Utilities ---> | |
| | --- | |
| | Load an Alternate Configuration File | |
| | Save Configuration to an Alternate File | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------------------------------------------+ |
+------------------------------------------------+
| <Select> < Exit > < Help > |
+------------------------------------------------+
2、
BusyBox 1.20.2 Configuration
-----------------------------------------------------
+--------------------------------- Busybox Settings ---------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted |
| letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] |
| built-in [ ] excluded <M> module < > module capable |
| +--------------------------------------------+ |
| | General Configuration ---> | |
| | Build Options ---> | |
| | Debugging Options ---> | |
| | Installation Options ("make install" behavior) ---> | |
| | Busybox Library Tuning ---> | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------------------------------------------+ |
+------------------------------------------------+
| <Select> < Exit > < Help > |
+------------------------------------------------+
3、
BusyBox 1.20.2 Configuration
-----------------------------------------------------
+------------------------------ General Configuration -------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted |
| letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] |
| built-in [ ] excluded <M> module < > module capable |
| +--------------------------------------------+ |
| | [*] Enable options for full-blown desktop systems | |
| | [ ] Provide compatible behavior for rare corner cases (bigger code) | |
| | [*] Enable obsolete features removed before SUSv3 | |
| | [ ] Avoid using GCC-specific code constructs | |
| | --- Enable Linux-specific applets and features | |
| | Buffer allocation policy (Allocate with Malloc) ---> | |
| | [*] Show applet usage messages | |
| | [*] Show verbose applet usage messages | |
| | [*] Store applet usage messages in compressed form | |
| | [*] Support --install [-s] to install applet links at runtime | |
| | [*] Don't use /usr | |
| | [ ] Enable locale support (system needs locale for this to work) | |
| | [*] Support Unicode | |
| | [ ] Check $LANG environment variable | |
| | (63) Character code to substitute unprintable characters with | |
| | (767) Range of supported Unicode characters | |
| | [ ] Allow zero-width Unicode characters on output | |
| | [ ] Allow wide Unicode characters on output | |
| | [ ] Bidirectional character-aware line input | |
| | [ ] Make it possible to enter sequences of chars which are not Unicode | |
| | [*] Support for --long-options | |
| | [*] Use the devpts filesystem for Unix98 PTYs | |
| | [ ] Clean up all memory before exiting (usually not needed) | |
| | [*] Support utmp file | |
| | [*] Support wtmp file | |
| | [*] Support writing pidfiles | |
| | [*] Support for SUID/SGID handling | |
| | [*] Runtime SUID/SGID configuration via /etc/busybox.conf | |
| | [*] Suppress warning message if /etc/busybox.conf is not readable | |
| | [ ] Support NSA Security Enhanced Linux | |
| | [ ] exec prefers applets | |
| | (/proc/self/exe) Path to BusyBox executable | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------------------------------------------+ |
+------------------------------------------------+
| <Select> < Exit > < Help > |
+------------------------------------------------+
4、
BusyBox 1.20.2 Configuration
-----------------------------------------------------
+--------------------------------- Busybox Settings ---------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted |
| letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] |
| built-in [ ] excluded <M> module < > module capable |
| +--------------------------------------------+ |
| | General Configuration ---> | |
| | Build Options ---> | |
| | Debugging Options ---> | |
| | Installation Options ("make install" behavior) ---> | |
| | Busybox Library Tuning ---> | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------------------------------------------+ |
+------------------------------------------------+
| <Select> < Exit > < Help > |
+------------------------------------------------+
5、
BusyBox 1.20.2 Configuration
-----------------------------------------------------
+---------------------------------- Build Options -----------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted |
| letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] |
| built-in [ ] excluded <M> module < > module capable |
| +--------------------------------------------+ |
| | [*] Build BusyBox as a static binary (no shared libs) | |
| | [ ] Force NOMMU build | |
| | [ ] Build with Large File Support (for accessing files > 2 GB) | |
| | ( /opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-) Cross Compiler prefix | |
| | () Path to sysroot | |
| | () Additional CFLAGS | |
| | () Additional LDFLAGS | |
| | () Additional LDLIBS | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------------------------------------------+ |
+------------------------------------------------+
| <Select> < Exit > < Help > |
+------------------------------------------------+
6、
+------------------------- Cross Compiler prefix -------------------------+
| Please enter a string value. Use the <TAB> key to move from the input |
| field to the buttons below it. |
| +---------------------------------+ |
| | /opt/buildroot-2012.08/arm920t/usr/bin/arm-linux- | |
| +---------------------------------+ |
| |
+-------------------------------------+
| < Ok > < Help > |
+-------------------------------------+
7、
BusyBox 1.20.2 Configuration
-----------------------------------------------------
+--------------------------------- Busybox Settings ---------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted |
| letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] |
| built-in [ ] excluded <M> module < > module capable |
| +--------------------------------------------+ |
| | General Configuration ---> | |
| | Build Options ---> | |
| | Debugging Options ---> | |
| | Installation Options ("make install" behavior) ---> | |
| | Busybox Library Tuning ---> | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------------------------------------------+ |
+------------------------------------------------+
| <Select> < Exit > < Help > |
+------------------------------------------------+
8、
BusyBox 1.20.2 Configuration
-----------------------------------------------------
+------------------ Installation Options ("make install" behavior) ------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted |
| letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] |
| built-in [ ] excluded <M> module < > module capable |
| +--------------------------------------------+ |
| | What kind of applet links to install (as soft-links) ---> | |
| | (../../rootfs) BusyBox installation prefix | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------------------------------------------+ |
+------------------------------------------------+
| <Select> < Exit > < Help > |
+------------------------------------------------+
9、
+----------------------+
| Do you wish to save your new configuration? |
+----------------------+
| < Yes > < No > |
+---------------------
*** End of configuration.
*** Execute 'make' to build the project or try 'make help'.
[lingyun@localhost busybox-1.20.2]$ make
原问题来自于CSDN问答频道,更多见:http://ask.csdn.net/questions/1879
问题描述:
在一个列表中我使用add(int,Object)方法添加了一个值,但是当我使用get(int)方法检索值的时候,却还是获得上次添加的值,并不是这次新添加的值。
谁能给出适当的建议呢?
我使用的下面的代码:
public static List getCompanyName(String user_id) { List<CustomerList> fetchDatefromID = new ArrayList<CustomerList>(); CustomerList tempProgram = new CustomerList(); String result = ""; InputStream is = null; ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("q", "" + user_id)); // http post try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost( "https://erestaurantonline.co.uk/kernow_mobile/customer_search.php?"); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); } catch (Exception e) { Log.e("log_tag", "Error in http connection " + e.toString()); } // convert response to string try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } is.close(); result = sb.toString(); } catch (Exception e) { Log.e("log_tag", "Error converting result " + e.toString()); } // parse json data try { JSONArray jArray = new JSONArray(result); for (int i = 0; i < jArray.length(); i++) { JSONObject json_data = jArray.getJSONObject(i); if (json_data.getString("company") != null) { tempProgram.setCompanyName(json_data.getString("company")); tempProgram.setID(json_data.getString("id")); fetchDatefromID.add(i, tempProgram); } } } catch (JSONException e) { Log.e("log_tag", "Error parsing data " + e.toString()); } for (int i = 0; i < fetchDatefromID.size(); i++) { Log.v("log_tag","DataMy : "+fetchDatefromID.get(i).getCompanyName().toString()); } return fetchDatefromID; }
:
把下面的代码:
if (json_data.getString("company") != null) { tempProgram.setCompanyName(json_data.getString("company")); tempProgram.setID(json_data.getString("id")); fetchDatefromID.add(i, tempProgram); }
换成:
if (json_data.getString("company") != null) { tempProgram = new CustomerList(); tempProgram.setCompanyName(json_data.getString("company")); tempProgram.setID(json_data.getString("id")); fetchDatefromID.add(i, tempProgram); }
否则,list中的每一项都要引用同样的对象,那样的话总是显示你最后一次输入的数据。
block_device_operations结构体
struct block_device_operations {
int (*open) (struct block_device *, fmode_t);
int (*release) (struct gendisk *, fmode_t);
int (*locked_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
int (*direct_access) (struct block_device *, sector_t,
void **, unsigned long *);
int (*media_changed) (struct gendisk *);
int (*revalidate_disk) (struct gendisk *);
int (*getgeo)(struct block_device *, struct hd_geometry *);
struct module *owner;
};
1.打开和释放
int (*open)(struct inode *inode ,struct file *filp);
int (*release)(struct inode *inode ,struct file *filp);
当设备打开和关闭时将调用它们。
2.IO控制
int (*ioctl)(struct inode *inode,struct file *filp uusignwd intcmd,unsigned long arg)
上述函数是ioctrl()系统调用的实现,块设备包含大量的标准亲球,这些标准请求有linux块设备层处理,因此大部分块设备驱动的ioctrl()函数相当短。
3.介质改变
int (*check_media_change) (kdev_t);
被内核调用来检查是否驱动器中的介质已经改变,如果是,则返回一个非0值,否则返回0.这个函数进时用于支持可移动介质的驱动器。通常需要在驱动中增加一个表示介质状态时否改变的标志变量,非可移动设备的驱动不需要实现这个方法。
4.使介质有效
int (*revalidate) (kdev_t);
该函数被调用来响应一个介质改变,它给驱动一个机会来进行必要的工作使得新介质准备好。
5.获得驱动信息
int (*getgeo)(struct block_device *,struct hd_geometry *);
该函数根据驱动器的几何信息填充一个hd_geometry结构体,hd_geometry结构体包含磁头,扇区,柱面等信息。
6.模块指针
struct module *owner;
通常初始化成THIS_MODULE