mirror of https://github.com/OpenIPC/firmware.git
42 lines
1.0 KiB
Diff
42 lines
1.0 KiB
Diff
diff -drupN a/init/initramfs.c b/init/initramfs.c
|
|
--- a/init/initramfs.c 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/init/initramfs.c 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -18,6 +18,7 @@
|
|
#include <linux/dirent.h>
|
|
#include <linux/syscalls.h>
|
|
#include <linux/utime.h>
|
|
+#include <linux/initramfs.h>
|
|
#include <linux/file.h>
|
|
|
|
static ssize_t __init xwrite(int fd, const char *p, size_t count)
|
|
@@ -606,9 +607,28 @@ static void __init clean_rootfs(void)
|
|
}
|
|
#endif
|
|
|
|
+static int __initdata do_skip_initramfs;
|
|
+
|
|
+static int __init skip_initramfs_param(char *str)
|
|
+{
|
|
+ if (*str)
|
|
+ return 0;
|
|
+ do_skip_initramfs = 1;
|
|
+ return 1;
|
|
+}
|
|
+__setup("skip_initramfs", skip_initramfs_param);
|
|
+
|
|
static int __init populate_rootfs(void)
|
|
{
|
|
- char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
|
|
+ char *err;
|
|
+
|
|
+ if (do_skip_initramfs) {
|
|
+ if (initrd_start)
|
|
+ free_initrd();
|
|
+ return default_rootfs();
|
|
+ }
|
|
+
|
|
+ err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
|
|
if (err)
|
|
panic("%s", err); /* Failed to decompress INTERNAL initramfs */
|
|
if (initrd_start) {
|