You are not logged in.
Pages: 1
Hi, just now I installed the latest system upgrades and I noticed a new file showed up:
/etc/mkinitcpio.conf.pacnew
What do I need to know about it? Can I just ignore it?
I have the old file (mkinitcpio.conf) with the encrypt and lvm2 hooks set up, do I need to move them to the new?
I shall wait for a reply before shuting down my computer.
Thanks
Offline
The new format just moves each of the lines into an array. You can manually edit your file and delete the pacnew.
Offline
Ignoring any .pacnew is not a good idea. In this case, the old style should continue to work, but is probably deprecated and may be dropped in a future version.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
changes from "space delimited" to array (as mentioned), any changes you made to mkinitcpio retain those changes in the pacnew file in array(s) where required, you can always save the old one as mkinitcpio.conf.old in case you need to fall back on it, drop the .pacnew from the new one and you should be good to go, you can always run it to make sure it will run.
mkinitcpio -P
or -p or ? depending on your system. Can usually diff the existing vs pacnew files to see what needs to be done before using the new file.
∞ hard times make the strong, the strong make good times, good times make the weak, the weak make hard times ∞
Offline
The new syntax of mkinitcpio.conf has replaced the () with ""
e.g.
HOOKS=""
instead of
HOOKS=()
for security, backup your old mkinitcpio.conf before the changes.
On Arch Linux there is "pacdiff" for manage the .pacnew files: https://wiki.archlinux.org/index.php/Pa … nd_Pacsave
Last edited by brainfucksec (2017-11-03 10:45:54)
--= [ |<!55 ]=--
Offline
Is there any info why this mkinitcpio.conf syntax change from literal strings to arrays was made?
I have these nice explanatory and easily toggle-able MODULES line switches which now need to be reworked:
#MODULES=()
MODULES="btrfs crc32c_intel" # filesystems
MODULES+=" sd_mod uas" # storage
#MODULES+=" ahci" # SATA
MODULES+=" hid_generic usbhid serio_raw atkbd i8042" # keyboard
MODULES+=" xhci_pci" # USB 3.1, 3.0, 2.0, 1.1
MODULES+=" ehci_pci" # USB 2.0
#MODULES+=" ohci_pci" # USB 1.1 non Intel or VIA chipset, like NEC
#MODULES+=" uhci_pci" # USB 1.x Intel or VIA chipset
#MODULES+="" # miscellaneous
Last edited by probackup-nl (2017-11-15 21:40:43)
Offline
After rework:
#MODULES=()
MODULES=(btrfs crc32c_intel) # filesystems
MODULES=("${MODULES[@]}" sd_mod uas) # storage
#MODULES=("${MODULES[@]}" ahci) # SATA
MODULES=("${MODULES[@]}" hid_generic usbhid serio_raw atkbd i8042) # keyboard
MODULES=("${MODULES[@]}" xhci_pci) # USB 3.1, 3.0, 2.0, 1.1
MODULES=("${MODULES[@]}" ehci_pci) # USB 2.0
#MODULES=("${MODULES[@]}" ohci_pci) # USB 1.1 non Intel or VIA chipset, like NEC
#MODULES=("${MODULES[@]}" uhci_pci) # USB 1.x Intel or VIA chipset
#MODULES=("${MODULES[@]}") # miscellaneous
So much for readability of the shell array notation.
Offline
So much for your basic understanding of how the shell works.
foo+=(bar)
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
@Alad Thanks for your reply and make me learn and improve.
I have not much clue of how the shell works. The search query for "bash array initialization round brackets" resulted in "The Ultimate Bash Array Tutorial with 15 Examples". The MODULES=("${MODULES[@]}"... config change was made based upon example #9: "Add an element to an existing Bash Array".
After changing mkinitcpio.conf to below, image creation still works as expected:
# MODULES=(piix ide_disk reiserfs)
#MODULES=()
MODULES=(btrfs crc32c_intel) # filesystems
MODULES+=(sd_mod uas) # storage
#MODULES+=(ahci) # SATA
MODULES+=(hid_generic usbhid serio_raw atkbd i8042) # keyboard
MODULES+=(xhci_pci) # USB 3.1, 3.0, 2.0, 1.1
MODULES+=(ehci_pci) # USB 2.0
#MODULES+=(ohci_pci) # USB 1.1 non Intel or VIA chipset, like NEC
#MODULES+=(uhci_pci) # USB 1.x Intel or VIA chipset
#MODULES+=() # miscellaneous
http://mywiki.wooledge.org/BashGuide is a better guide for Bash.
Last edited by probackup-nl (2017-11-16 11:26:23)
Offline
Pages: 1