summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkits.sh28
-rwxr-xr-xscripts/target-metadata.pl1
2 files changed, 28 insertions, 1 deletions
diff --git a/scripts/mkits.sh b/scripts/mkits.sh
index 59ff3a2d15..ecaba8e965 100755
--- a/scripts/mkits.sh
+++ b/scripts/mkits.sh
@@ -24,6 +24,7 @@ usage() {
printf "\n\t-a ==> set load address to 'addr' (hex)"
printf "\n\t-e ==> set entry point to 'entry' (hex)"
printf "\n\t-f ==> set device tree compatible string"
+ printf "\n\t-i ==> include initrd Blob 'initrd'"
printf "\n\t-v ==> set kernel version to 'version'"
printf "\n\t-k ==> include kernel image 'kernel'"
printf "\n\t-D ==> human friendly Device Tree Blob 'name'"
@@ -37,10 +38,11 @@ usage() {
FDTNUM=1
ROOTFSNUM=1
+INITRDNUM=1
HASH=sha1
LOADABLES=
-while getopts ":A:a:c:C:D:d:e:f:k:n:o:v:r:S" OPTION
+while getopts ":A:a:c:C:D:d:e:f:i:k:n:o:v:r:S" OPTION
do
case $OPTION in
A ) ARCH=$OPTARG;;
@@ -51,6 +53,7 @@ do
d ) DTB=$OPTARG;;
e ) ENTRY_ADDR=$OPTARG;;
f ) COMPATIBLE=$OPTARG;;
+ i ) INITRD=$OPTARG;;
k ) KERNEL=$OPTARG;;
n ) FDTNUM=$OPTARG;;
o ) OUTPUT=$OPTARG;;
@@ -96,6 +99,27 @@ if [ -n "${DTB}" ]; then
FDT_PROP="fdt = \"fdt@$FDTNUM\";"
fi
+if [ -n "${INITRD}" ]; then
+ INITRD_NODE="
+ initrd@$INITRDNUM {
+ description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\";
+ ${COMPATIBLE_PROP}
+ data = /incbin/(\"${INITRD}\");
+ type = \"ramdisk\";
+ arch = \"${ARCH}\";
+ os = \"linux\";
+ hash@1 {
+ algo = \"crc32\";
+ };
+ hash@2 {
+ algo = \"${HASH}\";
+ };
+ };
+"
+ INITRD_PROP="ramdisk=\"initrd@${INITRDNUM}\";"
+fi
+
+
if [ -n "${ROOTFS}" ]; then
dd if="${ROOTFS}" of="${ROOTFS}.pagesync" bs=4096 conv=sync
ROOTFS_NODE="
@@ -141,6 +165,7 @@ DATA="/dts-v1/;
algo = \"$HASH\";
};
};
+${INITRD_NODE}
${FDT_NODE}
${ROOTFS_NODE}
};
@@ -153,6 +178,7 @@ ${ROOTFS_NODE}
${FDT_PROP}
${LOADABLES:+loadables = ${LOADABLES};}
${COMPATIBLE_PROP}
+ ${INITRD_PROP}
};
};
};"
diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index 78f77b16d5..4128d54461 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -33,6 +33,7 @@ sub target_config_features(@) {
/^fpu$/ and $ret .= "\tselect HAS_FPU\n";
/^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n";
/^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n";
+ /^seperate_ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n\tselect USES_SEPERATE_INITRAMFS\n";
/^powerpc64$/ and $ret .= "\tselect powerpc64\n";
/^nommu$/ and $ret .= "\tselect NOMMU\n";
/^mips16$/ and $ret .= "\tselect HAS_MIPS16\n";