forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some scripts to recreate packages from an installed OpenWRT tree
- Loading branch information
1 parent
d03f3dc
commit a27122f
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
root_dir=$1 | ||
destination=$2 | ||
|
||
for package in ${root_dir}/usr/lib/opkg/info/*.list | ||
do | ||
echo ${package} | ||
./ipkg-build-from-installed ${package::-5} ${destination} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh | ||
|
||
# Create directory from installed package and build it | ||
|
||
set -e | ||
usage="Usage: $0 [-v] [-h] [-m] <pkg_path> [<destination_directory>]" | ||
case $# in | ||
1) | ||
dest_dir=$PWD | ||
;; | ||
2) | ||
dest_dir=$2 | ||
if [ "$dest_dir" = "." ] || [ "$dest_dir" = "./" ] ; then | ||
dest_dir=$PWD | ||
fi | ||
;; | ||
*) | ||
echo "$usage" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
tmp_dir=${dest_dir}/$(basename ${0}).$$ | ||
|
||
# This will be usr/lib/opkg/info/package[,.list,.control] | ||
input_file="$(realpath "${1}")" | ||
root_dir=$(dirname ${input_file})/../../../.. | ||
|
||
mkdir -p ${tmp_dir}/CONTROL | ||
cp ${input_file}.control ${tmp_dir}/CONTROL/control | ||
|
||
prev_dir=${PWD} | ||
cd ${root_dir} | ||
while read line | ||
do | ||
echo ${line} | ||
echo ${tmp_dir} | ||
cp -a --parents .${line} ${tmp_dir}/ | ||
done < ${input_file}.list | ||
cd ${prev_dir} | ||
|
||
./ipkg-build ${tmp_dir} ${dest_dir} | ||
rm -r ${tmp_dir} |