{"id":38324024,"url":"https://github.com/angt/slashinit","last_synced_at":"2026-01-17T02:42:29.771Z","repository":{"id":99728752,"uuid":"242570560","full_name":"angt/slashinit","owner":"angt","description":"Minimal PID 1 for initramfs","archived":false,"fork":false,"pushed_at":"2025-01-16T20:59:54.000Z","size":20,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T21:48:04.754Z","etag":null,"topics":["c","init","initramfs","linux","pid1"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angt.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":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-23T18:39:19.000Z","updated_at":"2025-01-16T20:59:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0b73f49-d3f0-4fdc-acfc-3c67c9ae24ea","html_url":"https://github.com/angt/slashinit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/angt/slashinit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angt%2Fslashinit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angt%2Fslashinit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angt%2Fslashinit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angt%2Fslashinit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angt","download_url":"https://codeload.github.com/angt/slashinit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angt%2Fslashinit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["c","init","initramfs","linux","pid1"],"created_at":"2026-01-17T02:42:29.175Z","updated_at":"2026-01-17T02:42:29.732Z","avatar_url":"https://github.com/angt.png","language":"C","readme":"# `/init`\nMinimal PID 1 for initramfs.\n\nThis is used for diskless servers with only two stages: `/etc/boot` and `/etc/reboot`.\n\nFor all spawned processes:\n- inputs from `stdin` are dropped.\n- outputs from `stdout` are redirected to `/dev/console`.\n- logs from `stderr` are redirected to `/dev/kmsg`.\n\n## Build \u0026 Install\n\nThe binary must be installed as `/init` and nothing else.\n\n    $ make install DESTDIR=\u003cPATH\u003e\n\n## Update \u0026 reboot\n\nWhen your system is running with `/init` you don't need any extra tool to do an update.\nJust put the new kernel at `/kernel` and `/init` will automatically kexec it after the `/etc/reboot` stage.\n\nIf you want to update your system in the usual way (pxe, efi,...) you need a cold reboot:\n\n    $ touch /reboot\n    $ reboot\n\nWith `reboot` a script that stops your supervisor. For example with `runit`:\n\n    $ cat /bin/reboot\n    #!/bin/sh\n\n    exec pkill -HUP runsvdir\n\n## Configuration\n\nOnly two files are needed, for example:\n\n    $ cat /etc/boot\n    #!/bin/sh\n\n    # your personal stuff..\n\n    exec runsvdir -P /run/service\n\nand\n\n    $ cat /etc/reboot\n    #!/bin/sh\n\n    # your personal stuff..\n\n    # you can still use kexec-tools for old kernels or unsupported arch.\n    kexec -l /kernel --reuse-cmdline \u0026\u0026 kexec -e\n\n## File system\n\n`/init` will create a minimal file system that should look like this if all goes well:\n\n    # cat /proc/mounts\n    none / rootfs rw,nosuid 0 0\n    none /proc proc rw,nosuid,nodev,noexec,relatime 0 0\n    none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0\n    none /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime 0 0\n    none /dev devtmpfs rw,nosuid,noexec 0 0\n    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0\n\nNote that `/init` mounts `cgroup2` as `/sys/fs/cgroup` and not the old `cgroup`.\n\n## Kernel configuration\n\nA minimal kernel configuration to enable all features of `/init` would look like this:\n\n    CONFIG_BLK_DEV_INITRD=y\n    CONFIG_INITRAMFS_SOURCE=\u003cPATH\u003e  # root directory with \u003cPATH\u003e/init\n    CONFIG_BINFMT_ELF=y\n    CONFIG_BINFMT_SCRIPT=y\n    CONFIG_DEVTMPFS=y\n    CONFIG_PROC_FS=y\n    CONFIG_SYSFS=y\n\nSince all logs go into the kernel, it's a good idea to increase the size of the log buffer:\n\n    CONFIG_LOG_BUF_SHIFT=24\n\nRequired for updates:\n\n    CONFIG_RELOCATABLE=y\n    CONFIG_CRYPTO=y\n    CONFIG_CRYPTO_SHA256=y\n    CONFIG_KEXEC_FILE=y\n\nNot mandatory but useful to see what's going on :)\n\n    CONFIG_PRINTK=y\n    CONFIG_TTY=y\n    CONFIG_SERIAL_8250=y\n    CONFIG_SERIAL_8250_CONSOLE=y\n\n---\nFor feature requests and bug reports,\nplease create an [issue](https://github.com/angt/slashinit/issues).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangt%2Fslashinit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangt%2Fslashinit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangt%2Fslashinit/lists"}