Frogging-Family / linux-tkg

linux-tkg custom kernels
GNU General Public License v2.0
1.33k stars 167 forks source link

./install.sh install fails to install kernel randomly #644

Open Slaviusz opened 1 year ago

Slaviusz commented 1 year ago

OS: Gentoo amd64

Using the ./install.sh install command randomly results in not isntalling the kernel after compilation. To me it happens roughly 1/8 times. No error is written to the console. Repeated run with no change results in kernel being installed correctly.

I'll try to investigate further.

...
 -> The installation process will run the following commands:
    # copy the patched and compiled sources to /usr/src/linux-6.1.0-rc4-tkg-bore-llvm
    sudo make modules_install
    sudo make install
    sudo dracut --force --hostonly --zstd --kver 6.1.0-rc4-tkg-bore-llvm
    sudo grub-mkconfig -o /boot/grub/grub.cfg
 -> Note: Uninstalling requires manual intervention, use './install.sh uninstall-help' for more information.
Continue ? Y/[n]: Y
 -> exit cleanup done
seankhl commented 1 year ago

This happens if I type anything besides a Y at any point between the "Continue ?" prompt and the previous one, i.e. right before the kernel starts building. Sometimes I accidentally hit a key on the keyboard while the kernel is building, and then, no matter what I do, this prompt results in triggering the default selection of n.

Siegfried512 commented 1 year ago

Yes, I suffer from this too.

AdelKS commented 1 year ago

I'll see what I can do, for sure there must be a way to discard any earlier input before prompting

Slaviusz commented 1 year ago

I have seen this being solved in some scripts before but I can't recall where.

I tried this and it worked on GNU bash, version 5.2.9(1)-release (x86_64-apple-darwin22.1.0):

clear_stdin()
(
    old_tty_settings=`stty -g`
    stty -icanon min 0 time 0

    while read none; do :; done

    stty $old_tty_settings
)
Siegfried512 commented 1 year ago

Thank you!

Siegfried512 commented 1 year ago

Now I collected on behalf of the user, and I did not have this problem.

AdelKS commented 1 year ago

The problem with flushing stdin is that approaches like yes "" | ./install.sh install wouldn't work any longer, and it's used by some people and our pipeline here :thinking:

tg12 commented 7 months ago

Yes I have just found this and I have this issue too

Slaviusz commented 7 months ago

@AdelKS Regarding scripted pipeline I beleive one could use expect or libexpect for that matter.