今天使用了一下yaffs2功能
就是生成一个yaffs的包
从移植的角度先生成ro_1109.yaffs包
烧录进去
操作步骤:
创建和生成ro文件夹和 mkyaffs2image610可执行程序
然后用
fakeroot ./mkyaffs2image610 ro ro_1109.yaffs 1 2
生成了ro_1109.yaffs
例:
@if [ "$(TARGET_DEPLOY_TYPE)" == "rodatafs" ] || [ "$(TARGET_DEPLOY_TYPE)" == "rwdatafs" ] || [ "$(TARGET_DEPLOY_TYPE)" == "rwfs" ];then \
echo "Deploy $(TARGET_DEPLOY_TYPE) permissions to directory $($(patsubst %_$(FLASH_TYPE)_yaffs_fsimage,%,$@)$(RESOUCE))"; \
$(FAKEROOT) /bin/bash $(DEPLOYER_SH) -s -P ${D_PRODUCT_TYPE} -d $(TARGET_DEPLOY_TYPE) -o $($(patsubst %_$(FLASH_TYPE)_yaffs_fsimage,%,$@)$(RESOUCE)) -- "$< $($(patsubst %_$(FLASH_TYPE)_yaffs_fsimage,%,$@)$(RESOUCE)) $(IMAGEDIR)/$(patsubst %_$(FLASH_TYPE)_yaffs_fsimage,%,$@)_202d.yaffs 1 2"; \
else \
echo "Create $(patsubst %_$(FLASH_TYPE)_yaffs_fsimage,%,$@) yaffs image"; \
$(FAKEROOT) $(MKYAFFS2IMAGE) $($(patsubst %_$(FLASH_TYPE)_yaffs_fsimage,%,$@)$(RESOUCE)) $(IMAGEDIR)/$(patsubst %_$(FLASH_TYPE)_yaffs_fsimage,%,$@)_202d.yaffs 1 2; \
fi;
//上面是存在ro_1109.yaggs文件做覆盖
//下面是不存在创建
升级ro_1109.yaffs
=============================移植cramfs================================
安装cramfs
sudo apt-get install cramfsprogs
//安装失败
E: Unable to locate package cramfsprogs
手动下载这个包
https://launchpad.net/ubuntu/xenial/+package/cramfsprogs
http://mirror4.nyist.edu.cn/ubuntu/ubuntu/pool/main/c/cramfs/cramfsprogs_1.1-6ubuntu1_amd64.deb
cramfsprogs_1.1-6ubuntu1_amd64.deb
安装
sudo dpkg -i cramfsprogs_1.1-6ubuntu1_amd64.deb
参考博客:Ubuntu 18.04 安装cramfsprogs_cramfs deb-CSDN博客
然后手动对文件系统打包
=============================移植yaffs2================================
index 15328e38c8c7..fdd60aeea19e 100644
--- a/arch/arm/configs/rv1126_defconfig
+++ b/arch/arm/configs/rv1126_defconfig
@@ -372,3 +403,18 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60
# CONFIG_FTRACE is not set
# CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_DEBUG_USER=y
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+CONFIG_YAFFS_XATTR=y
diff --git a/fs/Kconfig b/fs/Kconfig
index b8d003f02b76..1f02c1daf3e8 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -243,6 +243,7 @@ source "fs/hfsplus/Kconfig"
source "fs/befs/Kconfig"
source "fs/bfs/Kconfig"
source "fs/efs/Kconfig"
+source "fs/yaffs2/Kconfig"
source "fs/jffs2/Kconfig"
# UBIFS File system configuration
source "fs/ubifs/Kconfig"
diff --git a/fs/Makefile b/fs/Makefile
index 5030ac9050cb..20677918cc0f 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -132,3 +132,4 @@ obj-y += exofs/ # Multiple modules
obj-$(CONFIG_CEPH_FS) += ceph/
obj-$(CONFIG_PSTORE) += pstore/
obj-$(CONFIG_EFIVAR_FS) += efivarfs/
+obj-$(CONFIG_YAFFS_FS) += yaffs2/
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 035d641e8847..3dbddd57df39 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -40,9 +40,18 @@ struct mtd_info;
* or was not specific to any particular block.
*/
struct erase_info {
+ struct mtd_info *mtd;
uint64_t addr;
uint64_t len;
uint64_t fail_addr;
+ u_long time;
+ u_long retries;
+ unsigned dev;
+ unsigned cell;
+ void (*callback) (struct erase_info *self);
+ u_long priv;
+ u_char state;
+ struct erase_info *next;
};
struct mtd_erase_region_info {
diff --git a/include/linux/time.h b/include/linux/time.h
index 5f3e49978837..0952fe996fd7 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -21,6 +21,7 @@ int put_itimerspec64(const struct itimerspec64 *it,
extern time64_t mktime64(const unsigned int year, const unsigned int mon,
const unsigned int day, const unsigned int hour,
const unsigned int min, const unsigned int sec);
+#define CURRENT_TIME (current_kernel_time64())
/* Some architectures do not supply their own clocksource.
* This is mainly the case in architectures that get their
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 7b066fd38248..a6be784c1884 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -16,6 +16,7 @@ struct timer_list {
struct hlist_node entry;
unsigned long expires;
void (*function)(struct timer_list *);
+ unsigned long data;
u32 flags;
#ifdef CONFIG_LOCKDEP
@@ -131,6 +132,8 @@ static inline void init_timer_on_stack_key(struct timer_list *timer,
#define timer_setup_on_stack(timer, callback, flags) \
__init_timer_on_stack((timer), (callback), (flags))
+#define init_timer_on_stack(timer) \
+ __init_timer_on_stack((timer), 0, 0)
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
extern void destroy_timer_on_stack(struct timer_list *timer);
存在问题,编译出来的固件会死机,先存档.