Linux kernel recompilation issue - linux-kernel

I successfully recompiled and installed linux kernel 4.2.0 on my ubuntu 15, I for the learning purposes tried to install another kernel 4.1.7 on my machine. I followed the exact same procedure to recompile and install it. I become successful to recompile kernel 4.1.7 but when i installed it and reboot my ubuntu and checked running kernel in it it still shows the 4.2.0 instead of 4.1.7.
what could go wrong in my second installation?
The process i followed to recompile and install both kernel is
1. downloaded the kernel from kernel.org
2. made the kernel directory in home and extract kernel.tar.xz there
3. in terminal go to the kernel directory
4. run this command sudo apt-get install gcc libncurses5-dev dpkg-dev
5. make menuconfig
6. saved the .config file with a different name i-e .config_aa
7. mv .config_aa .config
8. make -j 5 KDEB_PKGVERSION=1.RIBALINUX deb-dev
9. sudo make install
10. sudo reboot
11. checked kernel version using uname -r

You need to choose kernel for load in bootloader. On Ubuntu it is usually a GRUB2 (tutorial).
This step is missed in some manuals, because one usually intents to build kernel with newer version. After installation, the newest kernel version is arranged first, which is loaded by default.

Related

How to compile a Go application using gopacket for 32bit mips

I am trying to compile a little application using the gopacket library to linux on a 32bit mips cpu. Unfortunately I am getting loads of errors like this:
/home/cdutz/go/pkg/mod/github.com/google/gopacket#v1.1.19/pcap/pcap.go:30:22: undefined: pcapErrorNotActivated
On a "normal" linux system these seem to be defined in "pcap_unix.go" while on windows the values are coming from "defs_windows_amd64.go". I do have the libpcap in a 32bit mips version on my target system, which is good as my target system doesn't have the extra space to install all the tools needed to compile anything on it. I know that libpcap doesn't exist as a 1-to-1 version on windows, so this probably explains the "defs"-files. But I would generally expect it to have the same API as the one on my linux system.
[UPDATE]
So it seems number 1 of the things that needs to be ensured is that cgo is executed. This is done by setting the environment variable:
CGO_ENABLED=1
Next we need to ensure the mips compatible versions of the libpcap are installed (the header files are identical on any architecture). In order to do this on my Ubuntu 16.4 I first needed to enable the 'mips' archirecture:
dpkg --add-architecture mips
And add the debian repo to the /etc/apt/sources.list
deb [trusted=yes] http://ftp.de.debian.org/debian buster main
As soon as that's done, I could install the mips binaries:
apt install libpcap-dev:mips libpcap0.8-dev:mips libc6-dev:mips libdbus-1-dev:mips libpcap0.8:mips
In order to cross compile, it seems I need a gccgo version that can do that. For this I installed:
apt-get install gccgo-mips-linux-gnu
Now comes something I am not sure I did right, but when running the go build with compiler=gccgo it always picked the amd64 version and using anything else but 'gccgo' as compiler argument didn't work, so I updated the symlink in /usr/bin/gccgo to point to: 'mips-linux-gnu-gccgo-8' (in the same directory).
After all of these changes, I was able to almost build everything with this command:
go build -compiler=gccgo
If I enable the additional output with the '-x' option, I can see that cgo is now doing it's thing. It's also compiling all the other modules. But on the pcap one it now fails with:
cc1: error: command line option '-c' is valid for the driver but not for C
So this is where I'm currently stuck at.
Ok, after 3 days I think I managed to get things working and I'll summ up what I did.
In the end the gccgo path was a dead end, so instead of installing gccgo-mips-linux-gnu I installed gcc-mips-linux-gnu.
Next I set the CC environment variable to point to this:
export CC=/usr/bin/mips-linux-gnu-gcc-8
That was actually what was missing.
So summing it up on my Ubuntu 16.04 system:
dpkg --add-architecture mips
echo "deb [trusted=yes] http://ftp.de.debian.org/debian buster main" > /etc/apt/sources.list
apt update
apt install -y wget git build-essential mc
apt install -y gcc-mips-linux-gnu
apt install -y libpcap-dev:mips libpcap0.8-dev:mips libc6-dev:mips libdbus-1-dev:mips libpcap0.8:mips
export CC=/usr/bin/mips-linux-gnu-gcc-8
export GOOS=linux
export GOARCH=mips
export GOMIPS=softfloat
export CGO_ENABLED=1
go build
I hope this might help others.

Can't add gcc-arm-linux-gnueabhf version 7 to Ubuntu

I'm trying to compile u-boot for Raspberry pi 3 but I have an issue
with my cross-compiler on my Ubuntu 16.04. I installed gcc-arm-linux-gnueabhf with sudo apt-get install, it automatically
installed version 4.8.
When I ran make CROSS_COMPILe=arm-linux-gnueabhf- to make u-boot
files, make erros and said that it needs arm-linux-gnueabhf higher version>= 6. To solve this, I downloaded a new 7.4 version and add
it's path to ~/.bashrc file.
export
PATH="$PATH:/home/$USER/opt/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin"
I run command arm-linux-gnueabhf-gcc --version. It still in 4.8.
Please help me look into it.
========================================================================
The issue was solved with reference form
https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-ARMCrossCompiler:GCC

Install Metatrader 5 on Ubuntu 17.04

I try to install Metatrader 5, on Ubuntu 17.04 (64-bit).
I get stuck, and need somebody to help me to solve this problem.
I've installed wine-2.0.1, which is the latest stable version at the moment, and it's for 64-bit.
Finally, after successfully installing Metatrader 5, on launching the application appears an error window: terminal64.exe, with message:
A debugger has been found running in your system.
Please, unload it from memory and restart your programm.
On wiki.winehq.org, I've found that is needed to install 2 separate versions of wine: 32-bit and 64-bit. I try to do all like in:
https://wiki.winehq.org/Building_Biarch_Wine_On_Ubuntu
, but at the stage "Build 64-bit Wine", for: make clean, I got:
make: *** No rule to make target 'clean'. Stop.
There is a way to really install mt5 on Ubuntu 17.04 ?
Just installed it after suffering a little bit. After seeing many requests from the installer to provide a proxy!
First install the latest Wine from the instructions given in its website for Ubuntu (this is the one that will work!)
sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key sudo apt-add-repository
https://dl.winehq.org/wine-builds/ubuntu/
sudo apt-get update
Stable branch:
sudo apt-get install --install-recommends winehq-stable
Configure Wine to 32 bits (only your user)
WINEARCH=win32 WINEPREFIX=~/.wine32 wineboot
Install Metatrader 5
WINEPREFIX=~/.wine32 wine start /unix /path/to/mt5setup.exe
Happiness
Finally to run MetaTrader 5 add the following to your .bashrc our .profile. And type metatrader on your terminal.
export WINEPREFIX=~/.wine32
alias metatrader='wine start "C:\program files\metatrader 5\terminal.exe"'
Thanks to #Kaleshwar Chand
I recently installed metatrader5 on ubuntu 17.04, using the instructions found on mql5 thread
basically mt5 is 32 bit and your ubuntu is 64 bit so you need to change arch to 32 bit to install/use it properly
enter into terminal
WINEARCH=win32 WINEPREFIX=/home/user/.wine32 wineboot
replace user with your username
then install with
WINEPREFIX=/home/user/.wine32 wine start /unix /path/to/mtsetup.exe
again replace user with your username
I am running MT5 on Arch,
in my case, a 64bit wineprefix is needed for connect with other apis so...
For install and run it correctly I installed:
wine, wine-mono, wine_gecko, winetricks, playonlinux
winetircks corefonts, winetricks winhttp
libgnutls allowed to skip the required proxy error
MT5 was installed throught playonlinux on a 64bit wineprefix
Follow the steps from office winehq at https://wiki.winehq.org/
and find your OS you are using
Android (WineHQ binary packages for Android)
Ubuntu (WineHQ binary packages for Ubuntu 16.04, 18.04, 19.04, and 19.10)
Debian (WineHQ binary packages for Debian Stretch, Buster, and Bullseye)
Fedora (WineHQ binary packages for Fedora 30 and 31)
MacOS (WineHQ binary packages for macOS 10.8 through 10.14)

the new kernel(3.9.6) configs for solving acpi=off in lenovo laptops

i have a Lenovo Z580 IDeaPAd Laptop and want to boot my linux with acpi.but with its kernel i must to set acpi off in the kernel i read more about this in net and found that must use new kernels above 3.8.
i donwload every kernels in the kernel.org.
i want to set the configs but i dont know any thing and use the previous kernel configs to compile.
i want to know what configs should i do and set for solving the acpi problem.
i ahve linuxmint 14 and linuxmint 15 and have kernels: 3.9.3 3.9.4 and 3.9.6.
If you have working linux-kernel, before compile of kernel use command
make oldconfig
This make config with working old params.
Try install previus version of Mint, which use 3.8.* kernel. Compile kernel with old-config and upgrade system.
Download the kernel tarball from kernel.org, then execute the following:
$ tar xvzf kernel-xxx.tar.gz
$ cp /book/config-`uname -r` .config
$ make oldconfig # use default value for all prompt
$ make
$ make modules_install
$ make install

Problem with gcc 4.6 installation on ubuntu

I am trying to install gcc 4.6 (mainly for having C++0x better supported) in my ubuntu 9.10 (via virtualbox). I referred to previous questions, but I am getting a different error.
I am referring this link for the installation. Now, I have done till the ./gcc-xx/configure ... step. Though it was giving some flex package related error. Mostly due to that make is also failing with below errors:
build/gengtype.o: In function
adjust_field_rtx_def':
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:978:
undefined reference tolexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1032:
undefined reference to lexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1042:
undefined reference tolexer_line' ...............
Now this is giving me a hard time figuring it out because I have already flex/bison latest versions installed. I searched over internet for 2 days almost but no luck. Any help would be really appreciated. Also note that, I already have gcc 4.4 installed in /usr/bin/gcc and I have unzipped the gcc 4.6 tar in my home directory local folder.
[Note: I am also ok with installing ubuntu 11.10 too (which has gcc 4.6) as last resort. But I don't know if its .iso image is available.]
I got this fixed. I followed following procedure:
[Note: run all the commands with sudo, if you are not login as root. e.g. sudo ls -ltr; sudo make install;
As mentioned in the link in my
question, download the gcc4.6...tar
file in a temporary place
Now find the place where current
gcc is stored. e.g. My earlier
gcc4.4 was stored in
/usr/lib/gcc/i486-linux-gnu. Which
has a folder called 4.4, 4.4.1
Create a folder named 4.6 (or
4.6.1/2/3 etc.) and put that
.tar file inside it. Untar the
file as shown in link.
Follow all the procedure as per the
link. Use nohup <command> & to
track the logs. i.e. nohup make
clean all & followed by tail -f
nohup.out
If some error comes, it means some
package is missing. Mostly those
package will be present in your
current gcc version. You can
install them there itself. For
example, in my case zlib was
missing. I ran sudo apt-get install
zlib1g-dev libssl-dev and it worked
fine. Otherwise download from internet and install it.
Once your gcc is installed, you
can simply check it using type
gcc-4.6. In my case it showed that
it's stored as
/usr/local/bin/g++-4.6.
Either you can use the same path to
compile or you can put an alias in
your bash/tcsh/ksh. e.g.
/usr/local/bin/g++-4.6 -std=c++0x
-Wall test.cpp
FWIW Debian testing and unstable have gcc-4.6 as a standard package. So you can simply install that distro inside of virtualbox or, as I've done on my Ubuntu 11.04 server at home, via kvm. In the past, I also used to use dchroot build environments.
There may also be prepackaged gcc-4.6 binaries at launchpad.

Resources