sdinstall-rp: make other fixes and install in /usr/sbin
This commit is contained in:
parent
006df4c5be
commit
9e0800f9b4
1
Makefile
1
Makefile
@ -56,6 +56,7 @@ install-dirs:
|
||||
install: install-dirs install-locales
|
||||
$(INSTALL_PROGRAM) src/usbinstall.py $(DESTDIR)$(mambadir)/usbinstall/usbinstall.py
|
||||
$(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/img/*.png $(DESTDIR)$(mambadir)/usbinstall/img/
|
||||
$(INSTALL_DATA) src/org.openmamba.usbinstall.policy $(DESTDIR)$(polkitdir)/org.openmamba.usbinstall.policy
|
||||
|
@ -26,19 +26,31 @@ else
|
||||
PARTITION2=${DRIVE}2
|
||||
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"
|
||||
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`
|
||||
echo Cylinders: $CYLINDERS
|
||||
echo "Cylinders: $CYLINDERS"
|
||||
|
||||
{
|
||||
echo ,9,0x0C,*
|
||||
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
|
||||
mke2fs -t ext4 -j -L "openmamba" $PARTITION2
|
||||
|
Loading…
Reference in New Issue
Block a user