mkinitcpio, mkinitramfs, initrd rebuild
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import piksemel
|
||||
import os
|
||||
|
||||
def updateInitrd(filepath):
|
||||
patterns = ("/lib/modules", "/lib/initrd", "/boot/kernel", "/bin/busybox")
|
||||
parse = piksemel.parse(filepath)
|
||||
for xmlfile in parse.tags("File"):
|
||||
path = xmlfile.getTagData("Path")
|
||||
if not path.startswith("/"):
|
||||
path = "/%s" % path # Just in case
|
||||
if path.startswith(patterns):
|
||||
# Handle the proper case of modules
|
||||
version = path.split("/")[3]
|
||||
os.environ['PATH'] = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin'
|
||||
cmd = "update-initrd KERNELVER=%s MODDIR=/lib/modules/%s OUTPUT=/boot/initramfs-%s" % (version, version, version)
|
||||
os.system(cmd)
|
||||
if os.path.exists("/proc/cmdline"):
|
||||
os.system("/usr/bin/update-grub")
|
||||
break
|
||||
|
||||
def setupPackage(metapath, filepath):
|
||||
updateInitrd(filepath)
|
||||
|
||||
def cleanupPackage(metapath, filepath):
|
||||
pass
|
||||
|
||||
def postCleanupPackage(metapath, filepath):
|
||||
# TODO: Remove old initramfs!
|
||||
pass
|
||||
@@ -25,13 +25,27 @@
|
||||
<RuntimeDependencies>
|
||||
<Dependency>btrfs-progs</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Conflicts>
|
||||
<Package>mkinitramfs</Package>
|
||||
<Package>mkinitcpio</Package>
|
||||
</Conflicts>
|
||||
<Files>
|
||||
<Path fileType="executable">/bin/update-initrd</Path>
|
||||
<Path fileType="library">/lib/initrd</Path>
|
||||
</Files>
|
||||
<Provides>
|
||||
<COMAR script="pakhandler.py">System.PackageHandler</COMAR>
|
||||
</Provides>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="6">
|
||||
<Date>2020-09-11</Date>
|
||||
<Version>1.1.4</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Berk Çakar</Name>
|
||||
<Email>berk2238@hotmail.com</Email>
|
||||
</Update>
|
||||
<Update release="5">
|
||||
<Date>2020-09-09</Date>
|
||||
<Version>1.1.4</Version>
|
||||
|
||||
Reference in New Issue
Block a user