Advertisement
bjakobson

webboot & ubuntu

Jan 24th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.13 KB | None | 0 0
  1. sudo apt install libssl-dev
  2. sudo apt-get install build-essential
  3.  
  4. git clone --depth 1 -b v4.12.7 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux
  5. git clone git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git
  6. cp config-4.12.7 linux/.config ** OR **  
  7. cd linux
  8.  wget https://raw.githubusercontent.com/u-root/webboot/master/config-4.12.7
  9. cp config-4.12.7 .config
  10.  
  11. make bzImage
  12.  
  13.  
  14. --Make Ubuntu's kernel :
  15. sudo apt-get install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex
  16. git clone --reference linux git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic
  17. git clone --reference linux git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/cosmic
  18.  
  19. sudo apt-get build-dep --no-install-recommends --only-source linux
  20. apt-get source --only-source linux
  21.  
  22. (if error, type sudo nano /etc/apt/sources.list, and delete any # you see)
  23.  
  24. sudo apt-get install linux-source
  25. mkdir ~/src; cd ~/src
  26. go to https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.15.tar.xz (it will start a download)
  27. sudo cp -R /Downloads/linux-4.15.tar.xz ~/src
  28. cd ~/src
  29. sudo tar -xzvf linux-4.15.tar.xz (or right click and extract)
  30.  
  31. cp -vi /boot/config-`uname -r` .config
  32. sudo apt-get install libncurses5 libncurses5-dev
  33.  
  34. sudo make menuconfig
  35. (I didn't change anything, just hit the down-arrow to exit and save)
  36. grep PMEM .config
  37.  
  38. if it has any =m,
  39. nano .config, CTRL+W (or whatever option says search for), find what said =m and change it to =y, and save.
  40. grep PMEM .config, and make sure it looks like this:
  41.  
  42. CONFIG_X86_PMEM_LEGACY_DEVICE=y
  43. CONFIG_X86_PMEM_LEGACY=y
  44. CONFIG_BLK_DEV_PMEM=y
  45. CONFIG_ARCH_HAS_PMEM_API=y
  46.  
  47. make -j8
  48.  
  49. go get github.com/u-root/webboot
  50.  
  51. cd $GOPATH/src/github.com/u-root/webboot
  52.  
  53. go run buildimage.go -u '-build=bb -files $HOME/src/linux-4.15/arch/x86/boot/bzImage:bzImage'
  54.  
  55.  
  56. qemu-system-x86_64  -m 2048   -kernel linux/arch/x86/boot/bzImage   -append 'console=ttyS0 console=tty1 memmap=4G!4G'   -initrd /tmp/initramfs.linux_amd64.cpio   -device virtio-rng-pci -netdev user,id=network0 -device rtl8139,netdev=network0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement