mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +00:00
busybox: use unified /usr
This commit is contained in:
parent
169d9e2bd4
commit
725ea4f977
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated make config: don't edit
|
||||||
# Busybox version: 1.25.0
|
# Busybox version: 1.25.1
|
||||||
# Wed Jul 20 11:53:10 2016
|
# Thu Nov 24 23:29:54 2016
|
||||||
#
|
#
|
||||||
CONFIG_HAVE_DOT_CONFIG=y
|
CONFIG_HAVE_DOT_CONFIG=y
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ CONFIG_FEATURE_VERBOSE_USAGE=y
|
|||||||
# CONFIG_FEATURE_COMPRESS_USAGE is not set
|
# CONFIG_FEATURE_COMPRESS_USAGE is not set
|
||||||
CONFIG_BUSYBOX=y
|
CONFIG_BUSYBOX=y
|
||||||
# CONFIG_FEATURE_INSTALLER is not set
|
# CONFIG_FEATURE_INSTALLER is not set
|
||||||
# CONFIG_INSTALL_NO_USR is not set
|
CONFIG_INSTALL_NO_USR=y
|
||||||
# CONFIG_LOCALE_SUPPORT is not set
|
# CONFIG_LOCALE_SUPPORT is not set
|
||||||
CONFIG_UNICODE_SUPPORT=y
|
CONFIG_UNICODE_SUPPORT=y
|
||||||
# CONFIG_UNICODE_USING_LOCALE is not set
|
# CONFIG_UNICODE_USING_LOCALE is not set
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated make config: don't edit
|
||||||
# Busybox version: 1.25.0
|
# Busybox version: 1.25.1
|
||||||
# Wed Jul 20 11:54:40 2016
|
# Thu Nov 24 23:26:05 2016
|
||||||
#
|
#
|
||||||
CONFIG_HAVE_DOT_CONFIG=y
|
CONFIG_HAVE_DOT_CONFIG=y
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ configure_target() {
|
|||||||
cp $BUSYBOX_CFG_FILE_TARGET .config
|
cp $BUSYBOX_CFG_FILE_TARGET .config
|
||||||
|
|
||||||
# set install dir
|
# set install dir
|
||||||
sed -i -e "s|^CONFIG_PREFIX=.*$|CONFIG_PREFIX=\"$INSTALL\"|" .config
|
sed -i -e "s|^CONFIG_PREFIX=.*$|CONFIG_PREFIX=\"$INSTALL/usr\"|" .config
|
||||||
|
|
||||||
if [ ! "$DEVTOOLS" = yes ]; then
|
if [ ! "$DEVTOOLS" = yes ]; then
|
||||||
sed -i -e "s|^CONFIG_DEVMEM=.*$|# CONFIG_DEVMEM is not set|" .config
|
sed -i -e "s|^CONFIG_DEVMEM=.*$|# CONFIG_DEVMEM is not set|" .config
|
||||||
@ -134,7 +134,7 @@ configure_init() {
|
|||||||
cp $BUSYBOX_CFG_FILE_INIT .config
|
cp $BUSYBOX_CFG_FILE_INIT .config
|
||||||
|
|
||||||
# set install dir
|
# set install dir
|
||||||
sed -i -e "s|^CONFIG_PREFIX=.*$|CONFIG_PREFIX=\"$INSTALL\"|" .config
|
sed -i -e "s|^CONFIG_PREFIX=.*$|CONFIG_PREFIX=\"$INSTALL/usr\"|" .config
|
||||||
|
|
||||||
# optimize for size
|
# optimize for size
|
||||||
CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-Os|"`
|
CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-Os|"`
|
||||||
@ -160,7 +160,6 @@ makeinstall_target() {
|
|||||||
cp $PKG_DIR/scripts/apt-get $INSTALL/usr/bin/
|
cp $PKG_DIR/scripts/apt-get $INSTALL/usr/bin/
|
||||||
cp $PKG_DIR/scripts/passwd $INSTALL/usr/bin/
|
cp $PKG_DIR/scripts/passwd $INSTALL/usr/bin/
|
||||||
cp $PKG_DIR/scripts/sudo $INSTALL/usr/bin/
|
cp $PKG_DIR/scripts/sudo $INSTALL/usr/bin/
|
||||||
ln -sf /bin/busybox $INSTALL/usr/bin/env #/usr/bin/env is needed for most python scripts
|
|
||||||
cp $PKG_DIR/scripts/pastebinit $INSTALL/usr/bin/
|
cp $PKG_DIR/scripts/pastebinit $INSTALL/usr/bin/
|
||||||
ln -sf pastebinit $INSTALL/usr/bin/paste
|
ln -sf pastebinit $INSTALL/usr/bin/paste
|
||||||
|
|
||||||
@ -191,10 +190,6 @@ makeinstall_target() {
|
|||||||
# create /etc/hostname
|
# create /etc/hostname
|
||||||
ln -sf /proc/sys/kernel/hostname $INSTALL/etc/hostname
|
ln -sf /proc/sys/kernel/hostname $INSTALL/etc/hostname
|
||||||
|
|
||||||
# systemd wants /usr/bin/mkdir
|
|
||||||
mkdir -p $INSTALL/usr/bin
|
|
||||||
ln -sf /bin/busybox $INSTALL/usr/bin/mkdir
|
|
||||||
|
|
||||||
# add webroot
|
# add webroot
|
||||||
mkdir -p $INSTALL/usr/www
|
mkdir -p $INSTALL/usr/www
|
||||||
echo "It works" > $INSTALL/usr/www/index.html
|
echo "It works" > $INSTALL/usr/www/index.html
|
||||||
@ -206,7 +201,7 @@ makeinstall_target() {
|
|||||||
post_install() {
|
post_install() {
|
||||||
ROOT_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $ROOT_PASSWORD`"
|
ROOT_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $ROOT_PASSWORD`"
|
||||||
|
|
||||||
echo "chmod 4755 $INSTALL/bin/busybox" >> $FAKEROOT_SCRIPT
|
echo "chmod 4755 $INSTALL/usr/bin/busybox" >> $FAKEROOT_SCRIPT
|
||||||
echo "chmod 000 $INSTALL/etc/shadow" >> $FAKEROOT_SCRIPT
|
echo "chmod 000 $INSTALL/etc/shadow" >> $FAKEROOT_SCRIPT
|
||||||
|
|
||||||
add_user root "$ROOT_PWD" 0 0 "Root User" "/storage" "/bin/sh"
|
add_user root "$ROOT_PWD" 0 0 "Root User" "/storage" "/bin/sh"
|
||||||
@ -237,8 +232,8 @@ post_install() {
|
|||||||
|
|
||||||
makeinstall_init() {
|
makeinstall_init() {
|
||||||
mkdir -p $INSTALL/bin
|
mkdir -p $INSTALL/bin
|
||||||
ln -sf busybox $INSTALL/bin/sh
|
ln -sf busybox $INSTALL/usr/bin/sh
|
||||||
chmod 4755 $INSTALL/bin/busybox
|
chmod 4755 $INSTALL/usr/bin/busybox
|
||||||
|
|
||||||
mkdir -p $INSTALL/etc
|
mkdir -p $INSTALL/etc
|
||||||
touch $INSTALL/etc/fstab
|
touch $INSTALL/etc/fstab
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
export HOME="/storage"
|
export HOME="/storage"
|
||||||
export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
|
export PATH="/usr/bin:/usr/sbin"
|
||||||
export LD_LIBRARY_PATH="/usr/lib:/lib"
|
export LD_LIBRARY_PATH="/usr/lib"
|
||||||
export HOSTNAME=`cat /etc/hostname`
|
export HOSTNAME=`cat /etc/hostname`
|
||||||
export PS1="\[\e[1;32m\]\h\[\e[1;32m\]:\[\e[1;34m\]\w \[\e[0m\]\\$ "
|
export PS1="\[\e[1;32m\]\h\[\e[1;32m\]:\[\e[1;34m\]\w \[\e[0m\]\\$ "
|
||||||
# k0p
|
# k0p
|
||||||
|
@ -21,24 +21,24 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# create directories
|
# create directories
|
||||||
/bin/busybox mkdir -p /dev
|
/usr/bin/busybox mkdir -p /dev
|
||||||
/bin/busybox mkdir -p /proc
|
/usr/bin/busybox mkdir -p /proc
|
||||||
/bin/busybox mkdir -p /sys
|
/usr/bin/busybox mkdir -p /sys
|
||||||
/bin/busybox mkdir -p /tmp
|
/usr/bin/busybox mkdir -p /tmp
|
||||||
/bin/busybox mkdir -p /flash
|
/usr/bin/busybox mkdir -p /flash
|
||||||
/bin/busybox mkdir -p /sysroot
|
/usr/bin/busybox mkdir -p /sysroot
|
||||||
/bin/busybox mkdir -p /storage
|
/usr/bin/busybox mkdir -p /storage
|
||||||
|
|
||||||
# mount all needed special filesystems
|
# mount all needed special filesystems
|
||||||
/bin/busybox mount -t devtmpfs devtmpfs /dev
|
/usr/bin/busybox mount -t devtmpfs devtmpfs /dev
|
||||||
/bin/busybox mount -t proc proc /proc
|
/usr/bin/busybox mount -t proc proc /proc
|
||||||
/bin/busybox mount -t sysfs sysfs /sys
|
/usr/bin/busybox mount -t sysfs sysfs /sys
|
||||||
|
|
||||||
# common functions
|
# common functions
|
||||||
. /functions
|
. /functions
|
||||||
|
|
||||||
# set needed variables
|
# set needed variables
|
||||||
MODULE_DIR=/lib/modules
|
MODULE_DIR=/usr/lib/modules
|
||||||
|
|
||||||
UPDATE_ROOT=/storage/.update
|
UPDATE_ROOT=/storage/.update
|
||||||
UPDATE_DIR="$UPDATE_ROOT"
|
UPDATE_DIR="$UPDATE_ROOT"
|
||||||
@ -271,19 +271,19 @@
|
|||||||
ISCSI_DEV="${1##*,}"
|
ISCSI_DEV="${1##*,}"
|
||||||
ISCSI_OPTIONS="${1%,*}"
|
ISCSI_OPTIONS="${1%,*}"
|
||||||
|
|
||||||
if [ ! -f "/sbin/iscsistart" ]; then
|
if [ ! -f "/usr/sbin/iscsistart" ]; then
|
||||||
error "iscsistart" "iSCSI support not available"
|
error "iscsistart" "iSCSI support not available"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$ISCSI_OPTIONS" = "auto" ]; then
|
if [ "$ISCSI_OPTIONS" = "auto" ]; then
|
||||||
progress "Network configuration based on iBFT"
|
progress "Network configuration based on iBFT"
|
||||||
/sbin/iscsistart -N >&$SILENT_OUT 2>&1 || \
|
/usr/sbin/iscsistart -N >&$SILENT_OUT 2>&1 || \
|
||||||
error "iscsistart" "Unable to configure network"
|
error "iscsistart" "Unable to configure network"
|
||||||
progress "iSCSI auto connect based on iBFT"
|
progress "iSCSI auto connect based on iBFT"
|
||||||
/sbin/iscsistart -b >&$SILENT_OUT 2>&1 || \
|
/usr/sbin/iscsistart -b >&$SILENT_OUT 2>&1 || \
|
||||||
error "iscsistart" "Unable to auto connect"
|
error "iscsistart" "Unable to auto connect"
|
||||||
else
|
else
|
||||||
/sbin/iscsistart $(get_iscsistart_options "$ISCSI_OPTIONS") >&$SILENT_OUT 2>&1 || \
|
/usr/sbin/iscsistart $(get_iscsistart_options "$ISCSI_OPTIONS") >&$SILENT_OUT 2>&1 || \
|
||||||
error "iscsistart" "Unable to connect to ISCSI target"
|
error "iscsistart" "Unable to connect to ISCSI target"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -554,16 +554,16 @@
|
|||||||
sync
|
sync
|
||||||
|
|
||||||
# unmount filesystems
|
# unmount filesystems
|
||||||
if /bin/busybox mountpoint -q /flash ; then
|
if /usr/bin/busybox mountpoint -q /flash ; then
|
||||||
/bin/busybox umount /flash
|
/usr/bin/busybox umount /flash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if /bin/busybox mountpoint -q /storage ; then
|
if /usr/bin/busybox mountpoint -q /storage ; then
|
||||||
/bin/busybox umount /storage
|
/usr/bin/busybox umount /storage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
usleep 2000000
|
usleep 2000000
|
||||||
/bin/busybox reboot
|
/usr/bin/busybox reboot
|
||||||
}
|
}
|
||||||
|
|
||||||
force_fsck() {
|
force_fsck() {
|
||||||
@ -577,7 +577,7 @@
|
|||||||
if [ "$?" -ne "0" -o "$?" -gt "128" ] ; then
|
if [ "$?" -ne "0" -o "$?" -gt "128" ] ; then
|
||||||
echo "Repairing filesystem..."
|
echo "Repairing filesystem..."
|
||||||
echo ""
|
echo ""
|
||||||
/sbin/fsck -T -M -y $RUN_FSCK_DISKS
|
/usr/sbin/fsck -T -M -y $RUN_FSCK_DISKS
|
||||||
FSCK_RET="$?"
|
FSCK_RET="$?"
|
||||||
if [ "$(( $FSCK_RET & 8 ))" = 8 ] ; then
|
if [ "$(( $FSCK_RET & 8 ))" = 8 ] ; then
|
||||||
# fubar
|
# fubar
|
||||||
@ -601,7 +601,7 @@
|
|||||||
check_disks() {
|
check_disks() {
|
||||||
if [ "$RUN_FSCK" = "yes" -a -n "$RUN_FSCK_DISKS" ]; then
|
if [ "$RUN_FSCK" = "yes" -a -n "$RUN_FSCK_DISKS" ]; then
|
||||||
progress "Checking disk(s): $RUN_FSCK_DISKS"
|
progress "Checking disk(s): $RUN_FSCK_DISKS"
|
||||||
/sbin/fsck -T -M -p -a $RUN_FSCK_DISKS > /dev/null 2>&1
|
/usr/sbin/fsck -T -M -p -a $RUN_FSCK_DISKS > /dev/null 2>&1
|
||||||
FSCK_RET="$?"
|
FSCK_RET="$?"
|
||||||
|
|
||||||
# FSCK_RET is the bit-wise OR of the exit codes for each filesystem that is checked.
|
# FSCK_RET is the bit-wise OR of the exit codes for each filesystem that is checked.
|
||||||
@ -991,7 +991,7 @@
|
|||||||
mount --move /flash /sysroot/flash
|
mount --move /flash /sysroot/flash
|
||||||
mount --move /storage /sysroot/storage
|
mount --move /storage /sysroot/storage
|
||||||
|
|
||||||
if [ ! -d "/sysroot/lib/modules/$(uname -r)/" -a -f "/sysroot/usr/lib/systemd/systemd" ]; then
|
if [ ! -d "/sysroot/usr/lib/modules/$(uname -r)/" -a -f "/sysroot/usr/lib/systemd/systemd" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "NEVER TOUCH boot= in extlinux.conf / cmdline.txt!"
|
echo "NEVER TOUCH boot= in extlinux.conf / cmdline.txt!"
|
||||||
echo "If you don't know what you are doing,"
|
echo "If you don't know what you are doing,"
|
||||||
@ -1040,10 +1040,10 @@
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# move some special filesystems
|
# move some special filesystems
|
||||||
/bin/busybox mount --move /dev /sysroot/dev
|
/usr/bin/busybox mount --move /dev /sysroot/dev
|
||||||
/bin/busybox mount --move /proc /sysroot/proc
|
/usr/bin/busybox mount --move /proc /sysroot/proc
|
||||||
/bin/busybox mount --move /sys /sysroot/sys
|
/usr/bin/busybox mount --move /sys /sysroot/sys
|
||||||
/bin/busybox rm -fr /tmp
|
/usr/bin/busybox rm -fr /tmp
|
||||||
|
|
||||||
# tell OE settings addon to disable updates
|
# tell OE settings addon to disable updates
|
||||||
if [ "$UPDATE_DISABLED" = "yes" ] ; then
|
if [ "$UPDATE_DISABLED" = "yes" ] ; then
|
||||||
@ -1068,6 +1068,6 @@
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# switch to new sysroot and start real init
|
# switch to new sysroot and start real init
|
||||||
exec /bin/busybox switch_root /sysroot /usr/lib/systemd/systemd $INIT_ARGS $INIT_UNIT
|
exec /usr/bin/busybox switch_root /sysroot /usr/lib/systemd/systemd $INIT_ARGS $INIT_UNIT
|
||||||
|
|
||||||
error "switch_root" "Error in initramfs. Could not switch to new root"
|
error "switch_root" "Error in initramfs. Could not switch to new root"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user