FDIV-Bug

Ubuntu Core Maker (OUTSIDE) - Alpha 7

Dec 11th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # DEBUG [OFF]
  4. #DEBUG_N1="> /dev/null"
  5. #DEBUG_N2="&> /dev/null"
  6. #SHOWCOMMAND=""
  7.  
  8. # DEBUG [ON]
  9. DEBUG_N1=""
  10. DEBUG_N2=""
  11. SHOWCOMMAND="set -x"
  12.  
  13. #$SHOWCOMMAND
  14.  
  15. echo -n "Device: "
  16. read DEVICE
  17.  
  18. echo "Creating partitions..."
  19. sleep 1
  20.  
  21. fdisk /dev/$DEVICE <<  EOF $DEBUG_N2
  22. o
  23. n
  24. p
  25. 1
  26. 2048
  27. +100M
  28. n
  29. p
  30. 2
  31. # Do not delete these blank spaces!!!
  32.  
  33.  
  34. # Do not delete these blank space!!!
  35. w
  36. EOF
  37.  
  38. echo "Done!!!"
  39. sleep 1
  40.  
  41. echo "Creating file systems..."
  42. sleep 1
  43.  
  44. mkfs.ext2 -L BOOT /dev/$DEVICE"1" $DEBUG_N2
  45. mkfs.btrfs -L ROOT /dev/$DEVICE"2" $DEBUG_N2
  46.  
  47. echo "Done!!!"
  48. sleep 1
  49.  
  50. echo "Mounting ROOT..."
  51. sleep 1
  52. mkdir /mnt/root
  53. mount -o defaults,compress-force=zlib,noatime -L ROOT /mnt/root
  54. mkdir /mnt/root/INSTALL
  55. cp INSIDE.sh /mnt/root/INSTALL
  56. cp POSTINSTALL.sh /mnt/root/INSTALL
  57. cd /mnt/root
  58.  
  59. echo "Done!!!"
  60. sleep 1
  61.  
  62. echo "Downloading rootfs..."
  63. # Ubuntu Core 14.4.1 (amd64)
  64. wget -P ./INSTALL http://cdimage.ubuntu.com/ubuntu-core/releases/14.04/release/ubuntu-core-14.04.1-core-amd64.tar.gz
  65.  
  66. echo "Done!!!"
  67. sleep 1
  68.  
  69. echo "Decompressig ROOT..."
  70. tar -xvzf ./INSTALL/ubuntu-core-* $DEBUG_N1
  71.  
  72. echo "Done!!!"
  73. sleep 1
  74.  
  75. echo "CHROOTING..."
  76. sleep 1
  77. cp /etc/resolv.conf etc
  78. touch etc/fstab
  79. echo "LABEL=BOOT    /boot   ext2    defaults    0 0" > etc/fstab
  80. echo "LABEL=ROOT    /   btrfs   defaults,compress-force=zlib,noatime    1 1" >> etc/fstab
  81. mount -L BOOT boot
  82. mount -o bind /dev dev
  83. mount -o bind /proc proc
  84. mount -o bind /sys sys
  85. cd /
  86. chroot /mnt/root /bin/bash -c "su -c ./INSTALL/INSIDE.sh"
Advertisement
Add Comment
Please, Sign In to add comment