Post 2976708 by Wolf480pl@niu.moe
(DIR) More posts by Wolf480pl@niu.moe
(DIR) Post #2975827 by Wolf480pl@niu.moe
2019-01-14T20:35:10Z
0 likes, 0 repeats
If you ever wonder what is${VARIABLE@a}It's an annoying bash-4.4-ism for getting attributes of a variable, eg. figuring out if it's an array.Of course it doesn't work in bash 4.3 or older, let alone dash, etc.sigh....
(DIR) Post #2975913 by duponin@niu.moe
2019-01-14T20:37:55Z
0 likes, 0 repeats
@Wolf480pl Do you want to know something frustrating ?Bash's array start at 1
(DIR) Post #2976708 by Wolf480pl@niu.moe
2019-01-14T20:59:14Z
0 likes, 0 repeats
If only mkinitcpio didn't use it...Look, mkinitcpio is a pretty nice framework for building initramfses, but I need something that runs on distros other than Arch.I'm fine with keeping its repo as a git submodule, and patching the main script to change the hardcoded paths to hook directories. And I'm fine patching the base hook to use /bin/busybox instead of /usr/lib/initcpio/busybox.But finding all bash-4.4-isms and patching them too... that sounds like a PITA...
(DIR) Post #2976812 by sir@cmpwn.com
2019-01-14T21:02:56Z
0 likes, 0 repeats
@Wolf480pl https://git.sr.ht/~sircmpwn/tinyinitrd
(DIR) Post #2976846 by sir@cmpwn.com
2019-01-14T21:03:19Z
0 likes, 0 repeats
@Wolf480pl batteries not included, requires minimal patching to use with other package managers
(DIR) Post #2976930 by Wolf480pl@niu.moe
2019-01-14T21:06:37Z
0 likes, 0 repeats
@sir oh, it uses apk internally?Well... at this point, both mkinitcpio and tinyinitrd require patching or forking... and mkinitcpio already has a set of hooks for everything from kernel modules to dhcp, so I'll stick with it for now.
(DIR) Post #2977391 by sir@cmpwn.com
2019-01-14T21:20:59Z
0 likes, 0 repeats
@Wolf480pl yeah, but tinyinitrd is a 50 line shell script and mkinitcpio... isn't
(DIR) Post #2978009 by Wolf480pl@niu.moe
2019-01-14T21:45:14Z
0 likes, 0 repeats
@sir yeah, but even if that means in tinyinitrd I need to change 2 lines to adapt it, there's at most 48 lines which I reuse, and I have to write the rest myself.OTOH, on mkinitcpio, even if I change 20 lines, I'm still benefiting from it more, and it gets me closer to the goal.Also, I haven't looked too closely, but it looks like tinyinitrd basically installs packages in the initramfs, so I think adapting it to a different package manager may be more work than changing 2 lines.
(DIR) Post #2978123 by Wolf480pl@niu.moe
2019-01-14T21:50:05Z
0 likes, 0 repeats
@sir I know that what I make will be ugly. But it'll do the job, and should be easy enough to update to newer kernels, and to adapt to be buildable on whatever distro my successors are gonna use.I could make a much better solution by using tinyinitrd, but it'd take much more time, which I do not have right now.
(DIR) Post #2978323 by sir@cmpwn.com
2019-01-14T21:57:56Z
0 likes, 0 repeats
@Wolf480pl hey, do what works
(DIR) Post #2979437 by ente@chaos.social
2019-01-14T22:44:20Z
0 likes, 0 repeats
@sir @Wolf480pl doing what works would mean installing bash 4.4. :)Fighting bashisms in projects that you don't maintain is an uphill battle you're not going to win.
(DIR) Post #2979448 by Wolf480pl@niu.moe
2019-01-14T22:45:11Z
0 likes, 0 repeats
@ente @sir after changing 5 lines it works on bash 4.3 just fine.And installing bash 4.4 on Debian 8 may not be as easy as you think it is.
(DIR) Post #2979492 by ente@chaos.social
2019-01-14T22:46:36Z
0 likes, 0 repeats
@Wolf480pl my sincere condolences! ;)