Browse Source
Do not save and restore the initramfs, but instead, just unpack the default initramfs for shutdown on shutdown.master
Harald Hoyer
12 years ago
19 changed files with 46 additions and 51 deletions
@ -1,15 +0,0 @@
@@ -1,15 +0,0 @@
|
||||
# This file is part of systemd. |
||||
# |
||||
# systemd is free software; you can redistribute it and/or modify it |
||||
# under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation; either version 2 of the License, or |
||||
# (at your option) any later version. |
||||
|
||||
[Unit] |
||||
Description=Save /run/initramfs |
||||
ConditionPathExists=/run/initramfs |
||||
|
||||
[Service] |
||||
ExecStart=/usr/lib/dracut/dracut-initramfs-backup backup |
||||
Type=oneshot |
||||
RemainAfterExit=yes |
@ -1,22 +0,0 @@
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh |
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
|
||||
set -e |
||||
cd /run/initramfs |
||||
|
||||
if [ "x$1" = "xbackup" ]; then |
||||
compress="gzip" |
||||
command -v pigz > /dev/null 2>&1 && compress="pigz" |
||||
find . |cpio -H newc -o --quiet \ |
||||
| pigz > /var/lib/initramfs/_run_initramfs-backup.cpio.gz |
||||
mv -f /var/lib/initramfs/_run_initramfs-backup.cpio.gz \ |
||||
/var/lib/initramfs/run_initramfs-backup.cpio.gz |
||||
rm -fr etc bin lib lib64 sbin shutdown tmp usr var |
||||
> .backuped |
||||
elif [ "x$1" = "xrestore" ]; then |
||||
[ -f .backuped -a -f /var/lib/initramfs/run_initramfs-backup.cpio.gz ] || exit 1 |
||||
zcat /var/lib/initramfs/run_initramfs-backup.cpio.gz | cpio -id >/dev/null 2>&1 |
||||
rm .backuped |
||||
rm -f /var/lib/initramfs/run_initramfs-backup.cpio.gz |
||||
fi |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh |
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
|
||||
set -e |
||||
cd /run/initramfs |
||||
IMG="/boot/initramfs-$(uname -r).img" |
||||
[ -f .need_shutdown -a -f "$IMG" ] || exit 1 |
||||
zcat "$IMG" | cpio -id >/dev/null 2>&1 |
||||
rm .need_shutdown |
Loading…
Reference in new issue