]> git.zerfleddert.de Git - m1-debian/commitdiff
working on rc.local
authorThomas Glanzmann <thomas@glanzmann.de>
Wed, 23 Feb 2022 19:43:08 +0000 (20:43 +0100)
committerThomas Glanzmann <thomas@glanzmann.de>
Wed, 23 Feb 2022 19:43:08 +0000 (20:43 +0100)
files/rc.local [new file with mode: 0755]

diff --git a/files/rc.local b/files/rc.local
new file mode 100755 (executable)
index 0000000..fbd572a
--- /dev/null
@@ -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 = <MOUNT>;
+        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");
Impressum, Datenschutz