Ok, let's start!
I put all commands in the
zone.
Choose your Linux distro.:
Open the Terminal and type:
sudo apt update; sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev liblz4-tool vim libelf-dev -y
Choose your kernel version:
Unzip the kernel which you downloaded:
tar -xvf ~/Download/linux-*.tar
cd
in to the folder you unziped:
cd ~/Download/linux-*
Edit the version info:
vim Makefile
-<YOUR STUDENT ID>
EXTRAVERSION = -B073040047
Esc
key to command mode, and type :wq
to save and quit25077667 Murmur: Edit the Makefile is much more easier and needless to search keywords in lots of lists.
Actually, Linus torvalds also uses 'Makefile' method. 💕 Valentine's Day Edition 💕
Set old default config as .config:
make olddefconfig
Make!
make -j $(nproc)
$(nproc)
command can get the number of CPUs in your computer, that is, compile kernel in full speed!Kernel: arch/x86/boot/bzImage is ready (#3)
Make module install
sudo make modules_install
Install it to /boot
sudo make install
Update Grub2
sudo update-initramfs -c -k <THE VERSION YOU COMPILED>
sudo update-grub
Reboot!
reboot
Done.
It will help you very much if you read this.
GNU Linux dev
What is Vim?
A picture to realize vim: picture
A meme:
What is disk partitions?
What is partitions' format and flag?
How to split your partitions by yourself?
fdisk
, gparted
, lsblk
, cfdisk
, this examples is using fdisk
fdisk -l
fdisk /dev/sdX
fdisk
press p
to list partitionfdisk
press o
to create new dos partition table(MBR) , press g
to create gpt partition(UEFI)/
(root)fdisk
press n
to create a new partitionfdisk
press t
to modify partition type(linux file system)/
(root) , the other mount as /boot
fdisk
press n
to create a new partitionfdisk
press t
to modify partition type(/
: linux file system , /boot
: efi)mkfs.ext4 /dev/sdXY
mkfs.vfat /dev/sdXY
Concluding:
Please follow these tutorials:
There are two methods to solved this:
- Resign your kernel and install.
- Disable the secure boot.
That is your memory is not enough to boot.
Please give your machine more memory.
Well, you can ping 8.8.8.8 first.
If ping 8.8.8.8 is working, that might be NSYSU's issue.(Please tell teacher)
else please check your network state.
Please check if you were following these steps without any error.
And make sure some dependency packages are installed.
If you have any error here, don't keep going down!!
Eg:
There is an error!! Please check your "debian/canonical-certs.pem" first.
Don't make install…
If you don't know what happends. Please Google it first, you can ask me if you can't not find useful answers.
Wait for it.
Eg:
There are 2 problems here.
The root directory is '/', which is called "root"(The root of your file system). And your "home" directory is symboled as "~/", the '~' is an alias for '/home/<YOUR_NAME>'.
You shouldn't have any Linux root file system on Windows (excepat some hacking skills). You cannot use the WSL to compelete this part of homework 1.
Because the WSL's kernel is not a normal Linux kernel, there are many encapsulation of Hyper-V or NT-Core, which simulate the behavior of Linux kernel. Therefore, you cannot recompile it from the "origional" Linux source code.