-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathassemble-app-bin.sh
More file actions
executable file
·60 lines (50 loc) · 1.77 KB
/
assemble-app-bin.sh
File metadata and controls
executable file
·60 lines (50 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
#
# This file was part of WDTV Tools (http://wdtvtools.sourceforge.net/).
# Copyright (C) 2009 Elmar Weber <[email protected]>
#
# adaptation to wdlxtv_optware by Denis Roio <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# assembly script for application images
appname=wdlxtv_optware
# no argument, create fresh
imagefile=./$appname.app.bin
loopdir=./$appname.app.loop
# create and fill in appdir
appdir=$appname.app
sudo rm -rf $appdir $imagefile $loopdir
mkdir -p $appdir
mkdir -p $appdir/bin
mkdir -p $appdir/etc/init.d
cp -v optware-*.sh $appdir/bin &&
cp -v wget $appdir/bin &&
cp -v ipkg.conf $appdir/etc &&
cp -v S99optware $appdir/etc/init.d &&
cp -v opt.tar.gz $appdir
chmod a+x $appdir/etc/init.d/S99optware &&
cp -v README $appdir &&
sudo chown -R root:root $appdir
dd if=/dev/zero of=$imagefile bs=1K count=1024 &&
/sbin/mkfs.ext3 -F $imagefile &&
/sbin/tune2fs -c 0 -i 0 $imagefile &&
mkdir -p $loopdir &&
sudo mount -o loop $imagefile $loopdir &&
sudo rm -rf $loopdir/lost+found &&
sudo cp -ra $appdir/* $loopdir/ &&
sudo chown root:root -R $loopdir &&
sudo umount $loopdir &&
sudo rm -rf $loopdir $appdir &&
sudo /sbin/fsck.ext3 $imagefile