From b00012c72bc9479e93fbc23d97fbc3332bb81029 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Fri, 11 Mar 2016 21:20:57 +0300 Subject: [PATCH] Root on NFS related tweaks and fixes --- debootstrap-ng.sh | 3 +++ fel-load.sh | 5 +++++ scripts/fel-boot.cmd.template | 2 +- scripts/nfs-boot.cmd.template | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debootstrap-ng.sh b/debootstrap-ng.sh index 8a9988f338..46c51f537e 100644 --- a/debootstrap-ng.sh +++ b/debootstrap-ng.sh @@ -436,6 +436,9 @@ create_image() eval 'rsync -aHWh --exclude="/boot/*" --exclude="/dev/*" --exclude="/proc/*" --exclude="/run/*" --exclude="/tmp/*" \ --exclude="/sys/*" --info=progress2,stats1 $DEST/cache/sdcard/ $DEST/cache/mount/' else + # to prevent creating swap file on NFS share as it needs special kernel config option turned on + touch $DEST/cache/sdcard/var/swap + display_alert "Creating rootfs archive" "rootfs.tgz" "info" tar cp --directory=$DEST/cache/sdcard/ --exclude='./boot/*' --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \ --exclude='./sys/*' . | \ diff --git a/fel-load.sh b/fel-load.sh index 63a9b8332f..72eca4fd5b 100644 --- a/fel-load.sh +++ b/fel-load.sh @@ -40,6 +40,11 @@ fel_prepare_target() # kill /etc/fstab on target echo > $FEL_ROOTFS/etc/fstab + echo "tmpfs /tmp tmpfs defaults,rw,nosuid 0 0" >> $FEL_ROOTFS/etc/fstab + + # to prevent creating swap file + touch $FEL_ROOTFS/var/swap + if [[ -z $FEL_DTB_FILE ]]; then if [[ $BRANCH == default ]]; then # script.bin is either regular file or absolute symlink diff --git a/scripts/fel-boot.cmd.template b/scripts/fel-boot.cmd.template index 2bba5fa8e2..b6913bed51 100644 --- a/scripts/fel-boot.cmd.template +++ b/scripts/fel-boot.cmd.template @@ -1,7 +1,7 @@ setenv nfs_ip FEL_LOCAL_IP setenv nfs_root FEL_ROOTFS setenv branch BRANCH -setenv bootargs "console=ttyS0,115200 root=/dev/nfs nfsroot=${nfs_ip}:${nfs_root} ip=dhcp rw panic=10 consoleblank=0 enforcing=0 loglevel=6 rootflags=noatime,nodiratime" +setenv bootargs "console=tty1 console=ttyS0,115200 root=/dev/nfs nfsroot=${nfs_ip}:${nfs_root} ip=dhcp rw panic=10 consoleblank=0 enforcing=0 loglevel=6 rootflags=noatime,nodiratime" if test ${branch} != default; then setenv fdt_high ffffffff bootz ${kernel_addr_r} - ${fdt_addr_r} diff --git a/scripts/nfs-boot.cmd.template b/scripts/nfs-boot.cmd.template index a48d5f77be..55e50aa7a9 100644 --- a/scripts/nfs-boot.cmd.template +++ b/scripts/nfs-boot.cmd.template @@ -3,7 +3,7 @@ #setenv nfs_root 192.168.0.2:/mnt/nfsroot -setenv bootargs "console=ttyS0,115200 root=/dev/nfs ip=dhcp rw rootflags=noatime,nodiratime disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=6" +setenv bootargs "console=tty1 console=ttyS0,115200 root=/dev/nfs ip=dhcp rw rootflags=noatime,nodiratime disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=6" if test -n ${nfs_root}; then setenv bootargs "${bootargs} nfsroot=${nfs_root}"