summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/preinit
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/lib/preinit')
-rw-r--r--package/base-files/files/lib/preinit/05_mount_skip13
-rw-r--r--package/base-files/files/lib/preinit/10_check_for_mtd20
-rw-r--r--package/base-files/files/lib/preinit/20_check_jffs2_ready19
-rw-r--r--package/base-files/files/lib/preinit/40_mount_jffs226
-rw-r--r--package/base-files/files/lib/preinit/41_merge_overlay_hooks24
-rw-r--r--package/base-files/files/lib/preinit/70_pivot_jffs2_root14
-rw-r--r--package/base-files/files/lib/preinit/80_mount_root11
-rw-r--r--package/base-files/files/lib/preinit/90_mount_no_jffs212
-rw-r--r--package/base-files/files/lib/preinit/90_restore_config17
-rw-r--r--package/base-files/files/lib/preinit/99_10_mount_no_mtd12
10 files changed, 10 insertions, 158 deletions
diff --git a/package/base-files/files/lib/preinit/05_mount_skip b/package/base-files/files/lib/preinit/05_mount_skip
deleted file mode 100644
index c2b7ee79d..000000000
--- a/package/base-files/files/lib/preinit/05_mount_skip
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2006 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-check_skip() {
- if [ "$pi_mount_skip_next" = "true" ]; then
- return 0
- else
- return 1
- fi
-}
-
diff --git a/package/base-files/files/lib/preinit/10_check_for_mtd b/package/base-files/files/lib/preinit/10_check_for_mtd
deleted file mode 100644
index 6a7bd307f..000000000
--- a/package/base-files/files/lib/preinit/10_check_for_mtd
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2006-2010 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-mount_no_mtd() {
- mtd unlock rootfs
- mount -o noatime,remount,rw /dev/root /
-}
-
-check_for_mtd() {
- check_skip || {
- grep -qs rootfs_data /proc/mtd || {
- mount_no_mtd && pi_mount_skip_next=true
- }
- }
-}
-
-boot_hook_add preinit_mount_root check_for_mtd
-
diff --git a/package/base-files/files/lib/preinit/20_check_jffs2_ready b/package/base-files/files/lib/preinit/20_check_jffs2_ready
deleted file mode 100644
index 3c5cf67e8..000000000
--- a/package/base-files/files/lib/preinit/20_check_jffs2_ready
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2006-2010 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-mount_no_jffs2() {
- echo "jffs2 not ready yet; using ramdisk"
- ramoverlay
-}
-
-check_for_jffs2() {
- check_skip || {
- jffs2_ready || {
- mount_no_jffs2 && pi_mount_skip_next=true
- }
- }
-}
-
-boot_hook_add preinit_mount_root check_for_jffs2
-
diff --git a/package/base-files/files/lib/preinit/40_mount_jffs2 b/package/base-files/files/lib/preinit/40_mount_jffs2
deleted file mode 100644
index ded785ed5..000000000
--- a/package/base-files/files/lib/preinit/40_mount_jffs2
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2006-2010 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-find_mount_jffs2() {
- mkdir -p /tmp/overlay
- mount -o noatime -t jffs2 "$(find_mtd_part rootfs_data)" /tmp/overlay
- mtd -qq unlock rootfs_data
-}
-
-jffs2_not_mounted() {
- if [ "$pi_jffs2_mount_success" != "true" ]; then
- return 0
- else
- return 1
- fi
-}
-
-do_mount_jffs2() {
- check_skip || {
- find_mount_jffs2 && pi_jffs2_mount_success=true
- }
-}
-
-boot_hook_add preinit_mount_root do_mount_jffs2
-
diff --git a/package/base-files/files/lib/preinit/41_merge_overlay_hooks b/package/base-files/files/lib/preinit/41_merge_overlay_hooks
deleted file mode 100644
index 4ca6877be..000000000
--- a/package/base-files/files/lib/preinit/41_merge_overlay_hooks
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2010 OpenWrt.org
-
-merge_overlay_hooks() {
- jffs2_not_mounted || [ ! -d /tmp/overlay/lib/preinit ] || {
- echo "- merge overlay components -"
-
- mkdir -p /tmp/preinit-hook-merge
- ln -sf /lib/preinit/* /tmp/overlay/lib/preinit/[0-9][0-9]_* /tmp/preinit-hook-merge/
-
- boot_hook_splice_start
-
- local pipart
- for pipart in /tmp/preinit-hook-merge/*; do
- . $pipart
- done
-
- boot_hook_splice_finish
-
- rm -rf /tmp/preinit-hook-merge
- }
-}
-
-boot_hook_add preinit_mount_root merge_overlay_hooks
diff --git a/package/base-files/files/lib/preinit/70_pivot_jffs2_root b/package/base-files/files/lib/preinit/70_pivot_jffs2_root
deleted file mode 100644
index b76f111ca..000000000
--- a/package/base-files/files/lib/preinit/70_pivot_jffs2_root
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2006-2010 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-rootfs_pivot() {
- check_skip || jffs2_not_mounted || {
- echo "switching to jffs2"
- mount -o noatime,move /tmp/overlay /overlay 2>&-
- fopivot /overlay /rom && pi_mount_skip_next=true
- }
-}
-
-boot_hook_add preinit_mount_root rootfs_pivot
-
diff --git a/package/base-files/files/lib/preinit/80_mount_root b/package/base-files/files/lib/preinit/80_mount_root
index 9a99ee910..0292d82d4 100644
--- a/package/base-files/files/lib/preinit/80_mount_root
+++ b/package/base-files/files/lib/preinit/80_mount_root
@@ -3,7 +3,16 @@
# Copyright (C) 2010 Vertical Communications
do_mount_root() {
- boot_run_hook preinit_mount_root
+ mount_root
+ boot_run_hook preinit_mount_root
+ [ -f /sysupgrade.tgz ] && {
+ echo "- config restore -"
+ cd /
+ mv sysupgrade.tgz /tmp
+ tar xzf /tmp/sysupgrade.tgz
+ rm -f /tmp/sysupgrade.tgz
+ sync
+ }
}
[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root
diff --git a/package/base-files/files/lib/preinit/90_mount_no_jffs2 b/package/base-files/files/lib/preinit/90_mount_no_jffs2
deleted file mode 100644
index d8ad4ae11..000000000
--- a/package/base-files/files/lib/preinit/90_mount_no_jffs2
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2006-2010 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-do_mount_no_jffs2() {
- check_skip || {
- mount_no_jffs2 && pi_mount_skip_next=true
- }
-}
-
-boot_hook_add preinit_mount_root do_mount_no_jffs2
-
diff --git a/package/base-files/files/lib/preinit/90_restore_config b/package/base-files/files/lib/preinit/90_restore_config
deleted file mode 100644
index 210bf6184..000000000
--- a/package/base-files/files/lib/preinit/90_restore_config
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2006 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-restore_config() {
- [ -f /sysupgrade.tgz ] && {
- echo "- config restore -"
- cd /
- mv sysupgrade.tgz /tmp
- tar xzf /tmp/sysupgrade.tgz
- rm -f /tmp/sysupgrade.tgz
- sync
- }
-}
-
-boot_hook_add preinit_main restore_config
-
diff --git a/package/base-files/files/lib/preinit/99_10_mount_no_mtd b/package/base-files/files/lib/preinit/99_10_mount_no_mtd
deleted file mode 100644
index c4f38e415..000000000
--- a/package/base-files/files/lib/preinit/99_10_mount_no_mtd
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2006-2010 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-
-do_mount_no_mtd() {
- check_skip || {
- mount_no_mtd
- }
-}
-
-boot_hook_add preinit_mount_root do_mount_no_mtd
-