Skip to content

Commit

Permalink
add setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
bamarni committed Mar 7, 2017
1 parent 675a46d commit 214b449
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion boot/cmdline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait init=/root/init_setup.sh
21 changes: 21 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ EOL
useradd -s /bin/bash --create-home -p $(perl -e 'print crypt("raspberry", "password")') pi
echo "pi ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/010_pi-nopasswd
cat > /root/init_setup.sh <<EOL
#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sys /sys
mount /boot
mount -o remount,rw /
parted /dev/mmcblk0 u s resizepart 2 \\\$(expr \\\$(cat /sys/block/mmcblk0/size) - 1)
resize2fs /dev/mmcblk0p2
sed -i 's| init=/root/init_setup.sh||' /boot/cmdline.txt
sync
echo 1 > /proc/sys/kernel/sysrq
rm /root/init_setup.sh
echo b > /proc/sysrq-trigger
EOL
chmod +x /root/init_setup.sh
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
Expand Down
2 changes: 1 addition & 1 deletion multistrap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ debootstrap=Debian
aptsources=Debian

[Debian]
packages=apt kmod dialog netbase net-tools ethtool iproute iputils-ping ifupdown isc-dhcp-client sudo ssh avahi-daemon vim
packages=apt kmod dialog netbase net-tools ethtool iproute iputils-ping ifupdown isc-dhcp-client sudo ssh avahi-daemon vim parted
source=http://deb.debian.org/debian/
keyring=debian-archive-keyring
suite=jessie

0 comments on commit 214b449

Please sign in to comment.