From 328e660b31f0937d52c5ae3d6e7029409918a9df Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 19 Feb 2007 23:28:09 +0000 Subject: [PATCH] make rootfs split/detection more generic - patch can be moved to generic-2.6 after testing on other platforms (especially broadcom) SVN-Revision: 6328 --- target/linux/atheros-2.6/config | 428 +----------------- target/linux/atheros-2.6/config-diff | 1 + .../files/drivers/mtd/devices/spiflash.c | 6 - .../patches/160-rootfs_split.patch | 414 +++++++++++++++++ 4 files changed, 416 insertions(+), 433 deletions(-) create mode 100644 target/linux/atheros-2.6/patches/160-rootfs_split.patch diff --git a/target/linux/atheros-2.6/config b/target/linux/atheros-2.6/config index 6852dc6b3bfb..5ba373a639c1 100644 --- a/target/linux/atheros-2.6/config +++ b/target/linux/atheros-2.6/config @@ -2,22 +2,14 @@ CONFIG_32BIT=y # CONFIG_64BIT is not set # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_6PACK is not set -# CONFIG_8139CP is not set # CONFIG_9P_FS is not set -# CONFIG_ACENIC is not set # CONFIG_ACORN_PARTITION is not set -# CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_AFS_FS is not set -CONFIG_AIRO=m -CONFIG_AIRO_CS=m -# CONFIG_AMD8111_ETH is not set # CONFIG_AMIGA_PARTITION is not set -# CONFIG_APPLICOM is not set CONFIG_AR2313=y CONFIG_ARCH_FLATMEM_ENABLE=y -# CONFIG_ARCNET is not set CONFIG_ARPD=y CONFIG_ASK_IP_FIB_HASH=y # CONFIG_ATA is not set @@ -28,26 +20,6 @@ CONFIG_ATHEROS=y CONFIG_ATHEROS_AR5312=y CONFIG_ATHEROS_AR5315=y # CONFIG_ATM is not set -CONFIG_ATMEL=m -# CONFIG_ATM_AMBASSADOR is not set -CONFIG_ATM_BR2684=m -CONFIG_ATM_BR2684_IPFILTER=y -CONFIG_ATM_CLIP=m -CONFIG_ATM_CLIP_NO_ICMP=y -CONFIG_ATM_DUMMY=m -# CONFIG_ATM_ENI is not set -# CONFIG_ATM_FIRESTREAM is not set -# CONFIG_ATM_FORE200E_MAYBE is not set -# CONFIG_ATM_HE is not set -# CONFIG_ATM_HORIZON is not set -# CONFIG_ATM_IA is not set -# CONFIG_ATM_IDT77252 is not set -# CONFIG_ATM_LANAI is not set -CONFIG_ATM_LANE=m -CONFIG_ATM_MPOA=m -# CONFIG_ATM_NICSTAR is not set -CONFIG_ATM_TCP=m -# CONFIG_ATM_ZATM is not set # CONFIG_AUDIT is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_AUTOFS_FS is not set @@ -59,23 +31,12 @@ CONFIG_BASE_SMALL=0 # CONFIG_BASLER_EXCITE is not set # CONFIG_BAYCOM_SER_FDX is not set # CONFIG_BAYCOM_SER_HDX is not set -CONFIG_BCM43XX=m -CONFIG_BCM43XX_DEBUG=y -CONFIG_BCM43XX_DMA=y -CONFIG_BCM43XX_DMA_AND_PIO_MODE=y -# CONFIG_BCM43XX_DMA_MODE is not set -CONFIG_BCM43XX_PIO=y -# CONFIG_BCM43XX_PIO_MODE is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_CRYPTOLOOP=m -# CONFIG_BLK_DEV_DAC960 is not set CONFIG_BLK_DEV_INITRD=y # CONFIG_BLK_DEV_IO_TRACE is not set CONFIG_BLK_DEV_LOOP=m @@ -83,11 +44,7 @@ CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_SD=m # CONFIG_BLK_DEV_SR is not set -# CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set -# CONFIG_BLK_DEV_UMEM is not set CONFIG_BLOCK=y -# CONFIG_BNX2 is not set CONFIG_BONDING=m # CONFIG_BPQETHER is not set CONFIG_BRIDGE=y @@ -117,44 +74,16 @@ CONFIG_BSD_DISKLABEL=y CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set # CONFIG_BT is not set -CONFIG_BT_BNEP=m -CONFIG_BT_BNEP_MC_FILTER=y -CONFIG_BT_BNEP_PROTO_FILTER=y -CONFIG_BT_HCIBCM203X=m -CONFIG_BT_HCIBFUSB=m -# CONFIG_BT_HCIBLUECARD is not set -CONFIG_BT_HCIBPA10X=m -# CONFIG_BT_HCIBT3C is not set -# CONFIG_BT_HCIBTUART is not set -# CONFIG_BT_HCIDTL1 is not set -CONFIG_BT_HCIUART=m -CONFIG_BT_HCIUART_BCSP=y -CONFIG_BT_HCIUART_H4=y -CONFIG_BT_HCIUSB=m -CONFIG_BT_HCIUSB_SCO=y -CONFIG_BT_HCIVHCI=m -CONFIG_BT_HIDP=m -CONFIG_BT_L2CAP=m -CONFIG_BT_RFCOMM=m -CONFIG_BT_RFCOMM_TTY=y -CONFIG_BT_SCO=m CONFIG_BUG=y -CONFIG_CARDBUS=y -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set -# CONFIG_CASSINI is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_CDROM_PKTCDVD is not set -# CONFIG_CHELSIO_T1 is not set # CONFIG_CHR_DEV_OSST is not set # CONFIG_CHR_DEV_SCH is not set # CONFIG_CHR_DEV_SG is not set # CONFIG_CHR_DEV_ST is not set -# CONFIG_CICADA_PHY is not set CONFIG_CIFS=m # CONFIG_CIFS_DEBUG2 is not set # CONFIG_CIFS_EXPERIMENTAL is not set -CONFIG_CIFS_POSIX=y CONFIG_CIFS_STATS=y # CONFIG_CIFS_STATS2 is not set # CONFIG_CIFS_WEAK_PW_HASH is not set @@ -230,7 +159,6 @@ CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_TWOFISH_COMMON=m CONFIG_CRYPTO_WP512=m -# CONFIG_DAVICOM_PHY is not set # CONFIG_DDB5477 is not set # CONFIG_DEBUG_FS is not set # CONFIG_DEBUG_KERNEL is not set @@ -251,28 +179,21 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVFS_FS=y CONFIG_DEVFS_MOUNT=y -# CONFIG_DGRS is not set # CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_DL2K is not set # CONFIG_DM9000 is not set # CONFIG_DMA_ENGINE is not set CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y # CONFIG_DNOTIFY is not set -# CONFIG_DRM is not set # CONFIG_DTLK is not set # CONFIG_DUMMY is not set # CONFIG_DVB is not set -CONFIG_E100=m -# CONFIG_E1000 is not set # CONFIG_ECONET is not set -# CONFIG_EEPRO100 is not set # CONFIG_EFI_PARTITION is not set # CONFIG_EFS_FS is not set # CONFIG_ELF_CORE is not set CONFIG_EMBEDDED=y CONFIG_ENABLE_MUST_CHECK=y -# CONFIG_EPIC100 is not set CONFIG_EPOLL=y # CONFIG_EQUALIZER is not set CONFIG_EXPERIMENTAL=y @@ -287,21 +208,15 @@ CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_FAT_FS=m # CONFIG_FB is not set -# CONFIG_FDDI is not set -# CONFIG_FEALNX is not set CONFIG_FIB_RULES=y # CONFIG_FIRMWARE_EDID is not set CONFIG_FLATMEM=y CONFIG_FLATMEM_MANUAL=y CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_FORCEDETH is not set CONFIG_FS_POSIX_ACL=y # CONFIG_FTL is not set # CONFIG_FUSE_FS is not set # CONFIG_FUSION is not set -# CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set -# CONFIG_FUSION_SPI is not set CONFIG_FUTEX=y CONFIG_FW_LOADER=y CONFIG_GACT_PROB=y @@ -314,24 +229,13 @@ CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_TIME=y # CONFIG_GEN_RTC is not set # CONFIG_GFS2_FS is not set -# CONFIG_HAMACHI is not set CONFIG_HAMRADIO=y -# CONFIG_HAPPYMEAL is not set CONFIG_HAVE_STD_PC_SERIAL_PORT=y # CONFIG_HEADERS_CHECK is not set -CONFIG_HERMES=m CONFIG_HFSPLUS_FS=m CONFIG_HFS_FS=m -# CONFIG_HIPPI is not set # CONFIG_HOSTAP is not set -CONFIG_HOSTAP_CS=m -CONFIG_HOSTAP_FIRMWARE=y -CONFIG_HOSTAP_FIRMWARE_NVRAM=y -CONFIG_HOSTAP_PCI=m -CONFIG_HOSTAP_PLX=m CONFIG_HOTPLUG=y -# CONFIG_HOTPLUG_PCI is not set -# CONFIG_HP100 is not set # CONFIG_HPFS_FS is not set # CONFIG_HUGETLB_PAGE is not set # CONFIG_HWMON is not set @@ -346,17 +250,8 @@ CONFIG_HZ_100=y # CONFIG_HZ_256 is not set # CONFIG_HZ_48 is not set # CONFIG_I2C is not set -# CONFIG_I2O is not set -# CONFIG_I82092 is not set # CONFIG_IDE is not set -# CONFIG_IEEE1394 is not set # CONFIG_IEEE80211 is not set -CONFIG_IEEE80211_CRYPT_CCMP=m -CONFIG_IEEE80211_CRYPT_TKIP=m -CONFIG_IEEE80211_CRYPT_WEP=m -# CONFIG_IEEE80211_DEBUG is not set -CONFIG_IEEE80211_SOFTMAC=m -# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set CONFIG_IFB=m CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y @@ -387,24 +282,12 @@ CONFIG_INET_XFRM_MODE_BEET=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y CONFIG_INET_XFRM_TUNNEL=m -# CONFIG_INFINIBAND is not set # CONFIG_INFTL is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y # CONFIG_INPUT is not set -# CONFIG_INPUT_EVBUG is not set -CONFIG_INPUT_EVDEV=m -# CONFIG_INPUT_FF_MEMLESS is not set -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MISC is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_TSDEV is not set # CONFIG_IOSCHED_AS is not set # CONFIG_IOSCHED_CFQ is not set CONFIG_IOSCHED_DEADLINE=y @@ -438,15 +321,6 @@ CONFIG_IPV6_ROUTER_PREF=y # CONFIG_IPV6_ROUTE_INFO is not set CONFIG_IPV6_SIT=m # CONFIG_IPV6_TUNNEL is not set -CONFIG_IPW2100=m -# CONFIG_IPW2100_DEBUG is not set -CONFIG_IPW2100_MONITOR=y -CONFIG_IPW2200=m -# CONFIG_IPW2200_DEBUG is not set -CONFIG_IPW2200_MONITOR=y -# CONFIG_IPW2200_PROMISCUOUS is not set -# CONFIG_IPW2200_QOS is not set -# CONFIG_IPW2200_RADIOTAP is not set # CONFIG_IPX is not set CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_DCCP=m @@ -545,7 +419,6 @@ CONFIG_IRQ_CPU=y # CONFIG_ISCSI_TCP is not set # CONFIG_ISDN is not set CONFIG_ISO9660_FS=m -# CONFIG_IXGB is not set CONFIG_JBD=m # CONFIG_JBD_DEBUG is not set # CONFIG_JFFS2_CMODE_NONE is not set @@ -590,18 +463,13 @@ CONFIG_LOCKDEP_SUPPORT=y CONFIG_LOCKD_V4=y CONFIG_LOG_BUF_SHIFT=14 # CONFIG_LSF is not set -# CONFIG_LXT_PHY is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MACH_JAZZ is not set # CONFIG_MACH_VR41XX is not set CONFIG_MAC_PARTITION=y # CONFIG_MAGIC_SYSRQ is not set # CONFIG_MARKEINS is not set -# CONFIG_MARVELL_PHY is not set # CONFIG_MD is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_SAS is not set CONFIG_MII=y CONFIG_MINIX_FS=m # CONFIG_MINIX_SUBPARTITION is not set @@ -701,7 +569,7 @@ CONFIG_MTD_REDBOOT_PARTS_READONLY=y # CONFIG_MTD_ROM is not set # CONFIG_MTD_SLRAM is not set CONFIG_MTD_SPIFLASH=y -# CONFIG_MYRI10GE is not set +CONFIG_MTD_SPLIT_ROOTFS=y # CONFIG_NCP_FS is not set CONFIG_NET=y # CONFIG_NETCONSOLE is not set @@ -757,7 +625,6 @@ CONFIG_NET_CLS_ACT=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_IND=y -CONFIG_NET_CLS_POLICE=y CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_RSVP=m @@ -773,18 +640,14 @@ CONFIG_NET_EMATCH_TEXT=m CONFIG_NET_EMATCH_U32=m CONFIG_NET_ESTIMATOR=y CONFIG_NET_ETHERNET=y -# CONFIG_NET_FC is not set CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_NET_IPIP=m CONFIG_NET_KEY=m -CONFIG_NET_PCI=y -# CONFIG_NET_PCMCIA is not set CONFIG_NET_PKTGEN=m # CONFIG_NET_POLL_CONTROLLER is not set CONFIG_NET_RADIO=y CONFIG_NET_SCHED=y -CONFIG_NET_SCH_ATM=m CONFIG_NET_SCH_CBQ=m # CONFIG_NET_SCH_CLK_CPU is not set # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set @@ -801,7 +664,6 @@ CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_TEQL=m -# CONFIG_NET_TULIP is not set CONFIG_NET_WIRELESS=y CONFIG_NET_WIRELESS_RTNETLINK=y CONFIG_NEW_LEDS=y @@ -857,8 +719,6 @@ CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=m -CONFIG_NORTEL_HERMES=m -# CONFIG_NS83820 is not set # CONFIG_NTFS_DEBUG is not set CONFIG_NTFS_FS=m CONFIG_NTFS_RW=y @@ -873,36 +733,14 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PARPORT is not set CONFIG_PARTITION_ADVANCED=y # CONFIG_PCCARD is not set -CONFIG_PCCARD_NONSTATIC=m -CONFIG_PCI=y -CONFIG_PCI_ATMEL=m -CONFIG_PCI_HERMES=m -# CONFIG_PCMCIA_AHA152X is not set -# CONFIG_PCMCIA_DEBUG is not set -# CONFIG_PCMCIA_FDOMAIN is not set -# CONFIG_PCMCIA_HERMES is not set -# CONFIG_PCMCIA_IOCTL is not set -# CONFIG_PCMCIA_LOAD_CIS is not set -# CONFIG_PCMCIA_NETWAVE is not set -# CONFIG_PCMCIA_NINJA_SCSI is not set -# CONFIG_PCMCIA_QLOGIC is not set -# CONFIG_PCMCIA_RAYCS is not set -# CONFIG_PCMCIA_SPECTRUM is not set -# CONFIG_PCMCIA_SYM53C500 is not set -# CONFIG_PCMCIA_WAVELAN is not set -# CONFIG_PCMCIA_WL3501 is not set -# CONFIG_PCNET32 is not set -# CONFIG_PD6729 is not set # CONFIG_PHONE is not set # CONFIG_PHYLIB is not set CONFIG_PLIST=y -CONFIG_PLX_HERMES=m # CONFIG_PMC_YOSEMITE is not set # CONFIG_PNX8550_JBS is not set # CONFIG_PNX8550_V2PCI is not set # CONFIG_POSIX_MQUEUE is not set CONFIG_PPP=m -CONFIG_PPPOATM=m CONFIG_PPPOE=m CONFIG_PPP_ASYNC=m CONFIG_PPP_BSDCOMP=m @@ -917,20 +755,14 @@ CONFIG_PREEMPT_NONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_PRINTK=y # CONFIG_PRINTK_TIME is not set -CONFIG_PRISM54=m CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_PROC_SYSCTL=y # CONFIG_PROFILING is not set # CONFIG_QEMU is not set -# CONFIG_QLA3XXX is not set # CONFIG_QNX4FS_FS is not set # CONFIG_QUOTA is not set # CONFIG_R3964 is not set -# CONFIG_R8169 is not set -# CONFIG_RADIO_GEMTEK_PCI is not set -# CONFIG_RADIO_MAESTRO is not set -# CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RAID_ATTRS is not set CONFIG_RAMFS=y # CONFIG_RAW_DRIVER is not set @@ -949,59 +781,30 @@ CONFIG_RPCSEC_GSS_KRB5=m # CONFIG_RTC_CLASS is not set CONFIG_RT_MUTEXES=y CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_S2IO is not set CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_SCSI=m -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_ARCMSR is not set # CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_LPFC is not set CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_NETLINK is not set -# CONFIG_SCSI_NSP32 is not set CONFIG_SCSI_PROC_FS=y -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_SAS_ATTRS is not set # CONFIG_SCSI_SAS_LIBSAS is not set # CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SECURITY is not set CONFIG_SELECT_MEMORY_MODEL=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_CS=m # CONFIG_SERIAL_8250_EXTENDED is not set CONFIG_SERIAL_8250_NR_UARTS=1 -# CONFIG_SERIAL_8250_PCI is not set CONFIG_SERIAL_8250_RUNTIME_UARTS=1 CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set # CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_SERIO is not set -# CONFIG_SGI_IOC4 is not set # CONFIG_SGI_IP22 is not set # CONFIG_SGI_IP27 is not set # CONFIG_SGI_IP32 is not set @@ -1017,11 +820,6 @@ CONFIG_SHMEM=y # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_SWARM is not set -# CONFIG_SIS190 is not set -# CONFIG_SIS900 is not set -# CONFIG_SK98LIN is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set CONFIG_SLAB=y CONFIG_SLHC=m # CONFIG_SLIP is not set @@ -1029,82 +827,22 @@ CONFIG_SLHC=m CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_SND=m -# CONFIG_SND_AD1889 is not set -# CONFIG_SND_ALI5451 is not set -# CONFIG_SND_ALS300 is not set -# CONFIG_SND_ATIIXP is not set -# CONFIG_SND_ATIIXP_MODEM is not set -# CONFIG_SND_AU8810 is not set -# CONFIG_SND_AU8820 is not set -# CONFIG_SND_AU8830 is not set -# CONFIG_SND_AZT3328 is not set -# CONFIG_SND_BT87X is not set -# CONFIG_SND_CA0106 is not set -# CONFIG_SND_CMIPCI is not set -# CONFIG_SND_CS4281 is not set -# CONFIG_SND_CS46XX is not set -# CONFIG_SND_DARLA20 is not set -# CONFIG_SND_DARLA24 is not set # CONFIG_SND_DEBUG is not set # CONFIG_SND_DUMMY is not set # CONFIG_SND_DYNAMIC_MINORS is not set -# CONFIG_SND_ECHO3G is not set -# CONFIG_SND_EMU10K1 is not set -# CONFIG_SND_EMU10K1X is not set -# CONFIG_SND_ENS1370 is not set -# CONFIG_SND_ENS1371 is not set -# CONFIG_SND_ES1938 is not set -# CONFIG_SND_ES1968 is not set -# CONFIG_SND_FM801 is not set -# CONFIG_SND_GINA20 is not set -# CONFIG_SND_GINA24 is not set -# CONFIG_SND_HDA_INTEL is not set -# CONFIG_SND_HDSP is not set -# CONFIG_SND_HDSPM is not set -CONFIG_SND_HWDEP=m -# CONFIG_SND_ICE1712 is not set -# CONFIG_SND_ICE1724 is not set -# CONFIG_SND_INDIGO is not set -# CONFIG_SND_INDIGODJ is not set -# CONFIG_SND_INDIGOIO is not set -# CONFIG_SND_INTEL8X0 is not set -# CONFIG_SND_INTEL8X0M is not set -# CONFIG_SND_KORG1212 is not set -# CONFIG_SND_LAYLA20 is not set -# CONFIG_SND_LAYLA24 is not set -# CONFIG_SND_MAESTRO3 is not set -# CONFIG_SND_MIA is not set -# CONFIG_SND_MIXART is not set CONFIG_SND_MIXER_OSS=m -# CONFIG_SND_MONA is not set # CONFIG_SND_MPU401 is not set # CONFIG_SND_MTPAV is not set -# CONFIG_SND_NM256 is not set CONFIG_SND_OSSEMUL=y CONFIG_SND_PCM=m CONFIG_SND_PCM_OSS=m CONFIG_SND_PCM_OSS_PLUGINS=y -# CONFIG_SND_PCXHR is not set -# CONFIG_SND_PDAUDIOCF is not set -CONFIG_SND_RAWMIDI=m -# CONFIG_SND_RIPTIDE is not set -# CONFIG_SND_RME32 is not set -# CONFIG_SND_RME96 is not set -# CONFIG_SND_RME9652 is not set # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_SONICVIBES is not set # CONFIG_SND_SUPPORT_OLD_API is not set CONFIG_SND_TIMER=m -# CONFIG_SND_TRIDENT is not set -CONFIG_SND_USB_AUDIO=m # CONFIG_SND_VERBOSE_PRINTK is not set CONFIG_SND_VERBOSE_PROCFS=y -# CONFIG_SND_VIA82XX is not set -# CONFIG_SND_VIA82XX_MODEM is not set -# CONFIG_SND_VX222 is not set -# CONFIG_SND_VXPOCKET is not set -# CONFIG_SND_YMFPCI is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOLARIS_X86_PARTITION is not set @@ -1123,13 +861,10 @@ CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 CONFIG_STACKTRACE_SUPPORT=y CONFIG_STANDALONE=y # CONFIG_STRIP is not set -# CONFIG_SUNDANCE is not set -# CONFIG_SUNGEM is not set CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m # CONFIG_SUN_PARTITION is not set CONFIG_SWAP=y -# CONFIG_SYNCLINK_CS is not set # CONFIG_SYN_COOKIES is not set CONFIG_SYSCTL=y CONFIG_SYSCTL_SYSCALL=y @@ -1159,17 +894,13 @@ CONFIG_TEXTSEARCH_BM=m CONFIG_TEXTSEARCH_FSM=m CONFIG_TEXTSEARCH_KMP=m # CONFIG_TIFM_CORE is not set -# CONFIG_TIGON3 is not set # CONFIG_TINY_SHMEM is not set # CONFIG_TIPC is not set -# CONFIG_TLAN is not set -CONFIG_TMD_HERMES=m CONFIG_TMPFS=y # CONFIG_TMPFS_POSIX_ACL is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_TOSHIBA_RBTX4927 is not set # CONFIG_TOSHIBA_RBTX4938 is not set -# CONFIG_TR is not set CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_TRAD_SIGNALS=y CONFIG_TUN=m @@ -1181,161 +912,13 @@ CONFIG_UNIX=y CONFIG_UNIX98_PTYS=y # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_UNUSED_SYMBOLS is not set -CONFIG_USB=m -# CONFIG_USB_ACECAD is not set -CONFIG_USB_ACM=m -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_AIPTEK is not set -CONFIG_USB_ALI_M5632=y -CONFIG_USB_AN2720=y -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_APPLETOUCH is not set # CONFIG_USB_ARCH_HAS_EHCI is not set # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -CONFIG_USB_ARMLINUX=y -# CONFIG_USB_ATI_REMOTE is not set -# CONFIG_USB_ATI_REMOTE2 is not set -CONFIG_USB_ATM=m -# CONFIG_USB_AUERSWALD is not set -# CONFIG_USB_BANDWIDTH is not set -CONFIG_USB_BELKIN=y -CONFIG_USB_CATC=m -# CONFIG_USB_CXACRU is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_DABUSB is not set -# CONFIG_USB_DEBUG is not set -CONFIG_USB_DEVICEFS=y -# CONFIG_USB_DSBR is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EPSON2888 is not set -CONFIG_USB_EZUSB=y -# CONFIG_USB_FTDI_ELAN is not set # CONFIG_USB_GADGET is not set -# CONFIG_USB_HID is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_KAWETH=m -# CONFIG_USB_KBD is not set -# CONFIG_USB_KBTAB is not set -# CONFIG_USB_KEYSPAN_REMOTE is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LIBUSUAL is not set -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_MOUSE is not set -CONFIG_USB_NET_AX8817X=m -CONFIG_USB_NET_CDCETHER=m -CONFIG_USB_NET_CDC_SUBSET=m -CONFIG_USB_NET_GL620A=m -CONFIG_USB_NET_MCS7830=m -CONFIG_USB_NET_NET1080=m -CONFIG_USB_NET_PLUSB=m -CONFIG_USB_NET_RNDIS_HOST=m -CONFIG_USB_NET_ZAURUS=m -# CONFIG_USB_OHCI_BIG_ENDIAN is not set -# CONFIG_USB_OHCI_HCD is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -# CONFIG_USB_OTG is not set -CONFIG_USB_PEGASUS=m -# CONFIG_USB_PHIDGET is not set -# CONFIG_USB_POWERMATE is not set -CONFIG_USB_PRINTER=m -# CONFIG_USB_RIO500 is not set -CONFIG_USB_RTL8150=m -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_AIRCABLE=m -CONFIG_USB_SERIAL_AIRPRIME=m -CONFIG_USB_SERIAL_ARK3116=m -CONFIG_USB_SERIAL_BELKIN=m -CONFIG_USB_SERIAL_CP2101=m -CONFIG_USB_SERIAL_CYBERJACK=m -CONFIG_USB_SERIAL_CYPRESS_M8=m -CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m -CONFIG_USB_SERIAL_EDGEPORT=m -CONFIG_USB_SERIAL_EDGEPORT_TI=m -CONFIG_USB_SERIAL_EMPEG=m -CONFIG_USB_SERIAL_FTDI_SIO=m -CONFIG_USB_SERIAL_FUNSOFT=m -CONFIG_USB_SERIAL_GARMIN=m -CONFIG_USB_SERIAL_GENERIC=y -CONFIG_USB_SERIAL_HP4X=m -CONFIG_USB_SERIAL_IPAQ=m -CONFIG_USB_SERIAL_IPW=m -CONFIG_USB_SERIAL_IR=m -CONFIG_USB_SERIAL_KEYSPAN=m -CONFIG_USB_SERIAL_KEYSPAN_MPR=y -CONFIG_USB_SERIAL_KEYSPAN_PDA=m -CONFIG_USB_SERIAL_KEYSPAN_USA18X=y -CONFIG_USB_SERIAL_KEYSPAN_USA19=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y -CONFIG_USB_SERIAL_KEYSPAN_USA19W=y -CONFIG_USB_SERIAL_KEYSPAN_USA28=y -CONFIG_USB_SERIAL_KEYSPAN_USA28X=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y -CONFIG_USB_SERIAL_KEYSPAN_USA49W=y -CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y -CONFIG_USB_SERIAL_KLSI=m -CONFIG_USB_SERIAL_KOBIL_SCT=m -CONFIG_USB_SERIAL_MCT_U232=m -CONFIG_USB_SERIAL_MOS7720=m -CONFIG_USB_SERIAL_MOS7840=m -CONFIG_USB_SERIAL_NAVMAN=m -CONFIG_USB_SERIAL_OMNINET=m -CONFIG_USB_SERIAL_OPTION=m -CONFIG_USB_SERIAL_PL2303=m -CONFIG_USB_SERIAL_SAFE=m -CONFIG_USB_SERIAL_SAFE_PADDED=y -CONFIG_USB_SERIAL_SIERRAWIRELESS=m -CONFIG_USB_SERIAL_TI=m -CONFIG_USB_SERIAL_VISOR=m -CONFIG_USB_SERIAL_WHITEHEAT=m -CONFIG_USB_SERIAL_XIRCOM=m -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_SL811_HCD is not set -CONFIG_USB_SPEEDTOUCH=m -CONFIG_USB_STORAGE=m -CONFIG_USB_STORAGE_ALAUDA=y -CONFIG_USB_STORAGE_DATAFAB=y -# CONFIG_USB_STORAGE_DEBUG is not set -CONFIG_USB_STORAGE_DPCM=y -CONFIG_USB_STORAGE_FREECOM=y -CONFIG_USB_STORAGE_JUMPSHOT=y -CONFIG_USB_STORAGE_KARMA=y -# CONFIG_USB_STORAGE_ONETOUCH is not set -CONFIG_USB_STORAGE_SDDR09=y -CONFIG_USB_STORAGE_SDDR55=y -CONFIG_USB_STORAGE_USBAT=y -# CONFIG_USB_TEST is not set -# CONFIG_USB_TOUCHSCREEN is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -CONFIG_USB_UEAGLEATM=m -CONFIG_USB_USBNET=m -CONFIG_USB_USBNET_MII=m -# CONFIG_USB_WACOM is not set -# CONFIG_USB_XPAD is not set -# CONFIG_USB_XUSBATM is not set -# CONFIG_USB_YEALINK is not set -CONFIG_USB_ZD1201=m # CONFIG_UTS_NS is not set CONFIG_VFAT_FS=m -# CONFIG_VIA_VELOCITY is not set -# CONFIG_VIDEO_ADV_DEBUG is not set # CONFIG_VIDEO_DEV is not set -# CONFIG_VIDEO_V4L1 is not set -CONFIG_VIDEO_V4L1_COMPAT=y -CONFIG_VIDEO_V4L2=y -# CONFIG_VIDEO_VIVI is not set -# CONFIG_VITESSE_PHY is not set CONFIG_VLAN_8021Q=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VT is not set @@ -1345,7 +928,6 @@ CONFIG_VLAN_8021Q=y # CONFIG_WAN_ROUTER is not set CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set -# CONFIG_WDTPCI is not set CONFIG_WIRELESS_EXT=y # CONFIG_WR_PPMC is not set # CONFIG_X25 is not set @@ -1358,14 +940,6 @@ CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set # CONFIG_XFS_SECURITY is not set # CONFIG_YAM is not set -# CONFIG_YELLOWFIN is not set -CONFIG_YENTA=m -# CONFIG_YENTA_O2 is not set -# CONFIG_YENTA_RICOH is not set -# CONFIG_YENTA_TI is not set -# CONFIG_YENTA_TOSHIBA is not set -CONFIG_ZD1211RW=m -# CONFIG_ZD1211RW_DEBUG is not set CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=m CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/atheros-2.6/config-diff b/target/linux/atheros-2.6/config-diff index 064880a3bb47..79fc6054eb6b 100644 --- a/target/linux/atheros-2.6/config-diff +++ b/target/linux/atheros-2.6/config-diff @@ -149,6 +149,7 @@ CONFIG_MTD_REDBOOT_PARTS_READONLY=y # CONFIG_MTD_ROM is not set # CONFIG_MTD_SLRAM is not set CONFIG_MTD_SPIFLASH=y +CONFIG_MTD_SPLIT_ROOTFS=y # CONFIG_PAGE_SIZE_16KB is not set CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_64KB is not set diff --git a/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c b/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c index 32a132a9ead8..029f624eb961 100644 --- a/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c +++ b/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c @@ -472,12 +472,6 @@ static int spiflash_probe(struct platform_device *pdev) #endif /* parse redboot partitions */ num_parts = parse_mtd_partitions(mtd, part_probe_types, &spidata->parsed_parts, 0); - for (i = 0; i < num_parts; i++) { - if (!strcmp(spidata->parsed_parts[i].name, ROOTFS_NAME)) { - /* create the root device */ - ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, i); - } - } #ifdef SPIFLASH_DEBUG printk (KERN_DEBUG "Found %d partitions\n", num_parts); diff --git a/target/linux/atheros-2.6/patches/160-rootfs_split.patch b/target/linux/atheros-2.6/patches/160-rootfs_split.patch new file mode 100644 index 000000000000..e2e52f6def79 --- /dev/null +++ b/target/linux/atheros-2.6/patches/160-rootfs_split.patch @@ -0,0 +1,414 @@ +diff -ur linux.old/drivers/mtd/Kconfig linux.dev/drivers/mtd/Kconfig +--- linux.old/drivers/mtd/Kconfig 2007-01-10 20:10:37.000000000 +0100 ++++ linux.dev/drivers/mtd/Kconfig 2007-02-19 23:00:53.739457000 +0100 +@@ -49,6 +49,11 @@ + devices. Partitioning on NFTL 'devices' is a different - that's the + 'normal' form of partitioning used on a block device. + ++config MTD_SPLIT_ROOTFS ++ bool "Automatically split rootfs partition for squashfs" ++ depends on MTD_PARTITIONS ++ default y ++ + config MTD_REDBOOT_PARTS + tristate "RedBoot partition table parsing" + depends on MTD_PARTITIONS +diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c +--- linux.old/drivers/mtd/mtdpart.c 2007-01-10 20:10:37.000000000 +0100 ++++ linux.dev/drivers/mtd/mtdpart.c 2007-02-20 00:01:38.587355896 +0100 +@@ -20,6 +20,8 @@ + #include + #include + #include ++#include ++#include + + /* Our partition linked list */ + static LIST_HEAD(mtd_partitions); +@@ -303,6 +305,173 @@ + return 0; + } + ++static u_int32_t cur_offset = 0; ++static int add_mtd_partition(struct mtd_info *master, const struct mtd_partition *part, int i) ++{ ++ struct mtd_part *slave; ++ ++ /* allocate the partition structure */ ++ slave = kmalloc (sizeof(*slave), GFP_KERNEL); ++ if (!slave) { ++ printk ("memory allocation error while creating partitions for \"%s\"\n", ++ master->name); ++ del_mtd_partitions(master); ++ return -ENOMEM; ++ } ++ memset(slave, 0, sizeof(*slave)); ++ list_add(&slave->list, &mtd_partitions); ++ ++ /* set up the MTD object for this partition */ ++ slave->mtd.type = master->type; ++ slave->mtd.flags = master->flags & ~part->mask_flags; ++ slave->mtd.size = part->size; ++ slave->mtd.writesize = master->writesize; ++ slave->mtd.oobsize = master->oobsize; ++ slave->mtd.ecctype = master->ecctype; ++ slave->mtd.eccsize = master->eccsize; ++ ++ slave->mtd.name = part->name; ++ slave->mtd.bank_size = master->bank_size; ++ slave->mtd.owner = master->owner; ++ ++ slave->mtd.read = part_read; ++ slave->mtd.write = part_write; ++ ++ if(master->point && master->unpoint){ ++ slave->mtd.point = part_point; ++ slave->mtd.unpoint = part_unpoint; ++ } ++ ++ if (master->read_oob) ++ slave->mtd.read_oob = part_read_oob; ++ if (master->write_oob) ++ slave->mtd.write_oob = part_write_oob; ++ if(master->read_user_prot_reg) ++ slave->mtd.read_user_prot_reg = part_read_user_prot_reg; ++ if(master->read_fact_prot_reg) ++ slave->mtd.read_fact_prot_reg = part_read_fact_prot_reg; ++ if(master->write_user_prot_reg) ++ slave->mtd.write_user_prot_reg = part_write_user_prot_reg; ++ if(master->lock_user_prot_reg) ++ slave->mtd.lock_user_prot_reg = part_lock_user_prot_reg; ++ if(master->get_user_prot_info) ++ slave->mtd.get_user_prot_info = part_get_user_prot_info; ++ if(master->get_fact_prot_info) ++ slave->mtd.get_fact_prot_info = part_get_fact_prot_info; ++ if (master->sync) ++ slave->mtd.sync = part_sync; ++ if (!i && master->suspend && master->resume) { ++ slave->mtd.suspend = part_suspend; ++ slave->mtd.resume = part_resume; ++ } ++ if (master->writev) ++ slave->mtd.writev = part_writev; ++ if (master->lock) ++ slave->mtd.lock = part_lock; ++ if (master->unlock) ++ slave->mtd.unlock = part_unlock; ++ if (master->block_isbad) ++ slave->mtd.block_isbad = part_block_isbad; ++ if (master->block_markbad) ++ slave->mtd.block_markbad = part_block_markbad; ++ slave->mtd.erase = part_erase; ++ slave->master = master; ++ slave->offset = part->offset; ++ slave->index = i; ++ ++ if (slave->offset == MTDPART_OFS_APPEND) ++ slave->offset = cur_offset; ++ if (slave->offset == MTDPART_OFS_NXTBLK) { ++ slave->offset = cur_offset; ++ if ((cur_offset % master->erasesize) != 0) { ++ /* Round up to next erasesize */ ++ slave->offset = ((cur_offset / master->erasesize) + 1) * master->erasesize; ++ printk(KERN_NOTICE "Moving partition %d: " ++ "0x%08x -> 0x%08x\n", i, ++ cur_offset, slave->offset); ++ } ++ } ++ if (slave->mtd.size == MTDPART_SIZ_FULL) ++ slave->mtd.size = master->size - slave->offset; ++ cur_offset = slave->offset + slave->mtd.size; ++ ++ printk (KERN_NOTICE "0x%08x-0x%08x : \"%s\"\n", slave->offset, ++ slave->offset + slave->mtd.size, slave->mtd.name); ++ ++ /* let's do some sanity checks */ ++ if (slave->offset >= master->size) { ++ /* let's register it anyway to preserve ordering */ ++ slave->offset = 0; ++ slave->mtd.size = 0; ++ printk ("mtd: partition \"%s\" is out of reach -- disabled\n", ++ part->name); ++ } ++ if (slave->offset + slave->mtd.size > master->size) { ++ slave->mtd.size = master->size - slave->offset; ++ printk ("mtd: partition \"%s\" extends beyond the end of device \"%s\" -- size truncated to %#x\n", ++ part->name, master->name, slave->mtd.size); ++ } ++ if (master->numeraseregions>1) { ++ /* Deal with variable erase size stuff */ ++ int i; ++ struct mtd_erase_region_info *regions = master->eraseregions; ++ ++ /* Find the first erase regions which is part of this partition. */ ++ for (i=0; i < master->numeraseregions && slave->offset >= regions[i].offset; i++) ++ ; ++ ++ for (i--; i < master->numeraseregions && slave->offset + slave->mtd.size > regions[i].offset; i++) { ++ if (slave->mtd.erasesize < regions[i].erasesize) { ++ slave->mtd.erasesize = regions[i].erasesize; ++ } ++ } ++ } else { ++ /* Single erase size */ ++ slave->mtd.erasesize = master->erasesize; ++ } ++ ++ if ((slave->mtd.flags & MTD_WRITEABLE) && ++ (slave->offset % slave->mtd.erasesize)) { ++ /* Doesn't start on a boundary of major erase size */ ++ /* FIXME: Let it be writable if it is on a boundary of _minor_ erase size though */ ++ slave->mtd.flags &= ~MTD_WRITEABLE; ++ printk ("mtd: partition \"%s\" doesn't start on an erase block boundary -- force read-only\n", ++ part->name); ++ } ++ if ((slave->mtd.flags & MTD_WRITEABLE) && ++ (slave->mtd.size % slave->mtd.erasesize)) { ++ slave->mtd.flags &= ~MTD_WRITEABLE; ++ printk ("mtd: partition \"%s\" doesn't end on an erase block -- force read-only\n", ++ part->name); ++ } ++ ++ slave->mtd.ecclayout = master->ecclayout; ++ if (master->block_isbad) { ++ uint32_t offs = 0; ++ ++ while(offs < slave->mtd.size) { ++ if (master->block_isbad(master, ++ offs + slave->offset)) ++ slave->mtd.ecc_stats.badblocks++; ++ offs += slave->mtd.erasesize; ++ } ++ } ++ ++ if(part->mtdp) ++ { /* store the object pointer (caller may or may not register it */ ++ *part->mtdp = &slave->mtd; ++ slave->registered = 0; ++ } ++ else ++ { ++ /* register our partition */ ++ add_mtd_device(&slave->mtd); ++ slave->registered = 1; ++ } ++ ++ return 0; ++} ++ + /* + * This function, given a master MTD object and a partition table, creates + * and registers slave MTD objects which are bound to the master according to +@@ -314,171 +483,53 @@ + const struct mtd_partition *parts, + int nbparts) + { +- struct mtd_part *slave; +- u_int32_t cur_offset = 0; +- int i; ++ struct mtd_partition *part; ++ int i, ret = 0; + + printk (KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name); + + for (i = 0; i < nbparts; i++) { ++ part = (struct mtd_partition *) &parts[i]; ++ ret = add_mtd_partition(master, part, i); ++ if (ret) ++ return ret; ++ if (strcmp(part->name, "rootfs") == 0) { ++#ifdef CONFIG_MTD_SPLIT_ROOTFS ++ int len; ++ char buf[512]; ++ struct squashfs_super_block *sb = (struct squashfs_super_block *) buf; ++#define ROOTFS_SPLIT_NAME "rootfs_data" ++ if ((master->read(master, part->offset, sizeof(struct squashfs_super_block), &len, buf) == 0) && ++ (len == sizeof(struct squashfs_super_block)) && ++ (*((u32 *) buf) == SQUASHFS_MAGIC) && ++ (sb->bytes_used > 0)) { ++ ++ ++ part = kmalloc(sizeof(struct mtd_partition), GFP_KERNEL); ++ memcpy(part, &parts[i], sizeof(struct mtd_partition)); ++ ++ part->name = kmalloc(sizeof(ROOTFS_SPLIT_NAME) + 1, GFP_KERNEL); ++ strcpy(part->name, ROOTFS_SPLIT_NAME); ++ ++ len = (u32) sb->bytes_used; ++ len += (part->offset & 0x000fffff); ++ len += (master->erasesize - 1); ++ len &= ~(master->erasesize - 1); ++ len -= (part->offset & 0x000fffff); ++ part->offset += len; ++ part->size -= len; ++ ++ if (len + master->erasesize < part->size) ++ ret = add_mtd_partition(master, part, i + 1); ++ else ++ kfree(part->name); ++ if (ret) ++ return ret; + +- /* allocate the partition structure */ +- slave = kmalloc (sizeof(*slave), GFP_KERNEL); +- if (!slave) { +- printk ("memory allocation error while creating partitions for \"%s\"\n", +- master->name); +- del_mtd_partitions(master); +- return -ENOMEM; +- } +- memset(slave, 0, sizeof(*slave)); +- list_add(&slave->list, &mtd_partitions); +- +- /* set up the MTD object for this partition */ +- slave->mtd.type = master->type; +- slave->mtd.flags = master->flags & ~parts[i].mask_flags; +- slave->mtd.size = parts[i].size; +- slave->mtd.writesize = master->writesize; +- slave->mtd.oobsize = master->oobsize; +- slave->mtd.ecctype = master->ecctype; +- slave->mtd.eccsize = master->eccsize; +- +- slave->mtd.name = parts[i].name; +- slave->mtd.bank_size = master->bank_size; +- slave->mtd.owner = master->owner; +- +- slave->mtd.read = part_read; +- slave->mtd.write = part_write; +- +- if(master->point && master->unpoint){ +- slave->mtd.point = part_point; +- slave->mtd.unpoint = part_unpoint; +- } +- +- if (master->read_oob) +- slave->mtd.read_oob = part_read_oob; +- if (master->write_oob) +- slave->mtd.write_oob = part_write_oob; +- if(master->read_user_prot_reg) +- slave->mtd.read_user_prot_reg = part_read_user_prot_reg; +- if(master->read_fact_prot_reg) +- slave->mtd.read_fact_prot_reg = part_read_fact_prot_reg; +- if(master->write_user_prot_reg) +- slave->mtd.write_user_prot_reg = part_write_user_prot_reg; +- if(master->lock_user_prot_reg) +- slave->mtd.lock_user_prot_reg = part_lock_user_prot_reg; +- if(master->get_user_prot_info) +- slave->mtd.get_user_prot_info = part_get_user_prot_info; +- if(master->get_fact_prot_info) +- slave->mtd.get_fact_prot_info = part_get_fact_prot_info; +- if (master->sync) +- slave->mtd.sync = part_sync; +- if (!i && master->suspend && master->resume) { +- slave->mtd.suspend = part_suspend; +- slave->mtd.resume = part_resume; +- } +- if (master->writev) +- slave->mtd.writev = part_writev; +- if (master->lock) +- slave->mtd.lock = part_lock; +- if (master->unlock) +- slave->mtd.unlock = part_unlock; +- if (master->block_isbad) +- slave->mtd.block_isbad = part_block_isbad; +- if (master->block_markbad) +- slave->mtd.block_markbad = part_block_markbad; +- slave->mtd.erase = part_erase; +- slave->master = master; +- slave->offset = parts[i].offset; +- slave->index = i; +- +- if (slave->offset == MTDPART_OFS_APPEND) +- slave->offset = cur_offset; +- if (slave->offset == MTDPART_OFS_NXTBLK) { +- slave->offset = cur_offset; +- if ((cur_offset % master->erasesize) != 0) { +- /* Round up to next erasesize */ +- slave->offset = ((cur_offset / master->erasesize) + 1) * master->erasesize; +- printk(KERN_NOTICE "Moving partition %d: " +- "0x%08x -> 0x%08x\n", i, +- cur_offset, slave->offset); ++ kfree(part); + } +- } +- if (slave->mtd.size == MTDPART_SIZ_FULL) +- slave->mtd.size = master->size - slave->offset; +- cur_offset = slave->offset + slave->mtd.size; +- +- printk (KERN_NOTICE "0x%08x-0x%08x : \"%s\"\n", slave->offset, +- slave->offset + slave->mtd.size, slave->mtd.name); +- +- /* let's do some sanity checks */ +- if (slave->offset >= master->size) { +- /* let's register it anyway to preserve ordering */ +- slave->offset = 0; +- slave->mtd.size = 0; +- printk ("mtd: partition \"%s\" is out of reach -- disabled\n", +- parts[i].name); +- } +- if (slave->offset + slave->mtd.size > master->size) { +- slave->mtd.size = master->size - slave->offset; +- printk ("mtd: partition \"%s\" extends beyond the end of device \"%s\" -- size truncated to %#x\n", +- parts[i].name, master->name, slave->mtd.size); +- } +- if (master->numeraseregions>1) { +- /* Deal with variable erase size stuff */ +- int i; +- struct mtd_erase_region_info *regions = master->eraseregions; +- +- /* Find the first erase regions which is part of this partition. */ +- for (i=0; i < master->numeraseregions && slave->offset >= regions[i].offset; i++) +- ; +- +- for (i--; i < master->numeraseregions && slave->offset + slave->mtd.size > regions[i].offset; i++) { +- if (slave->mtd.erasesize < regions[i].erasesize) { +- slave->mtd.erasesize = regions[i].erasesize; +- } +- } +- } else { +- /* Single erase size */ +- slave->mtd.erasesize = master->erasesize; +- } +- +- if ((slave->mtd.flags & MTD_WRITEABLE) && +- (slave->offset % slave->mtd.erasesize)) { +- /* Doesn't start on a boundary of major erase size */ +- /* FIXME: Let it be writable if it is on a boundary of _minor_ erase size though */ +- slave->mtd.flags &= ~MTD_WRITEABLE; +- printk ("mtd: partition \"%s\" doesn't start on an erase block boundary -- force read-only\n", +- parts[i].name); +- } +- if ((slave->mtd.flags & MTD_WRITEABLE) && +- (slave->mtd.size % slave->mtd.erasesize)) { +- slave->mtd.flags &= ~MTD_WRITEABLE; +- printk ("mtd: partition \"%s\" doesn't end on an erase block -- force read-only\n", +- parts[i].name); +- } +- +- slave->mtd.ecclayout = master->ecclayout; +- if (master->block_isbad) { +- uint32_t offs = 0; +- +- while(offs < slave->mtd.size) { +- if (master->block_isbad(master, +- offs + slave->offset)) +- slave->mtd.ecc_stats.badblocks++; +- offs += slave->mtd.erasesize; +- } +- } +- +- if(parts[i].mtdp) +- { /* store the object pointer (caller may or may not register it */ +- *parts[i].mtdp = &slave->mtd; +- slave->registered = 0; +- } +- else +- { +- /* register our partition */ +- add_mtd_device(&slave->mtd); +- slave->registered = 1; ++#endif /* CONFIG_MTD_SPLIT_ROOTFS */ ++ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, i); + } + } + -- 2.30.2