How to create a patch for hostapd.sh

Hi all,

Trying to patch hostapd.sh

  • download git clone git://git.openwrt.org/openwrt/openwrt.git
  • modify: package/network/services/hostapd/files/hostapd.sh.
  • create patch file: 800-my-addition.patch
  • download openwrt-SDK
  • copy 800-my-addition.patch to openwrt-sdk/feeds/base/package/network/services/hostapd/patches directory
  • make and install packages

But I am getting this error:

Applying ./patches/800-my-addition.patch using plaintext:
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/package/network/services/hostapd/files/hostapd.sh	(date 1551879915000)
|+++ b/package/network/services/hostapd/files/hostapd.sh	(date 1551910928000)
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Patch failed!  Please fix ./patches/800-my-addition.patch!

How do I fix this? What should be the path in the patch file?

Thanks :slight_smile:

The path is probably with respect to the extracted source.

quilt can be used with the OpenWrt build system. See, for example, https://openwrt.org/docs/guide-developer/patches

Hey Jeff,

I followed the steps in the in the link, both creating a new patch and adding an existing patch.

After the make/prepare command, menuconfig pops up and select hostapd, save .config and exit.
then I did: quilt push -a but it says "No series file found"

But when I do quilt new 010-main_code_fix.patch I am creating a patch for the hostapd package.

Here is the directory structure, this shows structure of hostapd

t@ubuntu:~/openwrt-sdk-18.06.2/build_dir/target-mips_24kc_musl/hostapd-full-internal/hostapd-2018-05-21-62566bc2$ ls
Android.mk     CONTRIBUTIONS  doc          hostapd  mac80211_hwsim  radius_example  src    wlantest  wpaspy
build_release  COPYING        eap_example  hs20     patches         README          tests  wpadebug  wpa_supplicant

I am not trying to create a patch for the package hostapd, I am trying to create a patch for the script hostapd.sh which is part of openWRT and which will be place here: /lib/netifd/hostapd.sh

Instead of the patch, do you think I should just replace hostapd.sh with my version and compile the package?

Thanks!

Ah, yes, I handle changes to the OpenWrt-distributed files with a local git branch. My apologies for sending you into the depths of quilt.

No worries, I learned something new. I didn't know about quilt. :slight_smile:

I was about to start a journey like Frodo Baggins but turned around just in time :smile:

Ok, I'll keep a git branch as well. That sounds much simpler.

Thanks

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.