Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ubuntu install script + general-ish .config&patching script #26

Merged
merged 57 commits into from
Aug 6, 2020
Merged

Conversation

AdelKS
Copy link
Collaborator

@AdelKS AdelKS commented Jun 29, 2020

Hello!

This is my current work after opening the issue #21. The implemented changes so far are the following :

  • I added the config option _distro in customization.cfg where the user should put "Arch", "Ubuntu" or "Fedora". This options is used for two reasons:
    • For the install script install.sh to know which distro it's working on, it will be important when installing since Fedora and Ubuntu are different
    • To isolate some code in _tkg_srcprep() that isn't useful for non-arch installs.
    • Extra: This option can be avoided by checking out /etc/os-release, where the NAME variable contains the distro's name. Sounds rather appealing to me, but I didn't want to bother for now. What do you think of it ? That would make the option _distro useless. But would mean that Arch derivatives, Debian derivatives and Redhat derivatives should be recognized appropriately.
  • I added an install.sh script, for now it only downloads the linux kernel sources, patches them, and does the config starting off the distro's current one.
    • Please try the install script on your machine, even if it's Arch based, lie to the script by telling it you're using Ubuntu for you to see what's happening, if you have any comments on how things are done.
  • I made _tkg_srcprep() a bit more verbose, just so I can visually see when a patch starts and when it ends. Up to you if you want to keep it.
  • I added make xconfig option.

I will work on the Ubuntu install and uninstall process. I will base it off a custom name, given by the user, the recognize the deb packages installed by the script and uninstall them. After that, I will tackle Fedora.

Also, please check that I haven't broken the PKGBUILD process.

Tell me what you think, I will keep you updated.

@AdelKS
Copy link
Collaborator Author

AdelKS commented Jun 29, 2020

Speaking of make xconfig, when I reach that stage with my current setup I get the following warnings then the window launches:

.config:6639: warning: override: reassigning to symbol CMDLINE
.config:6652: warning: override: reassigning to symbol MATOM
.config:6679: warning: override: HZ_500 changes choice state

If I save then quit, without doing any modifications, the generated fragments are the following:

CONFIG_HZ=500
# CONFIG_HZ_250 is not set
# CONFIG_HZ_750 is not set
# CONFIG_MNATIVE is not set
CONFIG_SMT_NICE=y

I am not sure this is related with my script, but I am writing it if ever it's the case.

@AdelKS
Copy link
Collaborator Author

AdelKS commented Jun 30, 2020

@Tk-Glitch Can the function user_patcher() be moved to the prepare file ? So I can enable in in the non-Arch install script.

@Tk-Glitch
Copy link
Member

Tk-Glitch commented Jul 3, 2020

user_patcher() can indeed be moved to the prepare file. I don't think the config overrides are related to your script. Those are looking familiar and normal to me.

Due to health issues I won't be able to properly review your code until a few more days. Sorry about that.

@AdelKS
Copy link
Collaborator Author

AdelKS commented Jul 3, 2020

user_patcher() can indeed be moved to the prepare file. I don't think the config overrides are related to your script. Those are looking familiar and normal to me.

Got it! I will move it then.

Due to health issues I won't be able to properly review your code until a few more days. Sorry about that.

Don't you even worry, I will keep on working on the script meanwhile, I hope it's nothing serious. get better soon ! 😄

@AdelKS
Copy link
Collaborator Author

AdelKS commented Jul 4, 2020

With the latest sub-versions of linux-5.7, 5.7.6 and 5.7.7 so far (5.7.5 works) I have been getting these errors, they happen when the .deb files are being created, I can't find anything about it on the webs:

error: include/uapi/linux/vt.h: leak CONFIG_NR_TTY_DEVICES to user-space
make[6]: *** [scripts/Makefile.headersinst:63: usr/include/linux/vt.h] Error 1
make[6]: *** Waiting for unfinished jobs....
HDRINST usr/include/linux/kvm_para.h
make[5]: *** [Makefile:1227: headers] Error 2
make[4]: *** [scripts/Makefile.package:87: intdeb-pkg] Error 2
make[3]: *** [Makefile:1463: intdeb-pkg] Error 2
make[2]: *** [debian/rules:9: binary-arch] Error 2
dpkg-buildpackage: error: fakeroot -u debian/rules binary subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:77: deb-pkg] Error 2
make: *** [Makefile:1463: deb-pkg] Error 2

Any idea what the reason behind this can be ?

@AdelKS
Copy link
Collaborator Author

AdelKS commented Jul 4, 2020

Given that I am having problems with the latest kernel sub-versions, I have found a very elegant way to switch between sub-versions and to reset the sources to their original state when re-running the install script : by using git !

I found a branch, linux-5.7.y, in https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git, that only contains the improvements to the linux-5.7 base kernel. Starting from there:

  1. Shallow clone that branch up to 5.7.0
  2. Doing git checkout --force linux-5.7.y will reset any modified file to its original state and move HEAD to the tip of the local branch.
  3. Doing git pull gets the latest source files
  4. Doing git clean -f -d -x deletes all the extra files created by compilation/patching.
  5. Doing git checkout v5.7.x enables reverting to older sub-versions. I added a config entry in customization.cfg that enables that, _kernel_subver. If left empty, latest code is used. Otherwise the script reverts to the asked sub-version.

What I win with this approach is that the hard drive is not over-used when resetting sources to their original state when re-running the install script. Because, for resetting, I was doing rm -rf source-folder then unpacking it again from the original tar archive. Also, no need for a commit to change the variable _subver to a newer version when a new subversion is released.

I don't know if this same approach can be implemented for PKGBUILD with its limitations.

@AdelKS AdelKS changed the title Add Ubuntu install script Add Ubuntu install script + general-ish .config&patching script Jul 27, 2020
@Tk-Glitch
Copy link
Member

I'll review soon.

@@ -77,9 +79,6 @@ _ftracedisable="false"
# Set to "true" to disable NUMA, lowering overhead, but breaking CUDA/NvEnc on Nvidia equipped systems - Kernel default is "false"
_numadisable="false"

# Set to "true" to enable misc additions - May contain temporary fixes pending upstream or changes that can break on non-Arch - Kernel default is "true"
_misc_adds="true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is here to stay, even if I end up removing the specific patch it was initially introduced for.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I wanted to discuss that with you. As I understand now you didn't put it only for Ubuntu to be able to compile, then okay!

Are you the one who reverts commits or me ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it was to have a place to add temporary patches without using -base for it. The decoupling of "that patch" with -base was following that logic of temporary fixing the issue we had with it.

I have no power on the PR's code until it's effectively merged afaik.

Copy link
Collaborator Author

@AdelKS AdelKS Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually gave you push permissions, with the "Allow edits by maintainers " 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a small concern about the misc patch, I would like people from ubuntu for example to get the amdgpu patch but not have the change that gives the leaky tty :/

patch -Np1 -i ../0003-glitched-cfs.patch
msg2 "Applying Glitched CFS patch"
patch -Np1 -i "$_where"/0003-glitched-cfs.patch
msg2 "Done"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced by those "Done" messages. Am I missing something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debugging in the beginning, and I wanted to know which lines are terminating properly. If you don't like the "Done" let's get rid of it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't actually ran the script to see the output yet, but with the patch coming after outputting it's "header message" I gave you my initial thoughts about it. I'm not against them if you consider they are helping out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find them useful and like to see that something is "Done" before it moves to something else. The final decision is up to you, it will take me few seconds to remove all the "Done" messages.

@AdelKS
Copy link
Collaborator Author

AdelKS commented Aug 4, 2020

Now that Linux 5.8 is out, I will add the install.sh there too.

@Tk-Glitch
Copy link
Member

I'm merging the 5.7 version and will work on making it a bit more flexible.

@Tk-Glitch Tk-Glitch merged commit 3c7fd7b into Frogging-Family:master Aug 6, 2020
Tk-Glitch added a commit that referenced this pull request Aug 6, 2020
@AdelKS
Copy link
Collaborator Author

AdelKS commented Aug 7, 2020

Awesome! Will you make the script for 5.8 or do you want me to do it ?

@Tk-Glitch
Copy link
Member

I'll reflect the changes to 5.8, no worries. The small tweaks I have made in the commit above should be all good on buntu but I haven't tested them there, so I might have missed a quirk or two. Do you happen to have checked that I didn't break anything by any chance ? 😄

@AdelKS
Copy link
Collaborator Author

AdelKS commented Aug 7, 2020

Cool! I haven't tested the Ubuntu build with your changes, will do now. Also can you remove all occurrences of _command_recognised in install.sh ? Forgot it there after I changed the way I handled non-recognized commands.

@AdelKS
Copy link
Collaborator Author

AdelKS commented Aug 7, 2020

Sorry, another thing, in customization.cfg, CUSTOM_GCC_PATH is not Arch specific anymore. Install.sh does use it.

@AdelKS
Copy link
Collaborator Author

AdelKS commented Aug 7, 2020

Okay it works! I got bamboozled by the _misc_adds variable: I waited for the entirety of the compile process to get the leaky message error, because I forgot to set it to false. I think it is a good idea to make an interactive prompt for it like the other options 😄

@AdelKS AdelKS mentioned this pull request Aug 7, 2020
Tk-Glitch added a commit that referenced this pull request Aug 17, 2020
Tk-Glitch added a commit to Tk-Glitch/PKGBUILDS that referenced this pull request Aug 19, 2020
  > Update TkgThingy
  > linux-tkg: linux58-tkg: 5.8.2
  > linux-tkg: linux57-tkg: 5.7.16
  > linux-tkg: linux54-tkg: 5.4.59
  > linux-tkg: linux59-rc-tkg: Update readme and comment out some disabled options in .cfg
  > linux-tkg: linux-tkg: Explicitly set X86_P6_NOP default (disabled) so it doesn't prompt on archs not selecting it.
  > linux-tkg: linux58-tkg: Update prjc / BMQ patchset to v5.8-r1
  > linux-tkg: linux-tkg: non-Arch: Set _misc_adds="false" for now
  > linux-tkg: linux-tkg: The double equal sign amusement continuation
  > linux-tkg: Introduce initial linux59-rc-tkg
  > linux-tkg: linux58-tkg: Update readme
  > linux-tkg: linux58-tkg: Bring Ubuntu install script and related changes initially introduced with Frogging-Family/linux-tkg#26
  > nvidia-all: Add initial kernel 5.9 patch, based on Isaak I. Aleksandrov's
  > nvidia-all: 450.66
  > wine-tkg-git: Hotfixer: Update rules and custom patches for 8f3bd63b, staging 7d08bb86 and fs hack unbreak list for 2b484b1a
  > wine-tkg-git: Proton-tkg: makepkg: Write "true" versioning string to the version file
  > wine-tkg-git: Hotfixer: Remove undesired winevulkan_vkGetPhysicalDeviceSurfaceCapabilitiesKHR restoration from 01150d7f hotfixes 64/65/66.
  > wine-tkg-git: Hotfixer: Early: Legacy: Fix the mfplat patchset typo in v5.15 release (fixed in v5.15.1)
  > wine-tkg-git: Use a triple-way selector for custom compiler paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants