From: Thomas Glanzmann Date: Wed, 23 Feb 2022 19:43:08 +0000 (+0100) Subject: working on rc.local X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/m1-debian/commitdiff_plain/e1af00a32584e2155a2252a2eafe838cf40aeb39 working on rc.local --- diff --git a/files/rc.local b/files/rc.local new file mode 100755 index 0000000..fbd572a --- /dev/null +++ b/files/rc.local @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +# [x] resize root filesystem +# [ ] find boot partition +# [ ] generate fstab +# [ ] mount boot +# [ ] extract wifi firmware +# [ ] reloads the kernel modules +# [ ] install grub +# [ ] disables itself + +sub +find_root_device +{ + open(MOUNT, '<', '/proc/mounts') || die ("Can not open /proc/mounts for reading: $!"); + my @lines = ; + close(MOUNT); + + for (@lines) { + if (/^([\S]+)+ \/ /) { + return $1; + } + } + + die("Could not find root device"); +} + +my $root_block_device = find_root_device(); + +system("resize2fs $root_block_device");