From e1af00a32584e2155a2252a2eafe838cf40aeb39 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Wed, 23 Feb 2022 20:43:08 +0100 Subject: [PATCH] working on rc.local --- files/rc.local | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 files/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"); -- 2.39.2