mirror of
git://soft.sys114.com/odroid-stamper
synced 2025-12-19 00:18:42 +09:00
Signed-off-by: Dongjin Kim <tobetter@gmail.com> Change-Id: I8ac07f3febf9d0575d8cddb53e7b2eb1f6b3742c
36 lines
877 B
Bash
Executable File
36 lines
877 B
Bash
Executable File
#!/bin/bash
|
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
|
|
|
. /lib/init/vars.sh
|
|
. /lib/lsb/init-functions
|
|
|
|
rootdev=`blkid -U @@UUID_ROOTFS@@`
|
|
|
|
case ${rootdev} in
|
|
/dev/mmcblk* | /dev/nvme*)
|
|
dev=${rootdev%??} ;;
|
|
*) dev=${rootdev%?} ;;
|
|
esac
|
|
|
|
lba_start=`fdisk -l ${dev} | grep p2 | awk '{print $2}'`
|
|
lba_finish=$((`fdisk -l ${dev} | grep Disk | grep sectors | awk '{printf $7}'` - 1))
|
|
|
|
echo -e "p\nd\n2\nn\np\n2\n${lba_start}\n${lba_finish}\np\nw\n" | \
|
|
fdisk ${dev} >/dev/null
|
|
partprobe
|
|
resize2fs ${rootdev}
|
|
|
|
rm -f /etc/ssh/ssh_host* && ssh-keygen -A
|
|
|
|
for sshd_config in /etc/ssh/sshd_config \
|
|
/etc/ssh/sshd_config.d/60-cloudimg-settings.conf; do
|
|
sed -i "s/^PasswordAuthentication.*/PasswordAuthentication yes/g" ${sshd_config}
|
|
done
|
|
sed -i "s/^KbdInteractiveAuthentication.*/KbdInteractiveAuthentication yes/g" /etc/ssh/sshd_config
|
|
|
|
systemctl enable ssh
|
|
systemctl restart ssh
|
|
|
|
exit 0
|