2018-04-30 16:57:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#remaster lib
|
2018-05-07 00:56:46 +00:00
|
|
|
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
|
2018-04-30 16:57:01 +00:00
|
|
|
|
|
|
|
#filesystem_pack [chroot_path] [filesystem_img_destination]
|
|
|
|
function filesystem_pack() {
|
|
|
|
echo "pack filesystem ..."
|
|
|
|
|
|
|
|
#$1 = chroot_path
|
|
|
|
#$2 = filesystem_img_destination
|
|
|
|
chroot_path="$1"
|
|
|
|
filesystem_img_destination="$2"
|
|
|
|
filesystem_log="`mktemp`"
|
|
|
|
|
|
|
|
#Überfrüfen der Parameter
|
|
|
|
[ -d "$chroot_path" ] || {
|
|
|
|
echo "### ERROR ### filesystem_extract: chroot_path \"$chroot_path\" not exist!"
|
|
|
|
return 12
|
|
|
|
}
|
|
|
|
|
|
|
|
#loslegen ...
|
|
|
|
rm -f "$filesystem_img_destination"
|
|
|
|
mksquashfs "$chroot_path" "$filesystem_img_destination" > "$filesystem_log" || {
|
|
|
|
echo "### ERROR ### filesystem_pack: mksquashfs failed!"
|
|
|
|
return 13
|
|
|
|
}
|
|
|
|
|
|
|
|
grep -v "\[" "$filesystem_log"
|
|
|
|
rm "$filesystem_log"
|
|
|
|
|
|
|
|
echo "done"
|
|
|
|
}
|
2018-05-10 15:13:19 +00:00
|
|
|
|
|
|
|
[ -n "$1" ] && {
|
|
|
|
echo param
|
|
|
|
$1
|
|
|
|
}
|