Skip to content

project to create a multi iso boot USB flash drive written in python

License

Notifications You must be signed in to change notification settings

Katana-Steel/multiboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiboot

project to create a multi iso boot USB flash drive

running

requiers a user with sudo permissions for now... it's only used to probe for attached storage devices to select USB drives and to check the partition tabel and filesystems.

With that it should be as simple as: python multiboot.py

test

for t in tests/*; do
  echo $(basename $t)
  cat $t | python3 - 
done

requirements

  • python-qt5 or python3-pyqt5
  • grub2
  • pyparted (python-parted)
  • filesystem creation tools of your choice, supported:
    • ext4
    • vfat
    • xfs

todo

I still need to correctly detect the actual filesystem on the USB drive although the general default 'vfat' as most USBs come preformatted as.

next need to install grub and write the generated grub.cfg to the seleted USB. something simple like this:

sudo sfdisk /dev/sdb --part-type 1 83
sudo sfdisk -A /dev/sdb 1
sudo mkfs.xfs /dev/sdb1
sudo mount /dev/sdb1 /mnt/usb0
sudo grub-install --root-directory/mnt/usb0 /dev/sdb

with

import menu

def CreateBootMenu(mnt_pnt):
    m = [menu.MenuSetup()]
    deb_hook = ""
    gentoo_ex = ''

    m.append(menu.DebianLiveISO(extra=deb_hook))
    sm = menu.SubMenu()
    m.append(sm)
    sm.AddEntry(menu.DebianLiveISO('/debian-xfce.iso',
                            name='Debian Xfce', extra=deb_hook))
    sm.AddEntry(menu.CentOSISO(disk='/dev/sda1'))
    m.append(menu.GentooISO(extra=gentoo_ex))

    with open(mnt_pnt + '/grub/grub.cfg', 'w') as grub_menu:
        for x in m:
            grub_menu.write(x.WriteMenu() + '\n')

About

project to create a multi iso boot USB flash drive written in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published