-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux-vim.install
68 lines (61 loc) · 2.44 KB
/
linux-vim.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# arg 1: the new package version
# arg 2: the old package version
KERNEL_NAME=-vim
KERNEL_VERSION=5.0.0-1
pre_install () {
# backuo Image and uInitrd
echo ">>> Backup Image and uInitrd. Please wait ..."
mv /boot/Image /boot/Image.old
mv /boot/uInitrd /boot/uInitrd.old
mv /boot/dtbs /boot/dtbs.old
mv /boot/s905_autoscript /boot/s905_autoscript.old
mv /boot/s905_autoscript.cmd /boot/s905_autoscript.cmd.old
mv /boot/hdmi.sh /boot/hdmi.sh.old
mv /usr/lib/sistem.d/system/amlogic.service /usr/lib/sistem.d/system/amlogic.service.old
}
pre_upgrade () {
# backuo Image and uInitrd
echo ">>> Backup Image and uInitrd. Please wait ..."
mv /boot/Image /boot/Image.old
mv /boot/uInitrd /boot/uInitrd.old
mv /boot/dtbs /boot/dtbs.old
mv /boot/s905_autoscript /boot/s905_autoscript.old
mv /boot/s905_autoscript.cmd /boot/s905_autoscript.cmd.old
mv /boot/hdmi.sh /boot/hdmi.sh.old
mv /usr/lib/sistem.d/system/amlogic.service /usr/lib/sistem.d/system/amlogic.service.old
}
post_install () {
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod ${KERNEL_VERSION}
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
mkinitcpio -p linux${KERNEL_NAME}
mkimage -A arm64 -T ramdisk -C none -n uInitrd -d /boot/initramfs-linux.img /boot/uInitrd
mkimage -A arm -O linux -T script -C none -d /boot/s905_autoscript.cmd /boot/s905_autoscript
# mv /boot/s905_autoscript.new /boot/s905_autoscript
systemctl enable amlogic
}
post_upgrade() {
if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then
echo "WARNING: /boot appears to be a separate partition but is not mounted."
fi
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod ${KERNEL_VERSION}
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
mkinitcpio -p linux${KERNEL_NAME}
mkimage -A arm64 -T ramdisk -C none -n uInitrd -d /boot/initramfs-linux.img /boot/uInitrd
mkimage -A arm -O linux -T script -C none -d /boot/s905_autoscript.cmd /boot/s905_autoscript
# mv /boot/s905_autoscript.new /boot/s905_autoscript
systemctl enable amlogic
}
post_remove() {
# also remove the compat symlinks
rm -f /boot/initramfs-linux.img
rm -f /boot/uInitrd
rm -f /boot/dtbs
rm -f /boot/s905_autoscript
rm -f /boot/s905_autoscript.cmd
rm -f /boot/hdmi.sh
rm -f /usr/lib/sistem.d/system/amlogic.service
systemctl disable amlogic