You are not logged in.
Hello,
I am trying to recompile a kernel where i have modified one driver file, but my changes get erased (and back to default) as soon as i start making the package.
I am using archlinux ABS (followed the wiki page https://wiki.archlinux.org/index.php/Ke … ild_System) and downloaded the kernel 3.10.9. The first thing i did was
makepkg -o PKBUILDSo i could get the sources. Next i modified "src/drivers/hid/usbhid/hid-core.c" adding one line to fix something related to my keyboard.
Afterwards i proceed to recompile the kernel
makepkg -s PKBUILDi see at least two potential problems with what i am doing.
(1) When i see the kernel build output of "makepkg -s PKBUILD" ,i see there is a patch for the file i modified; "src/drivers/hid/usbhid/hid-core.c". Does the patch removes all my manual changes done on the file?
i tried modifying "patch-3.10.9" commenting out the part that patches that file, so it does not get touched by the patch process. But still no luck, maybe because of problem (2)
(2) Each time i run "makepkg PKBUILD" i see that the "*.xy" file gets unpacked, probably overwriting all sources again, loosing the manual change.
In the end, what i am looking for is to have that custom kernel as another option in my grub list.
I am lost at this moment, any help is welcome.
Last edited by labotsirc (2013-08-28 15:36:16)
Offline
Read the man page for makepkg.
The correct link to the wiki is https://wiki.archlinux.org/index.php/Ke … ild_System (the closing parenthesis broke it)
Last edited by karol (2013-08-28 14:19:14)
Offline
Read the man page for makepkg.
The correct link to the wiki is https://wiki.archlinux.org/index.php/Ke … ild_System (the closing parenthesis broke it)
fixed link.
edit:
mmm maybe this should do:
from "man makepkg":
-e, --noextract
Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory. This is handy if you want to go into $srcdir/ and manually
patch or tweak code, then make a package out of the result. Keep in mind that creating a patch may be a better solution to allow others to use your PKGBUILD.
I will try and post back. Thanks
Last edited by labotsirc (2013-08-28 14:24:35)
Offline
If the change(s) are simple modifications (e.g. adding/changing a word on a line) you can add a sed command to the prepare() function in the PKGBUILD. This will then be executed for you when you run makepkg, making your changes before the build stage.
If the changes are more complex, consider creating a patch that you can apply during the prepare stage. https://wiki.archlinux.org/index.php/Patching_in_ABS
edit: I hadn't considered makepkg -e, that should work in this case.
Last edited by WorMzy (2013-08-28 14:29:58)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
If the change(s) are simple modifications (e.g. adding/changing a word on a line) you can add a sed command to the prepare() function in the PKGBUILD. This will then be executed for you when you run makepkg, making your changes before the build stage.
If the changes are more complex, consider creating a patch that you can apply during the prepare stage. https://wiki.archlinux.org/index.php/Patching_in_ABS
edit: I hadn't considered makepkg -e, that should work in this case.
Actually it is just one line. If i add the sed command as you suggest, will i be able to skip the "makepkg -o PKGBUILD" source downloading part?
Offline
Yes, it will be applied to the "fresh" source that makepkg extracts from the tarball, everytime you run "makepkg". Take a look at the linux package's PKGBUILD for an example of a prepare function.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Thanks Karol and WorMzy, adding the sed command in "prepare" did the job.
Offline