Page MenuHomeFreeBSD

D19266.id54134.diff
No OneTemporary

D19266.id54134.diff

Index: sys/conf/files
===================================================================
--- sys/conf/files
+++ sys/conf/files
@@ -636,6 +636,17 @@
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
+# xz
+contrib/xz-embedded/freebsd/xz_malloc.c optional xz \
+ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
+contrib/xz-embedded/linux/lib/xz/xz_crc32.c optional xz \
+ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
+contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c optional xz \
+ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
+contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c optional xz \
+ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
+contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c optional xz \
+ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
# Zstd
contrib/zstd/lib/freebsd/zstd_kmalloc.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/common/zstd_common.c optional zstdio compile-with ${ZSTD_C}
@@ -3655,21 +3666,6 @@
geom/raid3/g_raid3_ctl.c optional geom_raid3
geom/shsec/g_shsec.c optional geom_shsec
geom/stripe/g_stripe.c optional geom_stripe
-contrib/xz-embedded/freebsd/xz_malloc.c \
- optional xz_embedded | geom_uzip \
- compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
-contrib/xz-embedded/linux/lib/xz/xz_crc32.c \
- optional xz_embedded | geom_uzip \
- compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
-contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \
- optional xz_embedded | geom_uzip \
- compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
-contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \
- optional xz_embedded | geom_uzip \
- compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
-contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \
- optional xz_embedded | geom_uzip \
- compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
geom/uzip/g_uzip.c optional geom_uzip
geom/uzip/g_uzip_lzma.c optional geom_uzip
geom/uzip/g_uzip_wrkthr.c optional geom_uzip
Index: sys/contrib/xz-embedded/freebsd/xz_config.h
===================================================================
--- sys/contrib/xz-embedded/freebsd/xz_config.h
+++ sys/contrib/xz-embedded/freebsd/xz_config.h
@@ -35,7 +35,6 @@
#include <contrib/xz-embedded/linux/include/linux/xz.h>
#include "xz_malloc.h"
-#define XZ_DEC_SINGLE 1
#define XZ_PREBOOT 1
#undef XZ_EXTERN
Index: sys/contrib/xz-embedded/freebsd/xz_malloc.c
===================================================================
--- sys/contrib/xz-embedded/freebsd/xz_malloc.c
+++ sys/contrib/xz-embedded/freebsd/xz_malloc.c
@@ -26,6 +26,8 @@
#include <sys/malloc.h>
#include <sys/kernel.h>
+#include <sys/module.h>
+#include "xz.h"
#include "xz_malloc.h"
/* Wraper for XZ decompressor memmory pool */
@@ -47,3 +49,38 @@
free(addr, XZ_DEC);
}
+
+static int
+xz_module_event_handler(module_t mod, int what, void *arg)
+{
+ int error;
+
+ switch (what) {
+ case MOD_LOAD:
+#if XZ_INTERNAL_CRC32
+ xz_crc32_init();
+#endif
+#if XZ_INTERNAL_CRC64
+ xz_crc64_init();
+#endif
+ error = 0;
+ break;
+ case MOD_UNLOAD:
+ error = 0;
+ break;
+ default:
+ error = EOPNOTSUPP;
+ break;
+ }
+
+ return (error);
+}
+
+static moduledata_t xz_moduledata = {
+ "xz",
+ xz_module_event_handler,
+ NULL
+};
+
+DECLARE_MODULE(xz, xz_moduledata, SI_SUB_INIT_IF, SI_ORDER_ANY);
+MODULE_VERSION(xz, 1);
Index: sys/geom/uzip/g_uzip.c
===================================================================
--- sys/geom/uzip/g_uzip.c
+++ sys/geom/uzip/g_uzip.c
@@ -921,5 +921,6 @@
};
DECLARE_GEOM_CLASS(g_uzip_class, g_uzip);
+MODULE_DEPEND(g_uzip, xz, 1, 1, 1);
MODULE_DEPEND(g_uzip, zlib, 1, 1, 1);
MODULE_VERSION(geom_uzip, 0);
Index: sys/geom/uzip/g_uzip_lzma.c
===================================================================
--- sys/geom/uzip/g_uzip_lzma.c
+++ sys/geom/uzip/g_uzip_lzma.c
@@ -103,7 +103,6 @@
struct g_uzip_lzma *lzp;
lzp = malloc(sizeof(struct g_uzip_lzma), M_GEOM_UZIP, M_WAITOK);
- xz_crc32_init();
lzp->s = xz_dec_init(XZ_SINGLE, 0);
if (lzp->s == NULL) {
goto e1;
Index: sys/mips/conf/ALFA_HORNET_UB
===================================================================
--- sys/mips/conf/ALFA_HORNET_UB
+++ sys/mips/conf/ALFA_HORNET_UB
@@ -49,6 +49,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/AP121
===================================================================
--- sys/mips/conf/AP121
+++ sys/mips/conf/AP121
@@ -43,6 +43,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/AP135
===================================================================
--- sys/mips/conf/AP135
+++ sys/mips/conf/AP135
@@ -46,6 +46,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/AP143
===================================================================
--- sys/mips/conf/AP143
+++ sys/mips/conf/AP143
@@ -43,6 +43,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/AP91
===================================================================
--- sys/mips/conf/AP91
+++ sys/mips/conf/AP91
@@ -38,6 +38,7 @@
# options MSDOSFS
# uncompress - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/AP93
===================================================================
--- sys/mips/conf/AP93
+++ sys/mips/conf/AP93
@@ -26,6 +26,7 @@
options MSDOSFS
# uncompress - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/AP94
===================================================================
--- sys/mips/conf/AP94
+++ sys/mips/conf/AP94
@@ -21,6 +21,7 @@
# GEOM modules
device geom_redboot # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem hackery!
options GEOM_UZIP
Index: sys/mips/conf/AP96
===================================================================
--- sys/mips/conf/AP96
+++ sys/mips/conf/AP96
@@ -27,6 +27,7 @@
options MSDOSFS
# uncompress - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/BCM
===================================================================
--- sys/mips/conf/BCM
+++ sys/mips/conf/BCM
@@ -39,6 +39,7 @@
options UFS_ACL #Support for access control lists
options UFS_DIRHASH #Improve performance on big directories
+device xz
device geom_uzip
options GEOM_UZIP
options GEOM_LABEL # Providers labelization.
Index: sys/mips/conf/CARAMBOLA2
===================================================================
--- sys/mips/conf/CARAMBOLA2
+++ sys/mips/conf/CARAMBOLA2
@@ -48,6 +48,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/DB120
===================================================================
--- sys/mips/conf/DB120
+++ sys/mips/conf/DB120
@@ -38,6 +38,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/DIR-655A1
===================================================================
--- sys/mips/conf/DIR-655A1
+++ sys/mips/conf/DIR-655A1
@@ -41,6 +41,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/DIR-825B1
===================================================================
--- sys/mips/conf/DIR-825B1
+++ sys/mips/conf/DIR-825B1
@@ -47,6 +47,7 @@
# GEOM modules
device geom_map # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem hackery!
options GEOM_UZIP
options GEOM_PART_GPT
Index: sys/mips/conf/ENH200
===================================================================
--- sys/mips/conf/ENH200
+++ sys/mips/conf/ENH200
@@ -26,6 +26,7 @@
options MSDOSFS
# uncompress - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/MT7620A_FDT
===================================================================
--- sys/mips/conf/MT7620A_FDT
+++ sys/mips/conf/MT7620A_FDT
@@ -26,6 +26,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/MT7620N_FDT
===================================================================
--- sys/mips/conf/MT7620N_FDT
+++ sys/mips/conf/MT7620N_FDT
@@ -26,6 +26,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/MT7621_FDT
===================================================================
--- sys/mips/conf/MT7621_FDT
+++ sys/mips/conf/MT7621_FDT
@@ -26,6 +26,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/MT7628_FDT
===================================================================
--- sys/mips/conf/MT7628_FDT
+++ sys/mips/conf/MT7628_FDT
@@ -27,6 +27,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/ONIONOMEGA
===================================================================
--- sys/mips/conf/ONIONOMEGA
+++ sys/mips/conf/ONIONOMEGA
@@ -45,6 +45,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/PB47
===================================================================
--- sys/mips/conf/PB47
+++ sys/mips/conf/PB47
@@ -32,6 +32,7 @@
options MSDOSFS
# uncompress - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/PB92
===================================================================
--- sys/mips/conf/PB92
+++ sys/mips/conf/PB92
@@ -55,6 +55,7 @@
#options UFS_DIRHASH #Improve performance on big directories
# Support uncompress lzma rootfs
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/PICOSTATION_M2HP
===================================================================
--- sys/mips/conf/PICOSTATION_M2HP
+++ sys/mips/conf/PICOSTATION_M2HP
@@ -38,6 +38,7 @@
# options MSDOSFS
# uncompress - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/ROCKET_M2HP
===================================================================
--- sys/mips/conf/ROCKET_M2HP
+++ sys/mips/conf/ROCKET_M2HP
@@ -38,6 +38,7 @@
# options MSDOSFS
# uncompress - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/ROUTERSTATION
===================================================================
--- sys/mips/conf/ROUTERSTATION
+++ sys/mips/conf/ROUTERSTATION
@@ -14,6 +14,7 @@
# GEOM modules
device geom_redboot # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem support
options GEOM_UZIP
Index: sys/mips/conf/ROUTERSTATION_MFS
===================================================================
--- sys/mips/conf/ROUTERSTATION_MFS
+++ sys/mips/conf/ROUTERSTATION_MFS
@@ -12,6 +12,7 @@
# GEOM modules
device geom_redboot # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem hackery!
options GEOM_UZIP
Index: sys/mips/conf/RSPRO
===================================================================
--- sys/mips/conf/RSPRO
+++ sys/mips/conf/RSPRO
@@ -15,6 +15,7 @@
# GEOM modules
device geom_redboot # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem support
options GEOM_UZIP
Index: sys/mips/conf/RSPRO_MFS
===================================================================
--- sys/mips/conf/RSPRO_MFS
+++ sys/mips/conf/RSPRO_MFS
@@ -15,6 +15,7 @@
# GEOM modules
device geom_redboot # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem hackery!
options GEOM_UZIP
Index: sys/mips/conf/RSPRO_STANDALONE
===================================================================
--- sys/mips/conf/RSPRO_STANDALONE
+++ sys/mips/conf/RSPRO_STANDALONE
@@ -14,6 +14,7 @@
# GEOM modules
device geom_redboot # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem support
options GEOM_UZIP
Index: sys/mips/conf/RT3050_FDT
===================================================================
--- sys/mips/conf/RT3050_FDT
+++ sys/mips/conf/RT3050_FDT
@@ -27,6 +27,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/RT3352_FDT
===================================================================
--- sys/mips/conf/RT3352_FDT
+++ sys/mips/conf/RT3352_FDT
@@ -26,6 +26,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/RT3883_FDT
===================================================================
--- sys/mips/conf/RT3883_FDT
+++ sys/mips/conf/RT3883_FDT
@@ -27,6 +27,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/RT5350_FDT
===================================================================
--- sys/mips/conf/RT5350_FDT
+++ sys/mips/conf/RT5350_FDT
@@ -26,6 +26,7 @@
options ROOTDEVNAME=\"ufs:md0.uzip\"
# Support geom_uzip(4) compressed disk images
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/TL-ARCHERC7V2
===================================================================
--- sys/mips/conf/TL-ARCHERC7V2
+++ sys/mips/conf/TL-ARCHERC7V2
@@ -46,6 +46,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/TL-WDR4300
===================================================================
--- sys/mips/conf/TL-WDR4300
+++ sys/mips/conf/TL-WDR4300
@@ -39,6 +39,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/TL-WR1043NDv2
===================================================================
--- sys/mips/conf/TL-WR1043NDv2
+++ sys/mips/conf/TL-WR1043NDv2
@@ -34,6 +34,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/TL-WR740Nv4
===================================================================
--- sys/mips/conf/TL-WR740Nv4
+++ sys/mips/conf/TL-WR740Nv4
@@ -43,6 +43,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/TP-MR3040
===================================================================
--- sys/mips/conf/TP-MR3040
+++ sys/mips/conf/TP-MR3040
@@ -48,6 +48,7 @@
options AR71XX_ENV_UBOOT
# uzip - to boot read-only lzma natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/TP-WN1043ND
===================================================================
--- sys/mips/conf/TP-WN1043ND
+++ sys/mips/conf/TP-WN1043ND
@@ -39,6 +39,7 @@
options AR71XX_ENV_UBOOT
# uncompress - to boot natively from flash
+device xz
device geom_uzip
options GEOM_UZIP
Index: sys/mips/conf/WZR-300HP
===================================================================
--- sys/mips/conf/WZR-300HP
+++ sys/mips/conf/WZR-300HP
@@ -26,6 +26,7 @@
# GEOM modules
device geom_map # to get access to the SPI flash partitions
+device xz
device geom_uzip # compressed in-memory filesystem hackery!
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\"
Index: sys/mips/conf/WZR-HPAG300H
===================================================================
--- sys/mips/conf/WZR-HPAG300H
+++ sys/mips/conf/WZR-HPAG300H
@@ -25,6 +25,7 @@
options BOOTVERBOSE
# GEOM modules
+device xz
device geom_uzip # compressed in-memory filesystem hackery!
device geom_map # to get access to the SPI flash partitions
Index: sys/modules/Makefile
===================================================================
--- sys/modules/Makefile
+++ sys/modules/Makefile
@@ -404,6 +404,7 @@
${_x86bios} \
${_xe} \
xl \
+ xz \
zlib
.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
Index: sys/modules/geom/geom_uzip/Makefile
===================================================================
--- sys/modules/geom/geom_uzip/Makefile
+++ sys/modules/geom/geom_uzip/Makefile
@@ -8,16 +8,10 @@
g_uzip_wrkthr.h
#CFLAGS= -g -DINVARIANT_SUPPORT -DINVARIANTS
-.PATH: ${SRCTOP}/sys/contrib/xz-embedded/freebsd/ \
- ${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/ \
- ${SRCTOP}/sys/contrib/xz-embedded/linux/include/linux/ \
- ${SRCTOP}/sys/net
+.PATH: ${SRCTOP}/sys/net
CFLAGS+= -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
-I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/
-SRCS+= xz_crc32.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \
- xz_malloc.c
-SRCS+= xz.h xz_config.h xz_lzma2.h xz_malloc.h xz_private.h xz_stream.h
SRCS+= opt_geom.h
.include <bsd.kmod.mk>
Index: sys/modules/xz/Makefile
===================================================================
--- /dev/null
+++ sys/modules/xz/Makefile
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/contrib/xz-embedded/freebsd
+.PATH: ${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz
+
+KMOD=xz
+SRCS= \
+ xz_malloc.c \
+ xz_crc32.c \
+ xz_dec_bcj.c \
+ xz_dec_lzma2.c \
+ xz_dec_stream.c
+CFLAGS+= \
+ -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
+ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \
+ -I${SRCTOP}/sys/contrib/xz-embedded/linux/include/linux
+
+.include <bsd.kmod.mk>

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 11:27 AM (15 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14941276
Default Alt Text
D19266.id54134.diff (19 KB)

Event Timeline