pack.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. Header=$(ls -t -U | grep -m 1 "linux-header")
  3. Image=$(ls -t -U | grep -m 1 "linux-image")
  4. Libc=$(ls -t -U | grep -m 1 "linux-libc")
  5. version=$(ls linux-libc-dev_5.15.*-custom-1_amd64.deb | sed "s/linux-libc-dev_//g" | sed "s/custom.*/custom/g")
  6. if [ -f ksource.txt ]
  7. then
  8. rm ksource.txt
  9. fi
  10. touch ksource.txt
  11. echo "KHeader=$Header" >>ksource.txt
  12. echo "KImage=$Image" >>ksource.txt
  13. echo "KLibc=$Libc" >>ksource.txt
  14. echo "KLversion=$version" >>ksource.txt
  15. echo "kernel_version=kernel_$version.run" >>ksource.txt
  16. rm linux-upstream*
  17. #git add $Header
  18. #git add $Image
  19. #git add $Libc
  20. ./makeself.run
  21. echo ""
  22. echo -e "#!/bin/bash" >kernel.sh
  23. echo -e "sudo dpkg -i $Libc" >>kernel.sh
  24. echo -e "sudo dpkg -i $Header" >>kernel.sh
  25. echo -e "sudo dpkg -i $Image" >>kernel.sh
  26. chmod +x kernel.sh
  27. mkdir pack
  28. cp $Libc pack
  29. cp $Header pack
  30. cp $Image pack
  31. cp kernel.sh pack
  32. ./makeself-2.5.0/makeself.sh --xz pack/ kernel_$version.run "kernel_$version" ./kernel.sh
  33. rm -r pack
  34. rm kernel.sh
  35. rm -r -f makeself-2.5.0
  36. sudo scp $Header $Image $Libc kernel_$version.run mk4@192.168.1.8:/var/www/folivier/cube/pack/custom_kernel
  37. sudo ssh mk4@192.168.1.8 "echo 'B' >/dev/serial0"
  38. echo "ne pas oublier:"
  39. echo "git commit -a"
  40. echo "git push"
  41. echo -e ""