mirror of
				https://github.com/ItsDrike/dotfiles.git
				synced 2025-10-30 23:56:35 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			699 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			699 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/bash
 | |
| build() {
 | |
|   add_binary /bin/bash
 | |
|   add_binary /usr/bin/setleds
 | |
|   add_binary /usr/local/bin/numlock
 | |
| 
 | |
|   cat >"$BUILDROOT/usr/lib/systemd/system/numlock.service" <<EOF
 | |
| [Unit]
 | |
| Description=Enable numlock
 | |
| Before=cryptsetup-pre.target
 | |
| DefaultDependencies=no
 | |
| [Service]
 | |
| Type=oneshot
 | |
| RemainAfterExit=yes
 | |
| ExecStart=/usr/local/bin/numlock
 | |
| EOF
 | |
| 
 | |
|   add_systemd_unit cryptsetup-pre.target
 | |
|   cd "$BUILDROOT/usr/lib/systemd/system/sysinit.target.wants" || exit
 | |
|   ln -sf /usr/lib/systemd/system/cryptsetup-pre.target cryptsetup-pre.target
 | |
|   ln -sf /usr/lib/systemd/system/numlock.service numlock.service
 | |
| }
 | |
| 
 | |
| help() {
 | |
|   cat <<EOF
 | |
| This hook adds support to enable numlock before sd-encrypt hook is run.
 | |
| EOF
 | |
| }
 |