├── debian ├── compat ├── source │ └── format ├── installer │ ├── modules │ │ ├── nic-extra-modules │ │ ├── ext2-modules │ │ ├── floppy-modules │ │ ├── plip-modules │ │ ├── zlib-modules │ │ ├── loop-modules │ │ ├── mmc-core-modules │ │ ├── nullfs-modules │ │ ├── scsi-extra-modules │ │ ├── cdrom-modules │ │ ├── fat-modules │ │ ├── mmc-modules │ │ ├── nic-shared-modules │ │ ├── nls-core-modules │ │ ├── parport-modules │ │ ├── reiserfs-modules │ │ ├── scsi-core-modules │ │ ├── ipv6-modules │ │ ├── nfs-modules │ │ ├── sata-modules │ │ ├── zfs-modules │ │ ├── serial-modules │ │ ├── isofs-modules │ │ ├── crypto-modules │ │ ├── ppp-modules │ │ ├── acpi-modules │ │ ├── nic-usb-modules │ │ ├── crypto-dm-modules │ │ ├── md-modules │ │ ├── usb-serial-modules │ │ ├── i2c-modules │ │ ├── nic-modules │ │ ├── scsi-modules │ │ ├── sound-modules │ │ └── nic-wireless-modules │ ├── amd64 │ │ ├── modules │ │ │ └── kfreebsd-amd64 │ │ │ │ ├── md-modules │ │ │ │ ├── acpi-modules │ │ │ │ ├── cdrom-modules │ │ │ │ ├── ext2-modules │ │ │ │ ├── fat-modules │ │ │ │ ├── i2c-modules │ │ │ │ ├── ipv6-modules │ │ │ │ ├── isofs-modules │ │ │ │ ├── loop-modules │ │ │ │ ├── mmc-modules │ │ │ │ ├── nfs-modules │ │ │ │ ├── nic-modules │ │ │ │ ├── plip-modules │ │ │ │ ├── ppp-modules │ │ │ │ ├── sata-modules │ │ │ │ ├── scsi-modules │ │ │ │ ├── sound-modules │ │ │ │ ├── zfs-modules │ │ │ │ ├── zlib-modules │ │ │ │ ├── crypto-modules │ │ │ │ ├── floppy-modules │ │ │ │ ├── nic-usb-modules │ │ │ │ ├── nullfs-modules │ │ │ │ ├── parport-modules │ │ │ │ ├── serial-modules │ │ │ │ ├── crypto-dm-modules │ │ │ │ ├── mmc-core-modules │ │ │ │ ├── nic-shared-modules │ │ │ │ ├── nls-core-modules │ │ │ │ ├── reiserfs-modules │ │ │ │ ├── scsi-core-modules │ │ │ │ ├── scsi-extra-modules │ │ │ │ ├── usb-serial-modules │ │ │ │ ├── nic-wireless-modules │ │ │ │ └── kernel-image │ │ └── package-list │ ├── i386 │ │ ├── modules │ │ │ └── kfreebsd-i386 │ │ │ │ ├── fat-modules │ │ │ │ ├── i2c-modules │ │ │ │ ├── md-modules │ │ │ │ ├── mmc-modules │ │ │ │ ├── nfs-modules │ │ │ │ ├── nic-modules │ │ │ │ ├── ppp-modules │ │ │ │ ├── zfs-modules │ │ │ │ ├── acpi-modules │ │ │ │ ├── cdrom-modules │ │ │ │ ├── crypto-modules │ │ │ │ ├── ext2-modules │ │ │ │ ├── floppy-modules │ │ │ │ ├── ipv6-modules │ │ │ │ ├── isofs-modules │ │ │ │ ├── loop-modules │ │ │ │ ├── nullfs-modules │ │ │ │ ├── plip-modules │ │ │ │ ├── sata-modules │ │ │ │ ├── scsi-modules │ │ │ │ ├── serial-modules │ │ │ │ ├── sound-modules │ │ │ │ ├── zlib-modules │ │ │ │ ├── mmc-core-modules │ │ │ │ ├── nic-usb-modules │ │ │ │ ├── nls-core-modules │ │ │ │ ├── parport-modules │ │ │ │ ├── reiserfs-modules │ │ │ │ ├── crypto-dm-modules │ │ │ │ ├── nic-shared-modules │ │ │ │ ├── scsi-core-modules │ │ │ │ ├── scsi-extra-modules │ │ │ │ ├── usb-serial-modules │ │ │ │ ├── nic-wireless-modules │ │ │ │ └── kernel-image │ │ └── package-list │ └── package-list ├── arch │ ├── i386 │ │ ├── 686.defines │ │ ├── 486.installer │ │ ├── 686.config │ │ └── 486.config │ ├── amd64 │ │ ├── amd64.installer │ │ └── amd64.config │ └── mipsel │ │ └── malta.disabled ├── zlib-modules.overrides ├── kfreebsd-image.overrides ├── patches │ ├── 917_disable_kgssapi.diff │ ├── 109_linprocfs_non_x86.diff │ ├── 002_maxpathlen.diff │ ├── 908_linprocfs_is_not_proc.diff │ ├── 902_version.diff │ ├── 924_module_objdir.diff │ ├── mount_remount.diff │ ├── unescaped_kern_ident.diff │ ├── 910_GENERIC_hints.diff │ ├── 922_cc_version.diff │ ├── 930_freebsd_cc.diff │ ├── vxge_no_ctf.diff │ ├── ldscript_output_format.diff │ ├── 940_ld_verbose.diff │ ├── 920_linux_cflags.diff │ ├── 915_ip6.v6only.diff │ ├── 901_disable_optimization_2.diff │ ├── 923_newvers_timestamp.diff │ ├── series │ ├── 001_misc.diff │ ├── 107_mount_update.diff │ ├── 918_unix_socket_overflow.diff │ ├── 914_psm.diff │ ├── 007_clone_signals.diff │ ├── 919_delete_key.diff │ ├── 906_grow_sysv_ipc_limits.diff │ ├── 921_signal_watchdog.diff │ ├── 004_xargs.diff │ ├── 009_disable_duped_modules.diff │ ├── 999_config.diff │ ├── firmware_load.diff │ └── userland.diff ├── kfreebsd-image.README.Debian ├── prune.sh ├── kfreebsd-image.preinst.in ├── control.in ├── kfreebsd-image.prerm.in ├── kfreebsd-image.postinst.in ├── kfreebsd-image.postrm.in ├── control.flavor.in ├── local │ └── ar9300_devid.h └── rules └── .gitignore /debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/installer/modules/nic-extra-modules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/installer/modules/ext2-modules: -------------------------------------------------------------------------------- 1 | ext2fs 2 | -------------------------------------------------------------------------------- /debian/installer/modules/floppy-modules: -------------------------------------------------------------------------------- 1 | fdc 2 | -------------------------------------------------------------------------------- /debian/installer/modules/plip-modules: -------------------------------------------------------------------------------- 1 | plip 2 | -------------------------------------------------------------------------------- /debian/installer/modules/zlib-modules: -------------------------------------------------------------------------------- 1 | zlib 2 | -------------------------------------------------------------------------------- /debian/installer/modules/loop-modules: -------------------------------------------------------------------------------- 1 | geom_uzip 2 | -------------------------------------------------------------------------------- /debian/installer/modules/mmc-core-modules: -------------------------------------------------------------------------------- 1 | mmc 2 | -------------------------------------------------------------------------------- /debian/installer/modules/nullfs-modules: -------------------------------------------------------------------------------- 1 | nullfs 2 | -------------------------------------------------------------------------------- /debian/installer/modules/scsi-extra-modules: -------------------------------------------------------------------------------- 1 | vpo 2 | -------------------------------------------------------------------------------- /debian/arch/i386/686.defines: -------------------------------------------------------------------------------- 1 | Recommends: libc0.1-i686 2 | -------------------------------------------------------------------------------- /debian/installer/modules/cdrom-modules: -------------------------------------------------------------------------------- 1 | mcd 2 | scd 3 | -------------------------------------------------------------------------------- /debian/installer/modules/fat-modules: -------------------------------------------------------------------------------- 1 | msdosfs_iconv 2 | -------------------------------------------------------------------------------- /debian/installer/modules/mmc-modules: -------------------------------------------------------------------------------- 1 | mmcsd 2 | sdhci 3 | -------------------------------------------------------------------------------- /debian/installer/modules/nic-shared-modules: -------------------------------------------------------------------------------- 1 | miibus 2 | -------------------------------------------------------------------------------- /debian/installer/modules/nls-core-modules: -------------------------------------------------------------------------------- 1 | libiconv 2 | -------------------------------------------------------------------------------- /debian/installer/modules/parport-modules: -------------------------------------------------------------------------------- 1 | lpt 2 | ppi 3 | -------------------------------------------------------------------------------- /debian/installer/modules/reiserfs-modules: -------------------------------------------------------------------------------- 1 | reiserfs 2 | -------------------------------------------------------------------------------- /debian/installer/modules/scsi-core-modules: -------------------------------------------------------------------------------- 1 | scsi_low 2 | -------------------------------------------------------------------------------- /debian/installer/modules/ipv6-modules: -------------------------------------------------------------------------------- 1 | if_gif 2 | if_stf 3 | -------------------------------------------------------------------------------- /debian/installer/modules/nfs-modules: -------------------------------------------------------------------------------- 1 | nfscl 2 | nfscommon 3 | -------------------------------------------------------------------------------- /debian/installer/modules/sata-modules: -------------------------------------------------------------------------------- 1 | ahci 2 | mvs 3 | siis 4 | -------------------------------------------------------------------------------- /debian/installer/modules/zfs-modules: -------------------------------------------------------------------------------- 1 | opensolaris 2 | zfs 3 | -------------------------------------------------------------------------------- /debian/installer/modules/serial-modules: -------------------------------------------------------------------------------- 1 | nmdm 2 | puc 3 | scc 4 | -------------------------------------------------------------------------------- /debian/zlib-modules.overrides: -------------------------------------------------------------------------------- 1 | embedded-zlib 2 | embedded-library 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /debian/control 2 | /debian/installer/*/kernel-versions 3 | -------------------------------------------------------------------------------- /debian/installer/modules/isofs-modules: -------------------------------------------------------------------------------- 1 | cd9660_iconv 2 | udf_iconv 3 | udf 4 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/md-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/fat-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/i2c-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/md-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/mmc-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/nfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/nic-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/ppp-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/zfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/modules/crypto-modules: -------------------------------------------------------------------------------- 1 | geom_bde 2 | geom_eli 3 | geom_shsec 4 | -------------------------------------------------------------------------------- /debian/arch/i386/486.installer: -------------------------------------------------------------------------------- 1 | # Do not remove this comment (empty files break SVN) 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/acpi-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/cdrom-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/ext2-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/fat-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/i2c-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/ipv6-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/isofs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/loop-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/mmc-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/nfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/nic-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/plip-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/ppp-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/sata-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/scsi-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/sound-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/zfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/zlib-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/acpi-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/cdrom-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/crypto-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/ext2-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/floppy-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/ipv6-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/isofs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/loop-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/nullfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/plip-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/sata-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/scsi-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/serial-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/sound-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/zlib-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/arch/amd64/amd64.installer: -------------------------------------------------------------------------------- 1 | # Do not remove this comment (empty files break SVN) 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/crypto-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/floppy-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/nic-usb-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/nullfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/parport-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/serial-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/mmc-core-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/nic-usb-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/nls-core-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/parport-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/reiserfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/modules/ppp-modules: -------------------------------------------------------------------------------- 1 | if_lmc 2 | ng_ppp 3 | ng_pppoe 4 | ng_sppp 5 | sppp 6 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/crypto-dm-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/mmc-core-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/nic-shared-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/nls-core-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/reiserfs-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/scsi-core-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/scsi-extra-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/usb-serial-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/crypto-dm-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/nic-shared-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/scsi-core-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/scsi-extra-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/usb-serial-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/modules/acpi-modules: -------------------------------------------------------------------------------- 1 | alpm 2 | amdpm 3 | dpms 4 | intpm 5 | smbios ? 6 | viapm 7 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/nic-wireless-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/nic-wireless-modules: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /debian/installer/i386/modules/kfreebsd-i386/kernel-image: -------------------------------------------------------------------------------- 1 | # Do not remove this comment (empty files break SVN) 2 | -------------------------------------------------------------------------------- /debian/installer/amd64/modules/kfreebsd-amd64/kernel-image: -------------------------------------------------------------------------------- 1 | # Do not remove this comment (empty files break SVN) 2 | -------------------------------------------------------------------------------- /debian/installer/modules/nic-usb-modules: -------------------------------------------------------------------------------- 1 | if_aue 2 | if_axe 3 | if_cdce 4 | if_cue 5 | if_kue ? 6 | if_rue 7 | if_udav 8 | -------------------------------------------------------------------------------- /debian/installer/modules/crypto-dm-modules: -------------------------------------------------------------------------------- 1 | cryptodev 2 | crypto 3 | glxsb ? 4 | hifn 5 | padlock 6 | rc4 7 | safe 8 | ubsec 9 | -------------------------------------------------------------------------------- /debian/installer/modules/md-modules: -------------------------------------------------------------------------------- 1 | geom_concat 2 | geom_linux_lvm 3 | geom_mirror 4 | geom_raid3 5 | geom_stripe 6 | geom_vinum 7 | -------------------------------------------------------------------------------- /debian/installer/modules/usb-serial-modules: -------------------------------------------------------------------------------- 1 | u3g 2 | uark 3 | ubsa 4 | uftdi 5 | uipaq 6 | uplcom 7 | uslcom 8 | uvisor 9 | uvscom 10 | -------------------------------------------------------------------------------- /debian/kfreebsd-image.overrides: -------------------------------------------------------------------------------- 1 | shlib-with-non-pic-code 2 | shared-lib-without-dependency-information 3 | embedded-zlib 4 | embedded-library 5 | -------------------------------------------------------------------------------- /debian/installer/modules/i2c-modules: -------------------------------------------------------------------------------- 1 | amdsmb 2 | ichsmb 3 | iicbb 4 | iicbus 5 | iic 6 | iicsmb 7 | lpbb 8 | nfsmb 9 | pcf 10 | smb 11 | smbus 12 | -------------------------------------------------------------------------------- /debian/patches/917_disable_kgssapi.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/modules/Makefile 2 | +++ b/sys/modules/Makefile 3 | @@ -187,8 +187,6 @@ 4 | jme \ 5 | joy \ 6 | kbdmux \ 7 | - kgssapi \ 8 | - kgssapi_krb5 \ 9 | khelp \ 10 | krpc \ 11 | ksyms \ 12 | -------------------------------------------------------------------------------- /debian/installer/modules/nic-modules: -------------------------------------------------------------------------------- 1 | if_ce ? 2 | if_cm ? 3 | if_cp ? 4 | if_ct ? 5 | if_cas 6 | if_cxgb ? 7 | if_gem 8 | if_hme 9 | if_ixgb ? 10 | if_mxge 11 | if_my 12 | if_nxge 13 | mxge_ethp_z8e 14 | mxge_eth_z8e 15 | mxge_rss_ethp_z8e 16 | mxge_rss_eth_z8e 17 | -------------------------------------------------------------------------------- /debian/installer/modules/scsi-modules: -------------------------------------------------------------------------------- 1 | aha ? 2 | ahc_isa 3 | ahc_pci 4 | iscsi_initiator 5 | isp_1040_it ? 6 | isp_1040 ? 7 | isp_1080_it ? 8 | isp_1080 ? 9 | isp_12160_it ? 10 | isp_12160 ? 11 | isp_2100 ? 12 | isp_2200 ? 13 | isp_2300 ? 14 | isp_2322 ? 15 | isp_2400 ? 16 | isp_2400_multi ? 17 | isp_2500 ? 18 | isp_2500_multi ? 19 | ispfw ? 20 | -------------------------------------------------------------------------------- /debian/arch/mipsel/malta.disabled: -------------------------------------------------------------------------------- 1 | # Kernel for Debian GNU/kFreeBSD on mipsel/malta machines 2 | 3 | include MALTA 4 | 5 | makeoptions ARCH_FLAGS="-march=mips32 -mabi=32 -D__mips_o32" 6 | makeoptions WITHOUT_KERNEL_TRAMPOLINE=1 7 | 8 | options CPU_HAVEFPU 9 | options EXT2FS 10 | 11 | # Options used by all Debian kernels 12 | include DEBIAN 13 | -------------------------------------------------------------------------------- /debian/patches/109_linprocfs_non_x86.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/conf/options.mips 2 | +++ b/sys/conf/options.mips 3 | @@ -66,6 +66,9 @@ 4 | TICK_USE_YAMON_FREQ opt_global.h 5 | TICK_USE_MALTA_RTC opt_global.h 6 | 7 | +LINPROCFS opt_dontuse.h 8 | +LINSYSFS opt_dontuse.h 9 | + 10 | # 11 | # The highest memory address that can be used by the kernel in units of KB. 12 | # 13 | -------------------------------------------------------------------------------- /debian/patches/002_maxpathlen.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/dev/aic7xxx/aicasm/aicasm_scan.l 2 | +++ b/sys/dev/aic7xxx/aicasm/aicasm_scan.l 3 | @@ -57,6 +57,10 @@ 4 | #include "aicasm_symbol.h" 5 | #include "aicasm_gram.h" 6 | 7 | +#ifndef PATH_MAX 8 | +#define PATH_MAX 4096 9 | +#endif 10 | + 11 | /* This is used for macro body capture too, so err on the large size. */ 12 | #define MAX_STR_CONST 4096 13 | static char string_buf[MAX_STR_CONST]; 14 | -------------------------------------------------------------------------------- /debian/patches/908_linprocfs_is_not_proc.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/compat/linprocfs/linprocfs.c 2 | +++ b/sys/compat/linprocfs/linprocfs.c 3 | @@ -361,10 +361,6 @@ 4 | 5 | /* determine fs type */ 6 | fstype = sp->f_fstypename; 7 | - if (strcmp(fstype, pn->pn_info->pi_name) == 0) 8 | - mntfrom = fstype = "proc"; 9 | - else if (strcmp(fstype, "procfs") == 0) 10 | - continue; 11 | 12 | if (strcmp(fstype, "linsysfs") == 0) { 13 | sbuf_printf(sb, "/sys %s sysfs %s", mntto, 14 | -------------------------------------------------------------------------------- /debian/patches/902_version.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/conf/newvers.sh 2 | +++ b/sys/conf/newvers.sh 3 | @@ -233,6 +233,9 @@ 4 | #define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n ${u}@${h}:${d}\\n" 5 | #define RELSTR "${RELEASE}" 6 | 7 | +#undef VERSTR 8 | +#define VERSTR "#${v} ${t}\\n" 9 | + 10 | char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; 11 | char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; 12 | char compiler_version[] = "${compiler_v}"; 13 | -------------------------------------------------------------------------------- /debian/installer/modules/sound-modules: -------------------------------------------------------------------------------- 1 | snd_ad1816 2 | snd_als4000 3 | snd_atiixp 4 | snd_cmi 5 | snd_cs4281 6 | snd_csa ? 7 | snd_driver 8 | snd_ds1 ? 9 | snd_emu10k1 10 | snd_emu10kx 11 | snd_envy24ht 12 | snd_envy24 13 | snd_es137x 14 | snd_ess 15 | snd_fm801 16 | snd_hda 17 | snd_ich 18 | snd_maestro3 ? 19 | snd_maestro 20 | snd_mss 21 | snd_neomagic 22 | snd_sb16 23 | snd_sb8 24 | snd_sbc 25 | snd_solo 26 | snd_spicds 27 | snd_t4dwave 28 | snd_uaudio 29 | snd_via8233 30 | snd_via82c686 31 | snd_vibes 32 | sound 33 | speaker 34 | -------------------------------------------------------------------------------- /debian/installer/modules/nic-wireless-modules: -------------------------------------------------------------------------------- 1 | if_ipw 2 | if_iwi 3 | if_iwn 4 | if_malo 5 | if_wpi 6 | ipw_bss ? 7 | ipw_ibss ? 8 | ipw_monitor ? 9 | iwi_bss ? 10 | iwi_ibss ? 11 | iwi_monitor ? 12 | iwn1000fw ? 13 | iwn4965fw ? 14 | iwn5000fw ? 15 | iwn5150fw ? 16 | iwn6000fw ? 17 | rt2561fw ? 18 | rt2561sfw ? 19 | rt2661fw ? 20 | runfw ? 21 | siba_bwn 22 | wlan_acl 23 | wlan_rssadapt 24 | wlan_xauth 25 | wpifw ? 26 | 27 | # USB wireless 28 | if_rum ? 29 | if_run ? 30 | if_uath ? 31 | if_upgt 32 | if_ural 33 | if_urtw 34 | if_zyd ? 35 | -------------------------------------------------------------------------------- /debian/patches/924_module_objdir.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/conf/kern.pre.mk 2 | +++ b/sys/conf/kern.pre.mk 3 | @@ -215,7 +215,7 @@ 4 | # MKMODULESENV is set here so that port makefiles can augment 5 | # them. 6 | 7 | -MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} 8 | +MKMODULESENV+= MAKEOBJDIRPREFIX=/ KMODDIR=${KODIR} 9 | MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} 10 | MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} 11 | MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}" 12 | -------------------------------------------------------------------------------- /debian/patches/mount_remount.diff: -------------------------------------------------------------------------------- 1 | 2 | Upstream wants this in kernel. See: 3 | http://lists.freebsd.org/pipermail/freebsd-fs/2013-July/017794.html 4 | 5 | --- a/sys/kern/vfs_mount.c 6 | +++ b/sys/kern/vfs_mount.c 7 | @@ -578,7 +578,7 @@ 8 | * when we want to update the root filesystem. 9 | */ 10 | TAILQ_FOREACH_SAFE(opt, optlist, link, tmp_opt) { 11 | - if (strcmp(opt->name, "update") == 0) { 12 | + if (strcmp(opt->name, "update") == 0 || strcmp(opt->name, "remount") == 0) { 13 | fsflags |= MNT_UPDATE; 14 | vfs_freeopt(optlist, opt); 15 | } 16 | -------------------------------------------------------------------------------- /debian/arch/amd64/amd64.config: -------------------------------------------------------------------------------- 1 | # Kernel for Debian GNU/kFreeBSD on all x86-64 machines 2 | 3 | cpu HAMMER 4 | ident Debian-amd64 5 | 6 | hints "GENERIC.hints" # Default places to look for devices. 7 | 8 | options COMPAT_LINUX32 9 | 10 | # Needed for D-I, see #596577 11 | options NKPT=240 12 | 13 | include GENERIC 14 | 15 | # Switch default console to Newcons (see https://wiki.freebsd.org/Newcons) 16 | nodevice vga 17 | nodevice sc 18 | device vt 19 | device vt_vga 20 | 21 | # Options used by all Debian kernels 22 | include DEBIAN 23 | -------------------------------------------------------------------------------- /debian/patches/unescaped_kern_ident.diff: -------------------------------------------------------------------------------- 1 | 2 | This argument breaks build if your KERN_IDENT contains special characters. 3 | 4 | It's not being used anyway, so remove it. 5 | 6 | --- a/sys/conf/kern.post.mk 7 | +++ b/sys/conf/kern.post.mk 8 | @@ -338,7 +338,7 @@ 9 | ${NORMAL_LINT} 10 | 11 | vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP} 12 | - MAKE=${MAKE} sh $S/conf/newvers.sh ${KERN_IDENT} 13 | + MAKE=${MAKE} sh $S/conf/newvers.sh 14 | 15 | vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src 16 | ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c 17 | -------------------------------------------------------------------------------- /debian/arch/i386/686.config: -------------------------------------------------------------------------------- 1 | # Kernel for Debian GNU/kFreeBSD on an i686 machine 2 | 3 | cpu I686_CPU 4 | makeoptions COPTFLAGS="-O2 -pipe -march=i686 -mtune=generic" 5 | ident Debian-i686 6 | 7 | hints "GENERIC.hints" # Default places to look for devices. 8 | 9 | options COMPAT_LINUX 10 | 11 | # Xbox support 12 | options XBOX 13 | 14 | include GENERIC 15 | 16 | # Switch default console to Newcons (see https://wiki.freebsd.org/Newcons) 17 | nodevice vga 18 | nodevice sc 19 | device vt 20 | device vt_vga 21 | 22 | # Options used by all Debian kernels 23 | include DEBIAN 24 | -------------------------------------------------------------------------------- /debian/patches/910_GENERIC_hints.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/i386/conf/GENERIC.hints 2 | +++ b/sys/i386/conf/GENERIC.hints 3 | @@ -18,6 +18,7 @@ 4 | hint.atkbd.0.at="atkbdc" 5 | hint.atkbd.0.irq="1" 6 | hint.psm.0.at="atkbdc" 7 | +hint.psm.0.flags="0x100" 8 | hint.psm.0.irq="12" 9 | hint.sc.0.at="isa" 10 | hint.sc.0.flags="0x100" 11 | --- a/sys/amd64/conf/GENERIC.hints 12 | +++ b/sys/amd64/conf/GENERIC.hints 13 | @@ -12,6 +12,7 @@ 14 | hint.atkbd.0.at="atkbdc" 15 | hint.atkbd.0.irq="1" 16 | hint.psm.0.at="atkbdc" 17 | +hint.psm.0.flags="0x100" 18 | hint.psm.0.irq="12" 19 | hint.sc.0.at="isa" 20 | hint.sc.0.flags="0x100" 21 | -------------------------------------------------------------------------------- /debian/arch/i386/486.config: -------------------------------------------------------------------------------- 1 | # Kernel for Debian GNU/kFreeBSD on an i486 machine 2 | 3 | cpu I486_CPU 4 | cpu I586_CPU 5 | cpu I686_CPU 6 | makeoptions COPTFLAGS="-Os -pipe -march=i486 -mtune=i486" 7 | ident Debian-i486 8 | 9 | hints "GENERIC.hints" # Default places to look for devices. 10 | 11 | options COMPAT_LINUX 12 | 13 | # Xbox support 14 | options XBOX 15 | 16 | include GENERIC 17 | 18 | # Switch default console to Newcons (see https://wiki.freebsd.org/Newcons) 19 | nodevice vga 20 | nodevice sc 21 | device vt 22 | device vt_vga 23 | 24 | # Options used by all Debian kernels 25 | include DEBIAN 26 | -------------------------------------------------------------------------------- /debian/patches/922_cc_version.diff: -------------------------------------------------------------------------------- 1 | Ensure we don't accidentally match lines with 'version' as a substring in 2 | some other term (such as a compiler flag) when grepping for the compiler 3 | version. 4 | --- a/sys/conf/newvers.sh 5 | +++ b/sys/conf/newvers.sh 6 | @@ -89,7 +89,7 @@ 7 | touch version 8 | v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` 9 | i=`${MAKE:-make} -V KERN_IDENT` 10 | -compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') 11 | +compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep ' version ') 12 | 13 | for dir in /usr/bin /usr/local/bin; do 14 | if [ ! -z "${svnversion}" ] ; then 15 | -------------------------------------------------------------------------------- /debian/patches/930_freebsd_cc.diff: -------------------------------------------------------------------------------- 1 | From: Steven Chamberlain 2 | Date: Wed, 08 Jul 2015 00:22:18 +0100 3 | Subject: Unset FREEBSD_CC, as we lack FreeBSD compiler extensions 4 | 5 | The detection displays a warning on non-FreeBSD, for every source file 6 | compiled, and is likely also slow; so just manually unset it. 7 | 8 | --- a/sys/conf/kern.mk 9 | +++ b/sys/conf/kern.mk 10 | @@ -67,7 +67,7 @@ 11 | FORMAT_EXTENSIONS= -fformat-extensions 12 | .endif 13 | 14 | -FREEBSD_CC!= ${CC} -dM -E - Mon, 10 Aug 2009 10:51:55 +0200 16 | -------------------------------------------------------------------------------- /debian/patches/ldscript_output_format.diff: -------------------------------------------------------------------------------- 1 | 2 | Explicit OUTPUT_FORMAT prevents ld from working on GNU/Linux, as the 3 | "-freebsd" variant is not present there. However, both formats work 4 | fine for the purpose of building a kernel. 5 | 6 | --- a/sys/conf/ldscript.amd64 7 | +++ b/sys/conf/ldscript.amd64 8 | @@ -1,5 +1,4 @@ 9 | /* $FreeBSD$ */ 10 | -OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", "elf64-x86-64-freebsd") 11 | OUTPUT_ARCH(i386:x86-64) 12 | ENTRY(btext) 13 | SEARCH_DIR("/usr/lib"); 14 | --- a/sys/conf/ldscript.i386 15 | +++ b/sys/conf/ldscript.i386 16 | @@ -1,5 +1,4 @@ 17 | /* $FreeBSD$ */ 18 | -OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", "elf32-i386-freebsd") 19 | OUTPUT_ARCH(i386) 20 | ENTRY(btext) 21 | SEARCH_DIR(/usr/lib); 22 | -------------------------------------------------------------------------------- /debian/patches/940_ld_verbose.diff: -------------------------------------------------------------------------------- 1 | Show the kernel link command line in the build log 2 | 3 | --- a/sys/conf/kern.pre.mk 4 | +++ b/sys/conf/kern.pre.mk 5 | @@ -200,10 +200,10 @@ 6 | .if ${MFS_IMAGE:Uno} != "no" 7 | SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o 8 | .endif 9 | -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \ 10 | +SYSTEM_LD= ${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \ 11 | --warn-common --export-dynamic --dynamic-linker /red/herring \ 12 | -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o 13 | -SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ 14 | +SYSTEM_LD_TAIL= ${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ 15 | ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} 16 | SYSTEM_DEP+= ${LDSCRIPT} 17 | 18 | -------------------------------------------------------------------------------- /debian/patches/920_linux_cflags.diff: -------------------------------------------------------------------------------- 1 | 2 | Rejected on freebsd-hackers: 3 | 4 | http://lists.freebsd.org/pipermail/freebsd-hackers/2011-July/thread.html#35854 5 | 6 | --- a/sys/conf/kern.pre.mk 7 | +++ b/sys/conf/kern.pre.mk 8 | @@ -102,6 +102,8 @@ 9 | .endif 10 | WERROR?= -Werror 11 | 12 | +CFLAGS+= -Ulinux -U__linux__ -D__FreeBSD__=1000 13 | + 14 | # XXX LOCORE means "don't declare C stuff" not "for locore.s". 15 | ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} 16 | 17 | --- a/sys/conf/kmod.mk 18 | +++ b/sys/conf/kmod.mk 19 | @@ -93,6 +93,8 @@ 20 | CFLAGS+= -D_KERNEL 21 | CFLAGS+= -DKLD_MODULE 22 | 23 | +CFLAGS+= -Ulinux -U__linux__ -D__FreeBSD__=1000 24 | + 25 | # Don't use any standard or source-relative include directories. 26 | NOSTDINC= -nostdinc 27 | CFLAGS:= ${CFLAGS:N-I*} ${NOSTDINC} ${INCLMAGIC} ${CFLAGS:M-I*} 28 | -------------------------------------------------------------------------------- /debian/patches/915_ip6.v6only.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/netinet6/in6_proto.c 2 | +++ b/sys/netinet6/in6_proto.c 3 | @@ -416,7 +416,7 @@ 4 | VNET_DEFINE(int, ip6_sendredirects) = IPV6_SENDREDIRECTS; 5 | VNET_DEFINE(int, ip6_defhlim) = IPV6_DEFHLIM; 6 | VNET_DEFINE(int, ip6_defmcasthlim) = IPV6_DEFAULT_MULTICAST_HOPS; 7 | -VNET_DEFINE(int, ip6_accept_rtadv) = 0; 8 | +VNET_DEFINE(int, ip6_accept_rtadv) = 1; 9 | VNET_DEFINE(int, ip6_no_radr) = 0; 10 | VNET_DEFINE(int, ip6_norbit_raif) = 0; 11 | VNET_DEFINE(int, ip6_rfc6204w3) = 0; 12 | @@ -432,7 +432,7 @@ 13 | VNET_DEFINE(int, ip6_rr_prune) = 5; /* router renumbering prefix 14 | * walk list every 5 sec. */ 15 | VNET_DEFINE(int, ip6_mcast_pmtu) = 0; /* enable pMTU discovery for multicast? */ 16 | -VNET_DEFINE(int, ip6_v6only) = 1; 17 | +VNET_DEFINE(int, ip6_v6only) = 0; 18 | 19 | VNET_DEFINE(time_t, ip6_log_time) = (time_t)0L; 20 | #ifdef IPSTEALTH 21 | -------------------------------------------------------------------------------- /debian/patches/901_disable_optimization_2.diff: -------------------------------------------------------------------------------- 1 | 2 | Regretably, with GCC 4.4 or later this is the only flag combination 3 | I could find that doesn't cause kernel panics CPU triple-faults or 4 | other kind of severe breakage. 5 | 6 | --- a/sys/conf/kern.pre.mk 7 | +++ b/sys/conf/kern.pre.mk 8 | @@ -47,6 +47,9 @@ 9 | .if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) 10 | COPTFLAGS+= -fno-strict-aliasing 11 | .endif 12 | +.if !empty(COPTFLAGS:M-O[23s]) 13 | +COPTFLAGS+= -O1 14 | +.endif 15 | .if !defined(NO_CPU_COPTFLAGS) 16 | COPTFLAGS+= ${_CPUCFLAGS} 17 | .endif 18 | --- a/sys/conf/kmod.mk 19 | +++ b/sys/conf/kmod.mk 20 | @@ -87,6 +87,9 @@ 21 | .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) 22 | CFLAGS+= -fno-strict-aliasing 23 | .endif 24 | +.if !empty(CFLAGS:M-O[23s]) 25 | +CFLAGS+= -O1 26 | +.endif 27 | WERROR?= -Werror 28 | CFLAGS+= ${WERROR} 29 | CFLAGS+= -D_KERNEL 30 | -------------------------------------------------------------------------------- /debian/patches/923_newvers_timestamp.diff: -------------------------------------------------------------------------------- 1 | Description: Use timestamp from debian/changelog 2 | Use timestamp from the most recent debian/changelog entry, 3 | instead of the exact time of the build. 4 | . 5 | This helps to make builds repeatable and the output more easily 6 | comparable. 7 | Forwarded: not-needed 8 | Author: Steven Chamberlain 9 | 10 | --- a/sys/conf/newvers.sh 11 | +++ b/sys/conf/newvers.sh 12 | @@ -112,6 +112,12 @@ 13 | i=`${MAKE:-make} -V KERN_IDENT` 14 | compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep -w 'version') 15 | 16 | +if [ -f "${SYSDIR}/../../debian/changelog" ] ; then 17 | + # Use timestamp from the most recent debian/changelog entry, 18 | + # instead of the exact time of the build. 19 | + t=`dpkg-parsechangelog -l"${SYSDIR}/../../debian/changelog" -S"Date"` 20 | +fi 21 | + 22 | for dir in /usr/bin /usr/local/bin; do 23 | if [ ! -z "${svnversion}" ] ; then 24 | break 25 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- 1 | # Patches from (or merged in) upstream 2 | 3 | # Patches that are in good shape for merging upstream 4 | mount_remount.diff 5 | ldscript_output_format.diff 6 | unescaped_kern_ident.diff 7 | 8 | # Other patches that might or might not be mergeable 9 | userland.diff 10 | 001_misc.diff 11 | 002_maxpathlen.diff 12 | 004_xargs.diff 13 | #007_clone_signals.diff 14 | #009_disable_duped_modules.diff 15 | 107_mount_update.diff 16 | 109_linprocfs_non_x86.diff 17 | 18 | # Patches that are likely to be Debian-specific 19 | firmware_load.diff 20 | 902_version.diff 21 | 906_grow_sysv_ipc_limits.diff 22 | 908_linprocfs_is_not_proc.diff 23 | 910_GENERIC_hints.diff 24 | 914_psm.diff 25 | 915_ip6.v6only.diff 26 | 917_disable_kgssapi.diff 27 | 918_unix_socket_overflow.diff 28 | 919_delete_key.diff 29 | 920_linux_cflags.diff 30 | 921_signal_watchdog.diff 31 | 923_newvers_timestamp.diff 32 | 924_module_objdir.diff 33 | 930_freebsd_cc.diff 34 | 940_ld_verbose.diff 35 | 999_config.diff 36 | -------------------------------------------------------------------------------- /debian/patches/001_misc.diff: -------------------------------------------------------------------------------- 1 | 2 | Co-authored by Nali Toja 3 | 4 | --- a/sys/conf/kern.mk 5 | +++ b/sys/conf/kern.mk 6 | @@ -67,6 +67,16 @@ 7 | FORMAT_EXTENSIONS= -fformat-extensions 8 | .endif 9 | 10 | +FREEBSD_CC!= ${CC} -dM -E -name = strdup("noro", M_MOUNT); 24 | + noro_opt->value = NULL; 25 | + noro_opt->len = 0; 26 | + noro_opt->pos = -1; 27 | + noro_opt->seen = 1; 28 | + TAILQ_INSERT_TAIL(optlist, noro_opt, link); 29 | + } 30 | + 31 | + /* 32 | * Be ultra-paranoid about making sure the type and fspath 33 | * variables will fit in our mp buffers, including the 34 | * terminating NUL. 35 | -------------------------------------------------------------------------------- /debian/prune.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -vf `find sys -name *.uu` 3 | rm -vf sys/contrib/dev/ral/rt2661_ucode.h 4 | rm -vf sys/gnu/dev/sound/pci/csaimg.h 5 | rm -vf sys/gnu/dev/sound/pci/maestro3_dsp.h 6 | rm -vf sys/dev/drm/mga_ucode.h 7 | rm -vf sys/dev/drm/r128_cce.c 8 | rm -vf sys/dev/drm/r600_microcode.h 9 | rm -vf sys/dev/drm/radeon_microcode.h 10 | rm -vf sys/dev/txp/3c990img.h 11 | rm -vf sys/dev/fxp/rcvbundl.h 12 | rm -vf sys/dev/digi/*X*.h 13 | rm -vf sys/dev/sf/starfire_rx.h 14 | rm -vf sys/dev/sf/starfire_tx.h 15 | rm -vf sys/dev/sn/ositech.h 16 | rm -vf sys/dev/sound/pci/ds1-fw.h 17 | rm -vf sys/dev/si/si2_z280.c 18 | rm -vf sys/dev/si/si3_t225.c 19 | rm -vf sys/dev/cxgb/common/cxgb_ael1002.c 20 | rm -vf sys/dev/fatm/firmware.h 21 | rm -vf sys/dev/cx/csigmafw.h 22 | rm -vf sys/dev/bce/if_bcefw.h 23 | rm -vf sys/dev/usb/net/if_kuefw.h 24 | rm -vf sys/dev/usb/wlan/if_rumfw.h 25 | rm -vf sys/dev/usb/wlan/if_zydfw.h 26 | rm -vf sys/dev/ti/ti_fw2.h 27 | rm -vf sys/dev/ti/ti_fw.h 28 | rm -vf sys/dev/ctau/ctaue1fw.h 29 | rm -vf sys/dev/ctau/ctau2fw.h 30 | rm -vf sys/dev/ctau/ctaufw.h 31 | rm -vf sys/dev/ctau/ctaug7fw.h 32 | rm -vf sys/dev/ispfw/asm_*.h 33 | rm -vf sys/dev/advansys/adwmcode.c 34 | rm -vf sys/dev/ce/tau32-ddk.c 35 | rm -vf sys/dev/cp/cpddk.c 36 | -------------------------------------------------------------------------------- /debian/patches/918_unix_socket_overflow.diff: -------------------------------------------------------------------------------- 1 | See #645527. 2 | 3 | Our former userspace allows 108 bytes in sun_path, 4 | but kernel restrict it to 104 bytes. 5 | 6 | Userland compatibility was added in glibc 2.13-22 (glibc-bsd r3739). This 7 | patch can be removed when we no longer care about supporting older glibc. 8 | 9 | --- a/sys/kern/uipc_usrreq.c 10 | +++ b/sys/kern/uipc_usrreq.c 11 | @@ -475,7 +475,12 @@ 12 | KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); 13 | 14 | if (soun->sun_len > sizeof(struct sockaddr_un)) 15 | + { 16 | + if (soun->sun_len <= (4 + sizeof(struct sockaddr_un))) 17 | + soun->sun_len = sizeof(struct sockaddr_un); /* clip it */ 18 | + else 19 | return (EINVAL); 20 | + }; 21 | namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); 22 | if (namelen <= 0) 23 | return (EINVAL); 24 | @@ -1322,7 +1327,12 @@ 25 | KASSERT(unp != NULL, ("unp_connect: unp == NULL")); 26 | 27 | if (nam->sa_len > sizeof(struct sockaddr_un)) 28 | + { 29 | + if (nam->sa_len <= (4 + sizeof(struct sockaddr_un))) 30 | + nam->sa_len = sizeof(struct sockaddr_un); /* clip it */ 31 | + else 32 | return (EINVAL); 33 | + }; 34 | len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); 35 | if (len <= 0) 36 | return (EINVAL); 37 | -------------------------------------------------------------------------------- /debian/installer/amd64/package-list: -------------------------------------------------------------------------------- 1 | # This file is used to build up the control file. The kernel version and 2 | # "-di" are appended to the package names. Section can be left out. So can 3 | # architecture, which is derived from the files in the modules directory. 4 | # It overwrites specifications from /usr/share/kernel-wedge/package-list. 5 | # 6 | Package: kernel-image 7 | Provides: ata-modules, cdrom-core-modules, core-modules, crc-modules, ext2-modules, ide-core-modules, ide-modules, input-modules, mmc-core-modules, mouse-modules, nic-pcmcia-modules, nls-core-modules, pata-modules, pcmcia-modules, pcmcia-storage-modules, rtc-modules, scsi-common-modules, serial-modules, ufs-modules, uinput-modules, usb-modules, usb-storage-modules 8 | Description: kFreeBSD binary image for the Debian installer 9 | This package contains the kernel of FreeBSD for the Debian installer 10 | boot images. It does _not_ provide a usable kernel for your full 11 | Debian system. 12 | 13 | Package: acpi-modules 14 | Depends: kernel-image, i2c-modules 15 | 16 | Package: crypto-modules 17 | Depends: kernel-image, zlib-modules 18 | 19 | Package: i2c-modules 20 | Depends: kernel-image, parport-modules 21 | 22 | Package: loop-modules 23 | Depends: kernel-image, zlib-modules 24 | 25 | Package: mmc-modules 26 | Depends: kernel-image, mmc-core-modules 27 | 28 | Package: nic-modules 29 | Depends: kernel-image, nic-shared-modules 30 | 31 | Package: nic-extra-modules 32 | Depends: kernel-image, nic-modules 33 | 34 | Package: nic-wireless-modules 35 | Depends: kernel-image, nic-shared-modules 36 | -------------------------------------------------------------------------------- /debian/installer/i386/package-list: -------------------------------------------------------------------------------- 1 | # This file is used to build up the control file. The kernel version and 2 | # "-di" are appended to the package names. Section can be left out. So can 3 | # architecture, which is derived from the files in the modules directory. 4 | # It overwrites specifications from /usr/share/kernel-wedge/package-list. 5 | # 6 | Package: kernel-image 7 | Provides: ata-modules, cdrom-core-modules, core-modules, crc-modules, ext2-modules, ide-core-modules, ide-modules, input-modules, mmc-core-modules, mouse-modules, nic-pcmcia-modules, nls-core-modules, pata-modules, pcmcia-modules, pcmcia-storage-modules, rtc-modules, scsi-common-modules, serial-modules, ufs-modules, uinput-modules, usb-modules, usb-storage-modules 8 | Description: kFreeBSD binary image for the Debian installer 9 | This package contains the kernel of FreeBSD for the Debian installer 10 | boot images. It does _not_ provide a usable kernel for your full 11 | Debian system. 12 | 13 | Package: acpi-modules 14 | Depends: kernel-image, i2c-modules 15 | 16 | Package: crypto-modules 17 | Depends: kernel-image, zlib-modules 18 | 19 | Package: i2c-modules 20 | Depends: kernel-image, parport-modules 21 | 22 | Package: loop-modules 23 | Depends: kernel-image, zlib-modules 24 | 25 | Package: mmc-modules 26 | Depends: kernel-image, mmc-core-modules 27 | 28 | Package: nic-modules 29 | Depends: kernel-image, nic-shared-modules 30 | 31 | Package: nic-extra-modules 32 | Depends: kernel-image, nic-modules 33 | 34 | Package: nic-wireless-modules 35 | Depends: kernel-image, nic-shared-modules 36 | -------------------------------------------------------------------------------- /debian/kfreebsd-image.preinst.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # preinst script 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `install' 10 | # * `install' 11 | # * `upgrade' 12 | # * `abort-upgrade' 13 | # for details, see http://www.debian.org/doc/debian-policy/ or 14 | # the debian-policy package 15 | 16 | PATH="/sbin:/bin:/usr/sbin:/usr/bin" 17 | KERNEL_IMG_CONF="/etc/kernel-img.conf" 18 | RELEASE="@RELEASE@" 19 | VERSION="@VERSION@" 20 | 21 | case "$1" in 22 | install|upgrade) 23 | # Sanitize and quote maintainer script parameters 24 | for p in "$@"; do 25 | q="$(echo "$p" | sed -e "s/'/'\\''/g")" 26 | DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" 27 | done 28 | export DEB_MAINT_PARAMS 29 | 30 | # Run preinst hook if defined 31 | preinst_hook=$(sed '/^\s*preinst_hook/!d;s/.*=\s*//' $KERNEL_IMG_CONF 2>/dev/null || true) 32 | if [ -n "$preinst_hook" ] ; then 33 | echo "Running preinst hook script $preinst_hook." 1>&2 34 | $preinst_hook "$RELEASE" "/boot/kfreebsd-$RELEASE.gz" 35 | fi 36 | 37 | # Run /etc/kernel/preinst.d/ hooks if they exist 38 | if [ -d "/etc/kernel/preinst.d" ]; then 39 | echo "Running /etc/kernel/preinst.d hooks..." 1>&2 40 | run-parts --verbose --exit-on-error \ 41 | --arg=$RELEASE \ 42 | --arg=/boot/kfreebsd-$RELEASE.gz \ 43 | /etc/kernel/preinst.d 44 | fi 45 | ;; 46 | 47 | abort-upgrade) 48 | ;; 49 | 50 | *) 51 | echo "preinst called with unknown argument \`$1'" >&2 52 | exit 1 53 | ;; 54 | esac 55 | 56 | # dh_installdeb will replace this with shell code automatically 57 | # generated by other debhelper scripts. 58 | 59 | #DEBHELPER# 60 | 61 | exit 0 62 | -------------------------------------------------------------------------------- /debian/patches/914_psm.diff: -------------------------------------------------------------------------------- 1 | This patch fixes PS/2 mouse support with xserver-xorg-input-mouse 1.4.0. 2 | It is a revert of upstream commit r18970: 3 | 4 | | Teach psm about O_ASYNC 5 | | 6 | | This makes Xorg happy if you aren't using moused. 7 | 8 | --- a/sys/dev/atkbdc/psm.c 9 | +++ b/sys/dev/atkbdc/psm.c 10 | @@ -70,10 +70,7 @@ 11 | #include 12 | #include 13 | #include 14 | -#include 15 | #include 16 | -#include 17 | -#include 18 | #include 19 | #include 20 | #include 21 | @@ -338,7 +335,6 @@ 22 | struct cdev *bdev; 23 | int lasterr; 24 | int cmdcount; 25 | - struct sigio *async; /* Processes waiting for SIGIO */ 26 | int extended_buttons; 27 | }; 28 | static devclass_t psm_devclass; 29 | @@ -1580,7 +1576,6 @@ 30 | sc->mode.level = sc->dflt_mode.level; 31 | sc->mode.protocol = sc->dflt_mode.protocol; 32 | sc->watchdog = FALSE; 33 | - sc->async = NULL; 34 | 35 | /* flush the event queue */ 36 | sc->queue.count = 0; 37 | @@ -1721,12 +1716,6 @@ 38 | /* remove anything left in the output buffer */ 39 | empty_aux_buffer(sc->kbdc, 10); 40 | 41 | - /* clean up and sigio requests */ 42 | - if (sc->async != NULL) { 43 | - funsetown(&sc->async); 44 | - sc->async = NULL; 45 | - } 46 | - 47 | /* close is almost always successful */ 48 | sc->state &= ~PSM_OPEN; 49 | kbdc_lock(sc->kbdc, FALSE); 50 | @@ -2302,15 +2291,6 @@ 51 | break; 52 | #endif /* MOUSE_GETHWID */ 53 | 54 | - case FIONBIO: 55 | - case FIOASYNC: 56 | - break; 57 | - case FIOSETOWN: 58 | - error = fsetown(*(int *)addr, &sc->async); 59 | - break; 60 | - case FIOGETOWN: 61 | - *(int *) addr = fgetown(&sc->async); 62 | - break; 63 | default: 64 | return (ENOTTY); 65 | } 66 | @@ -3670,9 +3650,6 @@ 67 | wakeup(sc); 68 | } 69 | selwakeuppri(&sc->rsel, PZERO); 70 | - if (sc->async != NULL) { 71 | - pgsigio(&sc->async, SIGIO, 0); 72 | - } 73 | sc->state &= ~PSM_SOFTARMED; 74 | splx(s); 75 | } 76 | -------------------------------------------------------------------------------- /debian/control.in: -------------------------------------------------------------------------------- 1 | Source: kfreebsd-@major@ 2 | Section: kernel 3 | Priority: optional 4 | Maintainer: GNU/kFreeBSD Maintainers 5 | Uploaders: 6 | Aurelien Jarno , 7 | Robert Millan , 8 | Steven Chamberlain , 9 | Vcs-Browser: https://salsa.debian.org/kfreebsd-team/kfreebsd-@major@ 10 | Vcs-Git: https://salsa.debian.org/kfreebsd-team/kfreebsd-@major@.git 11 | Build-Depends: debhelper (>= 5.0.0), bzip2, sharutils, flex-old | flex, 12 | freebsd-buildutils (>= 10.3~), 13 | freebsd-glue (>= 0.2.15~), 14 | bmake (>= 20131001-1~), 15 | freebsd-mk (>= 10.3~), 16 | byacc, 17 | @cc_pkg@, libdb-dev, 18 | libsbuf-dev (>= 9.0+ds1-2), 19 | kernel-wedge (>= 2.88) [kfreebsd-any], 20 | # ctfutils (>= 10.3~), 21 | ## ctfconvert requires libdwarf with correct Dwarf_Off size 22 | # libdwarf-freebsd-3 (>= 10.0-2~), 23 | Standards-Version: 3.9.2 24 | 25 | Package: kfreebsd-source-@version@ 26 | Architecture: all 27 | Depends: ${misc:Depends} 28 | Recommends: freebsd-buildutils (>= 7) 29 | Provides: kfreebsd-source-@major@, kfreebsd-source 30 | Description: source code for kernel of FreeBSD @version@ with Debian patches 31 | This package provides the source code for kernel of FreeBSD @version@, base of 32 | a GNU/kFreeBSD system. 33 | 34 | Package: kfreebsd-headers-@version@-@abiname@ 35 | Architecture: kfreebsd-any 36 | Depends: ${misc:Depends} 37 | Description: Common architecture-specific header files for kernel of FreeBSD @version@ 38 | This package provides the architecture-specific common kernel header files for 39 | kernel of FreeBSD @version@, generally used for building out-of-tree kernel 40 | modules. To obtain a complete set of headers you also need to install the 41 | kfreebsd-headers-@version@-@abiname@-(flavour) package, matching the flavour of the 42 | kernel you intend the build for. To obtain such a set for the currently running 43 | kernel it is sufficient to run a command 44 | . 45 | apt-get install kfreebsd-headers-$(uname -r) 46 | . 47 | and it will be unpacked in /usr/src/kfreebsd-headers-@version@-@abiname@-(flavour) 48 | 49 | -------------------------------------------------------------------------------- /debian/patches/007_clone_signals.diff: -------------------------------------------------------------------------------- 1 | 2 | Starting with r223966 in 9-CURRENT, a new interface is available 3 | (RFTSIGZMB). It is supported in eglibc 2.13-11 or later. Use this 4 | patch if you need support for older eglibc. 5 | 6 | --- a/sys/kern/kern_fork.c 7 | +++ b/sys/kern/kern_fork.c 8 | @@ -480,7 +480,13 @@ 9 | if (flags & RFTSIGZMB) 10 | p2->p_sigparent = RFTSIGNUM(flags); 11 | else if (flags & RFLINUXTHPN) 12 | - p2->p_sigparent = SIGUSR1; 13 | + { 14 | + int sig; 15 | + sig = RFTHPNSIGNUM(flags); 16 | + if (sig == 0) sig = SIGUSR1; 17 | + if (sig == SIGCHLD) sig = 0; 18 | + p2->p_sigparent = sig; 19 | + } 20 | else 21 | p2->p_sigparent = SIGCHLD; 22 | 23 | @@ -723,12 +729,16 @@ 24 | static struct timeval lastfail; 25 | 26 | /* Check for the undefined or unimplemented flags. */ 27 | - if ((flags & ~(RFFLAGS | RFTSIGFLAGS(RFTSIGMASK))) != 0) 28 | + if ((flags & ~(RFFLAGS | RFTSIGFLAGS(RFTSIGMASK) | (RFTHPNMASK << RFTHPNSHIFT))) != 0) 29 | return (EINVAL); 30 | 31 | - /* Signal value requires RFTSIGZMB. */ 32 | - if ((flags & RFTSIGFLAGS(RFTSIGMASK)) != 0 && (flags & RFTSIGZMB) == 0) 33 | - return (EINVAL); 34 | + /* Signal value requires either RFTSIGZMB or RFLINUXTHPN. */ 35 | + if ((flags & RFTSIGZMB) == 0 && (flags & RFLINUXTHPN) == 0) { 36 | + if ((flags & RFTSIGFLAGS(RFTSIGMASK)) != 0) 37 | + return (EINVAL); 38 | + if ((flags & (RFTHPNMASK << RFTHPNSHIFT)) != 0) 39 | + return (EINVAL); 40 | + } 41 | 42 | /* Can't copy and clear. */ 43 | if ((flags & (RFFDG|RFCFDG)) == (RFFDG|RFCFDG)) 44 | --- a/sys/sys/unistd.h 45 | +++ b/sys/sys/unistd.h 46 | @@ -191,6 +191,11 @@ 47 | RFTHREAD | RFSIGSHARE | RFLINUXTHPN | RFSTOPPED | RFHIGHPID | RFTSIGZMB | \ 48 | RFPPWAIT) 49 | 50 | +#define RFTHPNSHIFT 24 /* reserve bits 24-30 */ 51 | +#define RFTHPNMASK 0x7F /* for compatibility with linuxthreads/clone() */ 52 | + /* allow to specify "clone exit parent notification" signal */ 53 | +#define RFTHPNSIGNUM(flags) (((flags) >> RFTHPNSHIFT) & RFTHPNMASK) 54 | + 55 | #endif /* __BSD_VISIBLE */ 56 | 57 | #endif /* !_SYS_UNISTD_H_ */ 58 | -------------------------------------------------------------------------------- /debian/kfreebsd-image.prerm.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # prerm script 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `upgrade' 11 | # * `failed-upgrade' 12 | # * `remove' `in-favour' 13 | # * `deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see http://www.debian.org/doc/debian-policy/ or 17 | # the debian-policy package 18 | 19 | PATH="/sbin:/bin:/usr/sbin:/usr/bin" 20 | KERNEL_IMG_CONF="/etc/kernel-img.conf" 21 | RELEASE="@RELEASE@" 22 | VERSION="@VERSION@" 23 | 24 | case "$1" in 25 | remove) 26 | # Sanitize and quote maintainer script parameters 27 | for p in "$@"; do 28 | q="$(echo "$p" | sed -e "s/'/'\\''/g")" 29 | DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" 30 | done 31 | export DEB_MAINT_PARAMS 32 | 33 | # Run prerm hook if defined 34 | prerm_hook=$(sed '/^\s*prerm_hook/!d;s/.*=\s*//g' $KERNEL_IMG_CONF 2>/dev/null || true) 35 | if [ -n "$prerm_hook" ] ; then 36 | echo "Running prerm hook script $prerm_hook." 1>&2 37 | $prerm_hook "$RELEASE" "/boot/kfreebsd-$RELEASE.gz" 38 | fi 39 | 40 | # Run /etc/kernel/prerm.d/ hooks if they exist 41 | if [ -d "/etc/kernel/prerm.d" ]; then 42 | echo "Running /etc/kernel/prerm.d hooks..." 1>&2 43 | run-parts --verbose --exit-on-error \ 44 | --arg=$RELEASE \ 45 | --arg=/boot/kfreebsd-$RELEASE.gz \ 46 | /etc/kernel/prerm.d 47 | fi 48 | ;; 49 | 50 | failed-upgrade|upgrade|deconfigure) 51 | ;; 52 | 53 | *) 54 | echo "prerm called with unknown argument \`$1'" >&2 55 | exit 1 56 | ;; 57 | esac 58 | 59 | # dh_installdeb will replace this with shell code automatically 60 | # generated by other debhelper scripts. 61 | 62 | #DEBHELPER# 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /debian/kfreebsd-image.postinst.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # postinst script 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see http://www.debian.org/doc/debian-policy/ or 17 | # the debian-policy package 18 | # 19 | 20 | PATH="/sbin:/bin:/usr/sbin:/usr/bin" 21 | KERNEL_IMG_CONF="/etc/kernel-img.conf" 22 | RELEASE="@RELEASE@" 23 | VERSION="@VERSION@" 24 | 25 | case "$1" in 26 | configure) 27 | # Sanitize and quote maintainer script parameters 28 | for p in "$@"; do 29 | q="$(echo "$p" | sed -e "s/'/'\\''/g")" 30 | DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" 31 | done 32 | export DEB_MAINT_PARAMS 33 | 34 | # Run /etc/kernel-img.conf postinst hook if defined 35 | postinst_hook=$(sed '/^\s*postinst_hook/!d;s/.*=\s*//' $KERNEL_IMG_CONF 2>/dev/null || true) 36 | if [ -n "$postinst_hook" ] ; then 37 | echo "Running postinst hook script $postinst_hook." 1>&2 38 | $postinst_hook "$RELEASE" "/boot/kfreebsd-$RELEASE.gz" 39 | fi 40 | 41 | # Run /etc/kernel/postinst.d/ hooks if they exist 42 | if [ -d "/etc/kernel/postinst.d" ] ; then 43 | run-parts --verbose --exit-on-error \ 44 | --arg=$RELEASE \ 45 | --arg=/boot/kfreebsd-$RELEASE.gz \ 46 | /etc/kernel/postinst.d 47 | fi 48 | ;; 49 | 50 | abort-upgrade|abort-remove|abort-deconfigure) 51 | ;; 52 | 53 | *) 54 | echo "postinst called with unknown argument \`$1'" >&2 55 | exit 1 56 | ;; 57 | esac 58 | 59 | # dh_installdeb will replace this with shell code automatically 60 | # generated by other debhelper scripts. 61 | 62 | #DEBHELPER# 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /debian/kfreebsd-image.postrm.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see http://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | PATH="/sbin:/bin:/usr/sbin:/usr/bin" 22 | KERNEL_IMG_CONF="/etc/kernel-img.conf" 23 | RELEASE="@RELEASE@" 24 | VERSION="@VERSION@" 25 | 26 | case "$1" in 27 | remove) 28 | # Sanitize and quote maintainer script parameters 29 | for p in "$@"; do 30 | q="$(echo "$p" | sed -e "s/'/'\\''/g")" 31 | DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" 32 | done 33 | export DEB_MAINT_PARAMS 34 | 35 | # Run /etc/kernel-img.conf postrm hook if defined 36 | postrm_hook=$(sed '/^\s*postrm_hook/!d;s/.*=\s*//' $KERNEL_IMG_CONF 2>/dev/null || true) 37 | if [ -n "$postrm_hook" ] ; then 38 | echo "Running postrm hook script $postrm_hook." 1>&2 39 | $postrm_hook "$RELEASE" "/boot/kfreebsd-$RELEASE.gz" 40 | fi 41 | 42 | # Run /etc/kernel/postrm.d/ hooks if they exist 43 | if [ -d "/etc/kernel/postrm.d" ]; then 44 | echo "Running /etc/kernel/postrm.d hooks..." 1>&2 45 | run-parts --verbose --exit-on-error \ 46 | --arg=$RELEASE \ 47 | --arg=/boot/kfreebsd-$RELEASE.gz \ 48 | /etc/kernel/postrm.d 49 | fi 50 | ;; 51 | 52 | purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 53 | ;; 54 | 55 | *) 56 | echo "postrm called with unknown argument \`$1'" >&2 57 | exit 1 58 | ;; 59 | esac 60 | 61 | # dh_installdeb will replace this with shell code automatically 62 | # generated by other debhelper scripts. 63 | 64 | #DEBHELPER# 65 | 66 | exit 0 67 | -------------------------------------------------------------------------------- /debian/patches/919_delete_key.diff: -------------------------------------------------------------------------------- 1 | Debian Policy 9.8 Keyboard configuration 2 | 3 | The (Linux) console is configured to make <-- generate DEL, and Delete generate ESC [ 3 ~. 4 | 5 | 6 | --- a/sys/dev/kbd/kbdtables.h 7 | +++ b/sys/dev/kbd/kbdtables.h 8 | @@ -56,7 +56,7 @@ 9 | /*0b*/{{ '0', ')', NOP, NOP, '0', ')', NOP, NOP, }, 0x33,0x00 }, 10 | /*0c*/{{ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, }, 0x00,0x00 }, 11 | /*0d*/{{ '=', '+', NOP, NOP, '=', '+', NOP, NOP, }, 0x33,0x00 }, 12 | -/*0e*/{{ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, }, 0x00,0x00 }, 13 | +/*0e*/{{ 0x7F, 0x7F, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, }, 0x00,0x00 }, 14 | /*0f*/{{ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, }, 0x77,0x00 }, 15 | /*10*/{{ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, }, 0x00,0x01 }, 16 | /*11*/{{ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, }, 0x00,0x01 }, 17 | @@ -125,7 +125,7 @@ 18 | /*50*/{{ F(58), '2', '2', '2', '2', '2', '2', '2', }, 0x80,0x02 }, 19 | /*51*/{{ F(59), '3', '3', '3', '3', '3', '3', '3', }, 0x80,0x02 }, 20 | /*52*/{{ F(60), '0', '0', '0', '0', '0', '0', '0', }, 0x80,0x02 }, 21 | -/*53*/{{ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, }, 0x03,0x02 }, 22 | +/*53*/{{ F(61), '.', '.', '.', '.', '.', RBT, RBT, }, 0x83,0x02 }, 23 | /*54*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, 24 | /*55*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, 25 | /*56*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, 26 | @@ -226,7 +226,7 @@ 27 | /* 49-52 */ {"\033[H", 3}, {"\033[A", 3}, {"\033[I", 3}, {"-" , 1}, 28 | /* 53-56 */ {"\033[D", 3}, {"\033[E", 3}, {"\033[C", 3}, {"+" , 1}, 29 | /* 57-60 */ {"\033[F", 3}, {"\033[B", 3}, {"\033[G", 3}, {"\033[L", 3}, 30 | -/* 61-64 */ {"\177", 1}, {"\033[J", 3}, {"\033[~", 3}, {"\033[}", 3}, 31 | +/* 61-64 */ {"\033[3~",4}, {"\033[J", 3}, {"\033[~", 3}, {"\033[}", 3}, 32 | /* 65-68 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} , 33 | /* 69-72 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} , 34 | /* 73-76 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} , 35 | -------------------------------------------------------------------------------- /debian/patches/906_grow_sysv_ipc_limits.diff: -------------------------------------------------------------------------------- 1 | Status: Rejected in upstream (kern/77353) 2 | 3 | postgresql documentation encourages to grow SysV IPC limits on *BSD systems 4 | (which obviously applies to GNU/k*BSD ones too): 5 | 6 | 7 | The options SYSVSHM and SYSVSEM need to be enabled when the kernel is compiled. (They are by default.) The maximum size of shared memory is determined by the option SHMMAXPGS (in pages). The following shows an example of how to set the various parameters: 8 | 9 | options SYSVSHM 10 | options SHMMAXPGS=4096 11 | options SHMSEG=256 12 | 13 | options SYSVSEM 14 | options SEMMNI=256 15 | options SEMMNS=512 16 | options SEMMNU=256 17 | options SEMMAP=256 18 | 19 | (On NetBSD and OpenBSD the key word is actually option singular.) 20 | 21 | You might also want to configure your kernel to lock shared memory into RAM and prevent it from being paged out to swap. Use the sysctl setting kern.ipc.shm_use_phys. 22 | 23 | 24 | --- a/sys/amd64/conf/GENERIC 25 | +++ b/sys/amd64/conf/GENERIC 26 | @@ -62,6 +62,11 @@ 27 | options SYSVSHM # SYSV-style shared memory 28 | options SYSVMSG # SYSV-style message queues 29 | options SYSVSEM # SYSV-style semaphores 30 | +options SHMMAXPGS=4096 31 | +options SHMSEG=256 32 | +options SEMMNI=256 33 | +options SEMMNS=512 34 | +options SEMMNU=256 35 | options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions 36 | options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. 37 | options KBD_INSTALL_CDEV # install a CDEV entry in /dev 38 | --- a/sys/i386/conf/GENERIC 39 | +++ b/sys/i386/conf/GENERIC 40 | @@ -63,6 +63,11 @@ 41 | options SYSVSHM # SYSV-style shared memory 42 | options SYSVMSG # SYSV-style message queues 43 | options SYSVSEM # SYSV-style semaphores 44 | +options SHMMAXPGS=4096 45 | +options SHMSEG=256 46 | +options SEMMNI=256 47 | +options SEMMNS=512 48 | +options SEMMNU=256 49 | options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions 50 | options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. 51 | options KBD_INSTALL_CDEV # install a CDEV entry in /dev 52 | -------------------------------------------------------------------------------- /debian/patches/921_signal_watchdog.diff: -------------------------------------------------------------------------------- 1 | 2 | This patch is just a safety check to detect when newer kernels introduce 3 | incompatibilities with our userland. When a possible problem happens, it 4 | will either stop applying or cause build failure. 5 | 6 | It handles three situations: 7 | 8 | - If the kernel attempts to use SIGTHR, SIGLWP or SIGLIBRT (build failure). 9 | 10 | - When signal 34 is used by the kernel (patch will stop applying). 11 | 12 | - The spares in struct sigevent are claimed by upstream (see #666454). 13 | 14 | --- a/sys/sys/signal.h 15 | +++ b/sys/sys/signal.h 16 | @@ -115,11 +115,7 @@ 17 | #define SIGUSR1 30 /* user defined signal 1 */ 18 | #define SIGUSR2 31 /* user defined signal 2 */ 19 | #endif 20 | -#if __BSD_VISIBLE 21 | -#define SIGTHR 32 /* reserved by thread library. */ 22 | -#define SIGLWP SIGTHR 23 | -#define SIGLIBRT 33 /* reserved by real-time library. */ 24 | -#endif 25 | +/* Signals 32, 33 and 34 are reserved by Glibc. */ 26 | 27 | #define SIGRTMIN 65 28 | #define SIGRTMAX 126 29 | @@ -178,6 +174,8 @@ 30 | void *_attribute; /* pthread_attr_t * */ 31 | } _sigev_thread; 32 | unsigned short _kevent_flags; 33 | + /* This comment is a safety check to detect when the spares 34 | + below are claimed by upstream (see #666454) */ 35 | long __spare__[8]; 36 | } _sigev_un; 37 | }; 38 | --- a/sys/kern/kern_prot.c 39 | +++ b/sys/kern/kern_prot.c 40 | @@ -1559,8 +1559,8 @@ 41 | * pretty safe to do since the only way to create two processes 42 | * with the same p_leader is via rfork(2). 43 | */ 44 | - if (td->td_proc->p_leader != NULL && signum >= SIGTHR && 45 | - signum < SIGTHR + 4 && td->td_proc->p_leader == p->p_leader) 46 | + if (td->td_proc->p_leader != NULL && signum >= 32 && 47 | + signum < 32 + 4 && td->td_proc->p_leader == p->p_leader) 48 | return (0); 49 | 50 | return (cr_cansignal(td->td_ucred, p, signum)); 51 | --- a/sys/sys/rctl.h 52 | +++ b/sys/sys/rctl.h 53 | @@ -124,7 +124,7 @@ 54 | #define RCTL_ACTION_SIGINFO SIGINFO 55 | #define RCTL_ACTION_SIGUSR1 SIGUSR1 56 | #define RCTL_ACTION_SIGUSR2 SIGUSR2 57 | -#define RCTL_ACTION_SIGTHR SIGTHR 58 | +#define RCTL_ACTION_SIGTHR 32 59 | #define RCTL_ACTION_SIGNAL_MAX RCTL_ACTION_SIGTHR 60 | #define RCTL_ACTION_DENY (RCTL_ACTION_SIGNAL_MAX + 1) 61 | #define RCTL_ACTION_LOG (RCTL_ACTION_SIGNAL_MAX + 2) 62 | -------------------------------------------------------------------------------- /debian/patches/004_xargs.diff: -------------------------------------------------------------------------------- 1 | 2 | xargs -I works here, although it's not exactly the same. 3 | -J option requested to findutils maintainers: 4 | 5 | http://savannah.gnu.org/patch/?4916 6 | 7 | --- a/sys/conf/kmod.mk 8 | +++ b/sys/conf/kmod.mk 9 | @@ -233,7 +233,7 @@ 10 | grep -v '^#' < ${EXPORT_SYMS} > export_syms 11 | .endif 12 | ${AWK} -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \ 13 | - export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} 14 | + export_syms | xargs -I% ${OBJCOPY} % ${.TARGET} 15 | .endif 16 | .endif 17 | .if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no 18 | --- a/sys/contrib/dev/acpica/acpica_prep.sh 19 | +++ b/sys/contrib/dev/acpica/acpica_prep.sh 20 | @@ -60,10 +60,10 @@ 21 | # copy files 22 | echo copying full dirs 23 | for i in ${fulldirs}; do 24 | - find ${wrk} -name ${i} -type d -print | xargs -J % mv % ${dst} 25 | + find ${wrk} -name ${i} -type d -print | xargs -I % mv % ${dst} 26 | done 27 | echo copying remaining files 28 | -find ${wrk} -type f -print | xargs -J % mv % ${dst} 29 | +find ${wrk} -type f -print | xargs -I % mv % ${dst} 30 | 31 | # canonify include paths 32 | for H in ${src_headers}; do 33 | --- a/sys/conf/kern.post.mk 34 | +++ b/sys/conf/kern.post.mk 35 | @@ -233,21 +233,21 @@ 36 | rm -f ${.TARGET}.tmp 37 | # C files 38 | ${MAKE} -V CFILES_NORMAL -V SYSTEM_CFILES -V GEN_CFILES | \ 39 | - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAGS} 40 | + CC="${_MKDEPCC}" xargs -r mkdep -a -f ${.TARGET}.tmp ${CFLAGS} 41 | ${MAKE} -V CFILES_CDDL | \ 42 | - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS} \ 43 | + CC="${_MKDEPCC}" xargs -r mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS} \ 44 | ${FBT_CFLAGS} ${DTRACE_CFLAGS} 45 | ${MAKE} -V CFILES_LINUXKPI | \ 46 | - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ 47 | + CC="${_MKDEPCC}" xargs -r mkdep -a -f ${.TARGET}.tmp \ 48 | ${CFLAGS} ${LINUXKPI_INCLUDES} 49 | ${MAKE} -V CFILES_OFED -V CFILES_MLX5 | \ 50 | - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ 51 | + CC="${_MKDEPCC}" xargs -r mkdep -a -f ${.TARGET}.tmp \ 52 | ${CFLAGS} ${OFEDINCLUDES} 53 | # Assembly files 54 | ${MAKE} -V SFILES_NORMAL | \ 55 | - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS} 56 | + CC="${_MKDEPCC}" xargs -r mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS} 57 | ${MAKE} -V SFILES_CDDL | \ 58 | - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS} 59 | + CC="${_MKDEPCC}" xargs -r mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS} 60 | mv ${.TARGET}.tmp ${.TARGET} 61 | .else 62 | : > ${.TARGET} 63 | -------------------------------------------------------------------------------- /debian/control.flavor.in: -------------------------------------------------------------------------------- 1 | Package: kfreebsd-image-@version@-@abiname@-@flavor@ 2 | Architecture: kfreebsd-@arch@ 3 | Depends: ${misc:Depends}, 4 | freebsd-utils (>= 8.1-5) [kfreebsd-any], kldutils (>= 7.1) [kfreebsd-any], 5 | devd [kfreebsd-any] | freebsd-utils (<< 8.2+ds2-9) [kfreebsd-any], 6 | # Policy-conformant keyboard mappings (see #605777) 7 | kbdcontrol (>= 8.2+ds2-6) [kfreebsd-any], 8 | # Not strictly correct, but putting it only in Breaks (see below) may result in 9 | # having freebsd-net-tools auto-removed (probably because of #738934 and similar 10 | # bugs) 11 | freebsd-net-tools (>= 10.0-2~) [kfreebsd-any], 12 | Conflicts: kfreebsd-loader (<< 5.4-1.3) 13 | Breaks: 14 | # Prior versions can't boot kFreeBSD >= 9.1 (see #699002) 15 | grub-common (<< 1.99-27+deb7u2) [kfreebsd-any], 16 | # Missing support for pts(4) (see #667448) 17 | libc0.1 (<< 2.17-4~) [kfreebsd-any], 18 | # Require ZFS v28 userland 19 | zfsutils (<< 8.3~) [kfreebsd-any], 20 | # 9.x uses old SIOCAIFADDR ABI (see #732693), and 10.0-1 uses inconsistent/mixed ABI (see #736238) 21 | freebsd-net-tools (<< 10.0-2~) [kfreebsd-any], 22 | Provides: kfreebsd-image-@major@, kfreebsd-image 23 | Recommends: @recommends@ 24 | Description: kernel of FreeBSD @version@ image 25 | This package provides the binary image and pre-built loadable modules for 26 | the kernel of FreeBSD @version@, base of a GNU/kFreeBSD system. 27 | . 28 | This package is compiled for a @flavor@-class machine. 29 | 30 | Package: kfreebsd-image-@major@-@flavor@ 31 | Architecture: kfreebsd-@arch@ 32 | Depends: kfreebsd-image-@version@-@abiname@-@flavor@, ${misc:Depends} 33 | Description: kernel of FreeBSD @major@ image (meta-package) 34 | This package depends on the latest binary image for kernel of FreeBSD @major@ on 35 | @flavor@-class machines. 36 | 37 | Package: kfreebsd-headers-@version@-@abiname@-@flavor@ 38 | Architecture: kfreebsd-@arch@ 39 | Provides: kfreebsd-headers-@major@, kfreebsd-headers 40 | Depends: kfreebsd-headers-@version@-@abiname@ (= ${binary:Version}), ${misc:Depends} 41 | Description: header files for kernel of FreeBSD @version@ 42 | This package provides the header files for kernel of FreeBSD @version@, generally 43 | used for building out-of-tree kernel modules. These files are going to be 44 | installed into /usr/src/kfreebsd-headers-@version@-@abiname@-@flavor@, and can be 45 | used for building modules that load into the kernel provided by the 46 | kfreebsd-image-@version@-@abiname@-@flavor@ package. 47 | 48 | Package: kfreebsd-headers-@major@-@flavor@ 49 | Architecture: kfreebsd-@arch@ 50 | Depends: kfreebsd-headers-@version@-@abiname@-@flavor@, ${misc:Depends} 51 | Description: header files for kernel of FreeBSD @major@ (meta-package) 52 | This package depends on the latest header files for kernel of FreeBSD @major@ on 53 | @flavor@-class machines. 54 | -------------------------------------------------------------------------------- /debian/local/ar9300_devid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2011 Atheros Communications Inc. 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #ifndef __AR9300_DEVID_H__ 18 | #define __AR9300_DEVID_H__ 19 | 20 | /* Atheros chipsets */ 21 | #define AR_SREV_VERSION_AR5416_PCI 0xD 22 | #define AR_SREV_VERSION_AR5416_PCIE 0xC 23 | #define AR_SREV_REVISION_AR5416_10 0 24 | #define AR_SREV_REVISION_AR5416_20 1 25 | #define AR_SREV_REVISION_AR5416_22 2 26 | #define AR_SREV_VERSION_AR9100 0x14 27 | #define AR_SREV_VERSION_AR9160 0x40 28 | #define AR_SREV_REVISION_AR9160_10 0 29 | #define AR_SREV_REVISION_AR9160_11 1 30 | #define AR_SREV_VERSION_AR9280 0x80 31 | #define AR_SREV_REVISION_AR9280_10 0 32 | #define AR_SREV_REVISION_AR9280_20 1 33 | #define AR_SREV_REVISION_AR9280_21 2 34 | #define AR_SREV_VERSION_AR9285 0xC0 35 | #define AR_SREV_REVISION_AR9285_10 0 36 | #define AR_SREV_REVISION_AR9285_11 1 37 | #define AR_SREV_REVISION_AR9285_12 2 38 | #define AR_SREV_VERSION_AR9287 0x180 39 | #define AR_SREV_REVISION_AR9287_10 0 40 | #define AR_SREV_REVISION_AR9287_11 1 41 | #define AR_SREV_REVISION_AR9287_12 2 42 | #define AR_SREV_REVISION_AR9287_13 3 43 | #define AR_SREV_VERSION_AR9271 0x140 44 | #define AR_SREV_REVISION_AR9271_10 0 45 | #define AR_SREV_REVISION_AR9271_11 1 46 | #define AR_SREV_VERSION_AR9300 0x1c0 47 | #define AR_SREV_REVISION_AR9300_20 2 /* 2.0 and 2.1 */ 48 | #define AR_SREV_REVISION_AR9300_22 3 49 | #define AR_SREV_VERSION_AR9330 0x200 50 | #define AR_SREV_REVISION_AR9330_10 0 51 | #define AR_SREV_REVISION_AR9330_11 1 52 | #define AR_SREV_REVISION_AR9330_12 2 53 | #define AR_SREV_VERSION_AR9485 0x240 54 | #define AR_SREV_REVISION_AR9485_10 0 55 | #define AR_SREV_REVISION_AR9485_11 1 56 | #define AR_SREV_VERSION_AR9340 0x300 57 | #define AR_SREV_REVISION_AR9340_10 0 58 | #define AR_SREV_REVISION_AR9340_11 1 59 | #define AR_SREV_REVISION_AR9340_12 2 60 | #define AR_SREV_REVISION_AR9340_13 3 61 | #define AR_SREV_VERSION_AR9380 0x1C0 62 | #define AR_SREV_VERSION_AR9580 0x1C0 63 | #define AR_SREV_REVISION_AR9580_10 4 /* AR9580 1.0 */ 64 | #define AR_SREV_VERSION_AR9460 0x280 65 | #define AR_SREV_VERSION_AR9462 0x280 66 | #define AR_SREV_REVISION_AR9462_20 2 67 | #define AR_SREV_REVISION_AR9462_21 3 68 | 69 | /* Qualcomm Atheros chipsets */ 70 | #define AR_SREV_VERSION_QCA9565 0x2C0 71 | #define AR_SREV_REVISION_QCA9565_10 0 72 | #define AR_SREV_REVISION_QCA9565_101 1 73 | #define AR_SREV_REVISION_QCA9565_11 2 74 | #define AR_SREV_VERSION_QCA9550 0x400 75 | #define AR_SREV_VERSION_QCA9530 0x500 76 | #define AR_SREV_REVISION_QCA9530_10 0 77 | #define AR_SREV_REVISION_QCA9530_11 1 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /debian/patches/009_disable_duped_modules.diff: -------------------------------------------------------------------------------- 1 | 2 | Status: in upstream BTS 3 | 4 | --- a/sys/conf/Makefile.amd64 5 | +++ b/sys/conf/Makefile.amd64 6 | @@ -48,6 +48,8 @@ 7 | ASM_CFLAGS+= ${.IMPSRC:T:Mmpboot.S:C/^.+$/-no-integrated-as/} 8 | .endif 9 | 10 | +%WITHOUT_MODULES 11 | + 12 | %BEFORE_DEPEND 13 | 14 | %OBJS 15 | --- a/sys/conf/Makefile.arm 16 | +++ b/sys/conf/Makefile.arm 17 | @@ -124,6 +124,8 @@ 18 | 19 | MKMODULESENV+= MACHINE=${MACHINE} 20 | 21 | +%WITHOUT_MODULES 22 | + 23 | %BEFORE_DEPEND 24 | 25 | %OBJS 26 | --- a/sys/conf/Makefile.i386 27 | +++ b/sys/conf/Makefile.i386 28 | @@ -40,6 +40,8 @@ 29 | ASM_CFLAGS+= ${.IMPSRC:T:Mmpboot.s:C/^.+$/-no-integrated-as/} 30 | .endif 31 | 32 | +%WITHOUT_MODULES 33 | + 34 | %BEFORE_DEPEND 35 | 36 | %OBJS 37 | --- a/sys/conf/Makefile.ia64 38 | +++ b/sys/conf/Makefile.ia64 39 | @@ -36,6 +36,8 @@ 40 | 41 | ASM_CFLAGS= -x assembler-with-cpp -Wa,-x -DLOCORE ${CFLAGS} 42 | 43 | +%WITHOUT_MODULES 44 | + 45 | %BEFORE_DEPEND 46 | 47 | %OBJS 48 | --- a/sys/conf/Makefile.mips 49 | +++ b/sys/conf/Makefile.mips 50 | @@ -70,6 +70,8 @@ 51 | ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ 52 | ${KERNEL_KO}.tramp.bin \ 53 | 54 | +%WITHOUT_MODULES 55 | + 56 | %BEFORE_DEPEND 57 | 58 | %OBJS 59 | --- a/sys/conf/Makefile.pc98 60 | +++ b/sys/conf/Makefile.pc98 61 | @@ -34,6 +34,8 @@ 62 | 63 | MKMODULESENV+= MACHINE=${MACHINE} 64 | 65 | +%WITHOUT_MODULES 66 | + 67 | %BEFORE_DEPEND 68 | 69 | %OBJS 70 | --- a/sys/conf/Makefile.powerpc 71 | +++ b/sys/conf/Makefile.powerpc 72 | @@ -42,6 +42,8 @@ 73 | CFLAGS+= -fno-omit-frame-pointer 74 | .endif 75 | 76 | +%WITHOUT_MODULES 77 | + 78 | %BEFORE_DEPEND 79 | 80 | %OBJS 81 | --- a/sys/conf/Makefile.sparc64 82 | +++ b/sys/conf/Makefile.sparc64 83 | @@ -32,6 +32,8 @@ 84 | 85 | MDOBJS= exception.o interrupt.o 86 | 87 | +%WITHOUT_MODULES 88 | + 89 | %BEFORE_DEPEND 90 | 91 | %OBJS 92 | --- a/usr.sbin/config/mkmakefile.c 93 | +++ b/usr.sbin/config/mkmakefile.c 94 | @@ -70,6 +70,7 @@ 95 | static void do_rules(FILE *); 96 | static void do_xxfiles(char *, FILE *); 97 | static void do_objs(FILE *); 98 | +static void do_without_modules(FILE *); 99 | static void do_before_depend(FILE *); 100 | static int opteq(const char *, const char *); 101 | static void read_files(void); 102 | @@ -161,6 +162,8 @@ 103 | } 104 | if (eq(line, "%BEFORE_DEPEND\n")) 105 | do_before_depend(ofp); 106 | + else if (eq(line, "%WITHOUT_MODULES\n")) 107 | + do_without_modules(ofp); 108 | else if (eq(line, "%OBJS\n")) 109 | do_objs(ofp); 110 | else if (strncmp(line, "%FILES.", 7) == 0) 111 | @@ -647,6 +650,28 @@ 112 | } 113 | 114 | static void 115 | +do_without_modules(FILE *fp) 116 | +{ 117 | + struct device *dp; 118 | + int lpos, len; 119 | + char *cp, *sp; 120 | + 121 | + fprintf(fp, "MKMODULESENV+= WITHOUT_MODULES=\""); 122 | + lpos = 34; 123 | + STAILQ_FOREACH(dp, &dtab, d_next) { 124 | + sp = dp->d_name; 125 | + cp = sp + (len = strlen(sp)) - 1; 126 | + if (len + lpos > 72) { 127 | + lpos = 8; 128 | + fprintf(fp, "\\\n\t"); 129 | + } 130 | + fprintf(fp, "%s ", sp); 131 | + lpos += len + 1; 132 | + } 133 | + fprintf(fp, "\"\n"); 134 | +} 135 | + 136 | +static void 137 | do_xxfiles(char *tag, FILE *fp) 138 | { 139 | struct file_list *tp; 140 | -------------------------------------------------------------------------------- /debian/patches/999_config.diff: -------------------------------------------------------------------------------- 1 | --- a/sys/amd64/conf/GENERIC 2 | +++ b/sys/amd64/conf/GENERIC 3 | @@ -18,8 +18,8 @@ 4 | # 5 | # $FreeBSD$ 6 | 7 | -cpu HAMMER 8 | -ident GENERIC 9 | +#cpu HAMMER 10 | +#ident GENERIC 11 | 12 | makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols 13 | makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support 14 | @@ -56,7 +56,7 @@ 15 | options COMPAT_FREEBSD7 # Compatible with FreeBSD7 16 | options COMPAT_FREEBSD9 # Compatible with FreeBSD9 17 | options COMPAT_FREEBSD10 # Compatible with FreeBSD10 18 | -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI 19 | +options SCSI_DELAY=2000 # Delay (in ms) before probing SCSI 20 | options KTRACE # ktrace(1) support 21 | options STACK # stack(9) support 22 | options SYSVSHM # SYSV-style shared memory 23 | --- a/sys/i386/conf/GENERIC 24 | +++ b/sys/i386/conf/GENERIC 25 | @@ -18,10 +18,10 @@ 26 | # 27 | # $FreeBSD$ 28 | 29 | -cpu I486_CPU 30 | -cpu I586_CPU 31 | -cpu I686_CPU 32 | -ident GENERIC 33 | +#cpu I486_CPU 34 | +#cpu I586_CPU 35 | +#cpu I686_CPU 36 | +#ident GENERIC 37 | 38 | makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols 39 | makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support 40 | @@ -57,7 +57,7 @@ 41 | options COMPAT_FREEBSD7 # Compatible with FreeBSD7 42 | options COMPAT_FREEBSD9 # Compatible with FreeBSD9 43 | options COMPAT_FREEBSD10 # Compatible with FreeBSD10 44 | -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI 45 | +options SCSI_DELAY=2000 # Delay (in ms) before probing SCSI 46 | options KTRACE # ktrace(1) support 47 | options STACK # stack(9) support 48 | options SYSVSHM # SYSV-style shared memory 49 | --- /dev/null 50 | +++ b/sys/conf/DEBIAN 51 | @@ -0,0 +1,32 @@ 52 | +# Common options to all Debian GNU/kFreeBSD kernels 53 | + 54 | +options LINPROCFS 55 | +options LINSYSFS 56 | +options FDESCFS 57 | +options TMPFS 58 | +options QUOTA 59 | +options KTRACE 60 | + 61 | +# See #706736 62 | +options INCLUDE_CONFIG_FILE 63 | + 64 | +# Floppy drives need not be built-in because our installer doesn't 65 | +# include a "floppy" flavour (and probably never will). 66 | +nodevice fdc 67 | + 68 | +# Network options 69 | +device carp 70 | +device pf 71 | +device pfsync 72 | +device pflog 73 | + 74 | +# Alternate queueing 75 | +options ALTQ 76 | +options ALTQ_CBQ # Class Bases Queuing (CBQ) 77 | +options ALTQ_RED # Random Early Detection (RED) 78 | +options ALTQ_RIO # RED In/Out 79 | +options ALTQ_HFSC # Hierarchical Packet Scheduler (HFSC) 80 | +options ALTQ_PRIQ # Priority Queuing (PRIQ) 81 | + 82 | +# Disable binary blobs 83 | +include WITHOUT_SOURCELESS 84 | --- /dev/null 85 | +++ b/sys/conf/DEBIAN_DEBUG 86 | @@ -0,0 +1,23 @@ 87 | + 88 | +## Enable debugging options 89 | + 90 | +# Not yet... 91 | +#makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support 92 | +nomakeoptions WITH_CTF 93 | + 94 | +### KDTRACE_FRAME is only for amd64 95 | +##options KDTRACE_FRAME # Ensure frames are compiled in 96 | +#options KDTRACE_HOOKS # Kernel DTrace hooks 97 | +#options DDB_CTF # Kernel ELF linker loads CTF data 98 | + 99 | +options DDB # Support DDB. 100 | +options GDB # Support remote GDB. 101 | +options DEADLKRES # Enable the deadlock resolver 102 | +options INVARIANTS # Enable calls of extra sanity checking 103 | +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS 104 | +options WITNESS # Enable checks to detect deadlocks and cycles 105 | +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed 106 | +options MALLOC_DEBUG_MAXZONES # Separate malloc(9) zones 107 | + 108 | +# Disable minimum debugger support 109 | +nooptions KDB_TRACE # Print a stack trace for a panic. 110 | --- /dev/null 111 | +++ b/sys/conf/DEBIAN_NODEBUG 112 | @@ -0,0 +1,21 @@ 113 | + 114 | +## Disable debugging options (except KDB_TRACE) 115 | + 116 | +nomakeoptions DEBUG # Build kernel with gdb(1) debug symbols 117 | +nomakeoptions WITH_CTF # Run ctfconvert(1) for DTrace support 118 | + 119 | +nooptions KDTRACE_FRAME # Ensure frames are compiled in 120 | +nooptions KDTRACE_HOOKS # Kernel DTrace hooks 121 | +nooptions DDB_CTF # Kernel ELF linker loads CTF data 122 | + 123 | +nooptions DDB # Support DDB. 124 | +nooptions GDB # Support remote GDB. 125 | +nooptions DEADLKRES # Enable the deadlock resolver 126 | +nooptions INVARIANTS # Enable calls of extra sanity checking 127 | +nooptions INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS 128 | +nooptions WITNESS # Enable checks to detect deadlocks and cycles 129 | +nooptions WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed 130 | +nooptions MALLOC_DEBUG_MAXZONES # Separate malloc(9) zones 131 | + 132 | +# Enable minimum debugger support 133 | +options KDB_TRACE # Print a stack trace for a panic. 134 | --- a/sys/modules/Makefile 135 | +++ b/sys/modules/Makefile 136 | @@ -561,7 +561,9 @@ 137 | .endif 138 | _safe= safe 139 | _scsi_low= scsi_low 140 | +.if ${MK_SOURCELESS_UCODE} != "no" 141 | _si= si 142 | +.endif 143 | _speaker= speaker 144 | _splash= splash 145 | _sppp= sppp 146 | -------------------------------------------------------------------------------- /debian/patches/firmware_load.diff: -------------------------------------------------------------------------------- 1 | 2 | Loads firmware blobs from /lib/firmware/ 3 | 4 | Currently only radeonkmsfw is supported. 5 | 6 | --- a/sys/kern/subr_firmware.c 7 | +++ b/sys/kern/subr_firmware.c 8 | @@ -45,6 +45,12 @@ 9 | 10 | #include 11 | #include 12 | +#include 13 | +#define lookup(a) namei_lookup(a) 14 | +#include 15 | +#undef lookup 16 | + 17 | +MALLOC_DEFINE(M_FIRMWARE, "firmware", "firmware loader"); 18 | 19 | /* 20 | * Loadable firmware support. See sys/sys/firmware.h and firmware(9) 21 | @@ -137,6 +143,124 @@ 22 | static struct mtx firmware_mtx; 23 | MTX_SYSINIT(firmware, &firmware_mtx, "firmware table", MTX_DEF); 24 | 25 | +MALLOC_DECLARE(M_FIRMWARE); 26 | + 27 | +static const struct 28 | +{ 29 | + char *file; 30 | + char *name; 31 | +} firmware_map[] = { 32 | + 33 | + /* 34 | + * Second column is the argument to firmware_get() used by the 35 | + * driver. If there are no firmware_get() calls this means it 36 | + * needs to be ported to firmware(9) framework first. 37 | + * 38 | + * Note that the first column may refer to a versioned file 39 | + * name, but the second one is NOT versioned. The versioned 40 | + * references are supposed to match with whatever this version 41 | + * of the kernel expects (check the makefiles for *fw modules 42 | + * in sys/modules/ for hints). 43 | + */ 44 | + 45 | + /* ral */ 46 | + { "/lib/firmware/rt2561.bin", "rt2561fw" }, 47 | + { "/lib/firmware/rt2661.bin", "rt2661fw" }, 48 | + { "/lib/firmware/rt2561s.bin", "rt2561sfw" }, 49 | + 50 | + /* iwi */ 51 | + { "/lib/firmware/ipw2200-bss.fw", "iwi_bss" }, 52 | + { "/lib/firmware/ipw2200-ibss.fw", "iwi_ibss" }, 53 | + { "/lib/firmware/ipw2200-sniffer.fw", "iwi_monitor" }, 54 | + 55 | + /* wpi */ 56 | + { "/lib/firmware/iwlwifi-3945-2.ucode", "wpifw" }, 57 | + 58 | + /* ipw */ 59 | + { "/lib/firmware/ipw2100-1.3.fw", "ipw_bss" }, 60 | + { "/lib/firmware/ipw2100-1.3-i.fw", "ipw_ibss" }, 61 | + { "/lib/firmware/ipw2100-1.3-p.fw", "ipw_monitor" }, 62 | + 63 | + /* iwn */ 64 | + { "/lib/firmware/iwlwifi-105-6.ucode", "iwn105fw" }, 65 | + { "/lib/firmware/iwlwifi-135-6.ucode", "iwn135fw" }, 66 | + { "/lib/firmware/iwlwifi-1000-5.ucode", "iwn1000fw" }, 67 | + { "/lib/firmware/iwlwifi-2000-6.ucode", "iwn2000fw" }, 68 | + { "/lib/firmware/iwlwifi-2030-6.ucode", "iwn2030fw" }, 69 | + { "/lib/firmware/iwlwifi-4965-2.ucode", "iwn4965fw" }, 70 | + { "/lib/firmware/iwlwifi-5000-5.ucode", "iwn5000fw" }, 71 | + { "/lib/firmware/iwlwifi-5150-2.ucode", "iwn5150fw" }, 72 | + { "/lib/firmware/iwlwifi-6000-4.ucode", "iwn6000fw" }, 73 | + { "/lib/firmware/iwlwifi-6050-5.ucode", "iwn6050fw" }, 74 | + { "/lib/firmware/iwlwifi-6000g2a-6.ucode", "iwn6000g2afw" }, 75 | + { "/lib/firmware/iwlwifi-6000g2b-6.ucode", "iwn6000g2bfw" }, 76 | + 77 | + /* rsu */ 78 | + { "/lib/firmware/rtlwifi/rtl8712u.bin", "rsu-rtl8712fw" }, 79 | +}; 80 | + 81 | +static const struct firmware * 82 | +firmware_load(const char *path, const char *imagename) 83 | +{ 84 | + struct thread *td = curthread; /* XXX */ 85 | + struct ucred *cred = td ? td->td_ucred : NULL; 86 | + struct nameidata nd; 87 | + struct vattr vattr; 88 | + u_char *fwdata = NULL; 89 | + u_char *cp; 90 | + int error, flags; 91 | + ssize_t reclen; 92 | + const struct firmware *result = NULL; 93 | + 94 | + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, path, td); 95 | + flags = FREAD; 96 | + error = vn_open(&nd, &flags, 0, NULL); 97 | + if (error) 98 | + goto bad; 99 | + NDFREE(&nd, NDF_ONLY_PNBUF); 100 | + if (nd.ni_vp->v_type != VREG) 101 | + goto bad; 102 | + cp = NULL; 103 | + error = VOP_GETATTR(nd.ni_vp, &vattr, cred); 104 | + if (error) 105 | + goto bad; 106 | + /* 107 | + * XXX: we need to limit this number to some reasonable value 108 | + */ 109 | + if (vattr.va_size > 1024 * 1024) { 110 | + printf("firmware image file too large %ld\n", (long)vattr.va_size); 111 | + goto bad; 112 | + } 113 | + fwdata = malloc(vattr.va_size, M_FIRMWARE, M_WAITOK); 114 | + if (fwdata == NULL) 115 | + goto bad; 116 | + error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)fwdata, vattr.va_size, 0, 117 | + UIO_SYSSPACE, IO_NODELOCKED, cred, NOCRED, &reclen, td); 118 | + if (error) 119 | + goto bad; 120 | + VOP_UNLOCK(nd.ni_vp, 0); 121 | + vn_close(nd.ni_vp, FREAD, cred, td); 122 | + nd.ni_vp = NULL; 123 | + if (reclen != 0) { 124 | + printf("can't read %zd\n", reclen); 125 | + goto bad; 126 | + } 127 | + result = firmware_register(imagename, fwdata, vattr.va_size, 0, NULL); 128 | +bad: 129 | + if (result == NULL) { 130 | + printf("unable to load %s", path); 131 | + } 132 | + 133 | + if (fwdata && !result) 134 | + free(fwdata, M_FIRMWARE); 135 | + if (nd.ni_vp != NULL) { 136 | + VOP_UNLOCK(nd.ni_vp, 0); 137 | + vn_close(nd.ni_vp, FREAD, cred, td); 138 | + } 139 | + 140 | + return (result); 141 | +} 142 | + 143 | /* 144 | * Helper function to lookup a name. 145 | * As a side effect, it sets the pointer to a free slot, if any. 146 | @@ -307,6 +431,31 @@ 147 | struct thread *td; 148 | struct priv_fw *fp; 149 | 150 | + /* 151 | + * Must call firmware_load *before* entering the mutex. 152 | + */ 153 | + if (!strncmp (imagename, "radeonkmsfw_", sizeof("radeonkmsfw_") - 1)) { 154 | + const char *basename = imagename + sizeof("radeonkmsfw_") - 1; 155 | + u_char *pathbuf; 156 | + ssize_t reclen; 157 | + reclen = sizeof("/lib/firmware/radeon/") - 1 158 | + + strlen(basename) 159 | + + sizeof(".bin"); 160 | + pathbuf = malloc(reclen, M_TEMP, M_WAITOK); 161 | + snprintf(pathbuf, reclen, "/lib/firmware/radeon/%s.bin", basename); 162 | + 163 | + firmware_load(pathbuf, imagename); 164 | + 165 | + free(pathbuf, M_TEMP); 166 | + } else { 167 | + int i; 168 | + for (i = 0; i < sizeof(firmware_map)/sizeof(firmware_map[0]); i++) 169 | + if (!strcmp (firmware_map[i].name, imagename)) { 170 | + firmware_load(firmware_map[i].file, imagename); 171 | + break; 172 | + } 173 | + } 174 | + 175 | mtx_lock(&firmware_mtx); 176 | fp = lookup(imagename, NULL); 177 | if (fp != NULL) 178 | -------------------------------------------------------------------------------- /debian/installer/package-list: -------------------------------------------------------------------------------- 1 | # This file is used to build up the control file. The kernel version and 2 | # "-di" are appended to the package names. Section can be left out. So can 3 | # architecture, which is derived from the files in the modules directory. 4 | # 5 | Package: kernel-image 6 | Priority: extra 7 | Description: Linux kernel binary image for the Debian installer 8 | This package contains the kernel image for the Debian installer 9 | boot images. It does _not_ provide a usable kernel for your full 10 | Debian system. 11 | 12 | Package: nic-modules 13 | Depends: kernel-image, nic-shared-modules, core-modules 14 | Priority: standard 15 | Description: Common NIC drivers 16 | This package contains common NIC drivers for the kernel. 17 | 18 | Package: nic-extra-modules 19 | Depends: kernel-image, nic-shared-modules, core-modules, i2c-modules, crc-modules 20 | Priority: standard 21 | Description: Rare NIC drivers 22 | This package contains rare NIC drivers for the kernel. 23 | 24 | Package: nic-wireless-modules 25 | Depends: kernel-image, nic-shared-modules, core-modules, usb-modules, mmc-modules, pcmcia-modules 26 | Priority: standard 27 | Description: Wireless NIC drivers 28 | This package contains wireless NIC drivers for the kernel. 29 | Includes crypto modules only needed for wireless (WEP). 30 | 31 | Package: nic-shared-modules 32 | Depends: kernel-image 33 | Priority: standard 34 | Description: Shared NIC drivers 35 | This package contains NIC drivers needed by combinations of nic-modules, 36 | nic-extra-modules, nic-pcmcia-modules, and nic-wireless-modules. 37 | 38 | Package: serial-modules 39 | Depends: kernel-image, pcmcia-modules 40 | Priority: optional 41 | Description: Serial drivers 42 | This package contains serial drivers for the kernel. 43 | 44 | Package: usb-serial-modules 45 | Depends: kernel-image, usb-modules 46 | Priority: optional 47 | Description: USB serial drivers 48 | This package contains USB serial drivers for the kernel. 49 | 50 | Package: ppp-modules 51 | Depends: kernel-image, serial-modules, zlib-modules, crc-modules 52 | Priority: optional 53 | Description: PPP drivers 54 | This package contains PPP drivers for the kernel. 55 | 56 | Package: ide-modules 57 | Depends: kernel-image, ide-core-modules 58 | Priority: standard 59 | Description: IDE drivers 60 | This package contains IDE drivers for the kernel. 61 | 62 | Package: pata-modules 63 | Depends: kernel-image, ata-modules 64 | Priority: standard 65 | Description: PATA drivers 66 | This package contains PATA drivers for the kernel. 67 | 68 | Package: ide-core-modules 69 | Depends: kernel-image 70 | Priority: standard 71 | Description: IDE support 72 | This package contains core IDE support for the kernel. 73 | 74 | Package: cdrom-core-modules 75 | Depends: kernel-image, scsi-core-modules, ide-modules, isofs-modules 76 | Priority: standard 77 | Description: CDROM support 78 | This package contains core CDROM support for the kernel. 79 | 80 | Package: cdrom-modules 81 | Depends: kernel-image, ide-modules, cdrom-core-modules 82 | Priority: optional 83 | Description: Esoteric CDROM drivers 84 | This package contains esoteric CDROM drivers for the kernel. 85 | 86 | Package: firewire-core-modules 87 | Depends: kernel-image, scsi-core-modules 88 | Priority: standard 89 | Description: Core FireWire drivers 90 | This package contains core FireWire drivers for the kernel. 91 | 92 | Package: scsi-core-modules 93 | Depends: kernel-image 94 | Priority: standard 95 | Description: Core SCSI subsystem 96 | This package contains the core SCSI subsystem for the kernel. 97 | 98 | Package: scsi-modules 99 | Depends: kernel-image, scsi-core-modules, parport-modules, cdrom-core-modules, core-modules, ata-modules 100 | Priority: standard 101 | Description: SCSI drivers 102 | This package contains SCSI drivers for the kernel. 103 | 104 | Package: scsi-common-modules 105 | Depends: kernel-image, scsi-core-modules, cdrom-core-modules 106 | Priority: standard 107 | Description: Very common SCSI drivers 108 | This package contains very common SCSI drivers for the kernel. 109 | 110 | Package: scsi-extra-modules 111 | Depends: scsi-modules, scsi-core-modules 112 | Priority: standard 113 | Description: Uncommon SCSI drivers 114 | This package contains uncommon SCSI drivers for the kernel. 115 | This includes SCSI RAID drivers, and some of the less common SCSI 116 | controllers. 117 | 118 | Package: plip-modules 119 | Depends: kernel-image, parport-modules 120 | Priority: optional 121 | Description: PLIP drivers 122 | This package contains PLIP drivers for the kernel. 123 | 124 | Package: floppy-modules 125 | Depends: kernel-image 126 | Priority: standard 127 | Description: Floppy driver 128 | This package contains the floppy driver for the kernel. 129 | 130 | Package: loop-modules 131 | Depends: kernel-image 132 | Priority: standard 133 | Description: Loopback filesystem support 134 | This package contains loopback filesystem support for the kernel. 135 | 136 | Package: ipv6-modules 137 | Depends: kernel-image 138 | Priority: extra 139 | Description: IPv6 driver 140 | This package contains the IPv6 driver for the kernel. 141 | 142 | Package: nls-core-modules 143 | Depends: kernel-image 144 | Priority: extra 145 | Description: Core NLS support 146 | This package contains basic NLS support modules for the kernel. 147 | 148 | Package: btrfs-modules 149 | Depends: kernel-image, core-modules, crc-modules, zlib-modules, lzo-modules 150 | Priority: extra 151 | Description: BTRFS filesystem support 152 | This package contains the BTRFS filesystem module for the kernel. 153 | 154 | Package: ext2-modules 155 | Depends: kernel-image 156 | Priority: standard 157 | Description: EXT2 filesystem support 158 | This package contains the EXT2 filesystem module for the kernel. 159 | 160 | Package: ext3-modules 161 | Depends: kernel-image 162 | Priority: standard 163 | Description: EXT3 filesystem support 164 | This package contains the EXT3 filesystem module for the kernel. 165 | 166 | Package: ext4-modules 167 | Depends: kernel-image, core-modules 168 | Priority: standard 169 | Description: EXT4 filesystem support 170 | This package contains the EXT4 filesystem module for the kernel. 171 | 172 | Package: isofs-modules 173 | Depends: kernel-image, nls-core-modules 174 | Priority: standard 175 | Description: ISOFS filesystem support 176 | This package contains the ISOFS filesystem module for the kernel. 177 | 178 | Package: jffs2-modules 179 | Depends: kernel-image, zlib-modules, lzo-modules 180 | Priority: extra 181 | Description: JFFS2 filesystem support 182 | This package contains the JFFS2 filesystem module for the kernel. 183 | 184 | Package: jfs-modules 185 | Depends: kernel-image, nls-core-modules 186 | Priority: standard 187 | Description: JFS filesystem support 188 | This package contains the JFS filesystem module for the kernel. 189 | 190 | Package: ntfs-modules 191 | Depends: kernel-image, nls-core-modules 192 | Priority: extra 193 | Description: NTFS filesystem support 194 | This package contains the NTFS file system module for the kernel. 195 | 196 | Package: reiserfs-modules 197 | Depends: kernel-image 198 | Priority: extra 199 | Description: Reiser filesystem support 200 | This package contains the Reiser filesystem module for the kernel. 201 | 202 | Package: xfs-modules 203 | Depends: kernel-image 204 | Priority: standard 205 | Description: XFS filesystem support 206 | This package contains the XFS filesystem module for the kernel. 207 | 208 | Package: fat-modules 209 | Depends: kernel-image, nls-core-modules 210 | Priority: extra 211 | Description: FAT filesystem support 212 | This package contains the FAT and VFAT filesystem modules for the kernel. 213 | 214 | Package: hfs-modules 215 | Depends: kernel-image, nls-core-modules 216 | Priority: extra 217 | Description: HFS filesystem support 218 | This package contains the HFS and HFS+ filesystem modules for the kernel. 219 | 220 | Package: affs-modules 221 | Depends: kernel-image 222 | Priority: extra 223 | Description: Amiga filesystem support 224 | This package contains the Amiga filesystem module for the kernel. 225 | 226 | Package: ufs-modules 227 | Depends: kernel-image 228 | Priority: extra 229 | Description: UFS filesystem support 230 | This package contains the UFS filesystem module for the kernel. 231 | 232 | Package: zfs-modules 233 | Depends: kernel-image 234 | Priority: extra 235 | Description: ZFS filesystem support 236 | This package contains the ZFS filesystem module for the kernel. 237 | 238 | Package: qnx4-modules 239 | Depends: kernel-image 240 | Priority: extra 241 | Description: QNX4 filesystem support 242 | This package contains the QNX4 filesystem module for the kernel. 243 | 244 | Package: minix-modules 245 | Depends: kernel-image 246 | Priority: extra 247 | Description: Minix filesystem support 248 | This package contains the Minix filesystem module for the kernel. 249 | 250 | Package: nfs-modules 251 | Depends: kernel-image 252 | Priority: extra 253 | Description: NFS filesystem support 254 | This package contains the NFS filesystem module for the kernel. 255 | 256 | Package: nullfs-modules 257 | Depends: kernel-image 258 | Priority: standard 259 | Description: nullfs filesystem support 260 | This package contains the nullfs filesystem module for the kernel. 261 | 262 | Package: md-modules 263 | Depends: kernel-image 264 | Priority: extra 265 | Description: RAID and LVM support 266 | This package contains RAID and LVM modules for the kernel. 267 | 268 | Package: multipath-modules 269 | Depends: kernel-image, md-modules, scsi-core-modules 270 | Priority: extra 271 | Description: Multipath support 272 | This package contains DM-Multipath modules for the kernel. 273 | 274 | Package: usb-modules 275 | Depends: kernel-image, nls-core-modules 276 | Priority: extra 277 | Description: USB support 278 | This package contains core USB drivers for the kernel. 279 | 280 | Package: usb-storage-modules 281 | Depends: kernel-image, ide-core-modules, scsi-core-modules, usb-modules 282 | Priority: standard 283 | Description: USB storage support 284 | This package contains the USB storage driver for the kernel. 285 | 286 | Package: pcmcia-storage-modules 287 | Depends: kernel-image, ide-core-modules, cdrom-core-modules, pcmcia-modules, ata-modules 288 | Priority: standard 289 | Description: PCMCIA storage drivers 290 | This package contains PCMCIA storage drivers for the kernel. 291 | 292 | Package: brltty-modules 293 | Depends: kernel-image, usb-modules 294 | Priority: extra 295 | Description: Braille support 296 | This package contains Braille drivers for the kernel. 297 | 298 | Package: fb-modules 299 | Depends: kernel-image 300 | Priority: extra 301 | Description: Frame buffer support 302 | This package contains Frame buffer drivers for the kernel. 303 | 304 | Package: input-modules 305 | Depends: kernel-image, usb-modules 306 | Priority: extra 307 | Description: Input devices support 308 | This package contains input device drivers for the kernel. 309 | 310 | Package: event-modules 311 | Depends: kernel-image 312 | Priority: extra 313 | Description: Event support 314 | This package contains event drivers for the kernel. 315 | 316 | Package: mouse-modules 317 | Depends: kernel-image, event-modules, input-modules, usb-modules 318 | Priority: extra 319 | Description: Mouse support 320 | This package contains mouse drivers for the kernel. 321 | 322 | Package: irda-modules 323 | Depends: kernel-image, ppp-modules, usb-modules 324 | Priority: extra 325 | Description: Infrared devices support 326 | This package contains infrared device drivers for the kernel. 327 | 328 | Package: parport-modules 329 | Depends: kernel-image 330 | Priority: extra 331 | Description: Parallel port support 332 | This package contains parallel port drivers for the kernel. 333 | 334 | Package: nic-pcmcia-modules 335 | Depends: kernel-image, nic-shared-modules, nic-wireless-modules, pcmcia-modules, mmc-core-modules 336 | Priority: standard 337 | Description: Common PCMCIA NIC drivers 338 | This package contains common PCMCIA NIC drivers for the kernel. 339 | 340 | Package: pcmcia-modules 341 | Depends: kernel-image 342 | Priority: standard 343 | Description: Common PCMCIA drivers 344 | This package contains common PCMCIA drivers for the kernel. 345 | 346 | Package: nic-usb-modules 347 | Depends: kernel-image, nic-shared-modules, nic-wireless-modules, usb-modules, core-modules 348 | Priority: standard 349 | Description: USB NIC drivers 350 | This package contains USB network adapter drivers for the kernel. 351 | 352 | Package: sata-modules 353 | Depends: kernel-image, scsi-core-modules, ata-modules 354 | Priority: standard 355 | Description: SATA drivers 356 | This package contains SATA drivers for the kernel. 357 | 358 | Package: core-modules 359 | Depends: kernel-image 360 | Priority: standard 361 | Description: Core modules 362 | This package contains core modules for the kernel, that will almost 363 | always be needed. 364 | 365 | Package: acpi-modules 366 | Depends: kernel-image 367 | Priority: extra 368 | Description: ACPI support modules 369 | This package contains kernel modules for ACPI. 370 | 371 | Package: i2c-modules 372 | Depends: kernel-image 373 | Priority: extra 374 | Description: i2c support modules 375 | This package contains basic i2c support modules. 376 | 377 | Package: crc-modules 378 | Depends: kernel-image 379 | Priority: extra 380 | Description: CRC modules 381 | This package contains CRC support modules. 382 | 383 | Package: crypto-modules 384 | Depends: kernel-image 385 | Priority: extra 386 | Description: crypto modules 387 | This package contains crypto modules. 388 | 389 | Package: crypto-dm-modules 390 | Depends: kernel-image, md-modules 391 | Priority: extra 392 | Description: devicemapper crypto module 393 | This package contains the devicemapper crypto (dm-crypt) module. 394 | 395 | Package: efi-modules 396 | Depends: kernel-image 397 | Priority: extra 398 | Description: EFI modules 399 | This package contains EFI modules. 400 | 401 | Package: ata-modules 402 | Depends: kernel-image, scsi-core-modules 403 | Priority: extra 404 | Description: ATA disk modules 405 | This package contains core ATA disk modules used by both PATA and SATA 406 | disk drivers. 407 | 408 | Package: mmc-core-modules 409 | Depends: kernel-image, core-modules 410 | Priority: extra 411 | Description: MMC/SD/SDIO core modules 412 | This package contains core modules for MMC/SD/SDIO support. 413 | 414 | Package: mmc-modules 415 | Depends: kernel-image, core-modules, mmc-core-modules 416 | Priority: extra 417 | Description: MMC/SD card modules 418 | This package contains modules needed to support MMC (multimedia) and 419 | SD cards. 420 | 421 | Package: nbd-modules 422 | Depends: kernel-image 423 | Priority: extra 424 | Description: Network Block Device modules 425 | This package contains the modules required for support of the Network Block 426 | Device 427 | 428 | Package: loop-aes-modules 429 | Depends: kernel-image! 430 | Priority: extra 431 | Description: loop-AES crypto modules 432 | This package contains loop-AES crypto modules. 433 | 434 | Package: squashfs-modules 435 | Depends: kernel-image 436 | Priority: extra 437 | Description: squashfs modules 438 | This package contains squashfs modules. 439 | 440 | Package: speakup-modules 441 | Depends: kernel-image! 442 | Priority: extra 443 | Description: speakup modules 444 | This package contains speakup modules. 445 | 446 | Package: rtc-modules 447 | Depends: kernel-image 448 | Priority: extra 449 | Description: RTC modules 450 | This package contains RTC modules. 451 | 452 | Package: virtio-modules 453 | Depends: kernel-image 454 | Priority: extra 455 | Description: virtio modules 456 | This package contains virtio modules. 457 | 458 | Package: uinput-modules 459 | Depends: kernel-image 460 | Priority: extra 461 | Description: uinput support 462 | This package contains the uinput module. 463 | 464 | Package: sound-modules 465 | Depends: kernel-image, core-modules, i2c-modules, usb-modules, pcmcia-modules, firewire-core-modules, crc-modules 466 | Priority: extra 467 | Description: sound support 468 | This package contains sound modules. 469 | 470 | Package: zlib-modules 471 | Depends: kernel-image 472 | Priority: extra 473 | Description: zlib modules 474 | This package contains zlib modules. 475 | 476 | Package: lzo-modules 477 | Depends: kernel-image 478 | Priority: extra 479 | Description: lzo modules 480 | This package contains lzo modules. 481 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Sample debian/rules that uses debhelper. 3 | # GNU copyright 1997 to 1999 by Joey Hess. 4 | 5 | SHELL = bash 6 | 7 | # Uncomment this to turn on verbose mode. 8 | #export DH_VERBOSE=1 9 | 10 | DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) 11 | DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) 12 | 13 | full_version := $(shell dpkg-parsechangelog | grep ^Version: | sed -e 's/^.*: //g') 14 | tar_version := $(shell echo $(full_version) | sed -e 's/-.*//g') 15 | svn_revision := $(shell echo $(full_version) | sed -e 's/.*~svn\([0-9]*\)-[0-9]\+.*/\1/g' -e 's/^$(full_version)$$/HEAD/g') 16 | version := $(shell echo $(full_version) | sed -e 's/[~+-].*//g') 17 | major := $(shell echo $(version) | sed -e 's/\..*//g') 18 | revision := $(shell echo $(full_version) | sed -e 's/^[^+-]*//g') 19 | cpu := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) 20 | config_files := $(wildcard debian/arch/$(cpu)/*.config) 21 | flavours := $(config_files:debian/arch/$(cpu)/%.config=%) 22 | abiname := 0 23 | ld_target := $(shell ld --help | sed -ne "s/[^ :]*: supported targets: \([^ ]*\) .*/\1/p") 24 | clang_version := $(shell test -e CLANG_VERSION && cat CLANG_VERSION) 25 | 26 | ifeq ($(cpu), mipsel) 27 | kfreebsd_cpu := mips 28 | else 29 | kfreebsd_cpu := $(cpu) 30 | endif 31 | 32 | #SVN := https://svn.freebsd.org/base/release/$(version).0 33 | #SVN := https://svn.freebsd.org/base/releng/$(version) 34 | #SVN := https://svn.freebsd.org/base/stable/$(major) 35 | SVN := https://svn.freebsd.org/base/head 36 | SOURCE_PACKAGE := $(CURDIR)/debian/kfreebsd-source-$(version) 37 | IMAGE_PACKAGE := $(CURDIR)/debian/kfreebsd-image-$(version)-$(abiname) 38 | HEADERS_PACKAGE := $(CURDIR)/debian/kfreebsd-headers-$(version)-$(abiname) 39 | SRC_TAR := kfreebsd-source-$(version).tar.xz 40 | SRC_DIR := kfreebsd-source-$(version) 41 | HEADERS_DIR := kfreebsd-headers-$(version)-$(abiname) 42 | ORIG_DIR := kfreebsd-$(major)-$(tar_version) 43 | ORIG_TAR := kfreebsd-$(major)_$(tar_version).orig.tar.xz 44 | PATH := /usr/lib/freebsd:$(PATH) 45 | SOURCE_DATE_EPOCH ?= $(shell date -d "$$(dpkg-parsechangelog -SDate)" +%s) 46 | 47 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) 48 | NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) 49 | 50 | # Do not mess with MAKEFLAGS until we transfer control to BSD make (see below) 51 | BSD_MAKEFLAGS += -j$(NUMJOBS) 52 | endif 53 | 54 | # Whether to enable extra debug features, at the expense of performance 55 | # Not recommended for release builds 56 | # Putting ~debug in the Version field enables this automatically 57 | ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS))$(findstring ~debug,$(full_version))) 58 | debug_config := sys/conf/DEBIAN_DEBUG 59 | else 60 | debug_config := sys/conf/DEBIAN_NODEBUG 61 | endif 62 | 63 | MAKE := \ 64 | MAKEFLAGS=$(BSD_MAKEFLAGS) \ 65 | bmake \ 66 | MACHINE_ARCH=$(kfreebsd_cpu) \ 67 | -DWITHOUT_SOURCELESS \ 68 | -DWITHOUT_FORMAT_EXTENSIONS 69 | 70 | # Clang is the default compiler on these architectures (see src/share/mk/src.opts.mk) 71 | clang_cpus := # i386 amd64 arm 72 | 73 | ifneq (, $(clang_version)) 74 | ifeq (, $(filter 3.7.%, $(clang_version))) 75 | $(error Upstream is now using a different Clang version than we expected. Consider updating cc_pkg and cc_cmd) 76 | endif 77 | endif 78 | 79 | # Experimentally build all arches with GCC for now 80 | cc_pkg := gcc-5 81 | #cc_pkg := clang-3.7 [$(foreach cpu,$(clang_cpus),any-$(cpu))], \ 82 | # gcc-5 [$(foreach cpu,$(clang_cpus),!any-$(cpu))] 83 | 84 | ifneq (, $(filter $(clang_cpus), $(DEB_HOST_ARCH_CPU))) 85 | cc_cmd := clang-3.7 86 | else 87 | cc_cmd := gcc-5 88 | endif 89 | 90 | ifneq (, $(filter clang-%, $(cc_cmd))) 91 | MAKE += -DWITH_CLANG_IS_CC 92 | MAKE += COMPILER_TYPE=clang 93 | MAKE += COMPILER_VERSION=30701 94 | else 95 | MAKE += -DWITHOUT_CLANG_IS_CC 96 | MAKE += COMPILER_TYPE=gcc 97 | MAKE += COMPILER_VERSION=40901 98 | MAKE += WERROR= 99 | endif 100 | 101 | # Disable install of *.ko.symbols files (their presence would trigger an 102 | # "unstripped-binary-or-object" lintian error). 103 | MAKE += -DWITHOUT_KERNEL_SYMBOLS 104 | 105 | get-orig-source: 106 | rm -rf $(ORIG_DIR) 107 | svn export --ignore-keywords -r $(svn_revision) $(SVN)/sys $(ORIG_DIR)/sys 108 | # The Clang version used by upstream 109 | svn cat -r $(svn_revision) $(SVN)/lib/clang/include/clang/Basic/Version.inc \ 110 | | sed -ne 's/.*\sCLANG_VERSION\s\+//p' \ 111 | > $(ORIG_DIR)/CLANG_VERSION 112 | cd $(ORIG_DIR) && $(CURDIR)/debian/prune.sh 113 | # Replace file with a DFSG-free re-implementation 114 | cp -af debian/local/ar9300_devid.h $(ORIG_DIR)/sys/contrib/dev/ath/ath_hal/ar9300/ 115 | cp -af debian/local/ar9300_devid.h $(ORIG_DIR)/sys/dev/ath/ath_hal/ar9003/ 116 | # Clamp timestamps to be no newer than last changelog entry, see 117 | # https://wiki.debian.org/ReproducibleBuilds/TimestampsInTarball 118 | find $(ORIG_DIR) -newermt "@$(SOURCE_DATE_EPOCH)" -print0 \ 119 | | xargs -0r touch --no-dereference --date="@$(SOURCE_DATE_EPOCH)" 120 | # Create tarball with files sorted in a stable order, see 121 | # https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs 122 | find $(ORIG_DIR) -print0 | LC_ALL=C sort -z \ 123 | | tar --null --no-recursion --files-from - \ 124 | --numeric-owner --owner 0 --group 0 \ 125 | -cJf ../$(ORIG_TAR) 126 | rm -rf $(ORIG_DIR) 127 | 128 | control: clean 129 | for arch in `ls $(CURDIR)/debian/arch/` ; do \ 130 | KW_CONFIG_DIR=debian/installer/$$arch ; \ 131 | if test -e $$KW_CONFIG_DIR ; then \ 132 | for config in `ls $(CURDIR)/debian/arch/$$arch/ | grep \.config` ; do \ 133 | flavor=$${config/.config/} ; \ 134 | if test -e debian/arch/$$arch/$$flavor.installer ; then \ 135 | echo "kfreebsd-$$arch $(version)-$(abiname) $$flavor $(version)-$(abiname)-$$flavor - -" ; \ 136 | fi ; \ 137 | done > $$KW_CONFIG_DIR/kernel-versions ; \ 138 | fi ; \ 139 | echo ; \ 140 | done 141 | sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" \ 142 | -e "s/@cc_pkg@/$(cc_pkg)/g" \ 143 | $(CURDIR)/debian/control.in > $(CURDIR)/debian/control 144 | echo >> $(CURDIR)/debian/control 145 | for arch in `ls $(CURDIR)/debian/arch/` ; do \ 146 | for config in `ls $(CURDIR)/debian/arch/$$arch/ | grep \.config` ; do \ 147 | flavor=$${config/.config/} ; \ 148 | recommends= ; \ 149 | test -f $(CURDIR)/debian/arch/$$arch/$$flavor.defines && recommends=`awk '/^Recommends: / {print $$2}' $(CURDIR)/debian/arch/$$arch/$$flavor.defines` ; \ 150 | sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" -e "s/@arch@/$$arch/g" -e "s/@recommends@/$$recommends/g" \ 151 | $(CURDIR)/debian/control.flavor.in ; \ 152 | echo ; \ 153 | done ; \ 154 | export KW_DEFCONFIG_DIR=debian/installer ; \ 155 | export KW_CONFIG_DIR=debian/installer/$$arch ; \ 156 | if test -e $$KW_CONFIG_DIR/kernel-versions ; then \ 157 | kernel-wedge gen-control ; \ 158 | fi ; \ 159 | echo ; \ 160 | done >> $(CURDIR)/debian/control 161 | 162 | clean: 163 | dh_testdir 164 | dh_testroot 165 | rm -rf kfreebsd-source-* sys/*/compile/* sys/*/conf/*.config 166 | find sys/modules/ \( -name '*.o' -o -name '*.ko' -o -name '*.so' -o -name 'export_syms' \) -delete 167 | find sys/modules/ -type l -delete 168 | rm -f debian/kfreebsd-image-*.{preinst,prerm,postinst,postrm} 169 | 170 | rm -f *-stamp 171 | dh_clean 172 | 173 | build-indep: build-indep-stamp 174 | build-indep-stamp: 175 | dh_testdir 176 | 177 | # Compile objects with relative, not absolute paths, to avoid embedding 178 | # full build tree paths into modules (Bug #757629) 179 | find sys/modules/ \ 180 | \( -name Makefile -o -name Makefile.inc \) \ 181 | -exec sed -i 's@$${.CURDIR}/@@g' \{\} \; 182 | 183 | mkdir -p $(SRC_DIR) 184 | cp -af sys $(SRC_DIR)/ 185 | 186 | touch build-indep-stamp 187 | 188 | build: build-arch build-indep 189 | 190 | install-indep: install-indep-stamp 191 | install-indep-stamp: build-indep 192 | dh_testdir 193 | dh_testroot 194 | dh_clean -k -i 195 | dh_installdirs -i 196 | 197 | mkdir -p $(SOURCE_PACKAGE)/usr/src 198 | chown -R root.src $(SRC_DIR) 199 | # Clamp timestamps to be no newer than last changelog entry, see 200 | # https://wiki.debian.org/ReproducibleBuilds/TimestampsInTarball 201 | find $(SRC_DIR) -newermt "@$(SOURCE_DATE_EPOCH)" -print0 \ 202 | | xargs -0r touch --no-dereference --date="@$(SOURCE_DATE_EPOCH)" 203 | # Create tarball with files sorted in a stable order, see 204 | # https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs 205 | # and normalised file permissions regardless of umask, see 206 | # https://wiki.debian.org/ReproducibleBuilds/VaryingPermissionsInTarballs 207 | find $(SRC_DIR) -print0 | LC_ALL=C sort -z \ 208 | | tar --null --no-recursion --files-from - \ 209 | --mode=go=rX,u+rw,a-s \ 210 | -cJf $(SOURCE_PACKAGE)/usr/src/$(SRC_TAR) 211 | 212 | touch install-indep-stamp 213 | 214 | build-arch: $(foreach flavor,$(flavours),build-flavor-$(flavor)-stamp) 215 | # Anti-dependency on build-indep (it needs a pristine build directory) 216 | build-flavor-%-stamp: build-indep 217 | # Configure the kernel 218 | cat \ 219 | debian/arch/$(cpu)/$*.config \ 220 | $(debug_config) \ 221 | > sys/$(kfreebsd_cpu)/conf/$*.config 222 | cd sys/$(kfreebsd_cpu)/conf && config $*.config 223 | 224 | # Change ident to the kernel version 225 | sed -i -e 's/^KERN_IDENT=.*/KERN_IDENT=Debian $* ($(full_version))/g' \ 226 | sys/$(kfreebsd_cpu)/compile/$*.config/Makefile 227 | 228 | # Build it 229 | $(MAKE) \ 230 | BRANCH_OVERRIDE="$(abiname)-$*" \ 231 | CC=$(cc_cmd) \ 232 | -C sys/$(kfreebsd_cpu)/compile/$*.config/ \ 233 | depend all 234 | 235 | touch build-flavor-$*-stamp 236 | 237 | install-common-stamp: 238 | dh_testdir 239 | dh_testroot 240 | dh_clean -k -p$(HEADERS_PACKAGE) 241 | 242 | mkdir -p $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) 243 | find sys -type f -name "*.h" -not -regex ".*modules.*" -not -regex ".*sys/$(kfreebsd_cpu)/.*" -exec cp --parents {} $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) \; 244 | 245 | mkdir -p $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)/conf 246 | cp --parents \ 247 | sys/conf/kern.mk \ 248 | sys/conf/kmod.mk \ 249 | sys/conf/kmod_syms.awk \ 250 | sys/kern/bus_if.m \ 251 | sys/dev/pci/pci_if.m \ 252 | sys/kern/device_if.m \ 253 | sys/kern/vnode_if.src \ 254 | sys/tools/vnode_if.awk \ 255 | sys/tools/makeobjops.awk \ 256 | $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) 257 | 258 | find $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) -type f -exec chmod 644 {} \; 259 | find $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) -type f -name "*.awk" -exec chmod 755 {} \; 260 | 261 | touch install-common-stamp 262 | 263 | install-arch: $(foreach flavor,$(flavours),install-flavor-$(flavor)-stamp) install-udeb-stamp 264 | install-flavor-%-stamp: install-common-stamp build-flavor-%-stamp 265 | dh_testdir 266 | dh_testroot 267 | dh_clean -k -pkfreebsd-image-$(version)-$(abiname)-$* 268 | 269 | # make the install target happy 270 | mkdir -p $(IMAGE_PACKAGE)-$*/boot 271 | install -o root -g root -m 644 \ 272 | sys/$(kfreebsd_cpu)/conf/GENERIC.hints \ 273 | $(IMAGE_PACKAGE)-$*/boot/device.hints || touch $(IMAGE_PACKAGE)-$*/boot/device.hints 274 | install -o root -g root -m 644 \ 275 | sys/boot/forth/loader.conf \ 276 | $(IMAGE_PACKAGE)-$*/boot/loader.conf 277 | mkdir -p $(IMAGE_PACKAGE)-$*/boot/defaults 278 | install -o root -g root -m 644 \ 279 | sys/boot/forth/loader.conf \ 280 | $(IMAGE_PACKAGE)-$*/boot/defaults/loader.conf 281 | 282 | # install the config file 283 | install -o root -g root -m 644 \ 284 | sys/$(kfreebsd_cpu)/conf/$*.config \ 285 | $(IMAGE_PACKAGE)-$*/boot/config-$(version)-$(abiname)-$* 286 | 287 | # now install the kernel 288 | $(MAKE) CC=$(cc_cmd) -C sys/$(kfreebsd_cpu)/compile/$*.config DESTDIR=$(IMAGE_PACKAGE)-$* install 289 | 290 | # relocate kernel image 291 | mv \ 292 | $(IMAGE_PACKAGE)-$*/boot/kernel/kernel \ 293 | $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$* 294 | chmod 644 $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$* 295 | gzip -9 -n $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$* 296 | 297 | # relocate module dir (sans kernel image) 298 | mkdir -p $(IMAGE_PACKAGE)-$*/lib/modules $(IMAGE_PACKAGE)-$*/boot/modules 299 | mv \ 300 | $(IMAGE_PACKAGE)-$*/boot/kernel \ 301 | $(IMAGE_PACKAGE)-$*/boot/modules/$(version)-$(abiname)-$* 302 | -chmod 644 $(IMAGE_PACKAGE)-$*/boot/modules/$(version)-$(abiname)-$*/* 303 | ln -s \ 304 | ../../boot/modules/$(version)-$(abiname)-$* \ 305 | $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$* 306 | 307 | ifeq ($(DEB_HOST_ARCH_OS), kfreebsd) 308 | # Assert linker.hints presence (upstream build system silently skips it when 309 | # it can't find kldxref). 310 | test -e $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/linker.hints 311 | endif 312 | 313 | # remove loader.conf (part of kfreebsd-loader) 314 | rm -f $(IMAGE_PACKAGE)-$*/boot/loader.conf 315 | rm -rf $(IMAGE_PACKAGE)-$*/boot/defaults 316 | 317 | # remove device.hints (built into kernel) 318 | rm -f $(IMAGE_PACKAGE)-$*/boot/device.hints 319 | 320 | # README file 321 | mkdir -p $(IMAGE_PACKAGE)-$*/usr/share/doc/kfreebsd-image-$(version)-$(abiname)-$* 322 | install -p -o root -g root -m 644 \ 323 | debian/kfreebsd-image.README.Debian \ 324 | $(IMAGE_PACKAGE)-$*/usr/share/doc/kfreebsd-image-$(version)-$(abiname)-$*/README.Debian 325 | 326 | # override file 327 | mkdir -p $(IMAGE_PACKAGE)-$*/usr/share/lintian/overrides 328 | install -p -o root -g root -m 644 \ 329 | debian/kfreebsd-image.overrides \ 330 | $(IMAGE_PACKAGE)-$*/usr/share/lintian/overrides/kfreebsd-image-$(version)-$(abiname)-$* 331 | 332 | # scripts 333 | for script in preinst prerm postinst postrm ; do \ 334 | sed -e "s/@VERSION@/$(version)/g" \ 335 | -e "s/@RELEASE@/$(version)-$(abiname)-$*/g" \ 336 | debian/kfreebsd-image.$$script.in \ 337 | > debian/kfreebsd-image-$(version)-$(abiname)-$*.$$script ; \ 338 | done 339 | 340 | # headers package 341 | mkdir -p $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(kfreebsd_cpu) 342 | cd sys/$(kfreebsd_cpu) \ 343 | && find . -type f -name "*.h" -not -regex ".*modules.*" -exec cp --parents {} $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(kfreebsd_cpu) \; \ 344 | && cp -d --parents compile/$*.config/machine $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(kfreebsd_cpu) \ 345 | && cp -d --parents conf/$*.config $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(kfreebsd_cpu) 346 | find $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(kfreebsd_cpu) -type f -exec chmod 644 {} \; 347 | for dir in `ls $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)/sys` ; do \ 348 | ln -s ../../$(HEADERS_DIR)/sys/$$dir $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$$dir ; \ 349 | done 350 | ln -s $(kfreebsd_cpu)/include $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/machine 351 | 352 | touch install-flavor-$*-stamp 353 | 354 | install-udeb-stamp: $(foreach flavor,$(flavours),install-flavor-$(flavor)-stamp) 355 | ifeq ($(DEB_HOST_ARCH_OS), kfreebsd) 356 | dh_testdir 357 | dh_testroot 358 | for i in debian/arch/$(DEB_HOST_ARCH_CPU)/*.installer ; do \ 359 | subarch=`basename $$i .installer` ; \ 360 | dh_clean -k -pkernel-image-$(version)-$(abiname)-$${subarch}-di ; \ 361 | done 362 | 363 | export KW_DEFCONFIG_DIR=debian/installer ; \ 364 | KW_CONFIG_DIR=debian/installer/$(DEB_HOST_ARCH_CPU) kernel-wedge install-files \ 365 | $(version)-$(abiname) debian/installer/$(DEB_HOST_ARCH_CPU) 366 | 367 | for i in debian/arch/$(DEB_HOST_ARCH_CPU)/*.installer ; do \ 368 | subarch=`basename $$i .installer` ; \ 369 | # override file \n\ 370 | mkdir -p $(CURDIR)/debian/zlib-modules-$(version)-$(abiname)-$${subarch}-di/usr/share/lintian/overrides ; \ 371 | install -p -o root -g root -m 644 \ 372 | debian/zlib-modules.overrides \ 373 | $(CURDIR)/debian/zlib-modules-$(version)-$(abiname)-$${subarch}-di/usr/share/lintian/overrides/zlib-modules-$(version)-$(abiname)-$${subarch}-di ; \ 374 | \ 375 | # fixup kernel path (so that this udeb can be installed alongside other major versions of kfreebsd) \n\ 376 | mv debian/kernel-image-$(version)-$(abiname)-$${subarch}-di/boot/kfreebsd{,-$(major)}.gz ; \ 377 | done 378 | endif 379 | touch $@ 380 | 381 | 382 | # Build architecture-independent files here. 383 | binary-indep: install-indep 384 | dh_testdir 385 | dh_testroot 386 | dh_installdocs -i 387 | dh_installchangelogs -i 388 | dh_link -i 389 | dh_strip -i 390 | dh_compress -i 391 | dh_fixperms -i 392 | dh_makeshlibs -i 393 | dh_installdeb -i 394 | dh_shlibdeps -i 395 | dh_gencontrol -i 396 | dh_md5sums -i 397 | dh_builddeb -i 398 | 399 | # Build architecture-dependent files here. 400 | binary-arch: install-arch 401 | dh_testdir 402 | dh_testroot 403 | dh_installdocs -s 404 | dh_installchangelogs -s 405 | dh_link -s 406 | dh_strip -s -X/boot 407 | dh_compress -s 408 | dh_fixperms -s 409 | dh_makeshlibs -s 410 | dh_installdeb -s 411 | dh_shlibdeps -s -X/boot 412 | dh_gencontrol -s 413 | dh_md5sums -s 414 | dh_builddeb -s -- -Zxz 415 | 416 | binary: binary-indep binary-arch 417 | 418 | .PHONY: clean build build-indep 419 | .PHONY: binary-indep binary-arch binary-indep binary-arch binary 420 | -------------------------------------------------------------------------------- /debian/patches/userland.diff: -------------------------------------------------------------------------------- 1 | Staging area for fixes needed by userland. 2 | 3 | --- a/sys/mips/include/_types.h 4 | +++ b/sys/mips/include/_types.h 5 | @@ -94,10 +94,14 @@ 6 | typedef __int32_t __int_least32_t; 7 | typedef __int64_t __int_least64_t; 8 | #if defined(__mips_n64) || defined(__mips_n32) 9 | +# ifdef __FreeBSD__ 10 | typedef __int64_t __register_t; 11 | +# endif 12 | typedef __int64_t f_register_t; 13 | #else 14 | +# ifdef __FreeBSD__ 15 | typedef __int32_t __register_t; 16 | +# endif 17 | typedef __int32_t f_register_t; 18 | #endif 19 | #ifdef __mips_n64 20 | --- a/sys/powerpc/include/_types.h 21 | +++ b/sys/powerpc/include/_types.h 22 | @@ -94,7 +94,9 @@ 23 | typedef __int64_t __int_least64_t; 24 | #ifdef __LP64__ 25 | typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ 26 | +#ifdef __FreeBSD__ 27 | typedef __int64_t __register_t; 28 | +#endif 29 | typedef __int64_t __segsz_t; /* segment size (in pages) */ 30 | typedef __uint64_t __size_t; /* sizeof() */ 31 | typedef __int64_t __ssize_t; /* byte count or error */ 32 | @@ -103,7 +105,9 @@ 33 | typedef __uint64_t __uintptr_t; 34 | #else 35 | typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ 36 | +#ifdef __FreeBSD__ 37 | typedef __int32_t __register_t; 38 | +#endif 39 | typedef __int32_t __segsz_t; /* segment size (in pages) */ 40 | typedef __uint32_t __size_t; /* sizeof() */ 41 | typedef __int32_t __ssize_t; /* byte count or error */ 42 | --- a/sys/sparc64/include/_types.h 43 | +++ b/sys/sparc64/include/_types.h 44 | @@ -70,7 +70,9 @@ 45 | typedef __int32_t __int_least32_t; 46 | typedef __int64_t __int_least64_t; 47 | typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ 48 | +#ifdef __FreeBSD__ 49 | typedef __int64_t __register_t; 50 | +#endif 51 | typedef __int64_t __segsz_t; /* segment size (in pages) */ 52 | typedef __uint64_t __size_t; /* sizeof() */ 53 | typedef __int64_t __ssize_t; /* byte count or error */ 54 | --- a/sys/sys/_timespec.h 55 | +++ b/sys/sys/_timespec.h 56 | @@ -41,9 +41,14 @@ 57 | #define _TIME_T_DECLARED 58 | #endif 59 | 60 | +#ifndef __FreeBSD__ 61 | +#define __need_timespec 62 | +#include 63 | +#else 64 | struct timespec { 65 | time_t tv_sec; /* seconds */ 66 | long tv_nsec; /* and nanoseconds */ 67 | }; 68 | +#endif 69 | 70 | #endif /* !_SYS__TIMESPEC_H_ */ 71 | --- a/sys/sys/_timeval.h 72 | +++ b/sys/sys/_timeval.h 73 | @@ -41,6 +41,10 @@ 74 | #define _TIME_T_DECLARED 75 | #endif 76 | 77 | +#ifndef __FreeBSD__ 78 | +#define __need_timeval 79 | +#include 80 | +#else 81 | /* 82 | * Structure returned by gettimeofday(2) system call, and used in other calls. 83 | */ 84 | @@ -48,5 +52,6 @@ 85 | time_t tv_sec; /* seconds */ 86 | suseconds_t tv_usec; /* and microseconds */ 87 | }; 88 | +#endif 89 | 90 | #endif /* !_SYS__TIMEVAL_H_ */ 91 | --- a/sys/sys/_types.h 92 | +++ b/sys/sys/_types.h 93 | @@ -39,10 +39,19 @@ 94 | typedef __int64_t __blkcnt_t; /* file block count */ 95 | typedef __int32_t __clockid_t; /* clock_gettime()... */ 96 | typedef __uint32_t __fflags_t; /* file flags */ 97 | +#if defined(__GLIBC__) && !defined(_KERNEL) 98 | +/* User-selectable types. Leave them to Glibc headers. */ 99 | +#else 100 | typedef __uint64_t __fsblkcnt_t; 101 | typedef __uint64_t __fsfilcnt_t; 102 | +#endif 103 | typedef __uint32_t __gid_t; 104 | +#if defined(__GLIBC__) && !defined(_KERNEL) 105 | +/* This divergence is probably accidental, but it can't be fixed now. */ 106 | +typedef __uint32_t __id_t; 107 | +#else 108 | typedef __int64_t __id_t; /* can hold a gid_t, pid_t, or uid_t */ 109 | +#endif 110 | typedef __uint32_t __ino_t; /* inode number */ 111 | typedef long __key_t; /* IPC key (for Sys V IPC) */ 112 | typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */ 113 | @@ -58,7 +67,11 @@ 114 | typedef __uint8_t __sa_family_t; 115 | typedef __uint32_t __socklen_t; 116 | typedef long __suseconds_t; /* microseconds (signed) */ 117 | +#if defined(__GLIBC__) && !defined(_KERNEL) 118 | +typedef __int32_t __timer_t; 119 | +#else 120 | typedef struct __timer *__timer_t; /* timer_gettime()... */ 121 | +#endif 122 | typedef struct __mq *__mqd_t; /* mq_open()... */ 123 | typedef __uint32_t __uid_t; 124 | typedef unsigned int __useconds_t; /* microseconds (unsigned) */ 125 | @@ -107,10 +120,14 @@ 126 | * mbstate_t is an opaque object to keep conversion state during multibyte 127 | * stream conversions. 128 | */ 129 | +#if defined(__GLIBC__) && !defined(_KERNEL) 130 | +/* Defined in */ 131 | +#else 132 | typedef union { 133 | char __mbstate8[128]; 134 | __int64_t _mbstateL; /* for alignment */ 135 | } __mbstate_t; 136 | +#endif 137 | 138 | typedef unsigned long __rman_res_t; 139 | 140 | --- a/sys/sys/elf32.h 141 | +++ b/sys/sys/elf32.h 142 | @@ -31,15 +31,21 @@ 143 | 144 | #include 145 | 146 | +#ifndef __FreeBSD__ 147 | +#include 148 | +#endif 149 | + 150 | /* 151 | * ELF definitions common to all 32-bit architectures. 152 | */ 153 | 154 | +#ifdef __FreeBSD__ 155 | typedef uint32_t Elf32_Addr; 156 | typedef uint16_t Elf32_Half; 157 | typedef uint32_t Elf32_Off; 158 | typedef int32_t Elf32_Sword; 159 | typedef uint32_t Elf32_Word; 160 | +#endif 161 | typedef uint64_t Elf32_Lword; 162 | 163 | typedef Elf32_Word Elf32_Hashelt; 164 | @@ -48,6 +54,7 @@ 165 | typedef Elf32_Word Elf32_Size; 166 | typedef Elf32_Sword Elf32_Ssize; 167 | 168 | +#ifdef __FreeBSD__ 169 | /* 170 | * ELF header. 171 | */ 172 | @@ -177,6 +184,8 @@ 173 | #define ELF32_M_SIZE(info) ((unsigned char)(info)) 174 | #define ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) 175 | 176 | +#endif 177 | + 178 | /* 179 | * Hardware/Software capabilities entry 180 | */ 181 | @@ -188,6 +197,7 @@ 182 | } c_un; 183 | } Elf32_Cap; 184 | 185 | +#ifdef __FreeBSD__ 186 | /* 187 | * Symbol table entries. 188 | */ 189 | @@ -246,12 +256,15 @@ 190 | Elf32_Word vna_name; 191 | Elf32_Word vna_next; 192 | } Elf32_Vernaux; 193 | +#endif 194 | 195 | typedef Elf32_Half Elf32_Versym; 196 | 197 | +#ifdef __FreeBSD__ 198 | typedef struct { 199 | Elf32_Half si_boundto; /* direct bindings - symbol bound to */ 200 | Elf32_Half si_flags; /* per symbol flags */ 201 | } Elf32_Syminfo; 202 | +#endif 203 | 204 | #endif /* !_SYS_ELF32_H_ */ 205 | --- a/sys/sys/elf64.h 206 | +++ b/sys/sys/elf64.h 207 | @@ -31,18 +31,26 @@ 208 | 209 | #include 210 | 211 | +#ifndef __FreeBSD__ 212 | +#include 213 | +#endif 214 | + 215 | /* 216 | * ELF definitions common to all 64-bit architectures. 217 | */ 218 | 219 | +#ifdef __FreeBSD__ 220 | typedef uint64_t Elf64_Addr; 221 | typedef uint16_t Elf64_Half; 222 | typedef uint64_t Elf64_Off; 223 | typedef int32_t Elf64_Sword; 224 | typedef int64_t Elf64_Sxword; 225 | typedef uint32_t Elf64_Word; 226 | +#endif 227 | typedef uint64_t Elf64_Lword; 228 | +#ifdef __FreeBSD__ 229 | typedef uint64_t Elf64_Xword; 230 | +#endif 231 | 232 | /* 233 | * Types of dynamic symbol hash table bucket and chain elements. 234 | @@ -57,6 +65,7 @@ 235 | typedef Elf64_Xword Elf64_Size; 236 | typedef Elf64_Sxword Elf64_Ssize; 237 | 238 | +#ifdef __FreeBSD__ 239 | /* 240 | * ELF header. 241 | */ 242 | @@ -184,6 +193,8 @@ 243 | #define ELF64_M_SIZE(info) ((unsigned char)(info)) 244 | #define ELF64_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) 245 | 246 | +#endif 247 | + 248 | /* 249 | * Hardware/Software capabilities entry 250 | */ 251 | @@ -195,6 +206,7 @@ 252 | } c_un; 253 | } Elf64_Cap; 254 | 255 | +#ifdef __FreeBSD__ 256 | /* 257 | * Symbol table entries. 258 | */ 259 | @@ -249,12 +261,15 @@ 260 | Elf64_Word vna_name; 261 | Elf64_Word vna_next; 262 | } Elf64_Vernaux; 263 | +#endif 264 | 265 | typedef Elf64_Half Elf64_Versym; 266 | 267 | +#ifdef __FreeBSD__ 268 | typedef struct { 269 | Elf64_Half si_boundto; /* direct bindings - symbol bound to */ 270 | Elf64_Half si_flags; /* per symbol flags */ 271 | } Elf64_Syminfo; 272 | +#endif 273 | 274 | #endif /* !_SYS_ELF64_H_ */ 275 | --- a/sys/sys/endian.h 276 | +++ b/sys/sys/endian.h 277 | @@ -53,6 +53,10 @@ 278 | #define _UINT64_T_DECLARED 279 | #endif 280 | 281 | +#if !defined(_KERNEL) && defined(__GLIBC__) 282 | +/* Avoid conflicting (but functionally equivalent) definitions below. */ 283 | +#include 284 | +#else 285 | /* 286 | * General byte order swapping functions. 287 | */ 288 | @@ -93,6 +97,7 @@ 289 | #define le32toh(x) bswap32((x)) 290 | #define le64toh(x) bswap64((x)) 291 | #endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ 292 | +#endif 293 | 294 | /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ 295 | 296 | --- a/sys/sys/limits.h 297 | +++ b/sys/sys/limits.h 298 | @@ -35,6 +35,11 @@ 299 | #include 300 | #include 301 | 302 | +#ifndef __FreeBSD__ 303 | +#include 304 | +#endif 305 | + 306 | +#ifdef __FreeBSD__ 307 | #define CHAR_BIT __CHAR_BIT /* number of bits in a char */ 308 | 309 | #define SCHAR_MAX __SCHAR_MAX /* max value for a signed char */ 310 | @@ -71,15 +76,16 @@ 311 | #if __POSIX_VISIBLE || __XSI_VISIBLE 312 | #define SSIZE_MAX __SSIZE_MAX /* max value for an ssize_t */ 313 | #endif 314 | +#endif /* 0 */ 315 | 316 | -#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 317 | +#if 1 318 | #define SIZE_T_MAX __SIZE_T_MAX /* max value for a size_t */ 319 | 320 | #define OFF_MAX __OFF_MAX /* max value for an off_t */ 321 | #define OFF_MIN __OFF_MIN /* min value for an off_t */ 322 | #endif 323 | 324 | -#if __BSD_VISIBLE 325 | +#if 1 326 | #define GID_MAX UINT_MAX /* max value for a gid_t */ 327 | #define UID_MAX UINT_MAX /* max value for a uid_t */ 328 | 329 | --- a/sys/sys/param.h 330 | +++ b/sys/sys/param.h 331 | @@ -40,9 +40,15 @@ 332 | 333 | #include 334 | 335 | +#ifndef __FreeBSD__ 336 | +#include 337 | +#endif 338 | + 339 | +#ifdef __FreeBSD__ 340 | #define BSD 199506 /* System version (year & month). */ 341 | -#define BSD4_3 1 342 | -#define BSD4_4 1 343 | +#define BSD4_3 1 344 | +#define BSD4_4 1 345 | +#endif 346 | 347 | /* 348 | * __FreeBSD_version numbers are documented in the Porter's Handbook. 349 | @@ -99,11 +105,15 @@ 350 | #include 351 | 352 | #define MAXCOMLEN 19 /* max command name remembered */ 353 | +#ifdef __FreeBSD__ 354 | #define MAXINTERP PATH_MAX /* max interpreter file name length */ 355 | +#endif 356 | #define MAXLOGNAME 33 /* max login name length (incl. NUL) */ 357 | #define MAXUPRC CHILD_MAX /* max simultaneous processes */ 358 | #define NCARGS ARG_MAX /* max bytes for an exec function */ 359 | +#ifdef __FreeBSD__ 360 | #define NGROUPS (NGROUPS_MAX+1) /* max number groups */ 361 | +#endif 362 | #define NOFILE OPEN_MAX /* max open files per process */ 363 | #define NOGROUP 65535 /* marker for empty group set member */ 364 | #define MAXHOSTNAMELEN 256 /* max hostname size */ 365 | @@ -140,7 +150,9 @@ 366 | #ifndef DEV_BSHIFT 367 | #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ 368 | #endif 369 | +#ifdef __FreeBSD__ 370 | #define DEV_BSIZE (1< 430 | +#endif 431 | 432 | #include 433 | 434 | @@ -187,10 +191,12 @@ 435 | 436 | #define SLIST_FIRST(head) ((head)->slh_first) 437 | 438 | +#if !defined(__GLIBC__) || defined(_KERNEL) 439 | #define SLIST_FOREACH(var, head, field) \ 440 | for ((var) = SLIST_FIRST((head)); \ 441 | (var); \ 442 | (var) = SLIST_NEXT((var), field)) 443 | +#endif 444 | 445 | #define SLIST_FOREACH_FROM(var, head, field) \ 446 | for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \ 447 | @@ -212,6 +218,7 @@ 448 | ((var) = *(varp)) != NULL; \ 449 | (varp) = &SLIST_NEXT((var), field)) 450 | 451 | +#if !defined(__GLIBC__) || defined(_KERNEL) 452 | #define SLIST_INIT(head) do { \ 453 | SLIST_FIRST((head)) = NULL; \ 454 | } while (0) 455 | @@ -225,9 +232,11 @@ 456 | SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ 457 | SLIST_FIRST((head)) = (elm); \ 458 | } while (0) 459 | +#endif 460 | 461 | #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) 462 | 463 | +#if !defined(__GLIBC__) || defined(_KERNEL) 464 | #define SLIST_REMOVE(head, elm, type, field) do { \ 465 | QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ 466 | if (SLIST_FIRST((head)) == (elm)) { \ 467 | @@ -241,7 +250,9 @@ 468 | } \ 469 | TRASHIT(*oldnext); \ 470 | } while (0) 471 | +#endif 472 | 473 | +#if !defined(__GLIBC__) || defined(_KERNEL) 474 | #define SLIST_REMOVE_AFTER(elm, field) do { \ 475 | SLIST_NEXT(elm, field) = \ 476 | SLIST_NEXT(SLIST_NEXT(elm, field), field); \ 477 | @@ -250,6 +261,7 @@ 478 | #define SLIST_REMOVE_HEAD(head, field) do { \ 479 | SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ 480 | } while (0) 481 | +#endif 482 | 483 | #define SLIST_SWAP(head1, head2, type) do { \ 484 | QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \ 485 | @@ -272,8 +284,10 @@ 486 | class type **stqh_last; /* addr of last next element */ \ 487 | } 488 | 489 | +#if defined(__FreeBSD__) || defined(_KERNEL) 490 | #define STAILQ_HEAD_INITIALIZER(head) \ 491 | { NULL, &(head).stqh_first } 492 | +#endif 493 | 494 | #define STAILQ_ENTRY(type) \ 495 | struct { \ 496 | @@ -288,6 +302,7 @@ 497 | /* 498 | * Singly-linked Tail queue functions. 499 | */ 500 | +#if !defined(__GLIBC__) || defined(_KERNEL) 501 | #define STAILQ_CONCAT(head1, head2) do { \ 502 | if (!STAILQ_EMPTY((head2))) { \ 503 | *(head1)->stqh_last = (head2)->stqh_first; \ 504 | @@ -295,36 +310,44 @@ 505 | STAILQ_INIT((head2)); \ 506 | } \ 507 | } while (0) 508 | +#endif 509 | 510 | #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) 511 | 512 | #define STAILQ_FIRST(head) ((head)->stqh_first) 513 | 514 | +#if !defined(__GLIBC__) || defined(_KERNEL) 515 | #define STAILQ_FOREACH(var, head, field) \ 516 | for((var) = STAILQ_FIRST((head)); \ 517 | (var); \ 518 | (var) = STAILQ_NEXT((var), field)) 519 | +#endif 520 | 521 | #define STAILQ_FOREACH_FROM(var, head, field) \ 522 | for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ 523 | (var); \ 524 | (var) = STAILQ_NEXT((var), field)) 525 | 526 | +#if !defined(__GLIBC__) || defined(_KERNEL) 527 | #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ 528 | for ((var) = STAILQ_FIRST((head)); \ 529 | (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ 530 | (var) = (tvar)) 531 | +#endif 532 | 533 | #define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ 534 | for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ 535 | (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ 536 | (var) = (tvar)) 537 | 538 | +#if !defined(__GLIBC__) || defined(_KERNEL) 539 | #define STAILQ_INIT(head) do { \ 540 | STAILQ_FIRST((head)) = NULL; \ 541 | (head)->stqh_last = &STAILQ_FIRST((head)); \ 542 | } while (0) 543 | +#endif 544 | 545 | +#if !defined(__GLIBC__) || defined(_KERNEL) 546 | #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ 547 | if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ 548 | (head)->stqh_last = &STAILQ_NEXT((elm), field); \ 549 | @@ -342,6 +365,7 @@ 550 | *(head)->stqh_last = (elm); \ 551 | (head)->stqh_last = &STAILQ_NEXT((elm), field); \ 552 | } while (0) 553 | +#endif 554 | 555 | #define STAILQ_LAST(head, type, field) \ 556 | (STAILQ_EMPTY((head)) ? NULL : \ 557 | @@ -350,6 +374,7 @@ 558 | 559 | #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) 560 | 561 | +#if !defined(__GLIBC__) || defined(_KERNEL) 562 | #define STAILQ_REMOVE(head, elm, type, field) do { \ 563 | QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ 564 | if (STAILQ_FIRST((head)) == (elm)) { \ 565 | @@ -363,6 +388,7 @@ 566 | } \ 567 | TRASHIT(*oldnext); \ 568 | } while (0) 569 | +#endif 570 | 571 | #define STAILQ_REMOVE_AFTER(head, elm, field) do { \ 572 | if ((STAILQ_NEXT(elm, field) = \ 573 | @@ -370,11 +396,13 @@ 574 | (head)->stqh_last = &STAILQ_NEXT((elm), field); \ 575 | } while (0) 576 | 577 | +#if !defined(__GLIBC__) || defined(_KERNEL) 578 | #define STAILQ_REMOVE_HEAD(head, field) do { \ 579 | if ((STAILQ_FIRST((head)) = \ 580 | STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ 581 | (head)->stqh_last = &STAILQ_FIRST((head)); \ 582 | } while (0) 583 | +#endif 584 | 585 | #define STAILQ_SWAP(head1, head2, type) do { \ 586 | QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \ 587 | @@ -451,30 +479,37 @@ 588 | 589 | #define LIST_FIRST(head) ((head)->lh_first) 590 | 591 | +#if !defined(__GLIBC__) || defined(_KERNEL) 592 | #define LIST_FOREACH(var, head, field) \ 593 | for ((var) = LIST_FIRST((head)); \ 594 | (var); \ 595 | (var) = LIST_NEXT((var), field)) 596 | +#endif 597 | 598 | #define LIST_FOREACH_FROM(var, head, field) \ 599 | for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ 600 | (var); \ 601 | (var) = LIST_NEXT((var), field)) 602 | 603 | +#if !defined(__GLIBC__) || defined(_KERNEL) 604 | #define LIST_FOREACH_SAFE(var, head, field, tvar) \ 605 | for ((var) = LIST_FIRST((head)); \ 606 | (var) && ((tvar) = LIST_NEXT((var), field), 1); \ 607 | (var) = (tvar)) 608 | +#endif 609 | 610 | #define LIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ 611 | for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ 612 | (var) && ((tvar) = LIST_NEXT((var), field), 1); \ 613 | (var) = (tvar)) 614 | 615 | +#if !defined(__GLIBC__) || defined(_KERNEL) 616 | #define LIST_INIT(head) do { \ 617 | LIST_FIRST((head)) = NULL; \ 618 | } while (0) 619 | +#endif 620 | 621 | +#if !defined(__GLIBC__) || defined(_KERNEL) 622 | #define LIST_INSERT_AFTER(listelm, elm, field) do { \ 623 | QMD_LIST_CHECK_NEXT(listelm, field); \ 624 | if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ 625 | @@ -499,6 +534,7 @@ 626 | LIST_FIRST((head)) = (elm); \ 627 | (elm)->field.le_prev = &LIST_FIRST((head)); \ 628 | } while (0) 629 | +#endif 630 | 631 | #define LIST_NEXT(elm, field) ((elm)->field.le_next) 632 | 633 | @@ -507,6 +543,7 @@ 634 | __containerof((elm)->field.le_prev, \ 635 | QUEUE_TYPEOF(type), field.le_next)) 636 | 637 | +#if !defined(__GLIBC__) || defined(_KERNEL) 638 | #define LIST_REMOVE(elm, field) do { \ 639 | QMD_SAVELINK(oldnext, (elm)->field.le_next); \ 640 | QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ 641 | @@ -519,6 +556,7 @@ 642 | TRASHIT(*oldnext); \ 643 | TRASHIT(*oldprev); \ 644 | } while (0) 645 | +#endif 646 | 647 | #define LIST_SWAP(head1, head2, type, field) do { \ 648 | QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \ 649 | @@ -533,6 +571,7 @@ 650 | /* 651 | * Tail queue declarations. 652 | */ 653 | +#if !defined(__GLIBC__) || defined(_KERNEL) 654 | #define TAILQ_HEAD(name, type) \ 655 | struct name { \ 656 | struct type *tqh_first; /* first element */ \ 657 | @@ -546,10 +585,14 @@ 658 | class type **tqh_last; /* addr of last next element */ \ 659 | TRACEBUF \ 660 | } 661 | +#endif 662 | 663 | +#if defined(__FreeBSD__) || defined(_KERNEL) 664 | #define TAILQ_HEAD_INITIALIZER(head) \ 665 | { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } 666 | +#endif 667 | 668 | +#if !defined(__GLIBC__) || defined(_KERNEL) 669 | #define TAILQ_ENTRY(type) \ 670 | struct { \ 671 | struct type *tqe_next; /* next element */ \ 672 | @@ -563,6 +606,7 @@ 673 | class type **tqe_prev; /* address of previous next element */ \ 674 | TRACEBUF \ 675 | } 676 | +#endif 677 | 678 | /* 679 | * Tail queue functions. 680 | @@ -598,6 +642,7 @@ 681 | #define QMD_TAILQ_CHECK_PREV(elm, field) 682 | #endif /* (_KERNEL && INVARIANTS) */ 683 | 684 | +#if !defined(__GLIBC__) || defined(_KERNEL) 685 | #define TAILQ_CONCAT(head1, head2, field) do { \ 686 | if (!TAILQ_EMPTY(head2)) { \ 687 | *(head1)->tqh_last = (head2)->tqh_first; \ 688 | @@ -608,51 +653,61 @@ 689 | QMD_TRACE_HEAD(head2); \ 690 | } \ 691 | } while (0) 692 | +#endif 693 | 694 | #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) 695 | 696 | #define TAILQ_FIRST(head) ((head)->tqh_first) 697 | 698 | +#if !defined(__GLIBC__) || defined(_KERNEL) 699 | #define TAILQ_FOREACH(var, head, field) \ 700 | for ((var) = TAILQ_FIRST((head)); \ 701 | (var); \ 702 | (var) = TAILQ_NEXT((var), field)) 703 | +#endif 704 | 705 | #define TAILQ_FOREACH_FROM(var, head, field) \ 706 | for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ 707 | (var); \ 708 | (var) = TAILQ_NEXT((var), field)) 709 | 710 | +#if !defined(__GLIBC__) || defined(_KERNEL) 711 | #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ 712 | for ((var) = TAILQ_FIRST((head)); \ 713 | (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ 714 | (var) = (tvar)) 715 | +#endif 716 | 717 | #define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ 718 | for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ 719 | (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ 720 | (var) = (tvar)) 721 | 722 | +#if !defined(__GLIBC__) || defined(_KERNEL) 723 | #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ 724 | for ((var) = TAILQ_LAST((head), headname); \ 725 | (var); \ 726 | (var) = TAILQ_PREV((var), headname, field)) 727 | +#endif 728 | 729 | #define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field) \ 730 | for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ 731 | (var); \ 732 | (var) = TAILQ_PREV((var), headname, field)) 733 | 734 | +#if !defined(__GLIBC__) || defined(_KERNEL) 735 | #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ 736 | for ((var) = TAILQ_LAST((head), headname); \ 737 | (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ 738 | (var) = (tvar)) 739 | +#endif 740 | 741 | #define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \ 742 | for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ 743 | (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ 744 | (var) = (tvar)) 745 | 746 | +#if !defined(__GLIBC__) || defined(_KERNEL) 747 | #define TAILQ_INIT(head) do { \ 748 | TAILQ_FIRST((head)) = NULL; \ 749 | (head)->tqh_last = &TAILQ_FIRST((head)); \ 750 | @@ -706,6 +761,7 @@ 751 | QMD_TRACE_HEAD(head); \ 752 | QMD_TRACE_ELEM(&(elm)->field); \ 753 | } while (0) 754 | +#endif 755 | 756 | #define TAILQ_LAST(head, headname) \ 757 | (*(((struct headname *)((head)->tqh_last))->tqh_last)) 758 | @@ -715,6 +771,7 @@ 759 | #define TAILQ_PREV(elm, headname, field) \ 760 | (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) 761 | 762 | +#if !defined(__GLIBC__) || defined(_KERNEL) 763 | #define TAILQ_REMOVE(head, elm, field) do { \ 764 | QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ 765 | QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ 766 | @@ -732,6 +789,7 @@ 767 | TRASHIT(*oldprev); \ 768 | QMD_TRACE_ELEM(&(elm)->field); \ 769 | } while (0) 770 | +#endif 771 | 772 | #define TAILQ_SWAP(head1, head2, type, field) do { \ 773 | QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \ 774 | --- a/sys/sys/time.h 775 | +++ b/sys/sys/time.h 776 | @@ -37,10 +37,16 @@ 777 | #include 778 | #include 779 | 780 | +#ifndef __FreeBSD__ 781 | +#include 782 | +#endif 783 | + 784 | +#ifdef __FreeBSD__ 785 | struct timezone { 786 | int tz_minuteswest; /* minutes west of Greenwich */ 787 | int tz_dsttime; /* type of dst correction */ 788 | }; 789 | +#endif 790 | #define DST_NONE 0 /* not on dst */ 791 | #define DST_USA 1 /* USA style dst */ 792 | #define DST_AUST 2 /* Australian style dst */ 793 | @@ -49,7 +55,7 @@ 794 | #define DST_EET 5 /* Eastern European dst */ 795 | #define DST_CAN 6 /* Canada */ 796 | 797 | -#if __BSD_VISIBLE 798 | +#if 1 /* used by sys/devicestat.h and others */ 799 | struct bintime { 800 | time_t sec; 801 | uint64_t frac; 802 | @@ -282,7 +288,7 @@ 803 | 804 | #endif /* _KERNEL */ 805 | 806 | -#ifndef _KERNEL /* NetBSD/OpenBSD compatible interfaces */ 807 | +#if 0 808 | 809 | #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 810 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 811 | @@ -310,6 +316,7 @@ 812 | } while (0) 813 | #endif 814 | 815 | +#ifdef __FreeBSD__ 816 | /* 817 | * Names of the interval timers, and structure 818 | * defining a timer setting. 819 | @@ -362,6 +369,8 @@ 820 | #define CPUCLOCK_WHICH_TID 1 821 | #endif 822 | 823 | +#endif 824 | + 825 | #ifdef _KERNEL 826 | 827 | /* 828 | @@ -473,6 +482,7 @@ 829 | #include 830 | #include 831 | 832 | +#if 0 833 | __BEGIN_DECLS 834 | int setitimer(int, const struct itimerval *, struct itimerval *); 835 | int utimes(const char *, const struct timeval *); 836 | @@ -492,6 +502,7 @@ 837 | #endif 838 | 839 | __END_DECLS 840 | +#endif 841 | 842 | #endif /* !_KERNEL */ 843 | 844 | --- a/sys/sys/timespec.h 845 | +++ b/sys/sys/timespec.h 846 | @@ -37,7 +37,9 @@ 847 | #include 848 | #include 849 | 850 | -#if __BSD_VISIBLE 851 | +#ifndef __FreeBSD__ 852 | +#include 853 | +#else 854 | #define TIMEVAL_TO_TIMESPEC(tv, ts) \ 855 | do { \ 856 | (ts)->tv_sec = (tv)->tv_sec; \ 857 | @@ -51,6 +53,7 @@ 858 | 859 | #endif /* __BSD_VISIBLE */ 860 | 861 | +#ifdef __FreeBSD__ 862 | /* 863 | * Structure defined by POSIX.1b to be like a itimerval, but with 864 | * timespecs. Used in the timer_*() system calls. 865 | @@ -59,5 +62,6 @@ 866 | struct timespec it_interval; 867 | struct timespec it_value; 868 | }; 869 | +#endif 870 | 871 | #endif /* _SYS_TIMESPEC_H_ */ 872 | --- a/sys/sys/types.h 873 | +++ b/sys/sys/types.h 874 | @@ -44,7 +44,21 @@ 875 | #include 876 | #include 877 | 878 | +#ifdef __FreeBSD__ 879 | #include 880 | +#endif 881 | + 882 | +#ifndef __FreeBSD__ 883 | +/* Allow conflicting declarations in glibc to override us. */ 884 | +#include 885 | +#define _CLOCK_T_DECLARED 886 | +#define _FSBLKCNT_T_DECLARED 887 | +#define _ID_T_DECLARED 888 | +#define _TIME_T_DECLARED 889 | +#define _TIMER_T_DECLARED 890 | +#define _MQD_T_DECLARED 891 | +#define _INO_T_DECLARED 892 | +#endif 893 | 894 | #if __BSD_VISIBLE 895 | typedef unsigned char u_char; 896 | @@ -179,7 +193,9 @@ 897 | #define _PID_T_DECLARED 898 | #endif 899 | 900 | +#ifdef __FreeBSD__ 901 | typedef __register_t register_t; 902 | +#endif 903 | 904 | #ifndef _RLIM_T_DECLARED 905 | typedef __rlim_t rlim_t; /* resource limit */ 906 | @@ -355,10 +371,11 @@ 907 | #define __bitcount(x) __bitcount32((unsigned int)(x)) 908 | #endif 909 | 910 | -#if __BSD_VISIBLE 911 | 912 | #include 913 | 914 | +#ifdef __FreeBSD__ 915 | + 916 | /* 917 | * minor() gives a cookie instead of an index since we don't want to 918 | * change the meanings of bits 0-15 or waste time and space shifting 919 | @@ -373,7 +390,7 @@ 920 | * to give broken programs a better chance of working with 921 | * 64-bit off_t's. 922 | */ 923 | -#ifndef _KERNEL 924 | +#if 0 925 | __BEGIN_DECLS 926 | #ifndef _FTRUNCATE_DECLARED 927 | #define _FTRUNCATE_DECLARED 928 | --- a/sys/sys/_sigset.h 929 | +++ b/sys/sys/_sigset.h 930 | @@ -48,9 +48,11 @@ 931 | #define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31)) 932 | #define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0) 933 | 934 | +#ifdef __FreeBSD__ 935 | typedef struct __sigset { 936 | __uint32_t __bits[_SIG_WORDS]; 937 | } __sigset_t; 938 | +#endif 939 | 940 | #if defined(_KERNEL) && defined(COMPAT_43) 941 | typedef unsigned int osigset_t; 942 | --- a/sys/sys/socket.h 943 | +++ b/sys/sys/socket.h 944 | @@ -38,6 +38,8 @@ 945 | #include 946 | #include 947 | 948 | +#ifdef __FreeBSD__ 949 | + 950 | /* 951 | * Definitions related to sockets: types, address families, options. 952 | */ 953 | @@ -370,6 +372,10 @@ 954 | 955 | #define PF_MAX AF_MAX 956 | 957 | +#endif /* __BSD_VISIBLE */ 958 | +#endif /* 0 */ 959 | + 960 | +#if __BSD_VISIBLE 961 | /* 962 | * Definitions for network related sysctl, CTL_NET. 963 | * 964 | @@ -395,6 +401,8 @@ 965 | * versions of msghdr structs. */ 966 | #endif /* __BSD_VISIBLE */ 967 | 968 | +#ifdef __FreeBSD__ 969 | + 970 | /* 971 | * Maximum queue length specifiable by listen. 972 | */ 973 | @@ -686,5 +694,6 @@ 974 | 975 | #endif 976 | 977 | +#endif 978 | 979 | #endif /* !_SYS_SOCKET_H_ */ 980 | --- a/sys/sys/_iovec.h 981 | +++ b/sys/sys/_iovec.h 982 | @@ -40,9 +40,13 @@ 983 | #define _SIZE_T_DECLARED 984 | #endif 985 | 986 | +#ifndef __FreeBSD__ 987 | +#include 988 | +#else 989 | struct iovec { 990 | void *iov_base; /* Base address. */ 991 | size_t iov_len; /* Length. */ 992 | }; 993 | +#endif 994 | 995 | #endif /* !_SYS__IOVEC_H_ */ 996 | --- a/sys/x86/include/_types.h 997 | +++ b/sys/x86/include/_types.h 998 | @@ -43,6 +43,13 @@ 999 | #error this file needs sys/cdefs.h as a prerequisite 1000 | #endif 1001 | 1002 | +/* What "ifdef __FreeBSD__" taketh, "ifndef __FreeBSD__" giveth */ 1003 | +#ifndef __FreeBSD__ 1004 | +#define __need_time_t 1005 | +#define __need_clock_t 1006 | +#include 1007 | +#endif 1008 | + 1009 | #define __NO_STRICT_ALIGNMENT 1010 | 1011 | /* 1012 | @@ -81,7 +88,10 @@ 1013 | typedef __int64_t __intfptr_t; 1014 | typedef __int64_t __intptr_t; 1015 | #else 1016 | +#ifdef __FreeBSD__ 1017 | +/* This divergence is probably accidental, but it can't be fixed now. */ 1018 | typedef unsigned long __clock_t; 1019 | +#endif 1020 | typedef __int32_t __critical_t; 1021 | typedef long double __double_t; 1022 | typedef long double __float_t; 1023 | @@ -99,11 +109,15 @@ 1024 | typedef __int64_t __int_least64_t; 1025 | #ifdef __LP64__ 1026 | typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ 1027 | +#ifdef __FreeBSD__ 1028 | typedef __int64_t __register_t; 1029 | +#endif 1030 | typedef __int64_t __segsz_t; /* segment size (in pages) */ 1031 | typedef __uint64_t __size_t; /* sizeof() */ 1032 | typedef __int64_t __ssize_t; /* byte count or error */ 1033 | +# ifdef __FreeBSD__ 1034 | typedef __int64_t __time_t; /* time()... */ 1035 | +# endif 1036 | typedef __uint64_t __uintfptr_t; 1037 | typedef __uint64_t __uintptr_t; 1038 | #else 1039 | @@ -112,7 +126,9 @@ 1040 | typedef __int32_t __segsz_t; 1041 | typedef __uint32_t __size_t; 1042 | typedef __int32_t __ssize_t; 1043 | +# ifdef __FreeBSD__ 1044 | typedef __int32_t __time_t; 1045 | +# endif 1046 | typedef __uint32_t __uintfptr_t; 1047 | typedef __uint32_t __uintptr_t; 1048 | #endif 1049 | --- a/sys/x86/include/signal.h 1050 | +++ b/sys/x86/include/signal.h 1051 | @@ -46,9 +46,15 @@ 1052 | #endif 1053 | 1054 | #ifdef __i386__ 1055 | + 1056 | +#ifndef __FreeBSD__ 1057 | +#define __need_sig_atomic_t 1058 | +#include 1059 | +#else 1060 | typedef int sig_atomic_t; 1061 | +#endif 1062 | 1063 | -#if __BSD_VISIBLE 1064 | +#ifdef __FreeBSD__ 1065 | struct sigcontext { 1066 | struct __sigset sc_mask; /* signal mask to restore */ 1067 | int sc_onstack; /* sigstack state to restore */ 1068 | @@ -100,9 +106,15 @@ 1069 | #endif /* __i386__ */ 1070 | 1071 | #ifdef __amd64__ 1072 | + 1073 | +#ifndef __FreeBSD__ 1074 | +#define __need_sig_atomic_t 1075 | +#include 1076 | +#else 1077 | typedef long sig_atomic_t; 1078 | +#endif 1079 | 1080 | -#if __BSD_VISIBLE 1081 | +#ifdef __FreeBSD__ 1082 | /* 1083 | * Information pushed on stack when a signal is delivered. 1084 | * This is used by the kernel to restore state following 1085 | --- a/sys/x86/include/endian.h 1086 | +++ b/sys/x86/include/endian.h 1087 | @@ -56,7 +56,9 @@ 1088 | * Deprecated variants that don't have enough underscores to be useful in more 1089 | * strict namespaces. 1090 | */ 1091 | -#if __BSD_VISIBLE 1092 | +#ifndef __FreeBSD__ 1093 | +#include 1094 | +#else 1095 | #define LITTLE_ENDIAN _LITTLE_ENDIAN 1096 | #define BIG_ENDIAN _BIG_ENDIAN 1097 | #define PDP_ENDIAN _PDP_ENDIAN 1098 | --- a/sys/x86/include/stdarg.h 1099 | +++ b/sys/x86/include/stdarg.h 1100 | @@ -34,6 +34,8 @@ 1101 | #include 1102 | #include 1103 | 1104 | +#ifdef __FreeBSD__ 1105 | + 1106 | #ifndef _VA_LIST_DECLARED 1107 | #define _VA_LIST_DECLARED 1108 | typedef __va_list va_list; 1109 | @@ -74,4 +76,6 @@ 1110 | #error this file needs to be ported to your compiler 1111 | #endif 1112 | 1113 | +#endif 1114 | + 1115 | #endif /* !_MACHINE_STDARG_H_ */ 1116 | --- a/sys/sys/syslimits.h 1117 | +++ b/sys/sys/syslimits.h 1118 | @@ -33,15 +33,6 @@ 1119 | #ifndef _SYS_SYSLIMITS_H_ 1120 | #define _SYS_SYSLIMITS_H_ 1121 | 1122 | -#if !defined(_KERNEL) && !defined(_LIMITS_H_) && !defined(_SYS_PARAM_H_) 1123 | -#ifndef _SYS_CDEFS_H_ 1124 | -#error this file needs sys/cdefs.h as a prerequisite 1125 | -#endif 1126 | -#ifdef __CC_SUPPORTS_WARNING 1127 | -#warning "No user-serviceable parts inside." 1128 | -#endif 1129 | -#endif 1130 | - 1131 | /* 1132 | * Do not add any new variables here. (See the comment at the end of 1133 | * the file for why.) 1134 | --- a/sys/sys/signal.h 1135 | +++ b/sys/sys/signal.h 1136 | @@ -45,6 +45,13 @@ 1137 | #include /* __MINSIGSTKSZ */ 1138 | #include /* sig_atomic_t; trap codes; sigcontext */ 1139 | 1140 | +/* For now just disable everything except the implicit includes. 1141 | + TODO: We might want to enable some things below, as long as they don't 1142 | + collide with GNU version of . */ 1143 | +#if defined(__GLIBC__) && !defined(_KERNEL) 1144 | +#include 1145 | +#else 1146 | + 1147 | /* 1148 | * System defined signals. 1149 | */ 1150 | @@ -440,4 +447,6 @@ 1151 | __sighandler_t *signal(int, __sighandler_t *); 1152 | __END_DECLS 1153 | 1154 | +#endif 1155 | + 1156 | #endif /* !_SYS_SIGNAL_H_ */ 1157 | --- a/sys/net80211/ieee80211_ioctl.h 1158 | +++ b/sys/net80211/ieee80211_ioctl.h 1159 | @@ -575,7 +575,7 @@ 1160 | uint16_t sv_vlan; 1161 | }; 1162 | 1163 | -#ifdef __FreeBSD__ 1164 | +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 1165 | /* 1166 | * FreeBSD-style ioctls. 1167 | */ 1168 | @@ -856,6 +856,6 @@ 1169 | #define IEEE80211_CLONE_WDSLEGACY 0x0004 /* legacy WDS processing */ 1170 | #define IEEE80211_CLONE_MACADDR 0x0008 /* use specified mac addr */ 1171 | #define IEEE80211_CLONE_TDMA 0x0010 /* operate in TDMA mode */ 1172 | -#endif /* __FreeBSD__ */ 1173 | +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ 1174 | 1175 | #endif /* _NET80211_IEEE80211_IOCTL_H_ */ 1176 | --- a/sys/net80211/ieee80211_var.h 1177 | +++ b/sys/net80211/ieee80211_var.h 1178 | @@ -34,7 +34,7 @@ 1179 | /* NB: portability glue must go first */ 1180 | #if defined(__NetBSD__) 1181 | #include 1182 | -#elif defined(__FreeBSD__) 1183 | +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 1184 | #include 1185 | #elif defined(__linux__) 1186 | #include 1187 | --------------------------------------------------------------------------------