|
@@ -115,7 +115,9 @@ print_help() {
|
|
|
are desired, they must precede the device name.
|
|
|
|
|
|
If the board has an eMMC, it may be used as the target device instead of
|
|
|
- an SD card." | less
|
|
|
+ an SD card. Depending on your platform, you may need to run ‘armbian-config’
|
|
|
+ and select ‘Install to internal storage’ -> ‘Install/Update the bootloader
|
|
|
+ on eMMC’ to enable booting from the eMMC" | less
|
|
|
}
|
|
|
|
|
|
pause() {
|
|
@@ -248,7 +250,7 @@ check_sdcard_name_and_params() {
|
|
|
if [ "$non_removable" ]; then warn " $non_removable"; fi
|
|
|
if [ "$nodos" ]; then warn " $nodos"; fi
|
|
|
if [ "$oversize" ]; then warn " $oversize"; fi
|
|
|
- _user_confirm ' Are you sure this is the correct device of your blank SD card?' 'no'
|
|
|
+ _user_confirm ' Are you sure this is the device you want to install on?' 'no'
|
|
|
fi
|
|
|
SDCARD_DEVNAME=${dev:5}
|
|
|
[ "${SDCARD_DEVNAME%[0-9]}" == $SDCARD_DEVNAME ] || part_sep='p'
|
|
@@ -919,14 +921,39 @@ copy_etc_files() {
|
|
|
}
|
|
|
|
|
|
_set_target_vars() {
|
|
|
+
|
|
|
target_distro=$(chroot $TARGET_ROOT 'lsb_release' '--short' '--codename')
|
|
|
target_kernel=$(chroot $TARGET_ROOT 'ls' '/boot' | egrep '^vmlinu[xz]')
|
|
|
target_armbian_keyring_signed=
|
|
|
+
|
|
|
case $target_distro in
|
|
|
- bionic|buster|focal) eth_dev='eth0' dropbear_dir='/etc/dropbear-initramfs' dropbear_conf='config' ;;
|
|
|
- bullseye|jammy) eth_dev='eth0' dropbear_dir='/etc/dropbear/initramfs' dropbear_conf='config' ;;
|
|
|
- bookworm|noble|*) eth_dev='end0' dropbear_dir='/etc/dropbear/initramfs' dropbear_conf='dropbear.conf' target_armbian_keyring_signed='y' ;;
|
|
|
+ bionic|buster|focal)
|
|
|
+ eth_dev='eth0'
|
|
|
+ dropbear_dir='/etc/dropbear-initramfs'
|
|
|
+ dropbear_conf='config' ;;
|
|
|
+ bullseye|jammy)
|
|
|
+ eth_dev='eth0'
|
|
|
+ dropbear_dir='/etc/dropbear/initramfs'
|
|
|
+ dropbear_conf='config' ;;
|
|
|
+ bookworm|noble|*)
|
|
|
+ eth_dev='end0'
|
|
|
+ dropbear_dir='/etc/dropbear/initramfs'
|
|
|
+ dropbear_conf='dropbear.conf'
|
|
|
+ target_armbian_keyring_signed='y' ;;
|
|
|
esac
|
|
|
+
|
|
|
+ local net_dev
|
|
|
+ for net_dev in eth0 end0 enp1s0 enp2s0; do
|
|
|
+ if ip -br link | grep -q ^$net_dev; then
|
|
|
+ host_eth_dev=$net_dev
|
|
|
+ break
|
|
|
+ fi
|
|
|
+ done
|
|
|
+
|
|
|
+ [ "$host_eth_dev" ] || die 'Unable to find default wired network device'
|
|
|
+
|
|
|
+ _distros_match && eth_dev=$host_eth_dev
|
|
|
+
|
|
|
imsg "$(printf '%-8s %-28s %s' '' 'Host' 'Target')"
|
|
|
imsg "$(printf '%-8s %-28s %s' '' '----' '------')"
|
|
|
imsg "$(printf '%-8s %-28s %s' 'distro:' $host_distro $target_distro)"
|
|
@@ -980,8 +1007,7 @@ _display_file() {
|
|
|
}
|
|
|
|
|
|
edit_armbianEnv() {
|
|
|
- local file text console_arg
|
|
|
- file="$TARGET_ROOT/boot/armbianEnv.txt"
|
|
|
+ local file=$TARGET_ROOT/$1 text console_arg
|
|
|
ed $file <<-'EOF'
|
|
|
g/^\s*rootdev=/d
|
|
|
g/^\s*console=/d
|
|
@@ -998,6 +1024,32 @@ edit_armbianEnv() {
|
|
|
console=$console_arg
|
|
|
bootlogo=false"
|
|
|
echo "$text" >> $file
|
|
|
+
|
|
|
+ _display_file $file
|
|
|
+}
|
|
|
+
|
|
|
+edit_extlinux_conf() {
|
|
|
+ local file=$TARGET_ROOT/$1 text console_arg
|
|
|
+ /bin/cp $SRC_ROOT/$1 $TARGET_ROOT/$1
|
|
|
+
|
|
|
+ case $SERIAL_CONSOLE in
|
|
|
+ 'yes') console_pat='console=tty1' ;;
|
|
|
+ *) console_pat='console=ttyS\S+' ;;
|
|
|
+ esac
|
|
|
+
|
|
|
+ ed --extended-regexp $file <<-EOF
|
|
|
+ s/root=\S+/root=\/dev\/mapper\/$ROOTFS_NAME/
|
|
|
+ s/$console_pat *//
|
|
|
+ wq
|
|
|
+ EOF
|
|
|
+
|
|
|
+ if grep -q 'splash plymouth' $file; then
|
|
|
+ ed --extended-regexp $file <<-EOF
|
|
|
+ s/splash plymouth\S+/splash=verbose/
|
|
|
+ wq
|
|
|
+ EOF
|
|
|
+ fi
|
|
|
+
|
|
|
_display_file $file
|
|
|
}
|
|
|
|
|
@@ -1157,10 +1209,10 @@ exit 0'
|
|
|
# begin chroot functions:
|
|
|
|
|
|
apt_remove_target_pkgs() {
|
|
|
- set +e
|
|
|
- if [ "$IP_ADDRESS" == 'none' ]; then apt --yes purge 'dropbear-initramfs'; fi
|
|
|
- apt --yes purge 'bash-completion' 'command-not-found'
|
|
|
- set -e
|
|
|
+ if [ "$IP_ADDRESS" == 'none' ]; then
|
|
|
+ apt --yes purge 'dropbear-initramfs' || :
|
|
|
+ fi
|
|
|
+ apt --yes purge 'bash-completion' 'command-not-found' || :
|
|
|
}
|
|
|
|
|
|
apt_install_target_pkgs() {
|
|
@@ -1238,7 +1290,15 @@ configure_target() {
|
|
|
netman_manage_usb0
|
|
|
ifupdown_config_usb0
|
|
|
[ "$IP_ADDRESS" == 'none' ] || create_cryptroot_unlock_sh
|
|
|
- edit_armbianEnv
|
|
|
+ armbian_env="boot/armbianEnv.txt"
|
|
|
+ extlinux_conf="boot/extlinux/extlinux.conf"
|
|
|
+ if [ -e $SRC_ROOT/$armbian_env ]; then
|
|
|
+ edit_armbianEnv $armbian_env
|
|
|
+ elif [ -e $SRC_ROOT/$extlinux_conf ]; then
|
|
|
+ edit_extlinux_conf $extlinux_conf
|
|
|
+ else
|
|
|
+ die "could not find $SRC_ROOT/$armbian_env or $SRC_ROOT/$extlinux_conf"
|
|
|
+ fi
|
|
|
_debug_pause
|
|
|
|
|
|
_show_output # this must be done before entering chroot
|