{"id":17059129,"url":"https://github.com/toxicfrog/mkrescue","last_synced_at":"2026-04-29T11:03:01.094Z","repository":{"id":30413421,"uuid":"33966278","full_name":"ToxicFrog/mkrescue","owner":"ToxicFrog","description":"Script to build bootable rescue USB sticks","archived":false,"fork":false,"pushed_at":"2017-07-10T21:36:24.000Z","size":2800,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T14:16:07.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ToxicFrog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-15T01:29:50.000Z","updated_at":"2021-01-09T20:29:26.000Z","dependencies_parsed_at":"2022-09-08T10:40:41.032Z","dependency_job_id":null,"html_url":"https://github.com/ToxicFrog/mkrescue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToxicFrog%2Fmkrescue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToxicFrog%2Fmkrescue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToxicFrog%2Fmkrescue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToxicFrog%2Fmkrescue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ToxicFrog","download_url":"https://codeload.github.com/ToxicFrog/mkrescue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245068676,"owners_count":20555801,"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":[],"created_at":"2024-10-14T10:32:45.122Z","updated_at":"2026-04-29T11:02:56.031Z","avatar_url":"https://github.com/ToxicFrog.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a collection of useful tools for system recovery and whatnot. It is not intended to be as complete as something like Knoppix, but it's good for taking drive snapshots, testing memory and disks, etc.\n\nIt comes with a script, `mkrescue`, which will automatically partition, format, and install syslinux on a flash drive or disk image, then copy these tools and an appropriate syslinux configuration to it.\n\nThe \"core\" contains:\n\n * memtest86+\n * x86test\n * Hardware Detection Tool\n * FreeDOS\n * HDAT2\n\nThis weighs in at about 3MB, suitable even for tiny USB sticks and flash cards.\n\nAs optional modules, you can also install:\n\n * `samsung-ssd` Firmware updates for Samsung SSDs (10MB)\n * `microcore` MicroCore Linux 6.1 (10MB)\n * `tinycore` TinyCore Linux 6.1 (16MB)\n * `wificore` TinyCore Linux 6.1 + wifi support (61MB)\n * `coreplus` CorePlus Linux Installer 6.1 (75MB)\n * `puppy5.7` Puppy Linux \"Slacko\" 5.7 (161MB)\n * `puppy6.0` Puppy Linux \"Tahrpup\" 6.0 (199MB)\n\nThese modules will download additional components the first time they're installed, so make sure you have a net connection. If you want to pre-download these components for later use, run:\n\n    ./mkrescue -m pre all\n\nand it will download them but do nothing else.\n\n## Usage\n\n    $ ./mkrescue -h\n    mkrescue -- make a rescue USB stick.\n    Usage: mkrescue [options] modules...\n      -i       -- device is an image file, automanage with losetup\n      -l label -- give filesystem this label; default \"rescue\"\n      -u       -- update already mounted stick, don't partition/format\n      -C dir   -- use dir as cache directory, default ~/.cache.mkrescue\n      -c       -- tell the modules to \"clean\" themselves first\n      -D       -- debug; print commands being executed\n      -m cmd   -- execute command on all modules\n      -d dest  -- device or image file to install onto\n      modules  -- modules to install, available ones are:\n\n### Quick recipes\n\nDownload fresh versions of all optional components without installing anything:\n\n    ./mkrescue -m clean all\n    ./mkrescue -m pre all\n\n---\nCreate an image file that can be dd'd onto a flash drive later:\n\n    dd if=/dev/zero bs=1M count=32 of=disk.img\n    ./mkrescue -i -d disk.img\n\n---\nCreate an all-in-one rescue stick with all modules enabled, using the flash drive /dev/sdb and the label \"allinone\":\n\n    ./mkrescue -d /dev/sdb -l allinone all\n\n---\nInstall all of the corelinux modules onto a stick already mounted at /media/rescue:\n\n    ./mkrescue -u -d /media/rescue microcore tinycore wificore coreplus\n\n\n### Details\n\n    modules\n\nThe list of modules to include. If omitted, only the core is installed. To see a list of modules, `ls modules` or `./mkrescue -h`.\n\n    -d destination\n\nSpecifies the destination of the install. `destination` should be a device file, which will be partitioned, formatted, and have a new bootloader written. In combination with `-i`, it should instead be a normal file, which will be treated as a whole-disk image; in combination with `-u`, it should be the mount point of the filesystem to copy boot files to.\n\n    -i\n\nIndicates that the argument to `-d` is a whole disk image rather than a device file. The script will automatically use `losetup` to attach and detach it from loop devices as needed. Note that it still needs to be run as root, unless your system permits mere mortals to use `losetup`.\n\n    -u\n\nIndicates that the argument to `-d` is the path to a mounted filesystem. The script will replace the `/boot/` directory on that filesystem according to its other arguments, but will not edit the partition table, write the bootloader, or create new filesystems. Any changes you have made to `/boot` will be discarded, but the other contents of that directory will be left intact.\n\n    -l label\n\nWhen writing the FAT filesystem to the device, give it the label `label`. Labels will be uppercased and long ones may be truncated.\n\nSome modules need to know the label in order to write a correct boot configuration, so when using `-u` you should also use `-l` to specify the label of the filesystem being updated.\n\n    -C dir\n\nUse `dir` as the cache directory. This is where downloaded disc images and similar will be stored. The default is `~/.cache/mkrescue/`.\n\n    -c\n\nBefore installing each module, tell it to run its `clean` function. Typically, this means deleting the entire cache directory, recreating it from the pristine module files, and then re-downloading anything that's missing. To clean all modules without installing anything, use `./mkrescue -m clean all`.\n\n    -m command\n\nRun `command` on the listed modules without doing anything. The only useful ones are likely to be `clean` (clean up downloaded/generated files), `pre` (perform pre-installation setup including downloading necessary components), or `boot` (display boot configuration). See \"adding new modules\" below for more details.\n\n    -D\n\nEnable debug mode; the script will print every command it executes. This is extremely spammy. It will also list the contents of the boot directory and the contents of the syslinux configuration at the end.\n\n\n## Adding new modules\n\nAdding small tools can be done directly in `modules/.boot/`; anything placed there will be copied to the stick when it's created. Make sure to update `modules/.boot/syslinux/syslinux.cfg` accordingly.\n\nTo add larger, optional modules, create a subdirectory in `modules/` and put all the module contents there. In that subdirectory, create a file, `.rescue`; this is a shell script that defines various functions used by the control script to set up the module.\n\nAt runtime, the functions in this file will have the following environment variables available:\n\n * `module`: the name of the currently executing module.\n * `label`: the filesystem label of the stick.\n * `cachedir`: the cache directory. The contents of this will be copied onto the target.\n * `tmpdir`: a temporary directory. It is shared among all modules and will be deleted at program exit.\n * `bootdir`: the `/boot` directory on the target filesystem.\n * `libdir`: the directory that the pristine, read-only versions of the modules are hosted in.\n\nThey run in a subshell and may freely set or modify the environment without affecting the control script.\n\nThe `.rescue` script is expected to define a number of functions which will be called by the control script. It is not *necessary* to define any of these, but without at least `describe` and `boot` the module won't be very useful. For examples of these, look at the existing modules.\n\nExcept where noted, the default implementations of these functions do nothing and return 0.\n\n    describe\n\nOutputs a brief description of the module on stdout (with no newline; use `echo -n` or similar). Called to generate help and status messages. The default emits `\u003cdescription missing\u003e`.\n\n    clean\n\nDeletes downloaded or intermediate files. Called when the user explicitly asks for a clean. The default erases `$cachedir`.\n\n    dest\n\nOutputs a directory name on stdout; the contents of the module will be placed in `/boot/$(dest)/`. Default is to output the module name. The module contents can be copied into `/boot/` itself by having `dest` output `./`.\n\n    pre\n\nCalled just before installing the module. This is where code that, for example, downloads necessary files should go.\n\n    install\n\nCalled to actually copy the module contents into `/boot`. The default copies `$cachedir/` into `$bootdir/$(dest)/`.\n\n    boot\n\nCalled after installing the module. This function should output, on stdout, the text to be appended to the `/boot/syslinux/syslinux.cfg` file.\n\n    post\n\nCalled last. Should do any post-install cleanup necessary other than writing the boot configuration.\n\n## License\n\nThe original parts of this project -- the mkrescue script and configuration files -- are licensed under the MIT license; see the file COPYING for the text of the license.\n\nIn addition, this package contains the following GPL-licensed software:\n\n- Syslinux (components of)\n- Hardware Detection Tool\n- memtest86\n- x86test\n- FreeDOS\n\nThese are included unmodified, as a \"mere aggregation\".\n\nAt runtime, it may (depending on user preference) also download components of the following GPL-licensed software:\n\n- Core Linux\n- Puppy Linux\n- OpenSUSE Linux\n\nAnd the following proprietary software:\n\n- Samsung SSD firmware installers\n\nIt also contains HDAT2, released under a custom freeware license reproduced below:\n\n- You are allowed to use this program on one or more machines at a time.\n- You are allowed to distribute this program as long as you do it without profit and without modifications to this license (you may not charge a licensing fee for the program).\n- You may redistribute this program included as a support tool for your programs, as long as you notify me by e-mail.\n- The software and related documentation are provided \"as is\", without warranty of any kind.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxicfrog%2Fmkrescue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoxicfrog%2Fmkrescue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxicfrog%2Fmkrescue/lists"}