Skip to content

Commit 6eb4b60

Browse files
committed
feat: add initramfs script for filesystem upgrade
1 parent d4f89db commit 6eb4b60

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
PREREQ=""
4+
5+
prereqs()
6+
{
7+
echo "${PREREQ}"
8+
}
9+
10+
case ${1} in
11+
prereqs)
12+
prereqs
13+
exit 0
14+
;;
15+
esac
16+
17+
mount -o remount,rw ${rootmnt}
18+
if [ -d ${rootmnt}/.system ]; then
19+
echo "vanilla-filesystem-upgrade: Detected old filesystem at /.system, upgrading..."
20+
rm -f ${rootmnt}/etc ${rootmnt}/usr
21+
mv ${rootmnt}/.system/FsGuard ${rootmnt}/.system/etc ${rootmnt}/.system/sysconf ${rootmnt}/.system/usr ${rootmnt}/.system/bin ${rootmnt}/.system/lib ${rootmnt}/.system/lib64 ${rootmnt}/.system/sbin ${rootmnt}/.system/vanilla.key ${rootmnt}
22+
rm -rf ${rootmnt}/.system
23+
echo "vanilla-filesystem-upgrade: Filesystem upgrade completed"
24+
fi

modules/46-filesystem-upgrade.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: 46-filesystem-upgrade
2+
type: shell
3+
commands:
4+
- chmod +x /usr/share/initramfs-tools/scripts/local-bottom/vanilla-filesystem-upgrade

recipe.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ stages:
4040
- modules/40-essentials.yml
4141
- modules/41-move-boot-scripts.yml
4242
- modules/45-lvm-fix.yml
43+
- modules/46-filesystem-upgrade.yml
4344
- modules/50-fs.yml
4445
- modules/60-sound.yml
4546
- modules/70-compression.yml

0 commit comments

Comments
 (0)