refactor(os): Clean up initramfs generation (#1)
This commit is contained in:
		
							
								
								
									
										13
									
								
								setup.sh
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								setup.sh
									
									
									
									
									
								
							| @@ -240,13 +240,22 @@ function set_hostname () { | |||||||
| } | } | ||||||
|  |  | ||||||
| function set_locale () { | function set_locale () { | ||||||
|     printf -- '%s\n' 'KEYMAP=de-latin1' > '/mnt/etc/vconsole.conf' |     printf -- '%s\n' \ | ||||||
|  |         'KEYMAP=de-latin1' \ | ||||||
|  |         'FONT=Lat2-Terminus16' \ | ||||||
|  |         'FONT_MAP=8859-1' \ | ||||||
|  |         > '/mnt/etc/vconsole.conf' | ||||||
|     sed -ri -e 's'$'\x1''^(#)(en_US.UTF-8[^\r\n\f]*)'$'\x1''\2'$'\x1''g' '/mnt/etc/locale.gen' |     sed -ri -e 's'$'\x1''^(#)(en_US.UTF-8[^\r\n\f]*)'$'\x1''\2'$'\x1''g' '/mnt/etc/locale.gen' | ||||||
|     printf -- '%s\n' 'LANG=en_US.UTF-8' > '/mnt/etc/locale.conf' |     printf -- '%s\n' 'LANG=en_US.UTF-8' > '/mnt/etc/locale.conf' | ||||||
| } | } | ||||||
|  |  | ||||||
| function add_zfs_hook_to_initramfs () { | function add_zfs_hook_to_initramfs () { | ||||||
|     sed -ri -e 's'$'\x1''(HOOKS=)(.*?[\(| ])(filesystems)([\)| ][^\r\n\f]*)'$'\x1''\1\2zfs \3\4'$'\x1''g' '/mnt/etc/mkinitcpio.conf' |     # Add zfs hook, remove fsck hook from initramfs | ||||||
|  |     sed -ri \ | ||||||
|  |         -e 's'$'\x1''(HOOKS=)(.*?[\(| ])(filesystems)([\)| ][^\r\n\f]*)'$'\x1''\1\2zfs \3\4'$'\x1''g' \ | ||||||
|  |         -e 's'$'\x1''((\()(fsck)(\)))'$'\x1''\2\4'$'\x1''g' \ | ||||||
|  |         -e 's'$'\x1''(([[:space:]]+)(fsck)|(fsck)([[:space:]]+))'$'\x1'''$'\x1''g' \ | ||||||
|  |         '/mnt/etc/mkinitcpio.conf' | ||||||
| } | } | ||||||
|  |  | ||||||
| function add_zfs_files_to_new_os () { | function add_zfs_files_to_new_os () { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user