diff options
Diffstat (limited to 'target/linux/x86/base-files/lib/preinit')
9 files changed, 260 insertions, 0 deletions
diff --git a/target/linux/x86/base-files/lib/preinit/.svn/entries b/target/linux/x86/base-files/lib/preinit/.svn/entries new file mode 100644 index 0000000..1fe7952 --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/x86/base-files/lib/preinit +svn://svn.openwrt.org/openwrt + + + +2012-12-19T16:07:46.450520Z +34792 +mirko + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +45_failsafe_x86 +file + + + + +2013-03-17T12:12:36.000000Z +15a84b188f4e8dc48b72b8fbedac91c4 +2010-03-23T22:57:16.248613Z +20393 +jow + + + + + + + + + + + + + + + + + + + + + +431 + +20_check_iso +file + + + + +2013-03-17T12:12:36.000000Z +ea4ac565db1511a46e47a8de3798d919 +2012-10-07T23:01:52.868031Z +33639 +nbd + + + + + + + + + + + + + + + + + + + + + +126 + +15_essential_fs_x86 +file + + + + +2013-03-17T12:12:36.000000Z +275270c7ab0caa7748d76b7d7b3f02c5 +2012-12-19T16:07:46.450520Z +34792 +mirko + + + + + + + + + + + + + + + + + + + + + +154 + +89_move_config +file + + + + +2013-03-17T12:12:36.000000Z +b562cb2e3f94df9a74f4c5b2e4162aa5 +2012-06-19T22:36:53.896967Z +32465 +acinonyx + + + + + + + + + + + + + + + + + + + + + +627 + diff --git a/target/linux/x86/base-files/lib/preinit/.svn/text-base/15_essential_fs_x86.svn-base b/target/linux/x86/base-files/lib/preinit/.svn/text-base/15_essential_fs_x86.svn-base new file mode 100644 index 0000000..5d54530 --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/.svn/text-base/15_essential_fs_x86.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2010 Vertical Communications + +do_mount_procfs() { + mount -o noatime -t proc none /proc +} + diff --git a/target/linux/x86/base-files/lib/preinit/.svn/text-base/20_check_iso.svn-base b/target/linux/x86/base-files/lib/preinit/.svn/text-base/20_check_iso.svn-base new file mode 100644 index 0000000..beff6eb --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/.svn/text-base/20_check_iso.svn-base @@ -0,0 +1,5 @@ +check_for_iso() { + grep -qE '/dev/root.*iso9660' /proc/mounts && ramoverlay +} + +boot_hook_add preinit_mount_root check_for_iso diff --git a/target/linux/x86/base-files/lib/preinit/.svn/text-base/45_failsafe_x86.svn-base b/target/linux/x86/base-files/lib/preinit/.svn/text-base/45_failsafe_x86.svn-base new file mode 100644 index 0000000..2ca039c --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/.svn/text-base/45_failsafe_x86.svn-base @@ -0,0 +1,13 @@ +#!/bin/sh +# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2010 Vertical Communications + +failsafe_wait() { + FAILSAFE= + grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE + if [ "$FAILSAFE" != "true" ]; then + preinit_net_echo "Please press button now to enter failsafe" + fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE + fi +} + diff --git a/target/linux/x86/base-files/lib/preinit/.svn/text-base/89_move_config.svn-base b/target/linux/x86/base-files/lib/preinit/.svn/text-base/89_move_config.svn-base new file mode 100644 index 0000000..ba337e1 --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/.svn/text-base/89_move_config.svn-base @@ -0,0 +1,22 @@ +#!/bin/sh +# Copyright (C) 2012 OpenWrt.org + +move_config() { + local rootfsdev + local rootfstype + + rootfstype="$(awk 'BEGIN { RS=" "; FS="="; } ($1 == "rootfstype") { print $2 }' < /proc/cmdline)" + case "$rootfstype" in + squashfs|jffs2) + rootfsdev="$(awk 'BEGIN { RS=" "; FS="="; } ($1 == "block2mtd.block2mtd") { print substr($2,1,index($2, ",")-1) }' < /proc/cmdline)";; + ext4) + rootfsdev="$(awk 'BEGIN { RS=" "; FS="="; } ($1 == "root") { print $2 }' < /proc/cmdline)";; + esac + + mount -t ext4 -o rw,noatime "${rootfsdev%[0-9]}1" /mnt + mv -f /mnt/sysupgrade.tgz / + umount /mnt +} + +boot_hook_add preinit_main move_config + diff --git a/target/linux/x86/base-files/lib/preinit/15_essential_fs_x86 b/target/linux/x86/base-files/lib/preinit/15_essential_fs_x86 new file mode 100644 index 0000000..5d54530 --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/15_essential_fs_x86 @@ -0,0 +1,8 @@ +#!/bin/sh +# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2010 Vertical Communications + +do_mount_procfs() { + mount -o noatime -t proc none /proc +} + diff --git a/target/linux/x86/base-files/lib/preinit/20_check_iso b/target/linux/x86/base-files/lib/preinit/20_check_iso new file mode 100644 index 0000000..beff6eb --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/20_check_iso @@ -0,0 +1,5 @@ +check_for_iso() { + grep -qE '/dev/root.*iso9660' /proc/mounts && ramoverlay +} + +boot_hook_add preinit_mount_root check_for_iso diff --git a/target/linux/x86/base-files/lib/preinit/45_failsafe_x86 b/target/linux/x86/base-files/lib/preinit/45_failsafe_x86 new file mode 100644 index 0000000..2ca039c --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/45_failsafe_x86 @@ -0,0 +1,13 @@ +#!/bin/sh +# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2010 Vertical Communications + +failsafe_wait() { + FAILSAFE= + grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE + if [ "$FAILSAFE" != "true" ]; then + preinit_net_echo "Please press button now to enter failsafe" + fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE + fi +} + diff --git a/target/linux/x86/base-files/lib/preinit/89_move_config b/target/linux/x86/base-files/lib/preinit/89_move_config new file mode 100644 index 0000000..ba337e1 --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/89_move_config @@ -0,0 +1,22 @@ +#!/bin/sh +# Copyright (C) 2012 OpenWrt.org + +move_config() { + local rootfsdev + local rootfstype + + rootfstype="$(awk 'BEGIN { RS=" "; FS="="; } ($1 == "rootfstype") { print $2 }' < /proc/cmdline)" + case "$rootfstype" in + squashfs|jffs2) + rootfsdev="$(awk 'BEGIN { RS=" "; FS="="; } ($1 == "block2mtd.block2mtd") { print substr($2,1,index($2, ",")-1) }' < /proc/cmdline)";; + ext4) + rootfsdev="$(awk 'BEGIN { RS=" "; FS="="; } ($1 == "root") { print $2 }' < /proc/cmdline)";; + esac + + mount -t ext4 -o rw,noatime "${rootfsdev%[0-9]}1" /mnt + mv -f /mnt/sysupgrade.tgz / + umount /mnt +} + +boot_hook_add preinit_main move_config + |