{"id":31571600,"url":"https://github.com/h8d13/syman-grub2","last_synced_at":"2026-06-25T13:31:20.735Z","repository":{"id":316409632,"uuid":"1063250141","full_name":"h8d13/SYMAN-GRUB2","owner":"h8d13","description":"Script to correct keymaps in Grub2 for Archlinux","archived":false,"fork":false,"pushed_at":"2025-09-26T16:48:29.000Z","size":120,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-09T13:02:58.419Z","etag":null,"topics":["grub2","keyboard-layout","keymaps","password"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h8d13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-24T11:20:09.000Z","updated_at":"2025-09-26T16:48:32.000Z","dependencies_parsed_at":"2025-09-26T13:06:10.524Z","dependency_job_id":null,"html_url":"https://github.com/h8d13/SYMAN-GRUB2","commit_stats":null,"previous_names":["h8d13/grub2_keymaps_fix","h8d13/symap-grub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/h8d13/SYMAN-GRUB2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h8d13%2FSYMAN-GRUB2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h8d13%2FSYMAN-GRUB2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h8d13%2FSYMAN-GRUB2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h8d13%2FSYMAN-GRUB2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h8d13","download_url":"https://codeload.github.com/h8d13/SYMAN-GRUB2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h8d13%2FSYMAN-GRUB2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34778079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["grub2","keyboard-layout","keymaps","password"],"created_at":"2025-10-05T13:13:53.411Z","updated_at":"2026-06-25T13:31:20.715Z","avatar_url":"https://github.com/h8d13.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYMAN\n\n## Grub2 Keymaps\n\nTook me 24h to not be on outdated documentation (which will break your setup btw) so made a script to save time for others. \n\nThanks to this blog post [FitzBlog](https://fitzcarraldoblog.wordpress.com/2019/04/21/how-to-change-the-keymap-keyboard-layout-used-by-the-grub-shell-in-gentoo-linux/) And W to gentoo users for going in exact detail and how to do something.\n\n---\n\nBasically when running `grub-mklayout` to generate the layout file: get error: `ckbcomp` not found on arch. So you just need to make sure to have it from the AUR (hopefully becomes a core package). This is a large perl script that just maps/converts keys to a grub compatible format `.gkb` I've included it directly in the repo here as it's unlikely to change that much. \n\nThen follow the steps from the guide on Fitz's blog or the script [here](https://github.com/h8d13/SYMAN-GRUB2/blob/master/grub_keymaps). \n\n```\nKB_LAYOUT=\"fr\"\nKB_VARIANT=\"azerty\"\n```\n\nMake sure to set these and variant can be left empty as `\"\"`. \n\nCareful that grub (and system critical pieces in general) are often restricted to 1-127 range. So don't use special chars in users/passwords, etc. And are case sensitive! \n\n\u003e At this point you can verify it works by pressing `c` in the grub menu and checking keys are properly registered.\n\nThis part does assume you have an install with existing `/usr/share/X11/xkb/symbols` but these are pretty standard and are included in `xkeyboard-config` required by: `libxkbcommon  xorg-server-common`\n\n## Grub2 Passwords\n\nIncluded a second script that can generate the hash append it to the same file we just modified.\n\nBut this already covers a large vector that nobody can edit your launch lines (common exploit of adding rw and spawing a shell) or use the rescue shell without your user/pw.\n\nScript [here](https://github.com/h8d13/SYMAN-GRUB2/blob/master/grub_passw). \n\nBy default I've set that root + sudo user invoker can use the password you have set. \n\nBut you can easily modify:\n\nUsing `grub-mkpasswd-pbkdf2`\n\n1. Single/Multiple superusers with full access:\n```\nset superusers=\"root alice bob\"\npassword_pbkdf2 root [root_hash]\npassword_pbkdf2 alice [alice_hash]\npassword_pbkdf2 bob [bob_hash]\n```\n\n2. (Optional) Different permission levels - regular users vs superusers:\n```\nset superusers=\"root\"\npassword_pbkdf2 root [root_hash]\npassword_pbkdf2 user1 [user1_hash]  # Regular user, no superuser privs\n```\n\n3. (Optional) Per-entry types\n```\n# Find the info you need:\nsudo grep -A15 \"menuentry 'Arch Linux'\" /boot/grub/grub.cfg | head -20\n\nmenuentry 'Arch Linux (Protected)' --users \"root,hadean\" {\n      load_video\n      set gfxpayload=keep\n      insmod gzio\n      insmod part_gpt\n      insmod fat\n      echo 'Loading Linux linux-zen ...'\n      linux /vmlinuz-linux-zen root=UUID=YOURUUID rw zswap.enabled=0 rootfstype=ext4 locale=en_GB loglevel=3 quiet\n      initrd /intel-ucode.img /initramfs-linux-zen.img\n  }\n```\n\nCan also use `--unrestricted` or `--users root` for example.\n\n4. Too lazy for custom entries but still want some protection.\n\n```\nsudo sed -i 's/\\${CLASS} \\\\\\$menuentry_id_option/\\${CLASS} --unrestricted \\\\$menuentry_id_option/g' /etc/grub.d/10_linux\n```\n\nYou can use `sed -i.backup` if you want to keep the original file to check/compare. But make sure to remove it after so it doesn't get parsed by `grub-mkconfig`\n\nThis will remove the restriction from default boot entry but keep the password protection for command line and edit launch config. Edits line 113 and 115. \n\nThen `sudo grub-mkconfig -o /boot/grub/grub.cfg`\n\n## Grub2 Rescue\n\nBasically let's say you `rm -rf /usr/bin` this provides a utility script to have a rescue env (copied from a USB to a physical partition) in your grub entries. To then mount and perform required maintenance. This is also useful for testing installations . Find script [here](https://github.com/h8d13/SYMAN-GRUB2/blob/master/grub_rescue). \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh8d13%2Fsyman-grub2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh8d13%2Fsyman-grub2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh8d13%2Fsyman-grub2/lists"}