]>
Commit | Line | Data |
---|---|---|
e1af00a3 TG |
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"); |