Compare commits
2 Commits
cbb3f9f229
...
6974e1e9ee
Author | SHA1 | Date | |
---|---|---|---|
6974e1e9ee | |||
234930572e |
21
install.sh
21
install.sh
@ -9,10 +9,23 @@ log() {
|
|||||||
printf '%s\n' "$1" > /dev/stderr
|
printf '%s\n' "$1" > /dev/stderr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_deps() {
|
||||||
|
if ! rpm -q squashfs-tools > /dev/null; then
|
||||||
|
log "squashfs-tools package not found. Installing..."
|
||||||
|
pkcon -y install squashfs-tools
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
backup() {
|
||||||
|
orig_image="$WORKDIR/system.img.orig.$(date +%Y%m%dT%H%M%S)"
|
||||||
|
cp "$SYSTEM_IMG" "$orig_image"
|
||||||
|
log "Copying original image $SYSTEM_IMG to $orig_image"
|
||||||
|
}
|
||||||
|
|
||||||
extract_image() {
|
extract_image() {
|
||||||
|
|
||||||
if [ ! -f "$SYSTEM_IMG" ]; then
|
if [ ! -f "$orig_image" ]; then
|
||||||
log "$SYSTEM_IMG not found"
|
log "$orig_image not found"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
unsquashfs -dest "$SQUASHFS_ROOT/" "$SYSTEM_IMG"
|
unsquashfs -dest "$SQUASHFS_ROOT/" "$SYSTEM_IMG"
|
||||||
@ -35,6 +48,9 @@ systemctl stop aliendalvik
|
|||||||
mkdir -p "$WORKDIR"
|
mkdir -p "$WORKDIR"
|
||||||
mkdir -p "$TMPWORKDIR"
|
mkdir -p "$TMPWORKDIR"
|
||||||
|
|
||||||
|
install_deps
|
||||||
|
backup
|
||||||
|
log "backup done"
|
||||||
extract_image
|
extract_image
|
||||||
log "image was extracted"
|
log "image was extracted"
|
||||||
log "install patch"
|
log "install patch"
|
||||||
@ -45,5 +61,4 @@ log "image was built"
|
|||||||
|
|
||||||
rmdir "$TMPWORKDIR"
|
rmdir "$TMPWORKDIR"
|
||||||
|
|
||||||
set_traps -
|
|
||||||
exit 0
|
exit 0
|
Loading…
Reference in New Issue
Block a user