Skip to content

Commit

Permalink
Small code adjustment and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zador-blood-stained committed Oct 14, 2016
1 parent 2b70f68 commit e3c0988
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ for line in "${buildlist[@]}"; do
unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
write_uboot_platform family_tweaks BOOTSCRIPT UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER UBOOT_TARGET \
MODULES MODULES_NEXT INITRD_ARCH
MODULES MODULES_NEXT INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE

read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
n=$[$n+1]
Expand Down
5 changes: 3 additions & 2 deletions configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ EXIT_PATCHING_ERROR="" # exit patching if failed
HOST="$BOARD" # set hostname to the board
CACHEDIR=$DEST/cache


[[ -z $ROOTFS_TYPE ]] && ROOTFS_TYPE=ext4 # default rootfs type is ext4
[[ "ext4 f2fs btrfs nfs fel" != *$ROOTFS_TYPE* ]] && exit_with_error "Unknown rootfs type" "$ROOTFS_TYPE"

Expand Down Expand Up @@ -54,7 +53,9 @@ OFFSET=1 # Bootloader space in MB (1 x 2048 = default)
ARCH=armhf
KERNEL_IMAGE_TYPE=zImage
SERIALCON=ttyS0
BOOTSIZE=0 # Mb size of boot partition

# WARNING: This option is deprecated
BOOTSIZE=0

if [[ -f $SRC/lib/config/sources/$LINUXFAMILY.conf ]]; then
source $SRC/lib/config/sources/$LINUXFAMILY.conf
Expand Down
13 changes: 2 additions & 11 deletions debootstrap-ng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -402,21 +402,12 @@ prepare_partitions()
fi
echo "tmpfs /tmp tmpfs defaults,nosuid 0 0" >> $CACHEDIR/sdcard/etc/fstab

# stage: create boot script
if [[ $ROOTFS_TYPE == nfs ]]; then
# copy script provided by user if exists
if [[ -f $SRC/userpatches/nfs-boot.cmd ]]; then
display_alert "Using custom NFS boot script" "userpatches/nfs-boot.cmd" "info"
cp $SRC/userpatches/nfs-boot.cmd $CACHEDIR/sdcard/boot/boot.cmd
else
cp $SRC/lib/scripts/nfs-boot.cmd.template $CACHEDIR/sdcard/boot/boot.cmd
fi
elif [[ $BOOTSIZE != 0 && -f $CACHEDIR/sdcard/boot/boot.cmd ]]; then
if [[ $ROOTFS_TYPE != nfs && $BOOTSIZE != 0 && -f $CACHEDIR/sdcard/boot/boot.cmd ]]; then
sed -i 's/mmcblk0p1/mmcblk0p2/' $CACHEDIR/sdcard/boot/boot.cmd
sed -i "s/rootfstype=ext4/rootfstype=$ROOTFS_TYPE/" $CACHEDIR/sdcard/boot/boot.cmd
fi

# recompile .cmd to .scr if needed
# recompile .cmd to .scr if boot.cmd exists
[[ -f $CACHEDIR/sdcard/boot/boot.cmd ]] && \
mkimage -C none -A arm -T script -d $CACHEDIR/sdcard/boot/boot.cmd $CACHEDIR/sdcard/boot/boot.scr > /dev/null 2>&1

Expand Down
14 changes: 14 additions & 0 deletions distributions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ install_common()
local bootscript_dst=${BOOTSCRIPT##*:}
cp $SRC/lib/config/bootscripts/$bootscript_src $CACHEDIR/sdcard/boot/$bootscript_dst

[[ -n $BOOTENV_FILE && -f $SRC/lib/config/bootenv/$BOOTENV_FILE ]] && \
cp $SRC/lib/config/bootenv/$BOOTENV_FILE $CACHEDIR/sdcard/boot/armbianEnv.txt

# TODO: modify $bootscript_dst or armbianEnv.txt to make NFS boot universal
# instead of copying sunxi-specific template
if [[ $ROOTFS_TYPE == nfs ]]; then
display_alert "Copying NFS boot script template"
if [[ -f $SRC/userpatches/nfs-boot.cmd ]]; then
cp $SRC/userpatches/nfs-boot.cmd $CACHEDIR/sdcard/boot/boot.cmd
else
cp $SRC/lib/scripts/nfs-boot.cmd.template $CACHEDIR/sdcard/boot/boot.cmd
fi
fi

# initial date for fake-hwclock
date -u '+%Y-%m-%d %H:%M:%S' > $CACHEDIR/sdcard/etc/fake-hwclock.data

Expand Down

0 comments on commit e3c0988

Please sign in to comment.