FDIV-Bug

Ubuntu Core Maker (OUTSIDE) - Alpha 8

Jan 22nd, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.79 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. +75M
  28. n
  29. p
  30. 2
  31. # Do not delete these blank spaces!!!
  32.  
  33. # Do not delete these blank space!!!
  34. +435M
  35. n
  36. p
  37. 3
  38. # Do not delete these blank spaces!!!
  39.  
  40. # Do not delete these blank space!!!
  41. +435M
  42. w
  43. EOF
  44.  
  45. echo "Done!!!"
  46. sleep 1
  47.  
  48. echo "Creating file systems..."
  49. sleep 1
  50.  
  51. mkfs.ext2 -L BOOT /dev/$DEVICE"1" $DEBUG_N2
  52. mkfs.btrfs -L ROOT /dev/$DEVICE"2" $DEBUG_N2
  53. mkfs.btrfs -L ROOT-BKP /dev/$DEVICE"3" $DEBUG_N2
  54.  
  55. echo "Done!!!"
  56. sleep 1
  57.  
  58. echo "Mounting ROOT..."
  59. sleep 1
  60. mkdir /mnt/root
  61. mount -o defaults,compress-force=zlib,noatime -L ROOT /mnt/root
  62. mkdir /mnt/root/INSTALL
  63. cp dnsmasq.conf /mnt/root/INSTALL
  64. cp iptables.sh /mnt/root/INSTALL
  65. cp smb.conf /mnt/root/INSTALL
  66. cp ntp.conf /mnt/root/INSTALL
  67. cp INSIDE.sh /mnt/root/INSTALL
  68. cp POSTINSTALL.sh /mnt/root/INSTALL
  69. cd /mnt/root
  70.  
  71. echo "Done!!!"
  72. sleep 1
  73.  
  74. echo "Downloading rootfs..."
  75. # Ubuntu Core 14.4.1 (amd64)
  76. #wget -P ./INSTALL http://cdimage.ubuntu.com/ubuntu-core/releases/14.04/release/ubuntu-core-14.04.1-core-amd64.tar.gz
  77.  
  78. echo "Done!!!"
  79. sleep 1
  80.  
  81. echo "Decompressig ROOT..."
  82. tar -xvzf /root/ALPHA\ 8/ubuntu-core-* -C /mnt/root
  83. sync
  84.  
  85. echo "Done!!!"
  86. sleep 1
  87.  
  88. echo "CHROOTING..."
  89. sleep 1
  90. cp /etc/resolv.conf etc
  91. touch etc/fstab
  92. echo "LABEL=BOOT    /boot   ext2    defaults    0 0" > etc/fstab
  93. echo "LABEL=ROOT    /   btrfs   defaults,compress-force=zlib,noatime    1 1" >> etc/fstab
  94. mount -L BOOT boot
  95. mount -o bind /dev dev
  96. mount -o bind /proc proc
  97. mount -o bind /sys sys
  98. cd /
  99. chroot /mnt/root /bin/bash -c "su -c ./INSTALL/INSIDE.sh"
Advertisement
Add Comment
Please, Sign In to add comment