├── README.md
├── cfgdir.rb
├── copy-progress.rb
├── detect-distro.rb
├── install-syslinux.rb
├── main.rb
├── multibootusb-new.ui
├── multibootusb.png
├── multibootusb
├── chain.c32
├── extlinux.cfg
├── grub.exe
├── memdisk
├── menu.c32
├── menu.lst
├── syslinux.cfg
├── syslinux.cfg~
└── vesamenu.c32
├── multibootusb_ui.rb
├── multibootusb_ui_old.rb
├── qemu.rb
├── test.rb
├── uninstall-distro.rb
├── update-config-lib.rb
├── update-config.rb
└── version.txt
/README.md:
--------------------------------------------------------------------------------
1 | multibootusb
2 | ============
3 |
4 | create multiple live distro on usb - ruby version
5 |
6 | This is same multibootusb you see in sourceforge.net/projects/multibootusb/
7 | but writen in ruby. This is an attempt to unify the code under multiple platform.
8 | This way it can be ported to other platform and maitained easily.
9 |
10 | multibootusb is brought to you by Sundar and Ian Bruce
11 |
12 | Contact feedback.multibootusb[@]gmail.com
13 |
--------------------------------------------------------------------------------
/cfgdir.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/ruby
2 |
3 |
4 | def syslinux_cfg_file(mount)
5 |
6 | dir = ["syslinux", "isolinux"]
7 |
8 | file = ["syslinux.cfg", "isolinux.cfg"]
9 |
10 |
11 | l2 = dir.map { |d| file.map { |f| "boot/#{d}/#{f}" } }.flatten
12 |
13 | l1 = dir.map { |d| file.map { |f| "#{d}/#{f}" } }.flatten
14 |
15 | l0 = file
16 |
17 |
18 | (l2 + l1 + l0).each { |f| return(f) if File.exists?("#{mount}/#{f}") }
19 |
20 | return nil
21 |
22 | end
23 |
--------------------------------------------------------------------------------
/copy-progress.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | def copy(src,dst)
4 | space_initial_i = `df -k #{$selected_usb_device}`.split(/\b/)[22].to_i
5 | size_iso = `du -k #{$selected_iso}`.split[0].to_i
6 | $isosize
7 | if File.file?(src)
8 | thr_copy = Thread.new {`cp -rvvf #{src} #{dst}/`}
9 | elsif File.directory?(src)
10 | thr_copy = Thread.new {`cp -rf #{src}/. #{dst}/`}
11 | end
12 | @ui.label.text = "Installing..."
13 | while thr_copy.status
14 | space_current_i = `df -k #{$selected_usb_device}`.split(/\b/)[22].to_i
15 | diff = space_current_i - space_initial_i
16 | persentage = (100.0 * diff / size_iso).round(2)
17 | #puts persentage
18 | @ui.progressBar.value = persentage
19 | #print "\rcopying #{src} to #{dst} ... #{format("%5.1f%%", 100.0 * dst_size / src_size)}"
20 | sleep 0.5
21 | end
22 | puts "100"
23 | @ui.progressBar.value = 0
24 | @ui.label.text = ""
25 | end
26 | #copy(src,dst)
27 |
--------------------------------------------------------------------------------
/detect-distro.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/ruby
2 |
3 | ##### IDENTIFY DISTRIBUTION ISO #####
4 | #
5 | # WRITTEN BY IAN BRUCE FOR MULTIBOOTUSB
6 | # LICENCE - GPL
7 | #
8 | # $1 is directory to operate on (optional)
9 |
10 | require "find"
11 |
12 |
13 | #if cfg = ARGV[0]
14 |
15 | # File.directory?(cfg) &&
16 |
17 | # Dir.chdir(cfg) ||
18 |
19 | # exit(false)
20 |
21 | #end
22 |
23 | $DISTRONAMES = {
24 | "pmagic" => "parted-magic",
25 | "partedmagic" => "parted-magic",
26 | "puppy" => "puppy",
27 | "ipcop" => "ipcop",
28 | "archisolabel" => "arch",
29 | "chakraisolabel" => "chakra",
30 | "misolabel" => "arch",
31 | "boot=live" => "debian",
32 | "root=live:" => "fedora",
33 | "root=mgalive:" => "magia",
34 | "redhat" => "redhat",
35 | "suse" => "suse",
36 | "opensuse" => "opensuse",
37 | "slitaz" => "slitaz",
38 | "ophcrack" => "slitaz",
39 | "systemrescuecd" => "systemrescuecd",
40 | "tinycore" => "slitaz",
41 | "xpud" => "slitaz",
42 | "rescue.cpi" => "slitaz",
43 | "untangle" => "slitaz",
44 | "boot=casper" => "ubuntu",
45 | "slax" => "slax",
46 | "porteus" => "porteus",
47 | "wifislax" => "wifislax",
48 | "antix" => "antix",
49 | "livecd=livecd" => "pclinuxos",
50 | "looptype=squashfs" => "gentoo",
51 | "knoppix" => "knoppix",
52 | "finnix" => "finnix",
53 | "sms" => "sms",
54 | "wifiway" => "wifiway",
55 | "unity" => "pclinuxos",
56 | "slack" => "slack",
57 | "salix" => "slackel",
58 | "4mlinux" => "slitaz",
59 | "partition wizard" => "slitaz",
60 | "riplinux" => "slitaz",
61 | "vector" => "sms",
62 | "autoexec" => "sms",
63 | "lebel dummy" => "slitaz"
64 | }
65 |
66 | def detect_distro(cfg)
67 | #match = $DISTRONAMES.each_key.reduce { |m, s| "#{m}|#{Regexp.escape(s)}" }
68 | match = $DISTRONAMES.each_key.reduce { |m, s| "#{m}|#{Regexp.escape(s)}" }
69 |
70 | regex = Regexp.new(match, true)
71 |
72 | count = {}
73 |
74 |
75 | #Find.find(".") { |name|
76 | Find.find($live_mount) { |name|
77 |
78 | Find.prune if name =~ /\/boot\/grub$/i
79 |
80 | if name =~ /\.cfg$/i
81 |
82 | config = open(name, "r") { |file|
83 | if File.file?(file)
84 | file.read
85 | end
86 | }
87 |
88 | if config
89 |
90 | config.scan(regex) { |key|
91 |
92 | key.downcase!
93 |
94 | if count[key]
95 | count[key] += 1
96 | else
97 | count[key] = 1
98 | end
99 |
100 | }
101 | end
102 |
103 | end
104 |
105 | }
106 |
107 |
108 | #puts count
109 |
110 | if max = count.max { |x, y| x[1] <=> y[1] }
111 |
112 | puts $DISTRONAMES[max[0]]
113 | return $DISTRONAMES[max[0]]
114 |
115 | else
116 | if File.directory?("#{$live_mount}/slackellive")
117 | puts "slackel"
118 | return "slackel"
119 | elsif File.directory?("#{$live_mount}/salixlive")
120 | puts "salixlive"
121 | return "salixlive"
122 | elsif File.exist?("#{$live_mount}/sources/boot.wim")
123 | puts "windows-7"
124 | return "windows-7"
125 | else
126 | puts "ISO not supported."
127 | return nil
128 | end
129 |
130 | end
131 | end
132 | #detect_distro("/home/sundar/.multibootusb/live/")
133 |
--------------------------------------------------------------------------------
/install-syslinux.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | def install_syslinux_common (dev)
4 | if dev
5 | if $syslinux_required == "yes"
6 | if $selected_usb_file_system = "vfat" || "ntfs"
7 | puts "Installing syslinux..."
8 | syslinux_install = `echo #{$pass} | sudo -S syslinux -i -d /multibootusb #{$selected_usb_device}`
9 | puts syslinux_install
10 | #$?
11 | install_mbr = `echo #{$pass} | sudo -S dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=#{$selected_usb_device[0..-2]}`
12 | puts install_mbr
13 | elsif $selected_usb_file_system = "ext2" || "ext3" || "ext4" || "btrf"
14 | puts "Installing syslinux..."
15 | syslinux_install = `echo #{$pass} | sudo -S syslinux -i -d /multibootusb #{$selected_usb_device}`
16 | puts syslinux_install
17 | #$?
18 | install_mbr = `echo #{$pass} | sudo -S dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=#{$selected_usb_device[0..-2]}`
19 | end
20 | end
21 | end
22 | end
23 |
24 | def install_syslinux ()
25 | if @ui.install_sys_all.isChecked()
26 | if $selected_usb_file_system = "vfat" || "ntfs"
27 | puts "Installing syslinux..."
28 | syslinux_install = `echo #{$pass} | sudo -S syslinux -i -d /multibootusb #{$selected_usb_device}`
29 | puts syslinux_install
30 | #$?
31 | install_mbr = `echo #{$pass} | sudo -S dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=#{$selected_usb_device[0..-2]}`
32 | puts install_mbr
33 | puts "Copying multibootusb directory."
34 | FileUtils.cp_r ("./multibootusb"), $selected_usb_mount_path
35 | elsif $selected_usb_file_system = "ext2" || "ext3" || "ext4" || "btrf"
36 | puts "Installing syslinux..."
37 | syslinux_install = `echo #{$pass} | sudo -S syslinux -i -d /multibootusb #{$selected_usb_device}`
38 | puts syslinux_install
39 | #$?
40 | install_mbr = `echo #{$pass} | sudo -S dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=#{$selected_usb_device[0..-2]}`
41 | end
42 | elsif @ui.install_sys_only.isChecked()
43 | if $selected_usb_file_system = "vfat" || "ntfs"
44 | puts "Installing syslinux..."
45 | syslinux_install = `echo #{$pass} | sudo -S syslinux -i -d /multibootusb #{$selected_usb_device}`
46 | puts syslinux_install
47 | #$?
48 | install_mbr = `echo #{$pass} | sudo -S dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=#{$selected_usb_device[0..-2]}`
49 | puts install_mbr
50 | elsif $selected_usb_file_system = "ext2" || "ext3" || "ext4" || "btrf"
51 | syslinux_install = `echo #{$pass} | sudo -S syslinux -i -d /multibootusb #{$selected_usb_device}`
52 | puts syslinux_install
53 | #$?
54 | install_mbr = `echo #{$pass} | sudo -S dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=#{$selected_usb_device[0..-2]}`
55 | end
56 | else
57 | Qt::MessageBox.information self, "No select.", "Please select an option to install syslinux."
58 | end
59 | end
60 |
61 | def edit_syslinux()
62 | if File.exist?($selected_usb_mount_path + "/multibootusb/syslinux.cfg")
63 | editors = ["gedit","kate", "kwrite", "leafpad", "jedit"]
64 | editors.each do |s|
65 | package = `which #{s}`
66 | if package.include? (s)
67 | puts package
68 | syslinux_link = package.chomp + " " + $selected_usb_mount_path + "/multibootusb/syslinux.cfg"
69 | puts syslinux_link
70 | `#{syslinux_link}`
71 | break
72 | end
73 | end
74 | else
75 | Qt::MessageBox.information self, "No file.", "syslinux.cfg file is not found under multibootusb directory."
76 | end
77 | end
78 |
79 |
--------------------------------------------------------------------------------
/main.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'Qt4'
3 | require 'fileutils'
4 | require 'find'
5 | require 'dbus'
6 | require 'rbconfig'
7 | require_relative 'install-syslinux'
8 | require_relative 'multibootusb_ui'
9 | require_relative 'update-config'
10 | require_relative 'copy-progress'
11 | require_relative 'detect-distro'
12 | require_relative 'uninstall-distro'
13 | require_relative 'qemu'
14 | require_relative 'cfgdir'
15 |
16 | include RbConfig
17 |
18 |
19 | case CONFIG['host_os']
20 |
21 | when /mswin|windows/i
22 | $Os = "Windows"
23 | when /linux|arch/i
24 | $Os = "Linux"
25 | $pro_dir = File.join(Dir.home, ".multibootusb")
26 | $live_mount = File.join(Dir.home, ".multibootusb", "live")
27 | if not File.exists?($pro_dir)
28 | Dir.mkdir($pro_dir)
29 | puts "Creating #$pro_dir"
30 | Dir.mkdir ($live_mount)
31 | puts "Creating #$live_mount"
32 | else
33 | puts "#$pro_dir not created"
34 | # Clean up code here...
35 | end
36 | #puts Os
37 | when /sunos|solaris/i
38 | $Os = "Solaris"
39 | when /darwin/i
40 | $Os = "MAC"
41 | else
42 | $Os = "None"
43 | end
44 |
45 |
46 | class MainForm < Qt::Dialog
47 |
48 | slots 'browse_iso()', 'create_mbusb()', 'update_combobox()', 'uninstall_distro()', 'install_syslinux()', 'edit_syslinux()', 'qemu_iso()', 'get_qemu_iso()', 'qemu_usb()'
49 |
50 | def initialize
51 | super
52 | @ui = Ui::Dialog.new
53 | @ui.setup_ui(self)
54 | $version = File.read("./version.txt").to_i
55 | puts $version
56 | if $Os == "Linux"
57 | pass_ui
58 | if not File.exists?($live_mount)
59 | Dir.mkdir($live_mount)
60 | puts "Creating #$live_mount"
61 | else
62 | puts "unmounting live directory."
63 | `echo "#{$pass}" | sudo -S umount "#{$live_mount}"`
64 | end
65 | end
66 |
67 | if $Os == "Windows"
68 | oFS = WIN32OLE.new("Scripting.FileSystemObject")
69 | oDrives = oFS.Drives
70 | oDrives.each() do |usb|
71 | #driveType 1 is removable disk
72 | if usb.DriveType == 1 && usb.IsReady
73 | @ui.comboBox.addItem usb.DriveLetter + ":\\ , " + usb.VolumeName
74 | end
75 | end
76 | elsif $Os == "Linux"
77 | bus = DBus::SystemBus.instance
78 | udisk_service = bus.service("org.freedesktop.UDisks")
79 | udisk_udisk = udisk_service.object("/org/freedesktop/UDisks")
80 | udisk_udisk.introspect
81 | udisk_udisk.default_iface = "org.freedesktop.UDisks"
82 | disk_list = udisk_udisk.EnumerateDevices[0]
83 | disk_list.each { |disk|
84 | udisk_udisk = udisk_service.object("#{disk}")
85 | udisk_udisk.introspect
86 | udisk_udisk_i = udisk_udisk["org.freedesktop.UDisks.Device"]
87 | if udisk_udisk_i["DriveConnectionInterface"] == "usb" && udisk_udisk_i["DeviceIsPartition"]
88 | #puts disk #Debug
89 | @ui.comboBox.addItem "#{udisk_udisk_i["DeviceFile"]}" + ", " + "#{udisk_udisk_i["IdLabel"]}"
90 | puts "Device file: #{udisk_udisk_i["DeviceFile"]}"
91 | $deviceFile = udisk_udisk_i["DeviceFile"]
92 | puts $deviceFile
93 | # puts "Is device mounted: #{udisk_udisk_i["DeviceIsMounted"]}"
94 | # puts "Is device mount path: #{udisk_udisk_i["DeviceMountPaths"]}"
95 | # $usb_mount_path = "#{udisk_udisk_i["DeviceMountPaths"][0]}"
96 | # puts "Device mount path: #$usb_mount_path"
97 | # puts "Device uuid: #{udisk_udisk_i["IdUuid"]}"
98 | # puts "Device label: #{udisk_udisk_i["IdLabel"]}"
99 | # puts "Device Type: #{udisk_udisk_i["IdType"]}"
100 | # puts "Device Size: #{udisk_udisk_i["PartitionSize"]}"
101 | # puts ""
102 | if "#{udisk_udisk_i["DeviceFile"]}"
103 | get_usb_details()
104 | end
105 | end
106 | }
107 |
108 | update_list_box()
109 | elsif $Os == "MAC"
110 | # Some body can code for mac OS here.
111 | elsif $Os == "Solaris"
112 | # Some body can code for Solaris here.
113 | end
114 | @ui.label.text = "Status OK."
115 | @ui.lineEdit_2.setFocus()
116 | @ui.lineEdit.setFocus()
117 | #Qt::Object.connect(@ui.browse_iso, SIGNAL('clicked()'), self, SLOT('browse_iso()'))
118 | @ui.browse_iso.connect(SIGNAL :clicked) { browse_iso() }
119 | Qt::Object.connect(@ui.create, SIGNAL('clicked()'), self, SLOT('create_mbusb()'))
120 | Qt::Object.connect(@ui.comboBox, SIGNAL('currentIndexChanged(int)'), self, SLOT('update_combobox()'))
121 | #@ui.comboBox.connect(SIGNAL :'currentIndexChanged(int)') { update_combobox() }
122 | Qt::Object.connect(@ui.uninstall, SIGNAL('clicked()'), self, SLOT('uninstall_distro()'))
123 | Qt::Object.connect(@ui.install_syslinux, SIGNAL('clicked()'), self, SLOT('install_syslinux()'))
124 | Qt::Object.connect(@ui.edit_syslinux, SIGNAL('clicked()'), self, SLOT('edit_syslinux()'))
125 | Qt::Object.connect(@ui.browse_iso_qemu, SIGNAL('clicked()'), self, SLOT('get_qemu_iso()'))
126 | Qt::Object.connect(@ui.boot_iso_qemu, SIGNAL('clicked()'), self, SLOT('qemu_iso()'))
127 | Qt::Object.connect(@ui.boot_usb_qemu, SIGNAL('clicked()'), self, SLOT('qemu_usb()'))
128 |
129 | @ui.close.connect(SIGNAL :clicked) {
130 | @ui.label.text = "Please wait..."
131 | if not Dir["#$live_mount/*"].empty?
132 | puts "unmounting iso directory..."
133 | umount_iso = `echo "#{$pass}" | sudo -S umount "#{$live_mount}"`
134 | sleep 0.5
135 | #Dir.rmdir ($live_mount)
136 | `sync`
137 | else
138 | @ui.label.text = "Please wait..."
139 | puts "Cleaning temp directory..."
140 | Dir.rmdir ($live_mount)
141 | puts "synchronizing..."
142 | `sync`
143 | end
144 | Qt::Application.instance.quit }
145 | self.show
146 | end
147 |
148 |
149 | def browse_iso()
150 | if @ui.comboBox.currentText()
151 | @ui.lineEdit.setText ""
152 | iso_link = Qt::FileDialog.getOpenFileName(self, tr("Choose an iso..."), Dir.home, "ISO (*.iso)")
153 | if iso_link
154 | @ui.lineEdit.insert "#{iso_link}"
155 | puts iso_link
156 | else
157 | puts "No iso choosen."
158 | end
159 | else
160 | puts "No USB found (Step 1)."
161 | Qt::MessageBox.critical self, "No USB.", "No USB found (Step 1)."
162 | end
163 | end
164 |
165 | def create_mbusb()
166 | if @ui.comboBox.currentText()
167 | selected_usb = @ui.comboBox.currentText()[0,9]
168 | if not @ui.lineEdit.text() == ""
169 | iso_link = @ui.lineEdit.text()
170 | $selected_iso = iso_link.chomp
171 | p $selected_iso
172 | $distro = File.basename($selected_iso)
173 | $distro_dir = File.basename($selected_iso, ".iso")
174 | @ui.lineEdit.setText ""
175 | mount_iso = `echo "#{$pass}" | sudo -S mount -o loop "#{$selected_iso}" "#{$live_mount}"`
176 | puts mount_iso
177 | #$detect_distro = detect_distro($live_mount)
178 | $distro_name = detect_distro($live_mount)
179 | if $distro_name
180 | puts $distro_name
181 | $isosize = sizeiso(iso=$selected_iso)
182 | puts "ISO size is : #{$isosize}"
183 | usb_avl_space = freespace(device=$selected_usb_device)
184 | puts "Available USB size is : #{usb_avl_space}"
185 | if not usb_avl_space > $isosize
186 | puts "Not enough space on #$selected_usb_device"
187 | Qt::MessageBox.critical self, "No space.", "Not enough space on #$selected_usb_device"
188 | else
189 | puts "Enough space is available on #$selected_usb_device"
190 | reply = Qt::MessageBox.question(self, tr("Review selection..."),
191 | "Selected USB disk:: #{$selected_usb_device}\n" +
192 | "USB mount point:: #{$selected_usb_mount_path}\n" +
193 | "Selected distro:: #{$distro}\n\n" +
194 | "Would you like to install the selected distro?",
195 | Qt::MessageBox::Yes,
196 | Qt::MessageBox::No )
197 | if reply == Qt::MessageBox::Yes
198 | add_distro()
199 | # puts distro_name
200 | puts $distro_install_path
201 | if $syslinux_required == "yes"
202 | install_syslinux_common ($selected_usb_device)
203 | end
204 | elsif reply == Qt::MessageBox::No
205 | puts "unmounting #{$live_mount}"
206 | `echo "#{$pass}" | sudo -S umount "#{$live_mount}"`
207 | end
208 | end
209 | else
210 | puts "#{$distro} is not supported at the moment."
211 | Qt::MessageBox.information self, "Not supported.", "Sorry. #{$distro} is not supported at the moment."
212 | end
213 | else
214 | puts "Please select an iso file (step 2)."
215 | Qt::MessageBox.critical self, "No iso.", "Please select an iso file (step 2)."
216 | end
217 | else
218 | puts "No USB found (Step 1)."
219 | Qt::MessageBox.critical self, "No USB.", "No USB found (Step 1)."
220 | end
221 | end
222 |
223 | def pass_ui
224 | $text = Qt::InputDialog.getText self, "Password","Enter user password",Qt::LineEdit::Password
225 |
226 | if !$text
227 | puts "Nothing entered."
228 | exit 0
229 | end
230 |
231 | if $text != nil
232 | $pass = $text.strip
233 | if not $pass.empty?
234 | sudo = `echo "#{$pass}" | sudo -k -S id -u`
235 | if sudo.chomp.eql? '0'
236 | puts "User password success."
237 | else
238 | puts "Incorrect user password."
239 | Qt::MessageBox.critical self, "Incorrect.", "User password is incorrect. Enter correct password."
240 | load 'main.rb'
241 | exit
242 | end
243 | end
244 | end
245 | end
246 |
247 | def get_usb_details()
248 | if @ui.comboBox.currentText()
249 | if $Os == "Linux"
250 | selected_usb_part = @ui.comboBox.currentText()[5,4]
251 | puts selected_usb_part
252 | bus = DBus::SystemBus.instance
253 | udisk_service = bus.service("org.freedesktop.UDisks")
254 | udisk_udisk = udisk_service.object("/org/freedesktop/UDisks/devices/#{selected_usb_part}")
255 | udisk_udisk.introspect
256 | udisk_udisk_i = udisk_udisk["org.freedesktop.UDisks.Device"]
257 | $selected_usb_device = "#{udisk_udisk_i["DeviceFile"]}"
258 | @ui.usb_dev.text = "Device :: #{$selected_usb_device}"
259 | puts "Selected usb device: " + $selected_usb_device
260 | $selected_usb_mount_status = "#{udisk_udisk_i["DeviceIsMounted"]}"
261 | puts "Selected usb mount status: " + $selected_usb_mount_status
262 | # $selected_usb_mount_path = "#{udisk_udisk_i["DeviceMountPaths"]}"[1...-1]
263 | $selected_usb_mount_path = "#{udisk_udisk_i["DeviceMountPaths"][0]}"
264 | @ui.usb_mount.text = "Mount :: #{$selected_usb_mount_path}"
265 | puts "Selected usb mount path: " + $selected_usb_mount_path
266 | $selected_usb_uuid = "#{udisk_udisk_i["IdUuid"]}"
267 | #@ui.usb_size_avl.text = "UUID :: #{$selected_usb_uuid}"
268 | puts "Selected usb uuid: " + $selected_usb_uuid
269 | $selected_usb_label = "#{udisk_udisk_i["IdLabel"]}"
270 | @ui.usb_label.text = "Label :: #{$selected_usb_label}"
271 | puts "Selected usb label: " + $selected_usb_label
272 | $selected_usb_size = "#{udisk_udisk_i["PartitionSize"]}"
273 | puts $selected_usb_size
274 | @ui.usb_size_avl.text = "Size :: #{$selected_usb_size}"
275 | $selected_usb_file_system = "#{udisk_udisk_i["IdType"]}"
276 | @ui.usb_size_ttl.text = "Filesystem :: #{$selected_usb_file_system}"
277 | puts "Selected usb filesystem: " + $selected_usb_file_system
278 | elsif $Os == "Windows"
279 | # Code for windows to be put here.
280 | else
281 | puts "No USB found (Step 1)."
282 | end
283 | end
284 | end
285 | def add_distro()
286 | if $selected_distro == "windows-7"
287 | $distro_install_path = "windows-7"
288 | else
289 | $distro_install_path = $selected_usb_mount_path + "/multibootusb/" + $distro_dir
290 | end
291 | if not File.exist?($selected_usb_mount_path + "/multibootusb/syslinux.cfg")
292 | $syslinux_required = "yes"
293 | puts "Copying multibootusb directory."
294 | FileUtils.cp_r ("./multibootusb"), $selected_usb_mount_path
295 | end
296 |
297 | if File.directory? ($distro_install_path)
298 | puts "Distro install directory already exist."
299 | Qt::MessageBox.information self, "Distro exist.", "#{$distro} is already installed."
300 | else
301 | puts "Creating distro install path."
302 | Dir.mkdir($distro_install_path)
303 | puts "Copying #$distro files to #{$distro_install_path}"
304 | # FileUtils.cp_r ("#{$live_mount}" + "/."), $distro_install_path
305 | if $distro_name == "opensuse"
306 | copy($selected_iso, $distro_install_path + "/")
307 | copy("#{$live_mount}/boot", $distro_install_path)
308 | elsif $distro_name == "slackel"
309 | copy($selected_iso, $distro_install_path + "/")
310 | copy("#{$live_mount}/boot", $distro_install_path)
311 | elsif $distro_name == "salixlive"
312 | copy($selected_iso, $distro_install_path + "/")
313 | copy("#{$live_mount}/boot", $distro_install_path)
314 | elsif $distro_name == "windows-7"
315 | copy("#{$live_mount}", $selected_usb_mount_path)
316 | else
317 | copy("#{$live_mount}", $distro_install_path)
318 | end
319 | puts "File copy finished."
320 | puts "unmounting " + $live_mount
321 | update_cfg()
322 | if not $cfg_file_path == nil
323 | update_config($distro_name,$distro_install_path + "/")
324 | end
325 | Qt::MessageBox.information self, "Copy...", $distro + " is successfully installed"
326 | umount_iso = `echo "#{$pass}" | sudo -S umount "#{$live_mount}"`
327 | end
328 | end
329 |
330 | def update_combobox()
331 | get_usb_details()
332 | update_list_box()
333 | end
334 |
335 | def freespace(device=".")
336 | lines = %x(df -k "#{device}").split("\n")
337 | n = lines.last.split[3].to_i #* 1024
338 | end
339 | def totalspace(device=".")
340 | lines = %x(df -k "#{device}").split("\n")
341 | n = lines.last.split[1].to_i #* 1024
342 | end
343 | def sizeiso(iso=".")
344 | line = %x(du -k "#{iso}")#.split("\n")
345 | n = line.split.first.to_i #* 1024
346 | end
347 |
348 | def update_cfg()
349 | $cfg_file_path = Dir.glob( $distro_install_path + "/**/*isolinux.cfg" )[0]
350 | if $cfg_file_path == nil
351 | $cfg_file_path = Dir.glob( $distro_install_path + "/**/*syslinux.cfg" )[0]
352 | end
353 | if not $cfg_file_path == nil
354 | $cfg_file_path.slice! $selected_usb_mount_path
355 | puts $cfg_file_path
356 | $cfg_file_path_dir = File.dirname($cfg_file_path)
357 | puts $cfg_file_path_dir
358 | #FileUtils.cp_r Dir.glob('./multibootusb/*.c32'), $selected_usb_mount_path + $cfg_file_path_dir
359 | puts "Checking isolinux version..."
360 | $isolinux_bin = Dir.glob( $distro_install_path + "/**/*isolinux.bin" )[0]
361 | $isolinux_bin_path = File.dirname($isolinux_bin)
362 | version = `cat #{$isolinux_bin} | grep -a -i "isolinux 3"`
363 | if version.downcase.include? ("isolinux 3")
364 | puts "Found older version of isolinux (3))"
365 | puts "Copying necessary com files..."
366 | copy_com_file = `cp -rvf ./multibootusb/*.c32 #{$isolinux_bin_path}`
367 | puts copy_com_file
368 | else
369 | puts "Found latest version of isolinux"
370 | end
371 | $line1 = "#start " + $distro_dir
372 | $line2 = "LABEL " + $distro_dir
373 | $line3 = "MENU LABEL " + $distro_dir
374 | $line4 = "CONFIG " + $cfg_file_path
375 | $line5 = "APPEND " + $cfg_file_path_dir
376 | $line6 = "#end " + $distro_dir
377 | else
378 | #custom_menu()
379 | custom_menu($distro_name)
380 | end
381 | File.open($selected_usb_mount_path + "/multibootusb/syslinux.cfg", 'a') do |file|
382 | file.puts $line1
383 | file.puts $line2
384 | file.puts $line3
385 | file.puts $line4
386 | file.puts $line5
387 | file.puts $line6
388 | #end
389 | end
390 | update_list_box()
391 | end
392 |
393 | def update_list_box()
394 | if not $deviceFile
395 | Qt::MessageBox.information self, "No USB.", "No USB found. Please insert USB and rerun multibootusb."
396 | Qt::Application.instance.quit
397 | abort
398 | else
399 | @ui.listWidget.clear()
400 | sys_cfg = $selected_usb_mount_path + "/multibootusb/syslinux.cfg"
401 | if File.exists?(sys_cfg)
402 | File.readlines(sys_cfg).each do |line|
403 | if (line['#start'])
404 | installed_distro = line.split(' ')[1..-1].join(' ')
405 | @ui.listWidget.addItem installed_distro
406 | end
407 | end
408 | end
409 | end
410 | end
411 |
412 | end
413 |
414 |
415 | if $0 == __FILE__
416 | a = Qt::Application.new(ARGV)
417 | MainForm.new
418 | a.exec
419 | end
420 |
421 |
--------------------------------------------------------------------------------
/multibootusb-new.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Dialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 537
10 | 448
11 |
12 |
13 |
14 | multibootusb
15 |
16 |
17 |
18 | multibootusb.pngmultibootusb.png
19 |
20 |
21 | -
22 |
23 |
24 | 4
25 |
26 |
27 |
28 | Multibootusb
29 |
30 |
31 |
-
32 |
33 |
-
34 |
35 |
36 | -
37 |
38 |
39 | Create
40 |
41 |
42 |
43 | -
44 |
45 |
46 | Close
47 |
48 |
49 |
50 | -
51 |
52 |
53 | -
54 |
55 |
56 | -
57 |
58 |
59 | Browse ISO
60 |
61 |
62 |
63 | -
64 |
65 |
66 | <html><head/><body><p align="center"><span style=" font-weight:600;">Step 1</span></p></body></html>
67 |
68 |
69 |
70 | -
71 |
72 |
73 | <html><head/><body><p align="center"><span style=" font-weight:600;">Step 2</span></p></body></html>
74 |
75 |
76 |
77 | -
78 |
79 |
80 | <html><head/><body><p align="center"><span style=" font-weight:600;">Step 3</span></p></body></html>
81 |
82 |
83 |
84 | -
85 |
86 |
87 | 0
88 |
89 |
90 |
91 | -
92 |
93 |
94 | Uninstall (Optional)
95 |
96 |
97 |
-
98 |
99 |
-
100 |
101 |
102 | Uninstall Distro
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | -
112 |
113 |
114 | TextLabel
115 |
116 |
117 |
118 | -
119 |
120 |
121 | USB Details
122 |
123 |
124 |
-
125 |
126 |
127 | Drive ::
128 |
129 |
130 |
131 | -
132 |
133 |
134 | Label ::
135 |
136 |
137 |
138 | -
139 |
140 |
141 | Mount::
142 |
143 |
144 |
145 | -
146 |
147 |
148 | Size Total ::
149 |
150 |
151 |
152 | -
153 |
154 |
155 | Size Avail ::
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 | Syslinux
169 |
170 |
171 | -
172 |
173 |
-
174 |
175 |
176 | true
177 |
178 |
179 | Install Syslinux
180 |
181 |
182 |
-
183 |
184 |
-
185 |
186 |
187 | Install
188 |
189 |
190 |
191 | -
192 |
193 |
194 | Qt::Horizontal
195 |
196 |
197 |
198 | 40
199 | 20
200 |
201 |
202 |
203 |
204 | -
205 |
206 |
207 | Install syslinux and copy all required files.
208 |
209 |
210 |
211 | -
212 |
213 |
214 | Install only syslinux (existing configurations will not be altred).
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 | -
224 |
225 |
226 | true
227 |
228 |
229 | Edit syslinux.cfg
230 |
231 |
232 |
-
233 |
234 |
-
235 |
236 |
237 | Edit
238 |
239 |
240 |
241 | -
242 |
243 |
244 | Qt::Horizontal
245 |
246 |
247 |
248 | 40
249 | 20
250 |
251 |
252 |
253 |
254 | -
255 |
256 |
257 | <html><head/><body><p align="justify">Using this option user can edit syslinux.cfg file directly. It directly uses </p><p align="justify">default editor of host system. Be careful while editing syslinux.cfg file.</p></body></html>
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | QEMU
273 |
274 |
275 | -
276 |
277 |
278 | true
279 |
280 |
281 | Boot ISO
282 |
283 |
284 |
-
285 |
286 |
-
287 |
288 |
289 | Boot ISO
290 |
291 |
292 |
293 | -
294 |
295 |
296 | 768 MB
297 |
298 |
299 |
300 | -
301 |
302 |
303 | 256 MB
304 |
305 |
306 |
307 | -
308 |
309 |
310 | -
311 |
312 |
313 | 512 MB
314 |
315 |
316 |
317 | -
318 |
319 |
320 | Choose desired RAM and click on Boot ISO button.
321 |
322 |
323 |
324 | -
325 |
326 |
327 | Browse ISO
328 |
329 |
330 |
331 | -
332 |
333 |
334 | 1024 MB
335 |
336 |
337 |
338 | -
339 |
340 |
341 | 2048 MB
342 |
343 |
344 |
345 | -
346 |
347 |
348 | Best way to check downloaded iso.
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 | -
358 |
359 |
-
360 |
361 |
362 | true
363 |
364 |
365 | Boot USB
366 |
367 |
368 |
-
369 |
370 |
-
371 |
372 |
373 | <html><head/><body><p align="justify">Be careful. If not used with care you may end up loosing your usb.</p></body></html>
374 |
375 |
376 |
377 | -
378 |
379 |
380 | 2048 MB
381 |
382 |
383 |
384 | -
385 |
386 |
387 | Choose desired RAM and click on Boot USB button.
388 |
389 |
390 |
391 | -
392 |
393 |
394 | 256 MB
395 |
396 |
397 |
398 | -
399 |
400 |
401 | 512 MB
402 |
403 |
404 |
405 | -
406 |
407 |
408 | 1024 MB
409 |
410 |
411 |
412 | -
413 |
414 |
415 | 768 MB
416 |
417 |
418 |
419 | -
420 |
421 |
422 | Boot USB
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 | Settings
438 |
439 |
440 | -
441 |
442 |
-
443 |
444 |
445 | true
446 |
447 |
448 | Persistance
449 |
450 |
451 |
-
452 |
453 |
-
454 |
455 |
456 | Ubuntu
457 |
458 |
459 |
-
460 |
461 |
462 | Enable persistance
463 |
464 |
465 |
466 | -
467 |
468 |
469 | <html><head/><body><p>Enable if you would like </p><p>to have persistancefor </p><p>ubuntu and its derivatives.</p></body></html>
470 |
471 |
472 |
473 |
474 |
475 |
476 | -
477 |
478 |
479 | Debian
480 |
481 |
482 |
-
483 |
484 |
485 | Enable persistance
486 |
487 |
488 |
489 | -
490 |
491 |
492 | <html><head/><body><p>Enable if you would like </p><p>to have persistancefor </p><p>debian and its derivatives.</p></body></html>
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 | -
505 |
506 |
507 | true
508 |
509 |
510 | Update
511 |
512 |
513 |
-
514 |
515 |
-
516 |
517 |
518 | Check update
519 |
520 |
521 |
522 | -
523 |
524 |
525 | <html><head/><body><p>Enable this option if you would like to recieve update information </p><p>right in to your desktop.</p></body></html>
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 | About
541 |
542 |
543 | -
544 |
545 |
-
546 |
547 |
548 | Qt::Vertical
549 |
550 |
551 | QSizePolicy::Minimum
552 |
553 |
554 |
555 | 20
556 | 40
557 |
558 |
559 |
560 |
561 | -
562 |
563 |
564 | Qt::Horizontal
565 |
566 |
567 |
568 | 40
569 | 20
570 |
571 |
572 |
573 |
574 | -
575 |
576 |
577 | Qt::Vertical
578 |
579 |
580 | QSizePolicy::Minimum
581 |
582 |
583 |
584 | 20
585 | 30
586 |
587 |
588 |
589 |
590 | -
591 |
592 |
593 | false
594 |
595 |
596 | <html><head/><body><p align="center">An advanced bootable usb creator with option to install/uninstall </p><p align="center">multiple distros. This software is written in ruby and qtbindings. </p><p align="center">Copyright 2010-2013 Sundar</p><p align="center"><span style=" font-weight:600; text-decoration: underline;">Author(s)</span>: Sundar, Ian Bruce</p><p align="center"><span style=" font-weight:600; text-decoration: underline;">Licence:</span> GPL version 2 or later</p><p align="center"><span style=" font-weight:600; text-decoration: underline;">Help/Email:</span> feedback.multibootusb@gmail.com</p><p align="center"><span style=" font-weight:600; text-decoration: underline;">Home page: </span>http://sourceforge.net/projects/multibootusb/</p><p align="center"><br/></p></body></html>
597 |
598 |
599 |
600 | -
601 |
602 |
603 | Qt::Horizontal
604 |
605 |
606 |
607 | 40
608 | 20
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
--------------------------------------------------------------------------------
/multibootusb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbusb/multibootusb-ruby/a288e9fceb045d78abb8ff9ae494c733bb82ea0f/multibootusb.png
--------------------------------------------------------------------------------
/multibootusb/chain.c32:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbusb/multibootusb-ruby/a288e9fceb045d78abb8ff9ae494c733bb82ea0f/multibootusb/chain.c32
--------------------------------------------------------------------------------
/multibootusb/extlinux.cfg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbusb/multibootusb-ruby/a288e9fceb045d78abb8ff9ae494c733bb82ea0f/multibootusb/extlinux.cfg
--------------------------------------------------------------------------------
/multibootusb/grub.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbusb/multibootusb-ruby/a288e9fceb045d78abb8ff9ae494c733bb82ea0f/multibootusb/grub.exe
--------------------------------------------------------------------------------
/multibootusb/memdisk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbusb/multibootusb-ruby/a288e9fceb045d78abb8ff9ae494c733bb82ea0f/multibootusb/memdisk
--------------------------------------------------------------------------------
/multibootusb/menu.c32:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbusb/multibootusb-ruby/a288e9fceb045d78abb8ff9ae494c733bb82ea0f/multibootusb/menu.c32
--------------------------------------------------------------------------------
/multibootusb/menu.lst:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/multibootusb/syslinux.cfg:
--------------------------------------------------------------------------------
1 | # This file is created by MultiBootUSB.
2 | default vesamenu.c32
3 | prompt 0
4 | menu title MultiBootUSB
5 | #MENU BACKGROUND /multibootusb/bg.png
6 | TIMEOUT 100
7 | MENU WIDTH 80
8 | MENU MARGIN 10
9 | MENU PASSWORDMARGIN 3
10 | MENU ROWS 12
11 | MENU TABMSGROW 18
12 | MENU CMDLINEROW 18
13 | MENU ENDROW -1
14 | MENU PASSWORDROW 11
15 | MENU TIMEOUTROW 20
16 | MENU HELPMSGROW 22
17 | MENU HELPMSGENDROW -1
18 | MENU HIDDENROW -2
19 | MENU HSHIFT 0
20 | MENU VSHIFT 0
21 | MENU COLOR border 30;44 #40ffffff #a0000000 std
22 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
23 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
24 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
25 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
26 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
27 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
28 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
29 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
30 | label Boot from Hard Drive
31 | MENU LABEL Boot from Hard Disk
32 | KERNEL chain.c32
33 | APPEND hd1
34 | MENU DEFAULT
35 |
36 |
--------------------------------------------------------------------------------
/multibootusb/syslinux.cfg~:
--------------------------------------------------------------------------------
1 | # This file is created by MultiBootUSB.
2 | default vesamenu.c32
3 | prompt 0
4 | menu title MultiBootUSB
5 | #MENU BACKGROUND /multibootusb/slitaz-4.0/multibootusb/tools/background.png
6 | TIMEOUT 100
7 | MENU WIDTH 80
8 | MENU MARGIN 10
9 | MENU PASSWORDMARGIN 3
10 | MENU ROWS 12
11 | MENU TABMSGROW 18
12 | MENU CMDLINEROW 18
13 | MENU ENDROW -1
14 | MENU PASSWORDROW 11
15 | MENU TIMEOUTROW 20
16 | MENU HELPMSGROW 22
17 | MENU HELPMSGENDROW -1
18 | MENU HIDDENROW -2
19 | MENU HSHIFT 0
20 | MENU VSHIFT 0
21 | MENU COLOR border 30;44 #40ffffff #a0000000 std
22 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
23 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
24 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
25 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
26 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
27 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
28 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
29 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
30 | label Boot from Hard Drive
31 | MENU LABEL Boot from Hard Disk
32 | KERNEL chain.c32
33 | APPEND hd1
34 | MENU DEFAULT
35 |
36 |
--------------------------------------------------------------------------------
/multibootusb/vesamenu.c32:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbusb/multibootusb-ruby/a288e9fceb045d78abb8ff9ae494c733bb82ea0f/multibootusb/vesamenu.c32
--------------------------------------------------------------------------------
/multibootusb_ui.rb:
--------------------------------------------------------------------------------
1 | =begin
2 | ** Form generated from reading ui file 'multibootusb-new.ui'
3 | **
4 | ** Created: Tue Jun 18 23:21:56 2013
5 | ** by: Qt User Interface Compiler version 4.8.1
6 | **
7 | ** WARNING! All changes made in this file will be lost when recompiling ui file!
8 | =end
9 |
10 | class Ui_Dialog
11 | attr_reader :horizontalLayout
12 | attr_reader :tabWidget
13 | attr_reader :tab_3
14 | attr_reader :horizontalLayout_2
15 | attr_reader :gridLayout
16 | attr_reader :comboBox
17 | attr_reader :create
18 | attr_reader :close
19 | attr_reader :listWidget
20 | attr_reader :lineEdit
21 | attr_reader :browse_iso
22 | attr_reader :labelstep1
23 | attr_reader :labelstep2
24 | attr_reader :labelstep3
25 | attr_reader :progressBar
26 | attr_reader :groupBox
27 | attr_reader :verticalLayout
28 | attr_reader :gridLayout_5
29 | attr_reader :uninstall
30 | attr_reader :label
31 | attr_reader :groupBox_6
32 | attr_reader :verticalLayout_5
33 | attr_reader :usb_dev
34 | attr_reader :usb_label
35 | attr_reader :usb_mount
36 | attr_reader :usb_size_ttl
37 | attr_reader :usb_size_avl
38 | attr_reader :syslinux_ab
39 | attr_reader :horizontalLayout_3
40 | attr_reader :gridLayout_2
41 | attr_reader :groupBox_2
42 | attr_reader :horizontalLayout_4
43 | attr_reader :gridLayout_3
44 | attr_reader :install_syslinux
45 | attr_reader :horizontalSpacer_2
46 | attr_reader :install_sys_all
47 | attr_reader :install_sys_only
48 | attr_reader :groupBox_3
49 | attr_reader :horizontalLayout_5
50 | attr_reader :gridLayout_4
51 | attr_reader :edit_syslinux
52 | attr_reader :horizontalSpacer_3
53 | attr_reader :label_2
54 | attr_reader :tab
55 | attr_reader :verticalLayout_2
56 | attr_reader :groupBox_5
57 | attr_reader :verticalLayout_3
58 | attr_reader :gridLayout_7
59 | attr_reader :boot_iso_qemu
60 | attr_reader :ram_iso_768
61 | attr_reader :ram_iso_256
62 | attr_reader :lineEdit_2
63 | attr_reader :ram_iso_512
64 | attr_reader :label_3
65 | attr_reader :browse_iso_qemu
66 | attr_reader :ram_iso_1024
67 | attr_reader :ram_iso_2048
68 | attr_reader :label_7
69 | attr_reader :gridLayout_6
70 | attr_reader :groupBox_4
71 | attr_reader :verticalLayout_4
72 | attr_reader :gridLayout_8
73 | attr_reader :label_6
74 | attr_reader :ram_usb_2048
75 | attr_reader :label_4
76 | attr_reader :ram_usb_256
77 | attr_reader :ram_usb_512
78 | attr_reader :ram_usb_1024
79 | attr_reader :ram_usb_768
80 | attr_reader :boot_usb_qemu
81 | attr_reader :settings
82 | attr_reader :horizontalLayout_7
83 | attr_reader :gridLayout_9
84 | attr_reader :groupBox_7
85 | attr_reader :verticalLayout_6
86 | attr_reader :gridLayout_11
87 | attr_reader :groupBox_9
88 | attr_reader :verticalLayout_8
89 | attr_reader :checkBox
90 | attr_reader :label_8
91 | attr_reader :groupBox_10
92 | attr_reader :verticalLayout_9
93 | attr_reader :checkBox_2
94 | attr_reader :label_9
95 | attr_reader :groupBox_8
96 | attr_reader :verticalLayout_7
97 | attr_reader :gridLayout_12
98 | attr_reader :checkBox_3
99 | attr_reader :label_10
100 | attr_reader :tab_2
101 | attr_reader :horizontalLayout_6
102 | attr_reader :gridLayout_10
103 | attr_reader :verticalSpacer_5
104 | attr_reader :horizontalSpacer_4
105 | attr_reader :verticalSpacer_4
106 | attr_reader :label_5
107 | attr_reader :horizontalSpacer_5
108 |
109 | def setupUi(dialog)
110 | if dialog.objectName.nil?
111 | dialog.objectName = "dialog"
112 | end
113 | dialog.resize(537, 448)
114 | icon = Qt::Icon.new
115 | icon.addPixmap(Qt::Pixmap.new("multibootusb.png"), Qt::Icon::Normal, Qt::Icon::Off)
116 | dialog.windowIcon = icon
117 | @horizontalLayout = Qt::HBoxLayout.new(dialog)
118 | @horizontalLayout.objectName = "horizontalLayout"
119 | @tabWidget = Qt::TabWidget.new(dialog)
120 | @tabWidget.objectName = "tabWidget"
121 | @tab_3 = Qt::Widget.new()
122 | @tab_3.objectName = "tab_3"
123 | @horizontalLayout_2 = Qt::HBoxLayout.new(@tab_3)
124 | @horizontalLayout_2.objectName = "horizontalLayout_2"
125 | @gridLayout = Qt::GridLayout.new()
126 | @gridLayout.objectName = "gridLayout"
127 | @comboBox = Qt::ComboBox.new(@tab_3)
128 | @comboBox.objectName = "comboBox"
129 |
130 | @gridLayout.addWidget(@comboBox, 0, 2, 1, 2)
131 |
132 | @create = Qt::PushButton.new(@tab_3)
133 | @create.objectName = "create"
134 |
135 | @gridLayout.addWidget(@create, 4, 3, 1, 1)
136 |
137 | @close = Qt::PushButton.new(@tab_3)
138 | @close.objectName = "close"
139 |
140 | @gridLayout.addWidget(@close, 4, 2, 1, 1)
141 |
142 | @listWidget = Qt::ListWidget.new(@tab_3)
143 | @listWidget.objectName = "listWidget"
144 |
145 | @gridLayout.addWidget(@listWidget, 0, 0, 3, 1)
146 |
147 | @lineEdit = Qt::LineEdit.new(@tab_3)
148 | @lineEdit.objectName = "lineEdit"
149 |
150 | @gridLayout.addWidget(@lineEdit, 3, 0, 1, 3)
151 |
152 | @browse_iso = Qt::PushButton.new(@tab_3)
153 | @browse_iso.objectName = "browse_iso"
154 |
155 | @gridLayout.addWidget(@browse_iso, 3, 3, 1, 1)
156 |
157 | @labelstep1 = Qt::Label.new(@tab_3)
158 | @labelstep1.objectName = "labelstep1"
159 |
160 | @gridLayout.addWidget(@labelstep1, 0, 4, 1, 1)
161 |
162 | @labelstep2 = Qt::Label.new(@tab_3)
163 | @labelstep2.objectName = "labelstep2"
164 |
165 | @gridLayout.addWidget(@labelstep2, 3, 4, 1, 1)
166 |
167 | @labelstep3 = Qt::Label.new(@tab_3)
168 | @labelstep3.objectName = "labelstep3"
169 |
170 | @gridLayout.addWidget(@labelstep3, 4, 4, 1, 1)
171 |
172 | @progressBar = Qt::ProgressBar.new(@tab_3)
173 | @progressBar.objectName = "progressBar"
174 | @progressBar.value = 0
175 |
176 | @gridLayout.addWidget(@progressBar, 5, 0, 1, 5)
177 |
178 | @groupBox = Qt::GroupBox.new(@tab_3)
179 | @groupBox.objectName = "groupBox"
180 | @verticalLayout = Qt::VBoxLayout.new(@groupBox)
181 | @verticalLayout.objectName = "verticalLayout"
182 | @gridLayout_5 = Qt::GridLayout.new()
183 | @gridLayout_5.objectName = "gridLayout_5"
184 | @uninstall = Qt::PushButton.new(@groupBox)
185 | @uninstall.objectName = "uninstall"
186 |
187 | @gridLayout_5.addWidget(@uninstall, 0, 0, 1, 1)
188 |
189 |
190 | @verticalLayout.addLayout(@gridLayout_5)
191 |
192 |
193 | @gridLayout.addWidget(@groupBox, 2, 2, 1, 2)
194 |
195 | @label = Qt::Label.new(@tab_3)
196 | @label.objectName = "label"
197 |
198 | @gridLayout.addWidget(@label, 4, 0, 1, 2)
199 |
200 | @groupBox_6 = Qt::GroupBox.new(@tab_3)
201 | @groupBox_6.objectName = "groupBox_6"
202 | @verticalLayout_5 = Qt::VBoxLayout.new(@groupBox_6)
203 | @verticalLayout_5.objectName = "verticalLayout_5"
204 | @usb_dev = Qt::Label.new(@groupBox_6)
205 | @usb_dev.objectName = "usb_dev"
206 |
207 | @verticalLayout_5.addWidget(@usb_dev)
208 |
209 | @usb_label = Qt::Label.new(@groupBox_6)
210 | @usb_label.objectName = "usb_label"
211 |
212 | @verticalLayout_5.addWidget(@usb_label)
213 |
214 | @usb_mount = Qt::Label.new(@groupBox_6)
215 | @usb_mount.objectName = "usb_mount"
216 |
217 | @verticalLayout_5.addWidget(@usb_mount)
218 |
219 | @usb_size_ttl = Qt::Label.new(@groupBox_6)
220 | @usb_size_ttl.objectName = "usb_size_ttl"
221 |
222 | @verticalLayout_5.addWidget(@usb_size_ttl)
223 |
224 | @usb_size_avl = Qt::Label.new(@groupBox_6)
225 | @usb_size_avl.objectName = "usb_size_avl"
226 |
227 | @verticalLayout_5.addWidget(@usb_size_avl)
228 |
229 |
230 | @gridLayout.addWidget(@groupBox_6, 1, 2, 1, 2)
231 |
232 |
233 | @horizontalLayout_2.addLayout(@gridLayout)
234 |
235 | @tabWidget.addTab(@tab_3, Qt::Application.translate("Dialog", "Multibootusb", nil, Qt::Application::UnicodeUTF8))
236 | @syslinux_ab = Qt::Widget.new()
237 | @syslinux_ab.objectName = "syslinux_ab"
238 | @horizontalLayout_3 = Qt::HBoxLayout.new(@syslinux_ab)
239 | @horizontalLayout_3.objectName = "horizontalLayout_3"
240 | @gridLayout_2 = Qt::GridLayout.new()
241 | @gridLayout_2.objectName = "gridLayout_2"
242 | @groupBox_2 = Qt::GroupBox.new(@syslinux_ab)
243 | @groupBox_2.objectName = "groupBox_2"
244 | @horizontalLayout_4 = Qt::HBoxLayout.new(@groupBox_2)
245 | @horizontalLayout_4.objectName = "horizontalLayout_4"
246 | @gridLayout_3 = Qt::GridLayout.new()
247 | @gridLayout_3.objectName = "gridLayout_3"
248 | @install_syslinux = Qt::PushButton.new(@groupBox_2)
249 | @install_syslinux.objectName = "install_syslinux"
250 |
251 | @gridLayout_3.addWidget(@install_syslinux, 2, 1, 1, 1)
252 |
253 | @horizontalSpacer_2 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
254 |
255 | @gridLayout_3.addItem(@horizontalSpacer_2, 2, 0, 1, 1)
256 |
257 | @install_sys_all = Qt::RadioButton.new(@groupBox_2)
258 | @install_sys_all.objectName = "install_sys_all"
259 |
260 | @gridLayout_3.addWidget(@install_sys_all, 1, 0, 1, 2)
261 |
262 | @install_sys_only = Qt::RadioButton.new(@groupBox_2)
263 | @install_sys_only.objectName = "install_sys_only"
264 |
265 | @gridLayout_3.addWidget(@install_sys_only, 0, 0, 1, 2)
266 |
267 |
268 | @horizontalLayout_4.addLayout(@gridLayout_3)
269 |
270 |
271 | @gridLayout_2.addWidget(@groupBox_2, 0, 0, 1, 1)
272 |
273 | @groupBox_3 = Qt::GroupBox.new(@syslinux_ab)
274 | @groupBox_3.objectName = "groupBox_3"
275 | @horizontalLayout_5 = Qt::HBoxLayout.new(@groupBox_3)
276 | @horizontalLayout_5.objectName = "horizontalLayout_5"
277 | @gridLayout_4 = Qt::GridLayout.new()
278 | @gridLayout_4.objectName = "gridLayout_4"
279 | @edit_syslinux = Qt::PushButton.new(@groupBox_3)
280 | @edit_syslinux.objectName = "edit_syslinux"
281 |
282 | @gridLayout_4.addWidget(@edit_syslinux, 1, 1, 1, 1)
283 |
284 | @horizontalSpacer_3 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
285 |
286 | @gridLayout_4.addItem(@horizontalSpacer_3, 1, 0, 1, 1)
287 |
288 | @label_2 = Qt::Label.new(@groupBox_3)
289 | @label_2.objectName = "label_2"
290 |
291 | @gridLayout_4.addWidget(@label_2, 0, 0, 1, 2)
292 |
293 |
294 | @horizontalLayout_5.addLayout(@gridLayout_4)
295 |
296 |
297 | @gridLayout_2.addWidget(@groupBox_3, 1, 0, 1, 1)
298 |
299 |
300 | @horizontalLayout_3.addLayout(@gridLayout_2)
301 |
302 | @tabWidget.addTab(@syslinux_ab, Qt::Application.translate("Dialog", "Syslinux", nil, Qt::Application::UnicodeUTF8))
303 | @tab = Qt::Widget.new()
304 | @tab.objectName = "tab"
305 | @verticalLayout_2 = Qt::VBoxLayout.new(@tab)
306 | @verticalLayout_2.objectName = "verticalLayout_2"
307 | @groupBox_5 = Qt::GroupBox.new(@tab)
308 | @groupBox_5.objectName = "groupBox_5"
309 | @verticalLayout_3 = Qt::VBoxLayout.new(@groupBox_5)
310 | @verticalLayout_3.objectName = "verticalLayout_3"
311 | @gridLayout_7 = Qt::GridLayout.new()
312 | @gridLayout_7.objectName = "gridLayout_7"
313 | @boot_iso_qemu = Qt::PushButton.new(@groupBox_5)
314 | @boot_iso_qemu.objectName = "boot_iso_qemu"
315 |
316 | @gridLayout_7.addWidget(@boot_iso_qemu, 3, 4, 1, 1)
317 |
318 | @ram_iso_768 = Qt::RadioButton.new(@groupBox_5)
319 | @ram_iso_768.objectName = "ram_iso_768"
320 |
321 | @gridLayout_7.addWidget(@ram_iso_768, 2, 2, 1, 1)
322 |
323 | @ram_iso_256 = Qt::RadioButton.new(@groupBox_5)
324 | @ram_iso_256.objectName = "ram_iso_256"
325 |
326 | @gridLayout_7.addWidget(@ram_iso_256, 2, 0, 1, 1)
327 |
328 | @lineEdit_2 = Qt::LineEdit.new(@groupBox_5)
329 | @lineEdit_2.objectName = "lineEdit_2"
330 |
331 | @gridLayout_7.addWidget(@lineEdit_2, 1, 0, 1, 4)
332 |
333 | @ram_iso_512 = Qt::RadioButton.new(@groupBox_5)
334 | @ram_iso_512.objectName = "ram_iso_512"
335 |
336 | @gridLayout_7.addWidget(@ram_iso_512, 2, 1, 1, 1)
337 |
338 | @label_3 = Qt::Label.new(@groupBox_5)
339 | @label_3.objectName = "label_3"
340 |
341 | @gridLayout_7.addWidget(@label_3, 3, 0, 1, 4)
342 |
343 | @browse_iso_qemu = Qt::PushButton.new(@groupBox_5)
344 | @browse_iso_qemu.objectName = "browse_iso_qemu"
345 |
346 | @gridLayout_7.addWidget(@browse_iso_qemu, 1, 4, 1, 1)
347 |
348 | @ram_iso_1024 = Qt::RadioButton.new(@groupBox_5)
349 | @ram_iso_1024.objectName = "ram_iso_1024"
350 |
351 | @gridLayout_7.addWidget(@ram_iso_1024, 2, 3, 1, 1)
352 |
353 | @ram_iso_2048 = Qt::RadioButton.new(@groupBox_5)
354 | @ram_iso_2048.objectName = "ram_iso_2048"
355 |
356 | @gridLayout_7.addWidget(@ram_iso_2048, 2, 4, 1, 1)
357 |
358 | @label_7 = Qt::Label.new(@groupBox_5)
359 | @label_7.objectName = "label_7"
360 |
361 | @gridLayout_7.addWidget(@label_7, 0, 0, 1, 5)
362 |
363 |
364 | @verticalLayout_3.addLayout(@gridLayout_7)
365 |
366 |
367 | @verticalLayout_2.addWidget(@groupBox_5)
368 |
369 | @gridLayout_6 = Qt::GridLayout.new()
370 | @gridLayout_6.objectName = "gridLayout_6"
371 | @groupBox_4 = Qt::GroupBox.new(@tab)
372 | @groupBox_4.objectName = "groupBox_4"
373 | @verticalLayout_4 = Qt::VBoxLayout.new(@groupBox_4)
374 | @verticalLayout_4.objectName = "verticalLayout_4"
375 | @gridLayout_8 = Qt::GridLayout.new()
376 | @gridLayout_8.objectName = "gridLayout_8"
377 | @label_6 = Qt::Label.new(@groupBox_4)
378 | @label_6.objectName = "label_6"
379 |
380 | @gridLayout_8.addWidget(@label_6, 0, 0, 1, 5)
381 |
382 | @ram_usb_2048 = Qt::RadioButton.new(@groupBox_4)
383 | @ram_usb_2048.objectName = "ram_usb_2048"
384 |
385 | @gridLayout_8.addWidget(@ram_usb_2048, 1, 4, 1, 1)
386 |
387 | @label_4 = Qt::Label.new(@groupBox_4)
388 | @label_4.objectName = "label_4"
389 |
390 | @gridLayout_8.addWidget(@label_4, 2, 0, 1, 4)
391 |
392 | @ram_usb_256 = Qt::RadioButton.new(@groupBox_4)
393 | @ram_usb_256.objectName = "ram_usb_256"
394 |
395 | @gridLayout_8.addWidget(@ram_usb_256, 1, 0, 1, 1)
396 |
397 | @ram_usb_512 = Qt::RadioButton.new(@groupBox_4)
398 | @ram_usb_512.objectName = "ram_usb_512"
399 |
400 | @gridLayout_8.addWidget(@ram_usb_512, 1, 1, 1, 1)
401 |
402 | @ram_usb_1024 = Qt::RadioButton.new(@groupBox_4)
403 | @ram_usb_1024.objectName = "ram_usb_1024"
404 |
405 | @gridLayout_8.addWidget(@ram_usb_1024, 1, 3, 1, 1)
406 |
407 | @ram_usb_768 = Qt::RadioButton.new(@groupBox_4)
408 | @ram_usb_768.objectName = "ram_usb_768"
409 |
410 | @gridLayout_8.addWidget(@ram_usb_768, 1, 2, 1, 1)
411 |
412 | @boot_usb_qemu = Qt::PushButton.new(@groupBox_4)
413 | @boot_usb_qemu.objectName = "boot_usb_qemu"
414 |
415 | @gridLayout_8.addWidget(@boot_usb_qemu, 2, 4, 1, 1)
416 |
417 |
418 | @verticalLayout_4.addLayout(@gridLayout_8)
419 |
420 |
421 | @gridLayout_6.addWidget(@groupBox_4, 0, 0, 1, 1)
422 |
423 |
424 | @verticalLayout_2.addLayout(@gridLayout_6)
425 |
426 | @tabWidget.addTab(@tab, Qt::Application.translate("Dialog", "QEMU", nil, Qt::Application::UnicodeUTF8))
427 | @settings = Qt::Widget.new()
428 | @settings.objectName = "settings"
429 | @horizontalLayout_7 = Qt::HBoxLayout.new(@settings)
430 | @horizontalLayout_7.objectName = "horizontalLayout_7"
431 | @gridLayout_9 = Qt::GridLayout.new()
432 | @gridLayout_9.objectName = "gridLayout_9"
433 | @groupBox_7 = Qt::GroupBox.new(@settings)
434 | @groupBox_7.objectName = "groupBox_7"
435 | @verticalLayout_6 = Qt::VBoxLayout.new(@groupBox_7)
436 | @verticalLayout_6.objectName = "verticalLayout_6"
437 | @gridLayout_11 = Qt::GridLayout.new()
438 | @gridLayout_11.objectName = "gridLayout_11"
439 | @groupBox_9 = Qt::GroupBox.new(@groupBox_7)
440 | @groupBox_9.objectName = "groupBox_9"
441 | @verticalLayout_8 = Qt::VBoxLayout.new(@groupBox_9)
442 | @verticalLayout_8.objectName = "verticalLayout_8"
443 | @checkBox = Qt::CheckBox.new(@groupBox_9)
444 | @checkBox.objectName = "checkBox"
445 |
446 | @verticalLayout_8.addWidget(@checkBox)
447 |
448 | @label_8 = Qt::Label.new(@groupBox_9)
449 | @label_8.objectName = "label_8"
450 |
451 | @verticalLayout_8.addWidget(@label_8)
452 |
453 |
454 | @gridLayout_11.addWidget(@groupBox_9, 0, 0, 1, 1)
455 |
456 | @groupBox_10 = Qt::GroupBox.new(@groupBox_7)
457 | @groupBox_10.objectName = "groupBox_10"
458 | @verticalLayout_9 = Qt::VBoxLayout.new(@groupBox_10)
459 | @verticalLayout_9.objectName = "verticalLayout_9"
460 | @checkBox_2 = Qt::CheckBox.new(@groupBox_10)
461 | @checkBox_2.objectName = "checkBox_2"
462 |
463 | @verticalLayout_9.addWidget(@checkBox_2)
464 |
465 | @label_9 = Qt::Label.new(@groupBox_10)
466 | @label_9.objectName = "label_9"
467 |
468 | @verticalLayout_9.addWidget(@label_9)
469 |
470 |
471 | @gridLayout_11.addWidget(@groupBox_10, 0, 1, 1, 1)
472 |
473 |
474 | @verticalLayout_6.addLayout(@gridLayout_11)
475 |
476 |
477 | @gridLayout_9.addWidget(@groupBox_7, 1, 0, 1, 1)
478 |
479 | @groupBox_8 = Qt::GroupBox.new(@settings)
480 | @groupBox_8.objectName = "groupBox_8"
481 | @verticalLayout_7 = Qt::VBoxLayout.new(@groupBox_8)
482 | @verticalLayout_7.objectName = "verticalLayout_7"
483 | @gridLayout_12 = Qt::GridLayout.new()
484 | @gridLayout_12.objectName = "gridLayout_12"
485 | @checkBox_3 = Qt::CheckBox.new(@groupBox_8)
486 | @checkBox_3.objectName = "checkBox_3"
487 |
488 | @gridLayout_12.addWidget(@checkBox_3, 0, 0, 1, 1)
489 |
490 | @label_10 = Qt::Label.new(@groupBox_8)
491 | @label_10.objectName = "label_10"
492 |
493 | @gridLayout_12.addWidget(@label_10, 1, 0, 1, 1)
494 |
495 |
496 | @verticalLayout_7.addLayout(@gridLayout_12)
497 |
498 |
499 | @gridLayout_9.addWidget(@groupBox_8, 2, 0, 1, 1)
500 |
501 |
502 | @horizontalLayout_7.addLayout(@gridLayout_9)
503 |
504 | @tabWidget.addTab(@settings, Qt::Application.translate("Dialog", "Settings", nil, Qt::Application::UnicodeUTF8))
505 | @tab_2 = Qt::Widget.new()
506 | @tab_2.objectName = "tab_2"
507 | @horizontalLayout_6 = Qt::HBoxLayout.new(@tab_2)
508 | @horizontalLayout_6.objectName = "horizontalLayout_6"
509 | @gridLayout_10 = Qt::GridLayout.new()
510 | @gridLayout_10.objectName = "gridLayout_10"
511 | @verticalSpacer_5 = Qt::SpacerItem.new(20, 40, Qt::SizePolicy::Minimum, Qt::SizePolicy::Minimum)
512 |
513 | @gridLayout_10.addItem(@verticalSpacer_5, 0, 1, 1, 1)
514 |
515 | @horizontalSpacer_4 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
516 |
517 | @gridLayout_10.addItem(@horizontalSpacer_4, 1, 0, 1, 1)
518 |
519 | @verticalSpacer_4 = Qt::SpacerItem.new(20, 30, Qt::SizePolicy::Minimum, Qt::SizePolicy::Minimum)
520 |
521 | @gridLayout_10.addItem(@verticalSpacer_4, 2, 1, 1, 1)
522 |
523 | @label_5 = Qt::Label.new(@tab_2)
524 | @label_5.objectName = "label_5"
525 |
526 | @gridLayout_10.addWidget(@label_5, 1, 1, 1, 1)
527 |
528 | @horizontalSpacer_5 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
529 |
530 | @gridLayout_10.addItem(@horizontalSpacer_5, 1, 2, 1, 1)
531 |
532 |
533 | @horizontalLayout_6.addLayout(@gridLayout_10)
534 |
535 | @tabWidget.addTab(@tab_2, Qt::Application.translate("Dialog", "About", nil, Qt::Application::UnicodeUTF8))
536 |
537 | @horizontalLayout.addWidget(@tabWidget)
538 |
539 |
540 | retranslateUi(dialog)
541 |
542 | @tabWidget.setCurrentIndex(0)
543 |
544 |
545 | Qt::MetaObject.connectSlotsByName(dialog)
546 | end # setupUi
547 |
548 | def setup_ui(dialog)
549 | setupUi(dialog)
550 | end
551 |
552 | def retranslateUi(dialog)
553 | dialog.windowTitle = Qt::Application.translate("Dialog", "multibootusb", nil, Qt::Application::UnicodeUTF8)
554 | @create.text = Qt::Application.translate("Dialog", "Create", nil, Qt::Application::UnicodeUTF8)
555 | @close.text = Qt::Application.translate("Dialog", "Close", nil, Qt::Application::UnicodeUTF8)
556 | @browse_iso.text = Qt::Application.translate("Dialog", "Browse ISO", nil, Qt::Application::UnicodeUTF8)
557 | @labelstep1.text = Qt::Application.translate("Dialog", "
Step 1
", nil, Qt::Application::UnicodeUTF8)
558 | @labelstep2.text = Qt::Application.translate("Dialog", "Step 2
", nil, Qt::Application::UnicodeUTF8)
559 | @labelstep3.text = Qt::Application.translate("Dialog", "Step 3
", nil, Qt::Application::UnicodeUTF8)
560 | @groupBox.title = Qt::Application.translate("Dialog", "Uninstall (Optional)", nil, Qt::Application::UnicodeUTF8)
561 | @uninstall.text = Qt::Application.translate("Dialog", "Uninstall Distro", nil, Qt::Application::UnicodeUTF8)
562 | @label.text = Qt::Application.translate("Dialog", "TextLabel", nil, Qt::Application::UnicodeUTF8)
563 | @groupBox_6.title = Qt::Application.translate("Dialog", "USB Details", nil, Qt::Application::UnicodeUTF8)
564 | @usb_dev.text = Qt::Application.translate("Dialog", "Drive ::", nil, Qt::Application::UnicodeUTF8)
565 | @usb_label.text = Qt::Application.translate("Dialog", "Label ::", nil, Qt::Application::UnicodeUTF8)
566 | @usb_mount.text = Qt::Application.translate("Dialog", "Mount::", nil, Qt::Application::UnicodeUTF8)
567 | @usb_size_ttl.text = Qt::Application.translate("Dialog", "Size Total ::", nil, Qt::Application::UnicodeUTF8)
568 | @usb_size_avl.text = Qt::Application.translate("Dialog", "Size Avail ::", nil, Qt::Application::UnicodeUTF8)
569 | @tabWidget.setTabText(@tabWidget.indexOf(@tab_3), Qt::Application.translate("Dialog", "Multibootusb", nil, Qt::Application::UnicodeUTF8))
570 | @groupBox_2.title = Qt::Application.translate("Dialog", "Install Syslinux", nil, Qt::Application::UnicodeUTF8)
571 | @install_syslinux.text = Qt::Application.translate("Dialog", "Install", nil, Qt::Application::UnicodeUTF8)
572 | @install_sys_all.text = Qt::Application.translate("Dialog", "Install syslinux and copy all required files.", nil, Qt::Application::UnicodeUTF8)
573 | @install_sys_only.text = Qt::Application.translate("Dialog", "Install only syslinux (existing configurations will not be altred).", nil, Qt::Application::UnicodeUTF8)
574 | @groupBox_3.title = Qt::Application.translate("Dialog", "Edit syslinux.cfg", nil, Qt::Application::UnicodeUTF8)
575 | @edit_syslinux.text = Qt::Application.translate("Dialog", "Edit", nil, Qt::Application::UnicodeUTF8)
576 | @label_2.text = Qt::Application.translate("Dialog", "Using this option user can edit syslinux.cfg file directly. It directly uses
default editor of host system. Be careful while editing syslinux.cfg file.
", nil, Qt::Application::UnicodeUTF8)
577 | @tabWidget.setTabText(@tabWidget.indexOf(@syslinux_ab), Qt::Application.translate("Dialog", "Syslinux", nil, Qt::Application::UnicodeUTF8))
578 | @groupBox_5.title = Qt::Application.translate("Dialog", "Boot ISO", nil, Qt::Application::UnicodeUTF8)
579 | @boot_iso_qemu.text = Qt::Application.translate("Dialog", "Boot ISO", nil, Qt::Application::UnicodeUTF8)
580 | @ram_iso_768.text = Qt::Application.translate("Dialog", "768 MB", nil, Qt::Application::UnicodeUTF8)
581 | @ram_iso_256.text = Qt::Application.translate("Dialog", "256 MB", nil, Qt::Application::UnicodeUTF8)
582 | @ram_iso_512.text = Qt::Application.translate("Dialog", "512 MB", nil, Qt::Application::UnicodeUTF8)
583 | @label_3.text = Qt::Application.translate("Dialog", "Choose desired RAM and click on Boot ISO button.", nil, Qt::Application::UnicodeUTF8)
584 | @browse_iso_qemu.text = Qt::Application.translate("Dialog", "Browse ISO", nil, Qt::Application::UnicodeUTF8)
585 | @ram_iso_1024.text = Qt::Application.translate("Dialog", "1024 MB", nil, Qt::Application::UnicodeUTF8)
586 | @ram_iso_2048.text = Qt::Application.translate("Dialog", "2048 MB", nil, Qt::Application::UnicodeUTF8)
587 | @label_7.text = Qt::Application.translate("Dialog", "Best way to check downloaded iso. ", nil, Qt::Application::UnicodeUTF8)
588 | @groupBox_4.title = Qt::Application.translate("Dialog", "Boot USB", nil, Qt::Application::UnicodeUTF8)
589 | @label_6.text = Qt::Application.translate("Dialog", "Be careful. If not used with care you may end up loosing your usb.
", nil, Qt::Application::UnicodeUTF8)
590 | @ram_usb_2048.text = Qt::Application.translate("Dialog", "2048 MB", nil, Qt::Application::UnicodeUTF8)
591 | @label_4.text = Qt::Application.translate("Dialog", "Choose desired RAM and click on Boot USB button.", nil, Qt::Application::UnicodeUTF8)
592 | @ram_usb_256.text = Qt::Application.translate("Dialog", "256 MB", nil, Qt::Application::UnicodeUTF8)
593 | @ram_usb_512.text = Qt::Application.translate("Dialog", "512 MB", nil, Qt::Application::UnicodeUTF8)
594 | @ram_usb_1024.text = Qt::Application.translate("Dialog", "1024 MB", nil, Qt::Application::UnicodeUTF8)
595 | @ram_usb_768.text = Qt::Application.translate("Dialog", "768 MB", nil, Qt::Application::UnicodeUTF8)
596 | @boot_usb_qemu.text = Qt::Application.translate("Dialog", "Boot USB", nil, Qt::Application::UnicodeUTF8)
597 | @tabWidget.setTabText(@tabWidget.indexOf(@tab), Qt::Application.translate("Dialog", "QEMU", nil, Qt::Application::UnicodeUTF8))
598 | @groupBox_7.title = Qt::Application.translate("Dialog", "Persistance", nil, Qt::Application::UnicodeUTF8)
599 | @groupBox_9.title = Qt::Application.translate("Dialog", "Ubuntu", nil, Qt::Application::UnicodeUTF8)
600 | @checkBox.text = Qt::Application.translate("Dialog", "Enable persistance", nil, Qt::Application::UnicodeUTF8)
601 | @label_8.text = Qt::Application.translate("Dialog", "Enable if you would like
to have persistancefor
ubuntu and its derivatives.
", nil, Qt::Application::UnicodeUTF8)
602 | @groupBox_10.title = Qt::Application.translate("Dialog", "Debian", nil, Qt::Application::UnicodeUTF8)
603 | @checkBox_2.text = Qt::Application.translate("Dialog", "Enable persistance", nil, Qt::Application::UnicodeUTF8)
604 | @label_9.text = Qt::Application.translate("Dialog", "Enable if you would like
to have persistancefor
debian and its derivatives.
", nil, Qt::Application::UnicodeUTF8)
605 | @groupBox_8.title = Qt::Application.translate("Dialog", "Update", nil, Qt::Application::UnicodeUTF8)
606 | @checkBox_3.text = Qt::Application.translate("Dialog", "Check update", nil, Qt::Application::UnicodeUTF8)
607 | @label_10.text = Qt::Application.translate("Dialog", "Enable this option if you would like to recieve update information
right in to your desktop.
", nil, Qt::Application::UnicodeUTF8)
608 | @tabWidget.setTabText(@tabWidget.indexOf(@settings), Qt::Application.translate("Dialog", "Settings", nil, Qt::Application::UnicodeUTF8))
609 | @label_5.text = Qt::Application.translate("Dialog", "An advanced bootable usb creator with option to install/uninstall
multiple distros. This software is written in ruby and qtbindings.
Copyright 2010-2013 Sundar
Author(s): Sundar, Ian Bruce
Licence: GPL version 2 or later
Help/Email: feedback.multibootusb@gmail.com
Home page: http://sourceforge.net/projects/multibootusb/
", nil, Qt::Application::UnicodeUTF8)
610 | @tabWidget.setTabText(@tabWidget.indexOf(@tab_2), Qt::Application.translate("Dialog", "About", nil, Qt::Application::UnicodeUTF8))
611 | end # retranslateUi
612 |
613 | def retranslate_ui(dialog)
614 | retranslateUi(dialog)
615 | end
616 |
617 | end
618 |
619 | module Ui
620 | class Dialog < Ui_Dialog
621 | end
622 | end # module Ui
623 |
624 |
--------------------------------------------------------------------------------
/multibootusb_ui_old.rb:
--------------------------------------------------------------------------------
1 | =begin
2 | ** Form generated from reading ui file 'untitled.ui'
3 | **
4 | ** Created: Sun Jun 9 18:33:25 2013
5 | ** by: Qt User Interface Compiler version 4.8.1
6 | **
7 | ** WARNING! All changes made in this file will be lost when recompiling ui file!
8 | =end
9 |
10 | class Ui_Dialog
11 | attr_reader :horizontalLayout
12 | attr_reader :tabWidget
13 | attr_reader :tab_3
14 | attr_reader :horizontalLayout_2
15 | attr_reader :gridLayout
16 | attr_reader :comboBox
17 | attr_reader :create
18 | attr_reader :close
19 | attr_reader :listWidget
20 | attr_reader :lineEdit
21 | attr_reader :browse_iso
22 | attr_reader :horizontalSpacer
23 | attr_reader :labelstep1
24 | attr_reader :labelstep2
25 | attr_reader :labelstep3
26 | attr_reader :progressBar
27 | attr_reader :groupBox
28 | attr_reader :verticalLayout
29 | attr_reader :gridLayout_5
30 | attr_reader :uninstall
31 | attr_reader :verticalSpacer_2
32 | attr_reader :verticalSpacer
33 | attr_reader :listdistro
34 | attr_reader :verticalSpacer_3
35 | attr_reader :label
36 | attr_reader :syslinux_ab
37 | attr_reader :horizontalLayout_3
38 | attr_reader :gridLayout_2
39 | attr_reader :groupBox_2
40 | attr_reader :horizontalLayout_4
41 | attr_reader :gridLayout_3
42 | attr_reader :install_syslinux
43 | attr_reader :horizontalSpacer_2
44 | attr_reader :install_sys_all
45 | attr_reader :install_sys_only
46 | attr_reader :groupBox_3
47 | attr_reader :horizontalLayout_5
48 | attr_reader :gridLayout_4
49 | attr_reader :edit_syslinux
50 | attr_reader :horizontalSpacer_3
51 | attr_reader :label_2
52 | attr_reader :tab
53 | attr_reader :verticalLayout_2
54 | attr_reader :groupBox_5
55 | attr_reader :verticalLayout_3
56 | attr_reader :gridLayout_7
57 | attr_reader :ram_iso_768
58 | attr_reader :ram_iso_256
59 | attr_reader :lineEdit_2
60 | attr_reader :ram_iso_512
61 | attr_reader :label_3
62 | attr_reader :browse_iso_qemu
63 | attr_reader :boot_iso_qemu
64 | attr_reader :ram_iso_1024
65 | attr_reader :ram_iso_2048
66 | attr_reader :gridLayout_6
67 | attr_reader :groupBox_4
68 | attr_reader :verticalLayout_4
69 | attr_reader :gridLayout_8
70 | attr_reader :label_6
71 | attr_reader :radioButton_9
72 | attr_reader :label_4
73 | attr_reader :radioButton_13
74 | attr_reader :radioButton_12
75 | attr_reader :radioButton_10
76 | attr_reader :radioButton_11
77 | attr_reader :boot_usb_qemu
78 | attr_reader :tab_2
79 | attr_reader :horizontalLayout_6
80 | attr_reader :gridLayout_10
81 | attr_reader :verticalSpacer_5
82 | attr_reader :horizontalSpacer_4
83 | attr_reader :verticalSpacer_4
84 | attr_reader :label_5
85 | attr_reader :horizontalSpacer_5
86 |
87 | def setupUi(dialog)
88 | if dialog.objectName.nil?
89 | dialog.objectName = "dialog"
90 | end
91 | dialog.resize(537, 420)
92 | icon = Qt::Icon.new
93 | icon.addPixmap(Qt::Pixmap.new("multibootusb.png"), Qt::Icon::Normal, Qt::Icon::Off)
94 | dialog.windowIcon = icon
95 | @horizontalLayout = Qt::HBoxLayout.new(dialog)
96 | @horizontalLayout.objectName = "horizontalLayout"
97 | @tabWidget = Qt::TabWidget.new(dialog)
98 | @tabWidget.objectName = "tabWidget"
99 | @tab_3 = Qt::Widget.new()
100 | @tab_3.objectName = "tab_3"
101 | @horizontalLayout_2 = Qt::HBoxLayout.new(@tab_3)
102 | @horizontalLayout_2.objectName = "horizontalLayout_2"
103 | @gridLayout = Qt::GridLayout.new()
104 | @gridLayout.objectName = "gridLayout"
105 | @comboBox = Qt::ComboBox.new(@tab_3)
106 | @comboBox.objectName = "comboBox"
107 |
108 | @gridLayout.addWidget(@comboBox, 0, 2, 1, 2)
109 |
110 | @create = Qt::PushButton.new(@tab_3)
111 | @create.objectName = "create"
112 |
113 | @gridLayout.addWidget(@create, 3, 3, 1, 1)
114 |
115 | @close = Qt::PushButton.new(@tab_3)
116 | @close.objectName = "close"
117 |
118 | @gridLayout.addWidget(@close, 3, 2, 1, 1)
119 |
120 | @listWidget = Qt::ListWidget.new(@tab_3)
121 | @listWidget.objectName = "listWidget"
122 |
123 | @gridLayout.addWidget(@listWidget, 0, 0, 2, 1)
124 |
125 | @lineEdit = Qt::LineEdit.new(@tab_3)
126 | @lineEdit.objectName = "lineEdit"
127 |
128 | @gridLayout.addWidget(@lineEdit, 2, 0, 1, 3)
129 |
130 | @browse_iso = Qt::PushButton.new(@tab_3)
131 | @browse_iso.objectName = "browse_iso"
132 |
133 | @gridLayout.addWidget(@browse_iso, 2, 3, 1, 1)
134 |
135 | @horizontalSpacer = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
136 |
137 | @gridLayout.addItem(@horizontalSpacer, 1, 1, 1, 1)
138 |
139 | @labelstep1 = Qt::Label.new(@tab_3)
140 | @labelstep1.objectName = "labelstep1"
141 |
142 | @gridLayout.addWidget(@labelstep1, 0, 4, 1, 1)
143 |
144 | @labelstep2 = Qt::Label.new(@tab_3)
145 | @labelstep2.objectName = "labelstep2"
146 |
147 | @gridLayout.addWidget(@labelstep2, 2, 4, 1, 1)
148 |
149 | @labelstep3 = Qt::Label.new(@tab_3)
150 | @labelstep3.objectName = "labelstep3"
151 |
152 | @gridLayout.addWidget(@labelstep3, 3, 4, 1, 1)
153 |
154 | @progressBar = Qt::ProgressBar.new(@tab_3)
155 | @progressBar.objectName = "progressBar"
156 | @progressBar.value = 0
157 |
158 | @gridLayout.addWidget(@progressBar, 4, 0, 1, 5)
159 |
160 | @groupBox = Qt::GroupBox.new(@tab_3)
161 | @groupBox.objectName = "groupBox"
162 | @verticalLayout = Qt::VBoxLayout.new(@groupBox)
163 | @verticalLayout.objectName = "verticalLayout"
164 | @gridLayout_5 = Qt::GridLayout.new()
165 | @gridLayout_5.objectName = "gridLayout_5"
166 | @uninstall = Qt::PushButton.new(@groupBox)
167 | @uninstall.objectName = "uninstall"
168 |
169 | @gridLayout_5.addWidget(@uninstall, 3, 0, 1, 1)
170 |
171 | @verticalSpacer_2 = Qt::SpacerItem.new(20, 40, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
172 |
173 | @gridLayout_5.addItem(@verticalSpacer_2, 4, 0, 1, 1)
174 |
175 | @verticalSpacer = Qt::SpacerItem.new(20, 40, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
176 |
177 | @gridLayout_5.addItem(@verticalSpacer, 2, 0, 1, 1)
178 |
179 | @listdistro = Qt::RadioButton.new(@groupBox)
180 | @listdistro.objectName = "listdistro"
181 |
182 | @gridLayout_5.addWidget(@listdistro, 1, 0, 1, 1)
183 |
184 | @verticalSpacer_3 = Qt::SpacerItem.new(20, 40, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
185 |
186 | @gridLayout_5.addItem(@verticalSpacer_3, 0, 0, 1, 1)
187 |
188 |
189 | @verticalLayout.addLayout(@gridLayout_5)
190 |
191 |
192 | @gridLayout.addWidget(@groupBox, 1, 2, 1, 2)
193 |
194 | @label = Qt::Label.new(@tab_3)
195 | @label.objectName = "label"
196 |
197 | @gridLayout.addWidget(@label, 3, 0, 1, 2)
198 |
199 |
200 | @horizontalLayout_2.addLayout(@gridLayout)
201 |
202 | @tabWidget.addTab(@tab_3, Qt::Application.translate("Dialog", "Multibootusb", nil, Qt::Application::UnicodeUTF8))
203 | @syslinux_ab = Qt::Widget.new()
204 | @syslinux_ab.objectName = "syslinux_ab"
205 | @horizontalLayout_3 = Qt::HBoxLayout.new(@syslinux_ab)
206 | @horizontalLayout_3.objectName = "horizontalLayout_3"
207 | @gridLayout_2 = Qt::GridLayout.new()
208 | @gridLayout_2.objectName = "gridLayout_2"
209 | @groupBox_2 = Qt::GroupBox.new(@syslinux_ab)
210 | @groupBox_2.objectName = "groupBox_2"
211 | @horizontalLayout_4 = Qt::HBoxLayout.new(@groupBox_2)
212 | @horizontalLayout_4.objectName = "horizontalLayout_4"
213 | @gridLayout_3 = Qt::GridLayout.new()
214 | @gridLayout_3.objectName = "gridLayout_3"
215 | @install_syslinux = Qt::PushButton.new(@groupBox_2)
216 | @install_syslinux.objectName = "install_syslinux"
217 |
218 | @gridLayout_3.addWidget(@install_syslinux, 2, 1, 1, 1)
219 |
220 | @horizontalSpacer_2 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
221 |
222 | @gridLayout_3.addItem(@horizontalSpacer_2, 2, 0, 1, 1)
223 |
224 | @install_sys_all = Qt::RadioButton.new(@groupBox_2)
225 | @install_sys_all.objectName = "install_sys_all"
226 |
227 | @gridLayout_3.addWidget(@install_sys_all, 1, 0, 1, 2)
228 |
229 | @install_sys_only = Qt::RadioButton.new(@groupBox_2)
230 | @install_sys_only.objectName = "install_sys_only"
231 |
232 | @gridLayout_3.addWidget(@install_sys_only, 0, 0, 1, 2)
233 |
234 |
235 | @horizontalLayout_4.addLayout(@gridLayout_3)
236 |
237 |
238 | @gridLayout_2.addWidget(@groupBox_2, 0, 0, 1, 1)
239 |
240 | @groupBox_3 = Qt::GroupBox.new(@syslinux_ab)
241 | @groupBox_3.objectName = "groupBox_3"
242 | @horizontalLayout_5 = Qt::HBoxLayout.new(@groupBox_3)
243 | @horizontalLayout_5.objectName = "horizontalLayout_5"
244 | @gridLayout_4 = Qt::GridLayout.new()
245 | @gridLayout_4.objectName = "gridLayout_4"
246 | @edit_syslinux = Qt::PushButton.new(@groupBox_3)
247 | @edit_syslinux.objectName = "edit_syslinux"
248 |
249 | @gridLayout_4.addWidget(@edit_syslinux, 1, 1, 1, 1)
250 |
251 | @horizontalSpacer_3 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
252 |
253 | @gridLayout_4.addItem(@horizontalSpacer_3, 1, 0, 1, 1)
254 |
255 | @label_2 = Qt::Label.new(@groupBox_3)
256 | @label_2.objectName = "label_2"
257 |
258 | @gridLayout_4.addWidget(@label_2, 0, 0, 1, 2)
259 |
260 |
261 | @horizontalLayout_5.addLayout(@gridLayout_4)
262 |
263 |
264 | @gridLayout_2.addWidget(@groupBox_3, 1, 0, 1, 1)
265 |
266 |
267 | @horizontalLayout_3.addLayout(@gridLayout_2)
268 |
269 | @tabWidget.addTab(@syslinux_ab, Qt::Application.translate("Dialog", "Syslinux", nil, Qt::Application::UnicodeUTF8))
270 | @tab = Qt::Widget.new()
271 | @tab.objectName = "tab"
272 | @verticalLayout_2 = Qt::VBoxLayout.new(@tab)
273 | @verticalLayout_2.objectName = "verticalLayout_2"
274 | @groupBox_5 = Qt::GroupBox.new(@tab)
275 | @groupBox_5.objectName = "groupBox_5"
276 | @verticalLayout_3 = Qt::VBoxLayout.new(@groupBox_5)
277 | @verticalLayout_3.objectName = "verticalLayout_3"
278 | @gridLayout_7 = Qt::GridLayout.new()
279 | @gridLayout_7.objectName = "gridLayout_7"
280 | @ram_iso_768 = Qt::RadioButton.new(@groupBox_5)
281 | @ram_iso_768.objectName = "ram_iso_768"
282 |
283 | @gridLayout_7.addWidget(@ram_iso_768, 1, 2, 1, 1)
284 |
285 | @ram_iso_256 = Qt::RadioButton.new(@groupBox_5)
286 | @ram_iso_256.objectName = "ram_iso_256"
287 |
288 | @gridLayout_7.addWidget(@ram_iso_256, 1, 0, 1, 1)
289 |
290 | @lineEdit_2 = Qt::LineEdit.new(@groupBox_5)
291 | @lineEdit_2.objectName = "lineEdit_2"
292 |
293 | @gridLayout_7.addWidget(@lineEdit_2, 0, 0, 1, 4)
294 |
295 | @ram_iso_512 = Qt::RadioButton.new(@groupBox_5)
296 | @ram_iso_512.objectName = "ram_iso_512"
297 |
298 | @gridLayout_7.addWidget(@ram_iso_512, 1, 1, 1, 1)
299 |
300 | @label_3 = Qt::Label.new(@groupBox_5)
301 | @label_3.objectName = "label_3"
302 |
303 | @gridLayout_7.addWidget(@label_3, 2, 0, 1, 4)
304 |
305 | @browse_iso_qemu = Qt::PushButton.new(@groupBox_5)
306 | @browse_iso_qemu.objectName = "browse_iso_qemu"
307 |
308 | @gridLayout_7.addWidget(@browse_iso_qemu, 0, 4, 1, 1)
309 |
310 | @boot_iso_qemu = Qt::PushButton.new(@groupBox_5)
311 | @boot_iso_qemu.objectName = "boot_iso_qemu"
312 |
313 | @gridLayout_7.addWidget(@boot_iso_qemu, 2, 4, 1, 1)
314 |
315 | @ram_iso_1024 = Qt::RadioButton.new(@groupBox_5)
316 | @ram_iso_1024.objectName = "ram_iso_1024"
317 |
318 | @gridLayout_7.addWidget(@ram_iso_1024, 1, 3, 1, 1)
319 |
320 | @ram_iso_2048 = Qt::RadioButton.new(@groupBox_5)
321 | @ram_iso_2048.objectName = "ram_iso_2048"
322 |
323 | @gridLayout_7.addWidget(@ram_iso_2048, 1, 4, 1, 1)
324 |
325 |
326 | @verticalLayout_3.addLayout(@gridLayout_7)
327 |
328 |
329 | @verticalLayout_2.addWidget(@groupBox_5)
330 |
331 | @gridLayout_6 = Qt::GridLayout.new()
332 | @gridLayout_6.objectName = "gridLayout_6"
333 | @groupBox_4 = Qt::GroupBox.new(@tab)
334 | @groupBox_4.objectName = "groupBox_4"
335 | @verticalLayout_4 = Qt::VBoxLayout.new(@groupBox_4)
336 | @verticalLayout_4.objectName = "verticalLayout_4"
337 | @gridLayout_8 = Qt::GridLayout.new()
338 | @gridLayout_8.objectName = "gridLayout_8"
339 | @label_6 = Qt::Label.new(@groupBox_4)
340 | @label_6.objectName = "label_6"
341 |
342 | @gridLayout_8.addWidget(@label_6, 0, 0, 1, 5)
343 |
344 | @radioButton_9 = Qt::RadioButton.new(@groupBox_4)
345 | @radioButton_9.objectName = "radioButton_9"
346 |
347 | @gridLayout_8.addWidget(@radioButton_9, 1, 4, 1, 1)
348 |
349 | @label_4 = Qt::Label.new(@groupBox_4)
350 | @label_4.objectName = "label_4"
351 |
352 | @gridLayout_8.addWidget(@label_4, 2, 0, 1, 4)
353 |
354 | @radioButton_13 = Qt::RadioButton.new(@groupBox_4)
355 | @radioButton_13.objectName = "radioButton_13"
356 |
357 | @gridLayout_8.addWidget(@radioButton_13, 1, 0, 1, 1)
358 |
359 | @radioButton_12 = Qt::RadioButton.new(@groupBox_4)
360 | @radioButton_12.objectName = "radioButton_12"
361 |
362 | @gridLayout_8.addWidget(@radioButton_12, 1, 1, 1, 1)
363 |
364 | @radioButton_10 = Qt::RadioButton.new(@groupBox_4)
365 | @radioButton_10.objectName = "radioButton_10"
366 |
367 | @gridLayout_8.addWidget(@radioButton_10, 1, 3, 1, 1)
368 |
369 | @radioButton_11 = Qt::RadioButton.new(@groupBox_4)
370 | @radioButton_11.objectName = "radioButton_11"
371 |
372 | @gridLayout_8.addWidget(@radioButton_11, 1, 2, 1, 1)
373 |
374 | @boot_usb_qemu = Qt::PushButton.new(@groupBox_4)
375 | @boot_usb_qemu.objectName = "boot_usb_qemu"
376 |
377 | @gridLayout_8.addWidget(@boot_usb_qemu, 2, 4, 1, 1)
378 |
379 |
380 | @verticalLayout_4.addLayout(@gridLayout_8)
381 |
382 |
383 | @gridLayout_6.addWidget(@groupBox_4, 0, 0, 1, 1)
384 |
385 |
386 | @verticalLayout_2.addLayout(@gridLayout_6)
387 |
388 | @tabWidget.addTab(@tab, Qt::Application.translate("Dialog", "QEMU", nil, Qt::Application::UnicodeUTF8))
389 | @tab_2 = Qt::Widget.new()
390 | @tab_2.objectName = "tab_2"
391 | @horizontalLayout_6 = Qt::HBoxLayout.new(@tab_2)
392 | @horizontalLayout_6.objectName = "horizontalLayout_6"
393 | @gridLayout_10 = Qt::GridLayout.new()
394 | @gridLayout_10.objectName = "gridLayout_10"
395 | @verticalSpacer_5 = Qt::SpacerItem.new(20, 40, Qt::SizePolicy::Minimum, Qt::SizePolicy::Minimum)
396 |
397 | @gridLayout_10.addItem(@verticalSpacer_5, 0, 1, 1, 1)
398 |
399 | @horizontalSpacer_4 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
400 |
401 | @gridLayout_10.addItem(@horizontalSpacer_4, 1, 0, 1, 1)
402 |
403 | @verticalSpacer_4 = Qt::SpacerItem.new(20, 30, Qt::SizePolicy::Minimum, Qt::SizePolicy::Minimum)
404 |
405 | @gridLayout_10.addItem(@verticalSpacer_4, 2, 1, 1, 1)
406 |
407 | @label_5 = Qt::Label.new(@tab_2)
408 | @label_5.objectName = "label_5"
409 |
410 | @gridLayout_10.addWidget(@label_5, 1, 1, 1, 1)
411 |
412 | @horizontalSpacer_5 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
413 |
414 | @gridLayout_10.addItem(@horizontalSpacer_5, 1, 2, 1, 1)
415 |
416 |
417 | @horizontalLayout_6.addLayout(@gridLayout_10)
418 |
419 | @tabWidget.addTab(@tab_2, Qt::Application.translate("Dialog", "About", nil, Qt::Application::UnicodeUTF8))
420 |
421 | @horizontalLayout.addWidget(@tabWidget)
422 |
423 |
424 | retranslateUi(dialog)
425 |
426 | @tabWidget.setCurrentIndex(0)
427 |
428 |
429 | Qt::MetaObject.connectSlotsByName(dialog)
430 | end # setupUi
431 |
432 | def setup_ui(dialog)
433 | setupUi(dialog)
434 | end
435 |
436 | def retranslateUi(dialog)
437 | dialog.windowTitle = Qt::Application.translate("Dialog", "multibootusb", nil, Qt::Application::UnicodeUTF8)
438 | @create.text = Qt::Application.translate("Dialog", "Create", nil, Qt::Application::UnicodeUTF8)
439 | @close.text = Qt::Application.translate("Dialog", "Close", nil, Qt::Application::UnicodeUTF8)
440 | @browse_iso.text = Qt::Application.translate("Dialog", "Browse ISO", nil, Qt::Application::UnicodeUTF8)
441 | @labelstep1.text = Qt::Application.translate("Dialog", "Step 1
", nil, Qt::Application::UnicodeUTF8)
442 | @labelstep2.text = Qt::Application.translate("Dialog", "Step 2
", nil, Qt::Application::UnicodeUTF8)
443 | @labelstep3.text = Qt::Application.translate("Dialog", "Step 3
", nil, Qt::Application::UnicodeUTF8)
444 | @groupBox.title = Qt::Application.translate("Dialog", "Optional", nil, Qt::Application::UnicodeUTF8)
445 | @uninstall.text = Qt::Application.translate("Dialog", "Uninstall Distro", nil, Qt::Application::UnicodeUTF8)
446 | @listdistro.text = Qt::Application.translate("Dialog", "List Distros", nil, Qt::Application::UnicodeUTF8)
447 | @label.text = Qt::Application.translate("Dialog", "TextLabel", nil, Qt::Application::UnicodeUTF8)
448 | @tabWidget.setTabText(@tabWidget.indexOf(@tab_3), Qt::Application.translate("Dialog", "Multibootusb", nil, Qt::Application::UnicodeUTF8))
449 | @groupBox_2.title = Qt::Application.translate("Dialog", "Install Syslinux", nil, Qt::Application::UnicodeUTF8)
450 | @install_syslinux.text = Qt::Application.translate("Dialog", "Install", nil, Qt::Application::UnicodeUTF8)
451 | @install_sys_all.text = Qt::Application.translate("Dialog", "Install syslinux and copy all required files.", nil, Qt::Application::UnicodeUTF8)
452 | @install_sys_only.text = Qt::Application.translate("Dialog", "Install only syslinux (existing configurations will not be altred).", nil, Qt::Application::UnicodeUTF8)
453 | @groupBox_3.title = Qt::Application.translate("Dialog", "Edit syslinux.cfg", nil, Qt::Application::UnicodeUTF8)
454 | @edit_syslinux.text = Qt::Application.translate("Dialog", "Edit", nil, Qt::Application::UnicodeUTF8)
455 | @label_2.text = Qt::Application.translate("Dialog", "Using this option user can edit syslinux.cfg file directly. It directly uses
default editor of host system. Be careful while editing syslinux.cfg file.
", nil, Qt::Application::UnicodeUTF8)
456 | @tabWidget.setTabText(@tabWidget.indexOf(@syslinux_ab), Qt::Application.translate("Dialog", "Syslinux", nil, Qt::Application::UnicodeUTF8))
457 | @groupBox_5.title = Qt::Application.translate("Dialog", "Boot ISO", nil, Qt::Application::UnicodeUTF8)
458 | @ram_iso_768.text = Qt::Application.translate("Dialog", "768 MB", nil, Qt::Application::UnicodeUTF8)
459 | @ram_iso_256.text = Qt::Application.translate("Dialog", "256 MB", nil, Qt::Application::UnicodeUTF8)
460 | @ram_iso_512.text = Qt::Application.translate("Dialog", "512 MB", nil, Qt::Application::UnicodeUTF8)
461 | @label_3.text = Qt::Application.translate("Dialog", "Choose desired RAM and click on Boot ISO button.", nil, Qt::Application::UnicodeUTF8)
462 | @browse_iso_qemu.text = Qt::Application.translate("Dialog", "Browse ISO", nil, Qt::Application::UnicodeUTF8)
463 | @boot_iso_qemu.text = Qt::Application.translate("Dialog", "Boot ISO", nil, Qt::Application::UnicodeUTF8)
464 | @ram_iso_1024.text = Qt::Application.translate("Dialog", "1024 MB", nil, Qt::Application::UnicodeUTF8)
465 | @ram_iso_2048.text = Qt::Application.translate("Dialog", "2048 MB", nil, Qt::Application::UnicodeUTF8)
466 | @groupBox_4.title = Qt::Application.translate("Dialog", "Boot USB", nil, Qt::Application::UnicodeUTF8)
467 | @label_6.text = Qt::Application.translate("Dialog", "Be careful. If not used with care you may end up loosing your usb.
", nil, Qt::Application::UnicodeUTF8)
468 | @radioButton_9.text = Qt::Application.translate("Dialog", "2048 MB", nil, Qt::Application::UnicodeUTF8)
469 | @label_4.text = Qt::Application.translate("Dialog", "Choose desired RAM and click on Boot USB button.", nil, Qt::Application::UnicodeUTF8)
470 | @radioButton_13.text = Qt::Application.translate("Dialog", "256 MB", nil, Qt::Application::UnicodeUTF8)
471 | @radioButton_12.text = Qt::Application.translate("Dialog", "512 MB", nil, Qt::Application::UnicodeUTF8)
472 | @radioButton_10.text = Qt::Application.translate("Dialog", "1024 MB", nil, Qt::Application::UnicodeUTF8)
473 | @radioButton_11.text = Qt::Application.translate("Dialog", "768 MB", nil, Qt::Application::UnicodeUTF8)
474 | @boot_usb_qemu.text = Qt::Application.translate("Dialog", "Boot USB", nil, Qt::Application::UnicodeUTF8)
475 | @tabWidget.setTabText(@tabWidget.indexOf(@tab), Qt::Application.translate("Dialog", "QEMU", nil, Qt::Application::UnicodeUTF8))
476 | @label_5.text = Qt::Application.translate("Dialog", "An advanced bootable usb creator with option to install/uninstall
multiple distros. This software is written in ruby and qtbindings.
Copyright 2010-2013 Sundar
Author: Sundar
Contributor(s): Ian Bruce, Ramesh
Licence: GPL version 2 or later
Help/Email: feedback.multibootusb@gmail.com
Home page: http://sourceforge.net/projects/multibootusb/
", nil, Qt::Application::UnicodeUTF8)
477 | @tabWidget.setTabText(@tabWidget.indexOf(@tab_2), Qt::Application.translate("Dialog", "About", nil, Qt::Application::UnicodeUTF8))
478 | end # retranslateUi
479 |
480 | def retranslate_ui(dialog)
481 | retranslateUi(dialog)
482 | end
483 |
484 | end
485 |
486 | module Ui
487 | class Dialog < Ui_Dialog
488 | end
489 | end # module Ui
490 |
491 |
--------------------------------------------------------------------------------
/qemu.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | def qemu_iso()
4 | package = ["kvm","qemu-system-x86_64"]
5 | package.each do |s|
6 | qemu = ` which #{s}`
7 | if not qemu.include? (qemu)
8 | puts "QEMU is not installed."
9 | Qt::MessageBox.information self, "No qemu.", "Please install qemu to avail this feature."
10 | else
11 | if not @ui.lineEdit_2.text() == ""
12 | iso_link = @ui.lineEdit_2.text()
13 | $selected_qemu_iso = iso_link.chomp
14 | puts $selected_qemu_iso
15 | @ui.lineEdit_2.setText ""
16 | if @ui.ram_iso_256.isChecked()
17 | ram = "256"
18 | elsif @ui.ram_iso_512.isChecked()
19 | ram = "512"
20 | elsif @ui.ram_iso_768.isChecked()
21 | ram = "768"
22 | elsif @ui.ram_iso_1024.isChecked()
23 | ram = "1024"
24 | elsif @ui.ram_iso_2048.isChecked()
25 | ram = "2048"
26 | end
27 | if ram
28 | thr_qemu = Thread.new {`#{qemu} -no-acpi -boot d -m #{ram} -cdrom #{$selected_qemu_iso}`}
29 | else
30 | Qt::MessageBox.information self, "No RAM.", "Please select desired RAM."
31 | @ui.lineEdit_2.insert "#{iso_link}"
32 | end
33 | else
34 | puts "No iso choosen."
35 | Qt::MessageBox.information self, "No iso.", "Please select an iso."
36 | end
37 | break
38 | end
39 | end
40 | end
41 |
42 | def qemu_usb()
43 | package = ["kvm","qemu-system-x86_64"]
44 | package.each do |s|
45 | qemu = ` which #{s}`
46 | if not qemu.include? (qemu)
47 | puts "QEMU is not installed."
48 | Qt::MessageBox.information self, "No qemu.", "Please install qemu to avail this feature."
49 | else
50 | if @ui.ram_usb_256.isChecked()
51 | ram = "256"
52 | elsif @ui.ram_usb_512.isChecked()
53 | ram = "512"
54 | elsif @ui.ram_usb_768.isChecked()
55 | ram = "768"
56 | elsif @ui.ram_usb_1024.isChecked()
57 | ram = "1024"
58 | elsif @ui.ram_usb_2048.isChecked()
59 | ram = "2048"
60 | end
61 | if ram
62 | device = $selected_usb_device[0..-2]
63 | puts device
64 | thr_qemu = Thread.new {`echo #{$pass} | sudo -S qemu-system-x86_64 -no-acpi -boot c -hda #{device} -m #{ram}`}
65 | else
66 | Qt::MessageBox.information self, "No RAM.", "Please select desired RAM."
67 | end
68 | break
69 | end
70 | end
71 |
72 | end
73 |
74 | def get_qemu_iso()
75 | $qemu_iso_link = Qt::FileDialog.getOpenFileName(self, tr("Choose an iso..."), Dir.home, "ISO (*.iso)")
76 | if $qemu_iso_link
77 | @ui.lineEdit_2.insert "#{$qemu_iso_link}"
78 | #puts $qemu_iso_link
79 | else
80 | puts "No iso choosen."
81 | Qt::MessageBox.information self, "No iso.", "Please choose an iso."
82 | end
83 | end
84 |
85 |
--------------------------------------------------------------------------------
/test.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/ruby
2 |
3 | $cfg_file_path = `cp -rfv ./multibootusb/*.c32 /media/SUNDAR/test`
4 | puts $cfg_file_path
5 |
--------------------------------------------------------------------------------
/uninstall-distro.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/ruby
2 | require 'fileutils'
3 | require 'find'
4 |
5 | def uninstall_distro()
6 | if @ui.listWidget.currentItem()
7 | $selected_distro = @ui.listWidget.currentItem().text()
8 | reply = Qt::MessageBox.question(self, tr("Review selection..."),
9 | "Are you sure to uninstall #{$selected_distro}",
10 | Qt::MessageBox::Yes,
11 | Qt::MessageBox::No )
12 | if reply == Qt::MessageBox::Yes
13 | puts $selected_distro
14 | puts $selected_usb_mount_path + "/multibootusb/" + $selected_distro
15 | @ui.label.text = "Uninsalling..."
16 | if not File.directory?($selected_usb_mount_path + "/multibootusb/" + $selected_distro)
17 | gsub_paragraph(:file_in => $selected_usb_mount_path + "/multibootusb/syslinux.cfg", :pattern_start => '#start ' + $selected_distro, :pattern_stop => '#end ' + $selected_distro)
18 | update_list_box()
19 | elsif File.directory?($selected_usb_mount_path + "/multibootusb/" + $selected_distro)
20 | if $selected_distro == "windows-7"
21 | size_folder = `du -ck #{$selected_usb_mount_path}/sources | grep total`.split[0].to_i
22 | `rm -rf #{$selected_usb_mount_path}/[boot]`
23 | `rm -rf #{$selected_usb_mount_path}/boot`
24 | `rm -rf #{$selected_usb_mount_path}/efi`
25 | `rm -rf #{$selected_usb_mount_path}/support`
26 | `rm -rf #{$selected_usb_mount_path}/upgrade`
27 | `rm -rf #{$selected_usb_mount_path}/autorun.inf`
28 | `rm -rf #{$selected_usb_mount_path}/bootmgr`
29 | `rm -rf #{$selected_usb_mount_path}/readme.txt`
30 | `rm -rf #{$selected_usb_mount_path}/setup.exe`
31 | thr_remove = Thread.new {`rm -rf #{$selected_usb_mount_path}/sources`}
32 | else
33 | size_folder = `du -ck #{$selected_usb_mount_path}/multibootusb/#{$selected_distro} | grep total`.split[0].to_i
34 | thr_remove = Thread.new {`rm -rf #{$selected_usb_mount_path}/multibootusb/#{$selected_distro}`}
35 | end
36 | space_initial_i = `df -k #{$selected_usb_device}`.split(/\b/)[22].to_i
37 | while thr_remove.status
38 | space_current_i = `df -k #{$selected_usb_device}`.split(/\b/)[22].to_i
39 | diff = space_initial_i - space_current_i
40 | persentage = (100.0 * diff / size_folder).round(2)
41 | #puts persentage
42 | @ui.progressBar.value = persentage
43 | sleep 0.5
44 | end
45 | #puts "100"
46 | @ui.progressBar.value = 100
47 | @ui.progressBar.value = 0
48 | @ui.label.text = "Updating syslinux.cfg."
49 | gsub_paragraph(:file_in => $selected_usb_mount_path + "/multibootusb/syslinux.cfg", :pattern_start => '#start ' + $selected_distro, :pattern_stop => '#end ' + $selected_distro)
50 | update_list_box()
51 | end
52 | @ui.label.text = ""
53 | Qt::MessageBox.information self, "Finished...", "#{$selected_distro} has been uninstalled successfully."
54 |
55 | elsif reply == Qt::MessageBox::No
56 | puts "No selected."
57 | end
58 | else
59 | puts "Please choose a distro from the list."
60 | Qt::MessageBox.information self, "No distro selection.", "Please choose a distro from the list."
61 | end
62 |
63 | end
64 |
65 | def gsub_paragraph(options)
66 | regex_start = /^.*#{options[:pattern_start]}.*$/
67 | regex_stop = /^.*#{options[:pattern_stop]}.*$/
68 |
69 | f_read = File.new(options[:file_in], 'r')
70 | true until (line_pattern = regex_start.match(f_read.gets))
71 | pos_start = f_read.pos - line_pattern[0].length - 1
72 | f_read.rewind
73 | part_start = f_read.read(pos_start)
74 |
75 | true until (line_pattern = regex_stop.match(f_read.gets))
76 | pos_stop = f_read.pos
77 | part_stop = f_read.read(pos_stop)
78 | f_read.close
79 |
80 | f_write = File.new((options[:file_out] || options[:file_in]), 'w+')
81 | replacement = options[:replacement] || ''
82 | if part_stop.nil?
83 | f_write.puts part_start + replacement #+ part_stop
84 | else
85 | f_write.puts part_start + replacement + part_stop
86 | end
87 | f_write.close
88 | end
89 | #gsub_paragraph(:file_in => $selected_usb_mount_path + "/multibootusb/syslinux.cfg", :pattern_start => '#start ' + $selected_distro, :pattern_stop => '#end ' + $selected_distro)
90 |
--------------------------------------------------------------------------------
/update-config-lib.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/ruby
2 |
3 | # Syslinux update script for MultiBootUSB
4 | #
5 | # written by Ian Bruce
6 | # GPL licence
7 | #
8 | # parameters:
9 | #
10 | # $1 - distribution type/name
11 | #
12 | # $2 - input file, or STDIO
13 | #
14 | # $3 - output file, or same as input
15 | #
16 | # $LOADER_PREFIX (must not begin with "/")
17 | #
18 | # $KERNEL_PREFIX
19 | #
20 | # $USB_UUID
21 | #
22 | # $ISO_IMAGE
23 |
24 |
25 | def update(config)
26 |
27 | v = [] ; i = 0
28 |
29 | while i = config.index(/^ *label/i, i)
30 | v += [i]
31 | i += 1
32 | end
33 |
34 | offset = 0 ; conflen = config.length
35 |
36 | v.each_index { |x|
37 |
38 | i = v[x] + offset
39 |
40 | j = (x+1 < v.size ? v[x+1] : conflen) + offset
41 |
42 | item = config[i...j] ; itemlen = item.length
43 |
44 | kernel = item[/^[ \t]*(kernel|linux)[ \t]+(.*?)[ \t]*$/i, 2]
45 |
46 | initrd = item[/^[ \t]*(initrd)[ \t]+(.*?)[ \t]*$/i, 2]
47 |
48 | option = item[/^[ \t]*(append)[ \t]+(.*?)[ \t]*$/i, 2]
49 |
50 |
51 | if ! initrd && option && (initrd = option[/(^|[ \t])initrd=(.*?)([ \t]|$)/i, 2])
52 |
53 | item.insert(item.index(/^[ \t]*append[ \t]/i), "#{item[/^([ \t]*)append[ \t]/i, 1]}initrd \n")
54 |
55 | option.sub!(/[ \t]initrd=.*?[ \t]/i, " ") ; option.sub!(/(^|[ \t])initrd=.*?([ \t]|$)/i, "")
56 |
57 | end
58 |
59 |
60 | yield [kernel, initrd, option]
61 |
62 |
63 | item.sub!(/^([ \t]*(kernel|linux)[ \t]+).*$/i, "\\1#{kernel}")
64 |
65 | item.sub!(/^([ \t]*(initrd)[ \t]+).*$/i, "\\1#{initrd}")
66 |
67 | item.sub!(/^([ \t]*(append)[ \t]+).*$/i, "\\1#{option}")
68 |
69 | config[i...j] = item
70 |
71 | offset += item.length - itemlen
72 |
73 | }
74 |
75 | end
76 |
77 |
78 | def mkbootopts(distro)
79 |
80 | case distro
81 | # ISO image files
82 |
83 | when "ubuntu-iso"
84 |
85 | ->(option) { option.sub!(/^/, "iso-scan/filename=#{$ISO_IMAGE} ") }
86 |
87 | when "debian-iso"
88 |
89 | ->(option) { option.sub!(/^/, "fromiso=#{$ISO_IMAGE} " ) }
90 |
91 | when "fedora-iso"
92 |
93 | ->(option) { option.sub!(/^/, "root=live:#{$ISO_IMAGE} ") }
94 |
95 | when "systemrescuecd-iso"
96 |
97 | ->(option) { option.sub!(/^/, "isoloop=#{$ISO_IMAGE} ") }
98 |
99 | # unpacked ISO filesystems
100 |
101 | when "parted-magic"
102 |
103 | ->(option) {
104 | option.sub!(/^/, "directory=#{$KERNEL_PREFIX}/ ")
105 | }
106 |
107 | when "ipcop"
108 |
109 | ->(option) {
110 | option.sub!(/ipcopboot=cdrom\S*/, "ipcopboot=usb")
111 |
112 | }
113 |
114 | when "fedora"
115 |
116 | ->(option) {
117 | option.sub!(/root=\S*/, "root=UUID=#{$USB_UUID}")
118 | option.sub!(/^/, "live_dir=#{$KERNEL_PREFIX}/LiveOS ")
119 | }
120 |
121 | when "magia"
122 |
123 | ->(option) {
124 | option.sub!(/root=\S*/, "root=UUID=#{$USB_UUID}")
125 | option.sub!(/^/, "live_dir=#{$KERNEL_PREFIX}/loopbacks ")
126 | }
127 |
128 |
129 | when "systemrescuecd"
130 |
131 | ->(option) { option.sub!(/^/, "subdir=#{$KERNEL_PREFIX}/ ") }
132 |
133 | when "arch"
134 |
135 | ->(option) {
136 | option.sub!(/(arch|chakra|m)isolabel=\S*/, "\\1isodevice=/dev/disk/by-uuid/#{$USB_UUID}")
137 | option.sub!(/(arch|chakra)isobasedir=\S*/, "\\1isobasedir=#{$KERNEL_PREFIX}/\\1")
138 | option.sub!(/(m)isobasedir=\S*/, "\\1isobasedir=#{$KERNEL_PREFIX}/manjaro")
139 | }
140 |
141 | when "chakra"
142 |
143 | ->(option) {
144 | option.sub!(/(arch|chakra|m)isolabel=\S*/, "\\1isodevice=/dev/disk/by-uuid/#{$USB_UUID}")
145 | option.sub!(/(arch|chakra)isobasedir=\S*/, "\\1isobasedir=#{$KERNEL_PREFIX}/\\1")
146 | option.sub!(/(m)isobasedir=\S*/, "\\1isobasedir=#{$KERNEL_PREFIX}/manjaro")
147 | option.sub!(/^/, "chakraisobasedir=#{$KERNEL_PREFIX}/chakra ")
148 | }
149 |
150 | when "porteus"
151 |
152 | ->(option) { option.sub!(/^/, "from=#{$KERNEL_PREFIX}/ fromusb ") }
153 |
154 | when "puppy"
155 |
156 | ->(option) {
157 | option.sub!(/^/, "psubdir=#{$KERNEL_PREFIX}/ ")
158 | option.sub!(/pmedia=cd\S*/, "pmedia=usbflash")
159 | }
160 |
161 | when "slax"
162 |
163 | ->(option) { option.sub!(/^/, "from=#{$KERNEL_PREFIX}/slax fromusb ") }
164 |
165 | when "wifislax"
166 |
167 | ->(option) { option.sub!(/^/, "from=#{$KERNEL_PREFIX}/Wifislax fromusb ") }
168 |
169 | when "wifiway"
170 |
171 | ->(option) { option.sub!(/^/, "from=#{$KERNEL_PREFIX}/wifiway fromusb ") }
172 |
173 | when "sl-live"
174 |
175 | ->(option) {
176 | option.sub!(/^/, "sgnfile=#{$KERNEL_PREFIX}/livecd.sgn from=#{$KERNEL_PREFIX}/ fromusb ")
177 | }
178 |
179 | when "slampp"
180 |
181 | ->(option) { option.sub!(/^/, "slax from=#{$KERNEL_PREFIX}/ fromusb ") }
182 |
183 | when "antix"
184 |
185 | ->(option) { option.sub!(/^/, "image_dir=#{$KERNEL_PREFIX}/antiX ") }
186 |
187 | when "pclinuxos"
188 |
189 | ->(option) {
190 | option.sub!(/^/, "fromusb ")
191 | }
192 |
193 | when "gentoo"
194 |
195 | ->(option) {
196 | option.sub!(/cdroot_type\S*/, "")
197 | option.sub!(/^/, "subdir=#{$KERNEL_PREFIX} ")
198 | }
199 |
200 | when "knoppix"
201 |
202 | ->(option) { option.sub!(/^/, "knoppix_dir=#{$KERNEL_PREFIX}/KNOPPIX ") }
203 |
204 | when "finnix"
205 |
206 | ->(option) { option.sub!(/^/, "finnix_dir=#{$KERNEL_PREFIX}/finnix ") }
207 |
208 | when "debian"
209 |
210 | ->(option) { option.sub!(/^/, "ignore_bootid live-media-path=#{$KERNEL_PREFIX}/live ") }
211 |
212 | when "slitaz"
213 |
214 | ->(option) { }
215 |
216 | when "sms"
217 |
218 | ->(option) { option.sub!(/^/, "from=#{$KERNEL_PREFIX}/ fromusb ") }
219 |
220 | when "opensuse"
221 |
222 | ->(option) { option.sub!(/^/, "loader=syslinux isofrom=/dev/disk/by-uuid/#{$USB_UUID}:/#{$ISO_IMAGE} ") }
223 |
224 | when "ubuntu"
225 |
226 | ->(option) {
227 | option.sub!(/file=\/cdrom\//, "file=/cdrom/#{$KERNEL_PREFIX.sub(/^\//, "")}/")
228 | option.sub!(/^/,
229 | "cdrom-detect/try-usb=true floppy.allowed_drive_mask=0 " +
230 | "ignore_uuid ignore_bootid root=UUID=#{$USB_UUID} " +
231 | "live-media-path=#{$KERNEL_PREFIX}/casper ")
232 | }
233 |
234 | else
235 |
236 | ->(option) { }
237 |
238 | end
239 |
240 | end
241 |
242 |
243 |
244 | def syslinuxconfig(distro, input, output)
245 |
246 | #output = input
247 |
248 | bootopts = mkbootopts(distro)
249 |
250 | config = ""
251 |
252 | if input == "-"
253 | $stdin.read(nil, config)
254 | else
255 | if File.file?(input)
256 | open(input, "r") { |f| f.read(nil, config) }
257 | end
258 | end
259 |
260 |
261 | update(config) { |kernel, initrd, option|
262 |
263 | # puts "'#{kernel}'\n'#{initrd}'\n'#{option}'\n\n"
264 |
265 | #kernel.gsub!(/(^|,)\//, "\\1#{$LOADER_PREFIX}/") if kernel
266 | if kernel
267 | #kernel.gsub!(/(^|,)\//, "\\1#{$LOADER_PREFIX}/")
268 | #initrd.gsub!(/(^|,)\//, "\\1#{$LOADER_PREFIX}/") if initrd
269 | initrd.gsub!(/(,)\//, "\\1#{$LOADER_PREFIX}/") if initrd
270 | bootopts[option] if option
271 | end
272 |
273 | # initrd.gsub!(/(^|,)\//, "\\1#{$LOADER_PREFIX}/") if initrd
274 |
275 | # bootopts[option] if option
276 |
277 | }
278 |
279 | config.gsub!(/([ \t])\//, "\\1#{$LOADER_PREFIX}/")
280 |
281 |
282 | if output == "-"
283 | $stdout.write(config)
284 | else
285 | if File.file?(output)
286 | open(output, "w") { |f| f.write(config) }
287 | end
288 | end
289 |
290 | end
291 |
--------------------------------------------------------------------------------
/update-config.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require_relative "update-config-lib"
4 |
5 | def update_config(distro,install_dir)
6 | #$LOADER_PREFIX = [".", "..", "../.."][syslinux_cfg_file($live_mount).count("/")]
7 | #puts "Load Prefix :: " + $LOADER_PREFIX
8 | $LOADER_PREFIX = "/multibootusb/#{$distro_dir}"
9 | $KERNEL_PREFIX = "/multibootusb/#{$distro_dir}"
10 | $USB_UUID = $selected_usb_uuid
11 | $ISO_IMAGE = $distro
12 | $PERSIST = ENV["PERSIST"]
13 | if not distro.to_s == '' and File.directory? install_dir # and
14 | @ui.label.text = "Updating config files..."
15 | Dir[install_dir + "/**/*.cfg"].each { |file| syslinuxconfig(distro, file, file) }
16 | @ui.label.text = ""
17 | end
18 | end
19 |
20 | def custom_menu(distro)
21 | case distro
22 | when "slackel"
23 | $line1 = "#start " + $distro_dir
24 | $line2 = "LABEL " + $distro_dir
25 | $line3 = "MENU LABEL " + $distro_dir
26 | $line4 = "kernel /multibootusb/#{$distro_dir}/vmlinuz"
27 | $line5 = "initrd /multibootusb/#{$distro_dir}/initrd.xz root=/dev/ram0 rw quiet max_loop=20 fromiso=/multibootusb/#{$distro_dir}/#{$distro} autologin"
28 | $line6 = "#end " + $distro_dir
29 | when "salixlive"
30 | $line1 = "#start " + $distro_dir
31 | $line2 = "LABEL " + $distro_dir
32 | $line3 = "MENU LABEL " + $distro_dir
33 | $line4 = "kernel /multibootusb/#{$distro_dir}/vmlinuz"
34 | $line5 = "initrd /multibootusb/#{$distro_dir}/initrd.xz root=/dev/ram0 rw quiet max_loop=20 fromiso=/multibootusb/#{$distro_dir}/#{$distro} autologin"
35 | $line6 = "#end " + $distro_dir
36 | when "windows-7"
37 | $line1 = "#start " + $distro_name
38 | $line2 = "LABEL " + $distro_name
39 | $line3 = "MENU LABEL " + $distro_name
40 | $line4 = "KERNEL chain.c32 hd0 1 ntldr=/bootmgr"
41 | $line6 = "#end " + $distro_name
42 | end
43 | end
44 |
45 |
--------------------------------------------------------------------------------
/version.txt:
--------------------------------------------------------------------------------
1 | 7.0
2 |
--------------------------------------------------------------------------------