]> git.zerfleddert.de Git - m1-debian/blob - files/rc.local
fbd572af7950ba1f8e10f80dbb9dabb266b49b13
[m1-debian] / files / rc.local
1 #!/usr/bin/perl
2
3 # [x] resize root filesystem
4 # [ ] find boot partition
5 # [ ] generate fstab
6 # [ ] mount boot
7 # [ ] extract wifi firmware
8 # [ ] reloads the kernel modules
9 # [ ] install grub
10 # [ ] disables itself
11
12 sub
13 find_root_device
14 {
15 open(MOUNT, '<', '/proc/mounts') || die ("Can not open /proc/mounts for reading: $!");
16 my @lines = <MOUNT>;
17 close(MOUNT);
18
19 for (@lines) {
20 if (/^([\S]+)+ \/ /) {
21 return $1;
22 }
23 }
24
25 die("Could not find root device");
26 }
27
28 my $root_block_device = find_root_device();
29
30 system("resize2fs $root_block_device");
Impressum, Datenschutz