# HG changeset patch # User Pascal Bellard # Date 1414080356 -7200 # Node ID b9fafbaeb4c6f8a70765f205d98ba62bb9f795ec # Parent 1f00b27b3afbd14f6e4343ba73db84549de9afa0 Add linux-romfs diff -r 1f00b27b3afb -r b9fafbaeb4c6 linux-romfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-romfs/receipt Thu Oct 23 18:05:56 2014 +0200 @@ -0,0 +1,42 @@ +# SliTaz package receipt. + +PACKAGE="linux-romfs" +VERSION="3.2.53" +CATEGORY="base-system" +SHORT_DESC="The Linux kernel romfs module." +MAINTAINER="devel@slitaz.org" +LICENSE="GPL2" +DEPENDS="linux" +WANTED="linux" +WEB_SITE="http://www.kernel.org/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src install + $wanted_stuff/list_modules.sh fs/${PACKAGE#*-} | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $install/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE#*-}$ $1/etc/filesystems || \ + echo "${PACKAGE#*-}" >> $1/etc/filesystems + chroot "$root/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE#*-}\$/d" $1/etc/filesystems + chroot "$root/" depmod -a $VERSION-slitaz +} + diff -r 1f00b27b3afb -r b9fafbaeb4c6 linux/receipt --- a/linux/receipt Thu Oct 23 11:06:43 2014 +0200 +++ b/linux/receipt Thu Oct 23 18:05:56 2014 +0200 @@ -115,6 +115,7 @@ $PACKAGE-freeinitrd.u $PACKAGE-subroot.u $PACKAGE-CVE-2013-2929.u +$PACKAGE-romfs.u aufs3-base.patch aufs3-standalone.patch aufs3-loopback.patch diff -r 1f00b27b3afb -r b9fafbaeb4c6 linux/stuff/linux-romfs.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux/stuff/linux-romfs.u Thu Oct 23 18:05:56 2014 +0200 @@ -0,0 +1,98 @@ +--- linux-3.2.53/fs/romfs/super.c ++++ linux-3.2.53/fs/romfs/super.c +@@ -74,6 +74,8 @@ + #include + #include "internal.h" + ++#define MS_ROMFS_WITH_DATE MS_VERBOSE ++ + static struct kmem_cache *romfs_inode_cachep; + + static const umode_t romfs_modemap[8] = { +@@ -302,6 +304,7 @@ + unsigned nextfh; + int ret; + umode_t mode; ++ unsigned long spec; + + /* we might have to traverse a chain of "hard link" file entries to get + * to the actual file */ +@@ -312,11 +315,12 @@ + + /* XXX: do romfs_checksum here too (with name) */ + ++ spec = be32_to_cpu(ri.spec); + nextfh = be32_to_cpu(ri.next); + if ((nextfh & ROMFH_TYPE) != ROMFH_HRD) + break; + +- pos = be32_to_cpu(ri.spec) & ROMFH_MASK; ++ pos = spec & ROMFH_MASK; + } + + /* determine the length of the filename */ +@@ -352,6 +356,12 @@ + i->i_fop = &romfs_dir_operations; + if (nextfh & ROMFH_EXEC) + mode |= S_IXUGO; ++ spec &= 0xf; ++ if (spec != 0) { ++ sb->s_flags |= MS_ROMFS_WITH_DATE; ++ set_nlink(i, spec); ++ } ++ spec = i->i_size; + break; + case ROMFH_REG: + i->i_fop = &romfs_ro_fops; +@@ -367,16 +377,40 @@ + i->i_data.a_ops = &romfs_aops; + mode |= S_IRWXUGO; + break; ++ case ROMFH_SCK: ++ case ROMFH_FIF: ++ spec = 0; + default: + /* depending on MBZ for sock/fifos */ +- nextfh = be32_to_cpu(ri.spec); +- init_special_inode(i, mode, MKDEV(nextfh >> 16, +- nextfh & 0xffff)); ++ init_special_inode(i, mode, MKDEV(spec >> 16, ++ spec & 0xffff)); ++ spec = i->i_size; ++ i->i_size = 0; + break; + } + + i->i_mode = mode; + ++ if (sb->s_flags & MS_ROMFS_WITH_DATE) { ++ ++ int signed_spec = spec; ++ ++ i->i_uid = signed_spec >> 20; ++ i->i_gid = (spec >> 12) & 0xFF; ++ if (spec & 0100) ++ i->i_gid |= ~0xFF; /* sign extention */ ++ i->i_mode &= ~07677; ++ i->i_mode |= spec & 07677; ++ ++ /* backward compatibility for blocks and char devices ++ * when spec is 0, uid = gid = 0 = root and mode is rw- --- --- ++ * so, these devices have a null size with old romfs code ++ */ ++ i->i_mode ^= 0600; ++ ++ i->i_mtime.tv_sec = i->i_atime.tv_sec = ++ i->i_ctime.tv_sec = ntohl(ri.checksum); ++ } + unlock_new_inode(i); + return i; + +@@ -428,6 +462,7 @@ + (romfs_maxsize(dentry->d_sb) + ROMBSIZE - 1) >> ROMBSBITS; + buf->f_fsid.val[0] = (u32)id; + buf->f_fsid.val[1] = (u32)(id >> 32); ++ sb->s_flags &= MS_ROMFS_WITH_DATE; + return 0; + } + diff -r 1f00b27b3afb -r b9fafbaeb4c6 linux/stuff/linux-slitaz.config --- a/linux/stuff/linux-slitaz.config Thu Oct 23 11:06:43 2014 +0200 +++ b/linux/stuff/linux-slitaz.config Thu Oct 23 18:05:56 2014 +0200 @@ -4571,7 +4571,7 @@ # CONFIG_OMFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set +CONFIG_ROMFS_FS=m # CONFIG_PSTORE is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set diff -r 1f00b27b3afb -r b9fafbaeb4c6 linux/stuff/linux-slitaz.config64 --- a/linux/stuff/linux-slitaz.config64 Thu Oct 23 11:06:43 2014 +0200 +++ b/linux/stuff/linux-slitaz.config64 Thu Oct 23 18:05:56 2014 +0200 @@ -4308,7 +4308,7 @@ # CONFIG_OMFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set +CONFIG_ROMFS_FS=m # CONFIG_PSTORE is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set diff -r 1f00b27b3afb -r b9fafbaeb4c6 linux64-romfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux64-romfs/receipt Thu Oct 23 18:05:56 2014 +0200 @@ -0,0 +1,45 @@ +# SliTaz package receipt. + +PACKAGE="linux64-romfs" +VERSION="3.2.53" +CATEGORY="base-system" +SHORT_DESC="The Linux kernel romfs module." +MAINTAINER="devel@slitaz.org" +LICENSE="GPL2" +DEPENDS="linux64" +WANTED="linux" +PROVIDE="linux-romfs:linux64" +WEB_SITE="http://www.kernel.org/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + install=$install/linux64 + path=lib/modules/$VERSION-slitaz64/kernel + mkdir -p $fs/$path $fs/etc + export src + export install + $wanted_stuff/list_modules.sh fs/${PACKAGE#*-} | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $install/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE#*-}$ $1/etc/filesystems || \ + echo "${PACKAGE#*-}" >> $1/etc/filesystems + chroot "$root/" depmod -a $VERSION-slitaz64 +} + +post_remove() +{ + sed -i "/^${PACKAGE#*-}\$/d" $1/etc/filesystems + chroot "$root/" depmod -a $VERSION-slitaz64 +} +