diff --git a/initramfs/busybox/update b/initramfs/busybox/update deleted file mode 100755 index 59af085..0000000 --- a/initramfs/busybox/update +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Automatically determine the architecture we're building on: -if [ -z "$MYARCH" ]; then - case "$( uname -m )" in - i?86) export MYARCH=i486 ;; - arm*) export MYARCH=arm ;; - # Unless $MYARCH is already set, use uname -m for all other archs: - *) export MYARCH=$( uname -m ) ;; - esac -fi - -ln busybox-$MYARCH ./busybox -chmod a+x ./busybox diff --git a/initramfs/initramfs_create b/initramfs/initramfs_create index 2e061b9..eb865d9 100755 --- a/initramfs/initramfs_create +++ b/initramfs/initramfs_create @@ -35,13 +35,14 @@ copy_including_deps() rm -Rf $INITRAMFS mkdir -p $INITRAMFS/{bin,dev,etc,lib,lib64,mnt,proc,root,run,sbin,sys,tmp,usr,var/log} -rm busybox/busybox -cd busybox +cd static ./update cd .. -cp busybox/busybox $INITRAMFS/bin -busybox/busybox | grep , | grep -v Copyright | tr "," " " | while read LINE; do +cp static/{busybox,mount.ntfs-3g} $INITRAMFS/bin +chmod a+x $INITRAMFS/bin/{busybox,mount.ntfs-3g} + +$INITRAMFS/bin/busybox | grep , | grep -v Copyright | tr "," " " | while read LINE; do for TOOL in $LINE; do ln -s busybox $INITRAMFS/bin/$TOOL ln -s ../bin/busybox $INITRAMFS/sbin/$TOOL diff --git a/initramfs/busybox/busybox-i486 b/initramfs/static/busybox-i486 similarity index 100% rename from initramfs/busybox/busybox-i486 rename to initramfs/static/busybox-i486 diff --git a/initramfs/busybox/busybox-x86_64 b/initramfs/static/busybox-x86_64 similarity index 100% rename from initramfs/busybox/busybox-x86_64 rename to initramfs/static/busybox-x86_64 diff --git a/initramfs/static/mount.ntfs-3g-i486 b/initramfs/static/mount.ntfs-3g-i486 new file mode 100755 index 0000000..e7a8867 Binary files /dev/null and b/initramfs/static/mount.ntfs-3g-i486 differ diff --git a/initramfs/static/mount.ntfs-3g-x86_64 b/initramfs/static/mount.ntfs-3g-x86_64 new file mode 100755 index 0000000..e5104d6 Binary files /dev/null and b/initramfs/static/mount.ntfs-3g-x86_64 differ diff --git a/initramfs/static/update b/initramfs/static/update new file mode 100755 index 0000000..aa1b775 --- /dev/null +++ b/initramfs/static/update @@ -0,0 +1,26 @@ +#!/bin/bash + +# How to rebuild these static binaries: +# - using buildroot scripts +# - unpack buildroot in /usr/src +# - copy busybox config (generated by busybox bbconfig) to /usr/src/buildroot-source/package/busybox/busybox-1.20.x.config +# - cd /usr/src/buildroot-sources +# - make menuconfig +# - configure buildroot to compile static libraries, set target processor architecture, and so on +# - some manual tweaking is necessary so buildroot properly compiles ntfs-3g driver, sorry +# - make +# - find static binaries in /usr/src/buildroot-sources/output/target/bin/ etc +# + +# Automatically determine the architecture we're building on: +if [ -z "$MYARCH" ]; then + case "$( uname -m )" in + i?86) export MYARCH=i486 ;; + arm*) export MYARCH=arm ;; + # Unless $MYARCH is already set, use uname -m for all other archs: + *) export MYARCH=$( uname -m ) ;; + esac +fi + +ln -f busybox-$MYARCH ./busybox +ln -f mount.ntfs-3g-$MYARCH ./ntfs-3g diff --git a/livekitlib b/livekitlib index befa223..48d1acd 100644 --- a/livekitlib +++ b/livekitlib @@ -218,9 +218,8 @@ device_bestfs() PEEK="$(dd if="$1" bs=1k count=1 2>/dev/null | strings)" if [ "$(echo "$PEEK" | egrep -i "FAT[13][26]")" != "" ]; then echo "-t vfat" - # TODO: this will work only with fuse - # else if [ "$(echo "$PEEK" | egrep -i 'NTFS')" != "" ]; then - # echo "-t ntfs-3g" + else if [ "$(echo "$PEEK" | egrep -i 'NTFS')" != "" ]; then + echo "-t ntfs-3g" fi } @@ -265,7 +264,7 @@ find_data() DATA="$(find_data_try "$2")" if [ "$DATA" != "" ]; then echo "" >&2 - echo "- found in $(mounted_device "$DATA")" >&2 + echo "* found in $(mounted_device "$DATA")" >&2 echo "$DATA" return fi @@ -291,7 +290,7 @@ union_append_bundles() echo_green_star echo "Adding bundles to union" ls -1 "$1" | grep '.'$BEXT'$' | sort | while read BUNDLE; do - echo "- $BUNDLE" + echo "* $BUNDLE" mkdir -p "$2/$BUNDLE" mount -o loop -t squashfs "$1/$BUNDLE" "$2/$BUNDLE" mount -o remount,add:1:"$2/$BUNDLE" none "$3"