diff options
30 files changed, 1280 insertions, 10 deletions
diff --git a/auto/create.sh b/auto/create.sh new file mode 100755 index 0000000..a7f965e --- /dev/null +++ b/auto/create.sh @@ -0,0 +1,75 @@ +#!/bin/sh +read -p "package name> " name +repo=$(ls repo/ | fzf --prompt="repo> ") +read -p "package version> " version +read -p "description> " desc +read -p "source url> " url +deps=$(find repo -type f | xargs -I % basename % .xibuild | fzf -m --prompt="dependencies> ") +read -p "additional urls> " additional +type=$(find ./templates -type f | xargs -I % basename % .xibuild | fzf --prompt="build type> ") + +clear +echo Name: $name +echo Repo: $repo +echo Deps: $deps +echo Desc: $desc +echo Vers: $version +echo Sour: $url +echo Addi: $additional +echo Type: $type +read -p "Ok? " go + +template=./templates/$type.xibuild +buildfile=repo/$repo/$name.xibuild + +[ -f $buildfile ] && read -p "Buildfile already exists, overwrite? " go + +url=$(echo $url | sed "s/$version/\$PKG_VER/g" | sed "s/\$pkgver/\$PKG_VER/g") +makedeps="" + +case $type in + make|configure) + makedeps="make $makedeps" + ;; + meson) + makedeps="meson ninja $makedeps" + ;; +esac + +cat > $buildfile << EOF +#!/bin/sh + +NAME="$name" +DESC="$desc" + +MAKEDEPS="$makedeps" +DEPS="$deps" + +PKG_VER=$version +SOURCE="$url" +EOF + + +[ "${#additional}" = 0 ] || { + filenames="" + mkdir extra/$name + for l in $additional; do + filename=$(basename $l) + curl -SsL $l > extra/$name/$filename + filenames="$filename $filenames" + done + echo "ADDITIONAL=\"$filenames\"" >> $buildfile + + echo $filenames | grep -q ".patch " && { + cat > $buildfile << EOF + +prepare () { + apply_patches +} +EOF + } +} + +echo >> $buildfile +cat $template >> $buildfile +vim $buildfile diff --git a/extra/broadcom-wl/001-null-pointer-fix.patch b/extra/broadcom-wl/001-null-pointer-fix.patch new file mode 100644 index 0000000..adef19f --- /dev/null +++ b/extra/broadcom-wl/001-null-pointer-fix.patch @@ -0,0 +1,27 @@ +Description: Fixing null pointer crash + +Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773713 +Bug-Ubuntu: https://launchpad.net/bugs/1415880 +Last-Update: 2015-08-18 + +--- + src/wl/sys/wl_linux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 860b935..295156f 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -2157,8 +2157,8 @@ wl_start(struct sk_buff *skb, struct net_device *dev) + wlif = WL_DEV_IF(dev); + wl = WL_INFO(dev); + ++ skb->prev = NULL; + if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) { +- skb->prev = NULL; + + TXQ_LOCK(wl); + +-- +1.9.1 + diff --git a/extra/broadcom-wl/002-rdtscl.patch b/extra/broadcom-wl/002-rdtscl.patch new file mode 100644 index 0000000..1b9862c --- /dev/null +++ b/extra/broadcom-wl/002-rdtscl.patch @@ -0,0 +1,22 @@ +Since Linux 4.3, rdtscl() is no longer available and native_read_tsc() +is renamed to rdtsc(). Move the macro contents in-line and call the +new function. References: + +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b + +diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c +--- a/src/shared/linux_osl.c 2015-09-19 01:47:15.000000000 +0300 ++++ b/src/shared/linux_osl.c 2015-11-21 15:20:30.585902518 +0200 +@@ -932,7 +932,11 @@ + uint cycles; + + #if defined(__i386__) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) ++ cycles = (u32)rdtsc(); ++#else + rdtscl(cycles); ++#endif + #else + cycles = 0; + #endif diff --git a/extra/broadcom-wl/003-linux47.patch b/extra/broadcom-wl/003-linux47.patch new file mode 100644 index 0000000..566680a --- /dev/null +++ b/extra/broadcom-wl/003-linux47.patch @@ -0,0 +1,109 @@ +Since Linux 4.7, the enum ieee80211_band is no longer used + +This shall cause no problem's since both enums ieee80211_band +and nl80211_band were added in the same commit: +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c + +This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_* + +Reference: +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3 + +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:57:36.159340297 -0500 ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:58:18.442323435 -0500 +@@ -236,7 +236,7 @@ + #endif + + #define CHAN2G(_channel, _freq, _flags) { \ +- .band = IEEE80211_BAND_2GHZ, \ ++ .band = NL80211_BAND_2GHZ, \ + .center_freq = (_freq), \ + .hw_value = (_channel), \ + .flags = (_flags), \ +@@ -245,7 +245,7 @@ + } + + #define CHAN5G(_channel, _flags) { \ +- .band = IEEE80211_BAND_5GHZ, \ ++ .band = NL80211_BAND_5GHZ, \ + .center_freq = 5000 + (5 * (_channel)), \ + .hw_value = (_channel), \ + .flags = (_flags), \ +@@ -379,7 +379,7 @@ + }; + + static struct ieee80211_supported_band __wl_band_2ghz = { +- .band = IEEE80211_BAND_2GHZ, ++ .band = NL80211_BAND_2GHZ, + .channels = __wl_2ghz_channels, + .n_channels = ARRAY_SIZE(__wl_2ghz_channels), + .bitrates = wl_g_rates, +@@ -387,7 +387,7 @@ + }; + + static struct ieee80211_supported_band __wl_band_5ghz_a = { +- .band = IEEE80211_BAND_5GHZ, ++ .band = NL80211_BAND_5GHZ, + .channels = __wl_5ghz_a_channels, + .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels), + .bitrates = wl_a_rates, +@@ -395,7 +395,7 @@ + }; + + static struct ieee80211_supported_band __wl_band_5ghz_n = { +- .band = IEEE80211_BAND_5GHZ, ++ .band = NL80211_BAND_5GHZ, + .channels = __wl_5ghz_n_channels, + .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels), + .bitrates = wl_a_rates, +@@ -1876,8 +1876,8 @@ + wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; + #endif + wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); +- wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; +- wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a; ++ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz; ++ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; + wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; + wdev->wiphy->cipher_suites = __wl_cipher_suites; + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +@@ -2000,7 +2000,7 @@ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) + freq = ieee80211_channel_to_frequency(notif_bss_info->channel, + (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ? +- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ); ++ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ); + #else + freq = ieee80211_channel_to_frequency(notif_bss_info->channel); + #endif +@@ -2116,7 +2116,7 @@ + return err; + } + chan = wf_chspec_ctlchan(chanspec); +- band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; ++ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; + freq = ieee80211_channel_to_frequency(chan, band); + channel = ieee80211_get_channel(wiphy, freq); + cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL); +@@ -2250,10 +2250,10 @@ + join_params->params.chanspec_list[0] = + ieee80211_frequency_to_channel(chan->center_freq); + +- if (chan->band == IEEE80211_BAND_2GHZ) { ++ if (chan->band == NL80211_BAND_2GHZ) { + chanspec |= WL_CHANSPEC_BAND_2G; + } +- else if (chan->band == IEEE80211_BAND_5GHZ) { ++ else if (chan->band == NL80211_BAND_5GHZ) { + chanspec |= WL_CHANSPEC_BAND_5G; + } + else { +@@ -2885,7 +2885,7 @@ + + if (phy == 'n' || phy == 'a' || phy == 'v') { + wiphy = wl_to_wiphy(wl); +- wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n; ++ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n; + } + + return err; diff --git a/extra/broadcom-wl/004-linux48.patch b/extra/broadcom-wl/004-linux48.patch new file mode 100644 index 0000000..20e8a9a --- /dev/null +++ b/extra/broadcom-wl/004-linux48.patch @@ -0,0 +1,64 @@ +From d3f93542326a06d920c6eb89b703384290d37b8b Mon Sep 17 00:00:00 2001 +From: Alberto Milone <alberto.milone@canonical.com> +Date: Fri, 2 Sep 2016 17:35:34 +0200 +Subject: [PATCH 1/1] Add support for Linux 4.8 + +Orginal author: Krzysztof Kolasa +--- + src/wl/sys/wl_cfg80211_hybrid.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 2fc71fe..ec5e472 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -2388,8 +2388,16 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + s32 err = 0; + + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true, ++ }; ++ WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); ++ cfg80211_scan_done(wl->scan_request, &info); ++#else + WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); + cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +@@ -2490,7 +2498,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, + + scan_done_out: + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = false, ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else + cfg80211_scan_done(wl->scan_request, false); ++#endif + wl->scan_request = NULL; + } + rtnl_unlock(); +@@ -2909,7 +2924,14 @@ s32 wl_cfg80211_down(struct net_device *ndev) + s32 err = 0; + + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true, ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else + cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +-- +2.7.4 + diff --git a/extra/broadcom-wl/005-debian-fix-kernel-warnings.patch b/extra/broadcom-wl/005-debian-fix-kernel-warnings.patch new file mode 100644 index 0000000..e9bf66a --- /dev/null +++ b/extra/broadcom-wl/005-debian-fix-kernel-warnings.patch @@ -0,0 +1,161 @@ +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -1968,7 +1968,7 @@ + + if (dtoh32(bi->length) > WL_BSS_INFO_MAX) { + WL_DBG(("Beacon is larger than buffer. Discarding\n")); +- return err; ++ return -E2BIG; + } + notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) + + WL_BSS_INFO_MAX, GFP_KERNEL); +@@ -1992,9 +1992,15 @@ + beacon_proberesp->capab_info = cpu_to_le16(bi->capability); + wl_rst_ie(wl); + +- wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); +- wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - ++ err = wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); ++ if (err) ++ goto inform_single_bss_out; ++ ++ err = wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - + offsetof(struct wl_cfg80211_bss_info, frame_buf)); ++ if (err) ++ goto inform_single_bss_out; ++ + notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) + + wl_get_ielen(wl); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) +@@ -2006,14 +2012,14 @@ + #endif + if (freq == 0) { + WL_ERR(("Invalid channel, fail to chcnage channel to freq\n")); +- kfree(notif_bss_info); +- return -EINVAL; ++ err = -EINVAL; ++ goto inform_single_bss_out; + } + channel = ieee80211_get_channel(wiphy, freq); + if (unlikely(!channel)) { + WL_ERR(("ieee80211_get_channel error\n")); +- kfree(notif_bss_info); +- return -EINVAL; ++ err = -EINVAL; ++ goto inform_single_bss_out; + } + + WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n", +@@ -2021,28 +2027,37 @@ + mgmt->u.beacon.capab_info, &bi->BSSID)); + + signal = notif_bss_info->rssi * 100; +- cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, +- le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); +- if (unlikely(!cbss)) { +- WL_ERR(("cfg80211_inform_bss_frame error\n")); +- kfree(notif_bss_info); +- return -EINVAL; +- } + +- notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); +- notify_ielen = le32_to_cpu(bi->ie_length); ++ if (!wl->scan_request) { ++ cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, ++ le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); ++ if (unlikely(!cbss)) { ++ WL_ERR(("cfg80211_inform_bss_frame error\n")); ++ err = -ENOMEM; ++ goto inform_single_bss_out; ++ } ++ } else { ++ notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); ++ notify_ielen = le32_to_cpu(bi->ie_length); + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) +- cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), +- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, +- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); ++ cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), ++ 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, ++ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); + #else +- cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet), +- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, +- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); ++ cbss = cfg80211_inform_bss(wiphy, channel, ++ wl->active_scan ? ++ CFG80211_BSS_FTYPE_PRESP : CFG80211_BSS_FTYPE_BEACON, ++ (const u8 *)(bi->BSSID.octet), 0, ++ beacon_proberesp->capab_info, ++ beacon_proberesp->beacon_int, ++ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); + #endif +- +- if (unlikely(!cbss)) +- return -ENOMEM; ++ if (unlikely(!cbss)) { ++ WL_ERR(("cfg80211_inform_bss error\n")); ++ err = -ENOMEM; ++ goto inform_single_bss_out; ++ } ++ } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(wiphy, cbss); +@@ -2050,6 +2065,7 @@ + cfg80211_put_bss(cbss); + #endif + ++inform_single_bss_out: + kfree(notif_bss_info); + + return err; +@@ -2316,6 +2332,9 @@ + if (err) + goto update_bss_info_out; + ++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, ++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); ++ + ie = ((u8 *)bi) + bi->ie_offset; + ie_len = bi->ie_length; + } else { +@@ -2328,11 +2347,18 @@ + ie_len = bss->len_information_elements; + #endif + wl->conf->channel = *bss->channel; ++ } ++ ++ if (bss) { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(wiphy, bss); + #else + cfg80211_put_bss(bss); + #endif ++ } else { ++ WL_DBG(("Could not update BSS\n")); ++ err = -EINVAL; ++ goto update_bss_info_out; + } + + tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM); +@@ -2360,10 +2386,17 @@ + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); + s32 err = 0; + +- wl_get_assoc_ies(wl); ++ err = wl_get_assoc_ies(wl); ++ if (err) ++ return err; ++ + memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); +- wl_update_bss_info(wl); ++ ++ err = wl_update_bss_info(wl); ++ if (err) ++ return err; ++ + cfg80211_roamed(ndev, + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) + &wl->conf->channel, diff --git a/extra/broadcom-wl/006-linux411.patch b/extra/broadcom-wl/006-linux411.patch new file mode 100644 index 0000000..7a2e8c0 --- /dev/null +++ b/extra/broadcom-wl/006-linux411.patch @@ -0,0 +1,27 @@ +diff -u sys0/wl_cfg80211_hybrid.c sys/wl_cfg80211_hybrid.c +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -39,6 +39,10 @@ + #include <proto/802.11.h> + #include <wl_cfg80211_hybrid.h> + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include <linux/sched/signal.h> ++#endif ++ + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) + #define EVENT_STATUS(e) dtoh32((e)->status) +diff -u sys0/wl_linux.c sys/wl_linux.c +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -2915,7 +2915,9 @@ + if (skb == NULL) return; + + skb->dev = wl->monitor_dev; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + skb->dev->last_rx = jiffies; ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + skb_reset_mac_header(skb); + #else diff --git a/extra/broadcom-wl/007-linux412.patch b/extra/broadcom-wl/007-linux412.patch new file mode 100644 index 0000000..8abc73d --- /dev/null +++ b/extra/broadcom-wl/007-linux412.patch @@ -0,0 +1,68 @@ +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index da36405..d3741eb 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -53,7 +53,11 @@ u32 wl_dbg_level = WL_DBG_ERR; + #endif + + static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ enum nl80211_iftype type, struct vif_params *params); ++#else + enum nl80211_iftype type, u32 *flags, struct vif_params *params); ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) + static s32 + wl_cfg80211_scan(struct wiphy *wiphy, +@@ -466,7 +470,11 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + + static s32 + wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ enum nl80211_iftype type, ++#else + enum nl80211_iftype type, u32 *flags, ++#endif + struct vif_params *params) + { + struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); +@@ -2361,6 +2369,20 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + const wl_event_msg_t *e, void *data) + { + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ struct cfg80211_bss *bss; ++ struct wlc_ssid *ssid; ++ ssid = &wl->profile->ssid; ++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, ++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); ++ struct cfg80211_roam_info roam_info = { ++ .bss = bss, ++ .req_ie = conn_info->req_ie, ++ .req_ie_len = conn_info->req_ie_len, ++ .resp_ie = conn_info->resp_ie, ++ .resp_ie_len = conn_info->resp_ie_len, ++ }; ++#endif + s32 err = 0; + + wl_get_assoc_ies(wl); +@@ -2368,12 +2390,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); + wl_update_bss_info(wl); + cfg80211_roamed(ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ &roam_info, ++#else + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) + &wl->conf->channel, + #endif + (u8 *)&wl->bssid, + conn_info->req_ie, conn_info->req_ie_len, +- conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); ++ conn_info->resp_ie, conn_info->resp_ie_len, ++#endif ++ GFP_KERNEL); + WL_DBG(("Report roaming result\n")); + + set_bit(WL_STATUS_CONNECTED, &wl->status); diff --git a/extra/broadcom-wl/008-linux415.patch b/extra/broadcom-wl/008-linux415.patch new file mode 100644 index 0000000..1bced2f --- /dev/null +++ b/extra/broadcom-wl/008-linux415.patch @@ -0,0 +1,46 @@ +--- a/src/wl/sys/wl_linux.c 2017-07-17 00:11:24.000000000 +0100 ++++ b/src/wl/sys/wl_linux.c 2018-01-27 09:49:47.057799596 +0000 +@@ -93,7 +93,11 @@ + + #include <wlc_wowl.h> + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++static void wl_timer(struct timer_list *tl); ++#else + static void wl_timer(ulong data); ++#endif + static void _wl_timer(wl_timer_t *t); + static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); + +@@ -2297,10 +2301,17 @@ + atomic_dec(&t->wl->callbacks); + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++static void ++wl_timer(struct timer_list *tl) ++{ ++ wl_timer_t *t = (wl_timer_t *)tl; ++#else + static void + wl_timer(ulong data) + { + wl_timer_t *t = (wl_timer_t *)data; ++#endif + + if (!WL_ALL_PASSIVE_ENAB(t->wl)) + _wl_timer(t); +@@ -2352,9 +2363,13 @@ + + bzero(t, sizeof(wl_timer_t)); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ timer_setup(&t->timer, wl_timer, 0); ++#else + init_timer(&t->timer); + t->timer.data = (ulong) t; + t->timer.function = wl_timer; ++#endif + t->wl = wl; + t->fn = fn; + t->arg = arg; diff --git a/extra/broadcom-wl/009-fix_mac_profile_discrepancy.patch b/extra/broadcom-wl/009-fix_mac_profile_discrepancy.patch new file mode 100644 index 0000000..1e19e8c --- /dev/null +++ b/extra/broadcom-wl/009-fix_mac_profile_discrepancy.patch @@ -0,0 +1,14 @@ +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2018-11-14 14:06:03.313487995 +0100 +@@ -1444,11 +1444,6 @@ + s32 rate; + s32 err = 0; + + if (memcmp(mac, wl->profile->bssid, ETHER_ADDR_LEN)) { + WL_ERR(("Wrong Mac address, mac = %pM profile =%pM\n", mac, wl->profile->bssid)); +- return -ENOENT; + } + + err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate)); + if (err) { + WL_DBG(("Could not get rate (%d)\n", err)); diff --git a/extra/broadcom-wl/010-linux56.patch b/extra/broadcom-wl/010-linux56.patch new file mode 100644 index 0000000..f8d5783 --- /dev/null +++ b/extra/broadcom-wl/010-linux56.patch @@ -0,0 +1,55 @@ +diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c +index 6157d18..8237ec7 100644 +--- a/src/shared/linux_osl.c ++++ b/src/shared/linux_osl.c +@@ -942,7 +942,7 @@ osl_getcycles(void) + void * + osl_reg_map(uint32 pa, uint size) + { +- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ return (ioremap((unsigned long)pa, (unsigned long)size)); + } + + void +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 0d05100..2ed1f0d 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -582,7 +582,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, + } + wl->bcm_bustype = bustype; + +- if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { + WL_ERROR(("wl%d: ioremap() failed\n", unit)); + goto fail; + } +@@ -772,7 +772,7 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + bar1_size = pci_resource_len(pdev, 2); +- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), + bar1_size); + wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, + pdev->irq, bar1_addr, bar1_size); +@@ -3335,12 +3335,19 @@ wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++static struct proc_ops wl_fops = { ++ .proc_read = wl_proc_read, ++ .proc_write = wl_proc_write, ++}; ++#else + static const struct file_operations wl_fops = { + .owner = THIS_MODULE, + .read = wl_proc_read, + .write = wl_proc_write, + }; + #endif ++#endif + + static int + wl_reg_proc_entry(wl_info_t *wl) diff --git a/extra/broadcom-wl/011-linux59.patch b/extra/broadcom-wl/011-linux59.patch new file mode 100644 index 0000000..6ef4764 --- /dev/null +++ b/extra/broadcom-wl/011-linux59.patch @@ -0,0 +1,211 @@ +From f3d652840f8dd959395065a1cf67ca40b04ec69b Mon Sep 17 00:00:00 2001 +From: Joan Bruguera <joanbrugueram@gmail.com> +Date: Tue, 13 Oct 2020 19:35:55 +0200 +Subject: [PATCH] Get rid of get_fs/set_fs calls in Broadcom WL driver. + +Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 5.10 (tested -rc1 up to 5.10.1) + +Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-23 on Arch Linux. + +NB: Some checks in wlc_ioctl_internal are likely superfluous, + but I'm not familiar enough with the driver to remove them with confidence. + +See also: https://lwn.net/Articles/722267/ + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=47058bb54b57962b3958a936ddbc59355e4c5504 + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5e6e9852d6f76e01b2e6803c74258afa5b432bc5 + +Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com> +--- + src/wl/sys/wl_cfg80211_hybrid.c | 25 ++------------------- + src/wl/sys/wl_iw.c | 25 ++------------------- + src/wl/sys/wl_linux.c | 40 ++++++++++++++++++++++++++++----- + src/wl/sys/wl_linux.h | 2 ++ + src/wl/sys/wlc_pub.h | 1 + + 5 files changed, 42 insertions(+), 51 deletions(-) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 7b606e0..1e0adb7 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -38,6 +38,7 @@ + #include <wlioctl.h> + #include <proto/802.11.h> + #include <wl_cfg80211_hybrid.h> ++#include <wl_linux.h> + + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) +@@ -435,30 +436,7 @@ static void key_endian_to_host(struct wl_wsec_key *key) + static s32 + wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + { +- struct ifreq ifr; +- struct wl_ioctl ioc; +- mm_segment_t fs; +- s32 err = 0; +- +- BUG_ON(len < sizeof(int)); +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t)&ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return err; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static s32 +diff --git a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c +index c4c610b..e346b15 100644 +--- a/src/wl/sys/wl_iw.c ++++ b/src/wl/sys/wl_iw.c +@@ -37,6 +37,7 @@ typedef const struct si_pub si_t; + + #include <wl_dbg.h> + #include <wl_iw.h> ++#include <wl_linux.h> + + extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status, + uint32 reason, char* stringBuf, uint buflen); +@@ -103,29 +104,7 @@ dev_wlc_ioctl( + int len + ) + { +- struct ifreq ifr; +- wl_ioctl_t ioc; +- mm_segment_t fs; +- int ret; +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t) &ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return ret; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static int +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 947cef3..f04c148 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -1643,10 +1643,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + goto done2; + } + +- if (segment_eq(get_fs(), KERNEL_DS)) +- buf = ioc.buf; +- +- else if (ioc.buf) { ++ if (ioc.buf) { + if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) { + bcmerror = BCME_NORESOURCE; + goto done2; +@@ -1667,7 +1664,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + WL_UNLOCK(wl); + + done1: +- if (ioc.buf && (ioc.buf != buf)) { ++ if (ioc.buf) { + if (copy_to_user(ioc.buf, buf, ioc.len)) + bcmerror = BCME_BADADDR; + MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN)); +@@ -1680,6 +1677,39 @@ done2: + return (OSL_ERROR(bcmerror)); + } + ++int ++wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len) ++{ ++ wl_info_t *wl; ++ wl_if_t *wlif; ++ int bcmerror; ++ ++ if (!dev) ++ return -ENETDOWN; ++ ++ wl = WL_INFO(dev); ++ wlif = WL_DEV_IF(dev); ++ if (wlif == NULL || wl == NULL || wl->dev == NULL) ++ return -ENETDOWN; ++ ++ bcmerror = 0; ++ ++ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd)); ++ ++ WL_LOCK(wl); ++ if (!capable(CAP_NET_ADMIN)) { ++ bcmerror = BCME_EPERM; ++ } else { ++ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif); ++ } ++ WL_UNLOCK(wl); ++ ++ ASSERT(VALID_BCMERROR(bcmerror)); ++ if (bcmerror != 0) ++ wl->pub->bcmerror = bcmerror; ++ return (OSL_ERROR(bcmerror)); ++} ++ + static struct net_device_stats* + wl_get_stats(struct net_device *dev) + { +diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h +index 5b1048e..c8c1f41 100644 +--- a/src/wl/sys/wl_linux.h ++++ b/src/wl/sys/wl_linux.h +@@ -22,6 +22,7 @@ + #define _wl_linux_h_ + + #include <wlc_types.h> ++#include <wlc_pub.h> + + typedef struct wl_timer { + struct timer_list timer; +@@ -187,6 +188,7 @@ extern irqreturn_t wl_isr(int irq, void *dev_id, struct pt_regs *ptregs); + extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); + extern void wl_free(wl_info_t *wl); + extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len); + extern struct net_device * wl_netdev_get(wl_info_t *wl); + + #endif +diff --git a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h +index 53a98b8..2b5a029 100644 +--- a/src/wl/sys/wlc_pub.h ++++ b/src/wl/sys/wlc_pub.h +@@ -24,6 +24,7 @@ + + #include <wlc_types.h> + #include <wlc_utils.h> ++#include <siutils.h> + #include "proto/802.11.h" + #include "proto/bcmevent.h" + +-- +2.28.0 diff --git a/extra/broadcom-wl/012-linux517.patch b/extra/broadcom-wl/012-linux517.patch new file mode 100644 index 0000000..74847cb --- /dev/null +++ b/extra/broadcom-wl/012-linux517.patch @@ -0,0 +1,39 @@ +diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +--- a/src/wl/sys/wl_linux.c 2022-03-23 00:35:42.930416350 +0000 ++++ b/src/wl/sys/wl_linux.c 2022-03-23 00:40:12.903771013 +0000 +@@ -2980,7 +2980,11 @@ + else + dev->type = ARPHRD_IEEE80211_RADIOTAP; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN); ++#else ++ eth_hw_addr_set(wl->dev, dev->dev_addr); ++#endif + + #if defined(WL_USE_NETDEV_OPS) + dev->netdev_ops = &wl_netdev_monitor_ops; +@@ -3261,7 +3265,11 @@ + static ssize_t + wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + wl_info_t * wl = PDE_DATA(file_inode(filp)); ++#else ++ wl_info_t * wl = pde_data(file_inode(filp)); ++#endif + #endif + int bcmerror, len; + int to_user = 0; +@@ -3318,7 +3326,11 @@ + static ssize_t + wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + wl_info_t * wl = PDE_DATA(file_inode(filp)); ++#else ++ wl_info_t * wl = pde_data(file_inode(filp)); ++#endif + #endif + int from_user = 0; + int bcmerror; diff --git a/extra/libev/libev-4.11-Add-pkgconfig-support.patch b/extra/libev/libev-4.11-Add-pkgconfig-support.patch new file mode 100644 index 0000000..8c478ca --- /dev/null +++ b/extra/libev/libev-4.11-Add-pkgconfig-support.patch @@ -0,0 +1,58 @@ +From 01d2c386b58afa49567ccc079c963f76dc2e60f3 Mon Sep 17 00:00:00 2001 +From: Mathieu Bridon <bochecha@fedoraproject.org> +Date: Fri, 8 Feb 2013 15:40:51 +0800 +Subject: [PATCH] Add pkgconfig support + +--- + Makefile.am | 4 ++++ + configure.ac | 2 +- + libev.pc.in | 11 +++++++++++ + 3 files changed, 16 insertions(+), 1 deletion(-) + create mode 100644 libev.pc.in + +diff --git a/Makefile.am b/Makefile.am +index 059305b..9e556c0 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -11,6 +11,10 @@ man_MANS = ev.3 + + include_HEADERS = ev.h ev++.h event.h + ++pkgconfigdir = $(libdir)/pkgconfig ++ ++pkgconfig_DATA = libev.pc ++ + lib_LTLIBRARIES = libev.la + + libev_la_SOURCES = ev.c event.c +diff --git a/configure.ac b/configure.ac +index 31d0a25..1af149a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -21,5 +21,5 @@ AC_PROG_LIBTOOL + + m4_include([libev.m4]) + +-AC_CONFIG_FILES([Makefile]) ++AC_CONFIG_FILES([Makefile libev.pc]) + AC_OUTPUT +diff --git a/libev.pc.in b/libev.pc.in +new file mode 100644 +index 0000000..3b6c636 +--- /dev/null ++++ b/libev.pc.in +@@ -0,0 +1,11 @@ ++prefix=@prefix@ ++exec_prefix=@prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: libev ++Description: High-performance event loop/event model ++Version: @VERSION@ ++Libs: -L${libdir} -lev ++Libs.private: ++Cflags: -I${includedir} +-- +1.8.1 + diff --git a/extra/linux-src b/extra/linux-src new file mode 120000 index 0000000..9c52cb3 --- /dev/null +++ b/extra/linux-src @@ -0,0 +1 @@ +linux
\ No newline at end of file diff --git a/repo/linux/b43-firmware.xibuild b/repo/linux/b43-firmware.xibuild new file mode 100644 index 0000000..b0a32d2 --- /dev/null +++ b/repo/linux/b43-firmware.xibuild @@ -0,0 +1,14 @@ +#!/bin/sh + +MAKEDEPS="b43-fwcutter" +DEPS="linux" + +PKG_VER=6.30.163.46 +SOURCE=http://www.lwfinger.com/b43-firmware/broadcom-wl-$PKG_VER.tar.bz2 + +DESC="Firmware for Broadcom B43 wireless networking chips - latest release" + +package () { + install -d "$PKG_DEST"/usr/lib/firmware/ + b43-fwcutter -w "$PKG_DEST"/usr/lib/firmware/ broadcom-wl-$PKG_VER.wl_apsta.o +} diff --git a/repo/linux/b43-fwcutter.xibuild b/repo/linux/b43-fwcutter.xibuild new file mode 100644 index 0000000..68394f5 --- /dev/null +++ b/repo/linux/b43-fwcutter.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl" + +PKG_VER=019 +SOURCE=https://bues.ch/b43/fwcutter/b43-fwcutter-$PKG_VER.tar.bz2 + +DESC="firmware extractor for the b43 kernel module" + +build () { + make +} + +package () { + install -D -m755 b43-fwcutter "$PKG_DEST"/usr/bin/b43-fwcutter + install -D -m644 b43-fwcutter.1 "$PKG_DEST"/usr/share/man/man1/b43-fwcutter.1 +} diff --git a/repo/linux/broadcom-wl.xibuild b/repo/linux/broadcom-wl.xibuild new file mode 100644 index 0000000..948c9bd --- /dev/null +++ b/repo/linux/broadcom-wl.xibuild @@ -0,0 +1,43 @@ +#!/bin/sh + +MAKEDEPS="linux-src linux-headers" +DEPS="linux" + +PKG_VER=6.30.223.271 +SOURCE=https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-$(echo $PKG_VER | sed "s,\.,_,g").tar.gz + +DESC="Broadcom's IEEE 802.11a/b/g/n hybrid Linux device driver" +ADDITIONAL=" + 001-null-pointer-fix.patch + 002-rdtscl.patch + 003-linux47.patch + 004-linux48.patch + 005-debian-fix-kernel-warnings.patch + 006-linux411.patch + 007-linux412.patch + 008-linux415.patch + 009-fix_mac_profile_discrepancy.patch + 010-linux56.patch + 011-linux59.patch + 012-linux517.patch +" + +prepare () { + apply_patches + sed -i -e '/BRCM_WLAN_IFNAME/s/eth/wlan/' src/wl/sys/wl_linux.c + sed -i -e "/EXTRA_LDFLAGS/s|\$(src)/lib|/usr/lib/broadcom-wl|" Makefile + sed -i '/GE_49 :=/s|:= .*|:= 1|' Makefile +} + +build () { + KVER=$(cat /usr/src/linux/version) + #KBASE=/lib/modules/$KVER + make -C /usr/src/linux timeconst-file + make -C /usr/src/linux M=$PWD +} + + +package () { + ls + read wait +} diff --git a/repo/linux/linux-src.xibuild b/repo/linux/linux-src.xibuild new file mode 100644 index 0000000..d4d704e --- /dev/null +++ b/repo/linux/linux-src.xibuild @@ -0,0 +1,33 @@ +#!/bin/sh + +MAKEDEPS="make bc" +DEPS="sbase kmod" + +PKG_VER=5.17.2 +SOURCE=https://cdn.kernel.org/pub/linux/kernel/v${PKG_VER%%.*}.x/linux-$PKG_VER.tar.xz +ADDITIONAL=" + fix-sbase-coreutils.patch + config +" + +DESC="The latest linux kernel (source)" + +prepare () { + rm linux-$PKG_VER.tar.xz + apply_patches + + make mrproper + make headers + + mv config .config + make olddefconfig + make -s kernelrelease > version +} + +package () { + local kernver="$(cat version)" + srcdir=$PKG_DEST/usr/src/linux + mkdir -p $srcdir + cp -r ./ $srcdir/ +} + diff --git a/repo/linux/linux.xibuild b/repo/linux/linux.xibuild index 72bd22d..1abf645 100644 --- a/repo/linux/linux.xibuild +++ b/repo/linux/linux.xibuild @@ -27,17 +27,17 @@ build () { package () { local kernver="$(cat version)" - local modulesdir="$PKG_DEST/usr/lib/modules/$PKG_VER" + local modulesdir="$PKG_DEST/usr/lib/modules/$kernver" echo "Installing boot image..." mkdir -p $PKG_DEST/boot - cp arch/x86/boot/bzImage $PKG_DEST/boot/vmlinuz-$PKG_VER - cp System.map $PKG_DEST/boot/System.map-$PKG_VER - cp .config $PKG_DEST/boot/config-$PKG_VER + cp arch/x86/boot/bzImage $PKG_DEST/boot/vmlinuz-$kernver + cp System.map $PKG_DEST/boot/System.map-$kernver + cp .config $PKG_DEST/boot/config-$kernver - install -d $PKG_DEST/usr/share/doc/linux-$PKG_VER - cp -r Documentation/* $PKG_DEST/usr/share/doc/linux-$PKG_VER + install -d $PKG_DEST/usr/share/doc/linux-$kernver + cp -r Documentation/* $PKG_DEST/usr/share/doc/linux-$kernver install -m755 -d $PKG_DEST/etc/modprobe.d cat > $PKG_DEST/etc/modprobe.d/usb.conf << "EOF" @@ -51,7 +51,22 @@ EOF echo "Installing modules..." make INSTALL_MOD_PATH="$PKG_DEST/usr" INSTALL_MOD_STRIP=1 modules_install - #rm "$modulesdir"/source - #rm "$modulesdir"/build + builddir=$modulesdir/build + rm $modulesdir/source + rm $builddir + mkdir $builddir + echo "Installing build files..." + install -D -m644 .config "$builddir" + install -D -m644 Makefile "$builddir" + install -D -m644 Module.symvers "$builddir" + install -D -m644 System.map "$builddir" + install -D -m644 version "$builddir" + install -D -m644 vmlinux "$builddir" + install -D -m644 kernel/Makefile "$builddir/kernel/Makefile" + install -D -m644 arch/x86/Makefile "$builddir/arch/x86/Makefile" + cp -r scripts "$builddir" + + install -D tools/objtool/objtool "$builddir/tools/objtool" + install -D tools/bpf/resolve_btfids/resolve_btfids "$builddir/tools/bpf/resolve_btfids" } diff --git a/repo/skip/test.xibuild b/repo/skip/test.xibuild new file mode 100644 index 0000000..8a8902f --- /dev/null +++ b/repo/skip/test.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="test" +DESC="no description" + +MAKEDEPS="make " +DEPS="musl +openrc" + +PKG_VER=1.7 +SOURCE="https://test.com/test-$PKG_VER.tar.gz" +ADDITIONAL="libev-4.11-Add-pkgconfig-support.patch " +build () { + ./configure \ + --prefix=/usr + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libconfig.xibuild b/repo/system/libconfig.xibuild new file mode 100644 index 0000000..b81a2bd --- /dev/null +++ b/repo/system/libconfig.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME="libconfig" +DESC="A simple library for manipulating structured configuration files" + +MAKEDEPS="make automake autoconf libtool" +DEPS="musl" + +PKG_VER=1.7.3 +SOURCE="https://github.com/hyperrealm/libconfig/archive/v$PKG_VER.tar.gz" + +prepare () { + autoreconf -fi +} + +build () { + ./configure \ + --prefix=/usr + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make -j1 DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libev.xibuild b/repo/system/libev.xibuild new file mode 100644 index 0000000..6f43e9b --- /dev/null +++ b/repo/system/libev.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl" + +PKG_VER=4.33 +SOURCE=http://dist.schmorp.de/libev/Attic/libev-$PKG_VER.tar.gz +ADDITIONAL=" + libev-4.11-Add-pkgconfig-support.patch +" + +DESC="Library for applications dealing with netlink sockets" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-static && + make +} + +package () { + make -j1 DESTDIR=$PKG_DEST install + rm $PKG_DEST/usr/include/event.h +} diff --git a/repo/x11/picom.xibuild b/repo/x11/picom.xibuild new file mode 100644 index 0000000..f8d8cf6 --- /dev/null +++ b/repo/x11/picom.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +MAKEDEPS="libx11 libxcomposite libxinerama libxdamage + libconfig pcre libxrandr dbus libdrm mesa meson + libev libxdg-basedir pixman xcb-util-renderutil + xcb-util-image asciidoc uthash" +DEPS="dbus libconfig libev libx11 libxcb mesa-gl musl pcre pixman xcb-util-image xcb-util-renderutil" + +PKG_VER=9.1 +SOURCE=https://github.com/yshui/picom/archive/v$PKG_VER.tar.gz + +build () { + mkdir build + cd build + meson \ + -Dwith_docs=true \ + .. + ninja +} + +package () { + DESTDIR=$PKG_DEST ninmake ja install + mkdir -p "$PKG_DEST/usr/share/doc/picom" + install -m644 README* "$PKG_DEST/usr/share/doc/picom/" + install -D -m644 "picom.sample.conf" "$PKG_DEST/etc/xdg/picom.conf.example" + +} diff --git a/repo/xi/xipkg.xibuild b/repo/xi/xipkg.xibuild index dd1dc28..6165734 100644 --- a/repo/xi/xipkg.xibuild +++ b/repo/xi/xipkg.xibuild @@ -3,7 +3,7 @@ MAKEDEPS="make" DEPS="openssl curl dash xiutils findutils diffutils sed xichroot grep base64" -PKG_VER=1.2.1 +PKG_VER=1.2.2 SOURCE=https://git.davidovski.xyz/xilinux/xipkg.git BRANCH="v$PKG_VER" diff --git a/templates/configure.xibuild b/templates/configure.xibuild new file mode 100644 index 0000000..d6278ad --- /dev/null +++ b/templates/configure.xibuild @@ -0,0 +1,12 @@ +build () { + ./configure \ + --prefix=/usr + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/templates/make.xibuild b/templates/make.xibuild new file mode 100644 index 0000000..82cdeb9 --- /dev/null +++ b/templates/make.xibuild @@ -0,0 +1,7 @@ +build () { + make PREFIX=/usr +} + +package () { + make PREFIX=/usr DESTDIR=$PKGDEST install +} diff --git a/templates/meson.xibuild b/templates/meson.xibuild new file mode 100644 index 0000000..67ab5af --- /dev/null +++ b/templates/meson.xibuild @@ -0,0 +1,10 @@ +build () { + mkdir build && + cd build && + meson --prefix=/usr .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/templates/pypi.xibuild b/templates/pypi.xibuild index 20042b3..fbaeff2 100644 --- a/templates/pypi.xibuild +++ b/templates/pypi.xibuild @@ -1,7 +1,7 @@ #!/bin/sh MAKEDEPS="python" -DEPS="" +DEPS="%deps%" PKG_VER=%version% SOURCE=%url% diff --git a/wishlist.md b/wishlist.md new file mode 100644 index 0000000..e113f77 --- /dev/null +++ b/wishlist.md @@ -0,0 +1,39 @@ +# package wishlist + +[x] bspwm +[x] sxhkd +[ ] picom +[ ] mpd +[ ] ncmpcpp +[ ] pulsemixer +[ ] pavucontrol +[ ] chromium +[ ] firefox +[ ] ffmpeg +[ ] dmenu +[ ] rofi +[ ] mpv +[ ] sxiv +[ ] feh +[ ] gimp +[ ] lmms +[ ] ardour +[ ] cava +[ ] pcmanfm +[ ] thunar +[ ] zathura +[ ] polybar + +[ ] gnu screen +[ ] tmux +[ ] ImageMagick +[x] nmap +[ ] exiftool +[ ] mpc + +[ ] nvidia drivers +[x] working xorg +[x] sshd (openssh) +[ ] broadcom wl drivers +[ ] bluetoothctl + |