Advertisement
swaggboi

misc_slack_scripts_etc

Jan 3rd, 2020
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.23 KB | None | 0 0
  1. ########
  2. # Adding comments like this to split up the scripts
  3. ########
  4. root@optepr0n:~/bin# cat kopier.sh boot-symlinker.sh mkinitrd-optepr0n-swagg.sh
  5. ########
  6. # This first one copies the kernel files to /boot
  7. ########
  8. #!/bin/sh
  9.  
  10. if [ -z "$1" ]; then
  11.     echo "usage: $0 <KERNEL VERSION>"
  12.     exit 64
  13. fi
  14.  
  15. cp /usr/src/linux-"$1"/arch/x86/boot/bzImage /boot/vmlinuz-swagg-"$1"
  16. cp /usr/src/linux-"$1"/.config /boot/config-swagg-"$1"
  17. cp /usr/src/linux-"$1"/System.map /boot/System.map-swagg-"$1"
  18. ########
  19. # This one creates the symlinks in /boot
  20. ########
  21. #!/bin/sh
  22.  
  23. if [ -z "$1" ]; then
  24.     echo "usage: $0 <KERNEL VERSION>"
  25.     exit 64
  26. fi
  27.  
  28. echo 'Changing dir to /boot'
  29. cd /boot || exit 65
  30.  
  31. echo 'Symlinking System.map'
  32. ln -sf System.map-swagg-"$1" System.map || exit 65
  33.  
  34. echo 'Symlinking config'
  35. ln -sf config-swagg-"$1" config || exit 65
  36.  
  37. echo 'Symlinking vmlinuz'
  38. ln -sf vmlinuz-swagg-"$1" vmlinuz-swagg || exit 65
  39.  
  40. # `shellcheck` says this next line is bad, probably should fix it
  41. echo "$( ls -l /boot | grep "^l" )"
  42. echo "DONE"
  43. ########
  44. # This one I created from the mkinitrd helper script, probably should break up the long line using back slashes
  45. ########
  46. #!/bin/sh
  47. #
  48. # mkinitrd_command_generator.sh revision 1.45
  49. #
  50. # This script will now make a recommendation about the command to use
  51. # in case you require an initrd image to boot a kernel that does not
  52. # have support for your storage or root filesystem built in
  53. # (such as the Slackware 'generic' kernels').
  54. # A suitable 'mkinitrd' command will be:
  55.  
  56. if [ -z "$1" ]; then
  57.     echo "usage: $0 <KERNEL VERSION>"
  58.     exit 64
  59. fi
  60.  
  61. mkinitrd -c -k "$1" -f xfs -r /dev/md0 -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:xfs -R -u -o /boot/initrd-swagg.gz
  62. ########
  63. # Here's my lilo.conf, relevant stuff at bottom
  64. ########
  65. root@optepr0n:~/bin# cat /etc/lilo.conf
  66. # LILO configuration file
  67. # generated by 'liloconfig'
  68. #
  69. # Start LILO global section
  70. # Append any additional kernel parameters:
  71. append="root=/dev/md0 vt.default_utf8=1"
  72. boot = /dev/md2
  73. raid-extra-boot = mbr-only
  74.  
  75. #compact        # faster, but won't work on all systems.
  76.  
  77. # Boot BMP Image.
  78. # Bitmap in BMP format: 640x480x8
  79.   bitmap = /boot/slack.bmp
  80. # Menu colors (foreground, background, shadow, highlighted
  81. # foreground, highlighted background, highlighted shadow):
  82.   bmp-colors = 255,0,255,0,255,0
  83. # Location of the option table: location x, location y, number of
  84. # columns, lines per column (max 15), "spill" (this is how many
  85. # entries must be in the first column before the next begins to
  86. # be used.  We don't specify it here, as there's just one column.
  87.   bmp-table = 60,6,1,16
  88. # Timer location x, timer location y, foreground color,
  89. # background color, shadow color.
  90.   bmp-timer = 65,27,0,255
  91.  
  92. # Standard menu.
  93. # Or, you can comment out the bitmap menu above and
  94. # use a boot message with the standard menu:
  95. #message = /boot/boot_message.txt
  96.  
  97. # Wait until the timeout to boot (if commented out, boot the
  98. # first entry immediately):
  99. prompt
  100. # Timeout before the first entry boots.
  101. # This is given in tenths of a second, so 600 for every minute:
  102. timeout = 100
  103. # Override dangerous defaults that rewrite the partition table:
  104. change-rules
  105.   reset
  106. # Normal VGA console
  107. vga = normal
  108. # Ask for video mode at boot (time out to normal in 30s)
  109. #vga = ask
  110. # VESA framebuffer console @ 1024x768x64k
  111. #vga=791
  112. # VESA framebuffer console @ 1024x768x32k
  113. #vga=790
  114. # VESA framebuffer console @ 1024x768x256
  115. #vga=773
  116. # VESA framebuffer console @ 800x600x64k
  117. #vga=788
  118. # VESA framebuffer console @ 800x600x32k
  119. #vga=787
  120. # VESA framebuffer console @ 800x600x256
  121. #vga=771
  122. # VESA framebuffer console @ 640x480x64k
  123. #vga=785
  124. # VESA framebuffer console @ 640x480x32k
  125. #vga=784
  126. # VESA framebuffer console @ 640x480x256
  127. #vga=769
  128. # End LILO global section
  129. # Linux bootable partition config begins
  130. default = Linux-swagg
  131.  
  132. image = /boot/vmlinuz
  133.   initrd = /boot/initrd.gz
  134.   root = /dev/md0
  135.   label = Linux
  136.   read-only
  137. image = /boot/vmlinuz-swagg
  138.   initrd = /boot/initrd-swagg.gz
  139.   root = /dev/md0
  140.   label = Linux-swagg
  141.   read-only
  142. # Linux bootable partition config ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement