{"id":13649032,"url":"https://github.com/mytbk/liveusb-builder","last_synced_at":"2025-04-11T03:42:52.005Z","repository":{"id":53895821,"uuid":"62526529","full_name":"mytbk/liveusb-builder","owner":"mytbk","description":"A script suite to create multiboot USB stick for GNU/Linux distributions","archived":false,"fork":false,"pushed_at":"2023-07-18T15:24:26.000Z","size":245,"stargazers_count":138,"open_issues_count":7,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-25T01:43:43.286Z","etag":null,"topics":["grub","iso","multiboot","syslinux","uefi","usb"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mytbk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support-a-new-distro.md","governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-04T02:43:42.000Z","updated_at":"2025-03-22T08:16:21.000Z","dependencies_parsed_at":"2024-01-14T10:59:53.849Z","dependency_job_id":"5ce6a339-db62-4dd3-8865-229cba541960","html_url":"https://github.com/mytbk/liveusb-builder","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mytbk%2Fliveusb-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mytbk%2Fliveusb-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mytbk%2Fliveusb-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mytbk%2Fliveusb-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mytbk","download_url":"https://codeload.github.com/mytbk/liveusb-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339287,"owners_count":21087213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grub","iso","multiboot","syslinux","uefi","usb"],"created_at":"2024-08-02T01:04:43.162Z","updated_at":"2025-04-11T03:42:51.984Z","avatar_url":"https://github.com/mytbk.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# liveusb-builder\n\nliveusb-builder is a script suite to create multiboot USB stick for GNU/Linux distributions. It's lightweight with few dependencies, and it's extensible and hackable.\n\nThe source code is hosted on both [git.wehack.space](https://git.wehack.space/liveusb-builder/) and GitHub.\n\nA presentation in Chinese is at https://wehack.space/vimacs/liveusb-builder.odp.\n\n## Features\n\n- Multiboot support with syslinux and GRUB\n- Support legacy BIOS, UEFI, and various firmware payloads (e.g. GRUB, petitboot) that reads GRUB or syslinux config files\n- Support placing kernel files (kernel and initramfs) and other data files (squashfs, CD image) in separate partitions\n- Download an up-to-date CD image and verify it\n- A GNU/Linux command line tool\n\n## Install\n\nYou need these packages on your GNU/Linux system to use liveusb-builder.\n\n- libarchive: for ISO image extraction\n- udisks2 (optional,recommended): for mounting USB disk partitions without being root\n- udevil (optional): for mounting USB disk partitions and ISO images without being root\n- wget: for downloading\n- syslinux (recommended): bootloader for legacy BIOS\n- GRUB: bootloader for legacy BIOS if there's no syslinux, and bootloader for UEFI\n\nFor Arch Linux users, just install [liveusb-builder-git](https://aur.archlinux.org/packages/liveusb-builder-git/) from AUR.\n\n## Will my boot image support liveusb-builder?\n\nliveusb-builder needs a kernel image, an initramfs image, and a proper kernel command line to support a boot image. However, not every CD/DVD image supports booting this way. There are some other ways to boot these images, but they will break our philosophy to support various firmware and bootloaders.\n\nIf you want to use a disk image to install an operating system, I suggest using the virtual machine method as follows. Boot an AMD64 machine with enough memory and VMX feature with a Live USB with QEMU GUI (e.g. Grml 2020.06, also see [my ticket](https://github.com/grml/grml-live/issues/71) for Grml) after attaching the hard disk you want to install the OS on, then run the following (assume the hard disk attached is /dev/sda):\n\n```bash\nsudo qemu-system-x86_64 -enable-kvm -m 4G -cdrom your-install-cd.iso -drive /dev/sda,format=raw -boot order=d -no-reboot\n```\n\nDo the system installation in the QEMU window. After QEMU exits, put the hard disk on the target machine to continue installing.\n\nI've already used this method to successfully install Windows 7, OpenBSD 6.7, and various GNU/Linux systems.\n\n## Usage\n\nFirst, you need to have a partitioned USB drive. For the best legacy BIOS compatibility, it's recommended to use MSDOS (MBR) partition table. Because most UEFI firmware only supports FAT32 partitions, you need a FAT32 partition on the USB drive, and put the boot files into this partition.\n\n### The easier way: one FAT32 partition\n\nSuppose your USB stick device is /dev/sdb and the partition on the device is /dev/sdb1.\n\n```bash\n# install Arch, Mint (x86_64 with MATE Desktop) and Fedora 32 to USB\n./buildlive --root=/dev/sdb1 arch mint/mate fedora/32\n```\n\nThe other way is to mount your USB drive partition first. I recommend using udevil so that you can write files without as root.\nThen run buildlive script as follows, suppose /dev/sdb1 is mount to /media/sdb1:\n\n```bash\n# install Arch, Mint (x86_64 with MATE Desktop) and Fedora 32 to USB\n./buildlive --root=/media/sdb1 arch mint/mate fedora/32\n```\n\n### The more customizable way: using a FAT32 boot partition and an ext2 data partition\n\nPartition your disk as follows to create a 500MB FAT32 boot partition, and an ext2 partition using the remaining space, suppose your USB is /dev/sdb.\n\n```\n$ sudo fdisk /dev/sdb\n\nCommand (m for help): o\nCreated a new DOS disklabel with disk identifier 0x24c5dd70.\n\nCommand (m for help): n\nPartition type\n   p   primary (0 primary, 0 extended, 4 free)\n   e   extended (container for logical partitions)\nSelect (default p):\n\nUsing default response p.\nPartition number (1-4, default 1):\nFirst sector (2048-30463999, default 2048):\nLast sector, +sectors or +size{K,M,G,T,P} (2048-30463999, default 30463999): +500M\n\nCreated a new partition 1 of type 'Linux' and of size 500 MiB.\n\nCommand (m for help): t\nSelected partition 1\nHex code (type L to list all codes): b\nChanged type of partition 'Linux' to 'W95 FAT32'.\n\nCommand (m for help): a\nSelected partition 1\nThe bootable flag on partition 1 is enabled now.\n\nCommand (m for help): n\nPartition type\n   p   primary (1 primary, 0 extended, 3 free)\n   e   extended (container for logical partitions)\nSelect (default p):\n\nUsing default response p.\nPartition number (2-4, default 2):\nFirst sector (1026048-30463999, default 1026048):\nLast sector, +sectors or +size{K,M,G,T,P} (1026048-30463999, default 30463999):\n\nCreated a new partition 2 of type 'Linux' and of size 14 GiB.\n\nCommand (m for help): w\nThe partition table has been altered.\nCalling ioctl() to re-read partition table.\nSyncing disks.\n```\n\nFormat the partitions:\n\n```\nsudo mkfs.msdos -F 32 /dev/sdb1\nsudo mkfs.ext2 /dev/sdb2\n```\n\nMount them and create the directory, and we need to make the directory ``liveusb-data`` writable by the current user.\n\n```\nudevil mount /dev/sdb1 /media/boot\nudevil mount /dev/sdb2 /media/root\nsudo install -d /media/root/liveusb-data\nsudo chown $(whoami) /media/root/liveusb-data/\n```\n\nAt last, make the Live USB (we install Arch and Fedora 32 in it):\n\n```\n$ ./buildlive --boot /media/boot --root /media/root arch fedora/32\n```\n\n## Experimental features\n\nI've made some experimental features that are not yet merged to the main source tree.\n\n- [ia32efi-test](https://github.com/mytbk/liveusb-builder/commits/ia32efi-test): support IA32 EFI\n\n## Status\n\nThe resulting USB stick works on QEMU with PC BIOS (SeaBIOS), UEFI (OVMF), libreboot (i440fx, GRUB txtmode) as firmware.\n\nThe script ``testusb.sh`` can be used to test a USB stick with QEMU.\n\n## Related work\n\nYou can search keyword ``multiboot`` on GitHub and find some related projects. Listed below is some related work I know or find.\n\n- [Yumi](https://www.pendrivelinux.com/yumi-multiboot-usb-creator/): a Windows GUI multiboot USB builder, I need a similar tool that runs on GNU/Linux, so I created this project\n- [aguslr/multibootusb](https://github.com/aguslr/multibootusb): provides grub.cfg files for many CD images, I used some of the kernel command line of distros in this project, but some grub.cfg files use features provided by GRUB and thus not portable for loaders like syslinux\n- [Ventoy](https://www.ventoy.net): a new multiboot USB project that supports making a live USB with most of the CD images. It has its own boot loader so doesn't rely on GRUB or syslinux config files.\n- [MultiBootLiveUSB](https://github.com/moontide/MultiBootLiveUSB)\n- [Multiboot USB drive - ArchWiki](https://wiki.archlinux.org/index.php/Multiboot_USB_drive)\n- [cbodden/multiboot](https://github.com/cbodden/multiboot)\n- [mbusb/multibootusb](https://github.com/mbusb/multibootusb)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmytbk%2Fliveusb-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmytbk%2Fliveusb-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmytbk%2Fliveusb-builder/lists"}