sdinstall-rp: make other fixes and install in /usr/sbin

This commit is contained in:
Silvan Calarco 2012-10-16 15:48:23 +02:00
parent 006df4c5be
commit 9e0800f9b4
2 changed files with 18 additions and 5 deletions

View File

@ -56,6 +56,7 @@ install-dirs:
install: install-dirs install-locales install: install-dirs install-locales
$(INSTALL_PROGRAM) src/usbinstall.py $(DESTDIR)$(mambadir)/usbinstall/usbinstall.py $(INSTALL_PROGRAM) src/usbinstall.py $(DESTDIR)$(mambadir)/usbinstall/usbinstall.py
$(INSTALL_SCRIPT) src/usbinstall.sh $(DESTDIR)$(sbindir)/usbinstall $(INSTALL_SCRIPT) src/usbinstall.sh $(DESTDIR)$(sbindir)/usbinstall
$(INSTALL_SCRIPT) src/sdinstall-rpi.sh $(DESTDIR)$(sbindir)/sdinstall-rpi
$(INSTALL_DATA) src/fdisk_template $(DESTDIR)$(mambadir)/usbinstall/fdisk_template $(INSTALL_DATA) src/fdisk_template $(DESTDIR)$(mambadir)/usbinstall/fdisk_template
$(INSTALL_DATA) src/img/*.png $(DESTDIR)$(mambadir)/usbinstall/img/ $(INSTALL_DATA) src/img/*.png $(DESTDIR)$(mambadir)/usbinstall/img/
$(INSTALL_DATA) src/org.openmamba.usbinstall.policy $(DESTDIR)$(polkitdir)/org.openmamba.usbinstall.policy $(INSTALL_DATA) src/org.openmamba.usbinstall.policy $(DESTDIR)$(polkitdir)/org.openmamba.usbinstall.policy

View File

@ -26,19 +26,31 @@ else
PARTITION2=${DRIVE}2 PARTITION2=${DRIVE}2
fi fi
dd if=/dev/zero of=$DRIVE bs=1024 count=1024 dd if=/dev/zero of=$DRIVE bs=1024 count=1024 || {
echo "ERROR: dd returned an error code of $?; aborting."
exit $?
}
set -- $(LC_ALL=C fdisk -l "$DRIVE" | grep "^Disk.*bytes$") set -- $(LC_ALL=C fdisk -l "$DRIVE" | grep "^Disk.*bytes")
SIZE="$5" SIZE="$5"
echo Disk Size: $SIZE bytes
[ "$SIZE" ] || {
echo "ERROR: unable to detect disk size; aborting."
exit 1
}
echo "Disk Size: $SIZE bytes"
CYLINDERS=`echo $SIZE/255/63/512 | bc` CYLINDERS=`echo $SIZE/255/63/512 | bc`
echo Cylinders: $CYLINDERS echo "Cylinders: $CYLINDERS"
{ {
echo ,9,0x0C,* echo ,9,0x0C,*
echo ,,,- echo ,,,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE || {
echo "ERROR: sfdisk returned an error code of $?; aborting."
exit $?
}
mkfs.vfat -F 32 -n "boot" $PARTITION1 mkfs.vfat -F 32 -n "boot" $PARTITION1
mke2fs -t ext4 -j -L "openmamba" $PARTITION2 mke2fs -t ext4 -j -L "openmamba" $PARTITION2