Debian on SD


I installed debian armhf via smilnovi's prodedure and have been using it as my work os since.  I haven't tried pandian because of questions about usb-ethernet and because this was up and running before pandian was announced.  Following are my notes from the installation.  I went through several tries so the notes may not be completely consistent with themselves.  Also, I'm not an expert.  Mostly I just fumble around 'till stuff works.

install qemu-static-arm on my laptop (has an SD reader on it, running debian)

   -installed qemu and qemu-user-static. Qemu-arm-static came along for the ride with one of these.

format SD card to ext2 and mount it

   -mount it as root so that there are no 'nodev noexec' flags when you run mount

do a first stage armhf debootstrap

   -first stage is triggered by the –foreign flag

   # debootstrap --arch=armhf –foreign wheezy tmp/location http://ftp.us.debian.org/debian

copy files in tmp/location into root of sd card.

copy /usr/bin/qemu-static-arm onto SD/usr/bin (this is an important part)

   -it's actually qemu-arm-static

mount /proc, /sys, etc as needed

   # mount -o bind /dev /mnt/deboot/dev

   # mount -o bind /proc /mnt/deboot/proc

   # mount -o bind /sys /mnt/deboot/sys

edit:

    # mount -o bind /dev /mnt/sdMountPoint/dev

    # mount -o bind /proc /mnt/sdMountPoint/proc

    # mount -o bind /sys /mnt/sdMountPoint/sys

end edit

   make sure that mount shows /mnt/sdMountPoint/sys etc. without noexec and without nodev

chroot SD

   # chroot /media/sdcardLocation

second stage armhf debootstrap

   # /debootstrap/debootstrap –second-stage

   (this work is still being done on the laptop. qemu is invoked and will run stuff in armhf environment)

miscellaneous install stuff as needed

   “deb http://ftp.debian.org/debian sid main” goes into /etc/apt/sources.list

   then

   # apt-get update

   # apt-get install xserver-xorg-video-omap3

edit:

    -looks like xserver-xorg-video-fbdev is the correct video driver, so

  # apt-get install xserver-xorg-video-fbdev

end edit

   # apt-get install fluxbox

   # apt-get install network-manager

   # apt-get install xinit

   edit .xinitrc in home directory to include these two lines:

      #!/bin/sh

      exec startfluxbox

   edit  /etc/X11/xorg.conf.d/50-nubs.conf to contain:

        Section "InputClass"
                Identifier "Nubs"
                MatchDevicePath "/dev/input/js*"
                Driver "joystick"
        EndSection

edit:

   use "passwd" command to set root password so you can log in as root when you boot from sd on pandora.

end edit

   put autoboot.txt into the root of the card, containing:

       setenv bootargs root=/dev/mmcblk0p1 rw rootwait vram=6272K omapfb.vram=0:3000K mmc_core.removable=0
       ext2load mmc 0 0x80300000 /boot/uImage-3
       bootm 0x80300000

-If I remember correctly "exit" gets out of the chroot environment, then you may need to unmount /mnt/deboot/dev, /mnt/deboot/proc and /mnt/deboot/sys to remove the card.  I always did but maybe it's not needed. ??

- boot default pandora (superzaxxon)

  # xmodmap -pke > my-xmodmap

- umount SD and put it into pandora, mount SD

- copy pandora kernel (/boot, /lib/modules, /lib/firmware) onto SD

- copy /etc/pandora and /usr/pandora from zaxxon into identical spots in new file structure.

     (use "cp -r" to get entire directories.)

     edit:  Use "cp -ar" to preserves user attributes.  According to man pages, the "r" is not needed when "a" is used.    end edit.

- copy my-xmodmap onto SD

- reboot pandora into debian armhf from SD  (reboot with sd card in left slot.)

- ...

    -My nubs weren't set to control the mouse, so this:

# echo mouse > /proc/pandora/nub0/mode

# echo mbuttons > /proc/pandora/nub1/mode

# startx

open up terminal  (shortcut:  alt-Fn-1)

    -"my_xmodmap" is a dump of the keyboard mapping from superzaxxon.   -needed for characters like "$" and "#".

# xmodmap my_xmodmap

   -to toggle usb host mode.

# /usr/pandora/scripts/op_usbhost.sh

***Things that are in notes but may or may not help****

***apt-get install xserver-xorg-video-fbdev

****put “export DISPLAY=:0” in ~/.Xauthority

hope this helps
 
Last edited by a moderator:
mount /proc, /sys, etc as needed

   # mount -o bind /dev /mnt/deboot/dev

   # mount -o bind /proc /mnt/deboot/proc

   # mount -o bind /sys /mnt/deboot/sys

   make sure that mount shows /mnt/deboot/sys etc. without noexec and without nodev
That's a bit unclear to me:

mount -o bind /dev /MOUNTPOIT_ofSD/dev  or

mount -o bind /dev /MOUNTPOIT_ofSD/debootstrap/dev
 
Apink, that is great! :)

I'd just like to add the following:

- I have created 2 shell scripts, one for mounting and one for unmounting the /dev, /proc and /sys. Yes, it is neccessary to unmount those first, because the system will refuse to unmount /sdmountpoint.

- Use "cp -ar" instead of just "cp -r" so that cp keeps the UID/GIDs, rwx rights etc for the files that you're copying

@mclien:

Create the mountpoint for your SD (in your example /MOUNTPOINT_ofSD), then mount your SD there, and then do mount -o bind /dev /MOUNTPOINT_ofSD/dev

/MOUNTPOINT_ofSD/debootstrap is just the temporary directory for debootstrap to do its thing.
 
Last edited by a moderator:
Perhaps I miss something obvious, but as soon as I get inti chroot, I get an message:


chroot /mnt_pandora
I have no name!@zhaan:/#

something is missing I guess /etc/passwd /etc/group?

Ignored that (yeah stupid, I know).

So I can boot into my debian, but can't log in...

Oh, and needless tosay I tought about the permissions thing for cp, but didn't follow it..

EDIT: @smilnovi:

What about that:

make sure that mount shows /mnt/deboot/sys etc. without noexec and without nodev
I tried that by mounting with "-o bind,exec,dev"  with no success
 
Last edited by a moderator:
So I can boot into my debian, but can't log in...

You can set up a password for root in the chroot environment with the passwd command, then login as root.
 
Last edited by a moderator:
Or just copy /etc/passwd, /etc/shadow and /etc/group from your linux distribution which you're using to do debootstrap.

You have to explicitely mount with noexec and/or nodev if you want those disabled. Noexec means that even if the file has exec flag on it, it won't run when started from that partition, and nodev that you can't create an device file on that partition. So, default is that you can do both - execute and create device files.
 
Or just copy /etc/passwd, /etc/shadow and /etc/group from your linux distribution which you're using to do debootstrap.

You have to explicitely mount with noexec and/or nodev if you want those disabled. Noexec means that even if the file has exec flag on it, it won't run when started from that partition, and nodev that you can't create an device file on that partition. So, default is that you can do both - execute and create device files.
Was just about to copy the shadow/passwd/group (nit to forget the according homes aka parts of it)

to the mounts: my problem was that default seams to be noexec nodev and more confusing dosen't change if I pass exec and dev to the mount command, means I pass  "-o exec,dev" to the mount, but get noexec and nodev, when at mount

and I can't get x working so far.

I tried to copy the xorg.conf from the zaxxon and the default (which is debian-like without anx xorg.conf).

Do you use stackshadows xorg.conf with fbdev? Or do you have another trick?
 
Wait a second. Are you actually talking about booting the Debian from SD on Pandora, or are you still talking about chrooted SD card on your PC/laptop? Which of those is giving you problems?
 
OK to clear that. The mount problems are in chroot on the Debian Desktop machine.

When running debian from sdcard on pandora, I have the root user working, but can't start X so far.

first try was without modification (which is without a xorg.conf, because the bootstrap machine is running debian, which runs without xorg.conf)

second try was sopving the xorg.conf from the zaxxon on pandora to the sd-card debian)

first one gives me a"screen not found" in xerros.log, second one gives mean blankscreen (from wich I can't ever reboot. Try to "alt+ctrl+F1 to a text console on the pandorakeyboard, that's impossible...)

guess I just need a working xorg.conf file for the pandora. And just wanted to know if stackshadows fbdev config (page3 in this thread) is the only working one.
 
Have you tried xserver-xorg-video-omap3 instead of xserver-xorg-video-fbev?  I tried them both and one (don't know which right now) seemed to work.
 
Last edited by a moderator:
I ran into the same problem when I set up my system.  I could not log into debian on the pandora via sd because I had no password for root.  So I just went back into the chroot environment to set the password. 
Sorry about beeing not to the point: Yes the setting root password in chroot worked, so I can log in now, just missing the X to run (aka need a working xorg.conf)

EDIT:

tried the xorg.conf with fbdev (from stackshadow). X won'T start with a missing module for fbdev
 
Last edited by a moderator:
Have you tried xserver-xorg-video-omap3 instead of xserver-xorg-video-fbev?  I tried them both and one (don't know which right now) seemed to work.
Oh my fault. I tried xserver-xorg-video-omap3, without xorg.conf and with a plain copy of the zaxxon xorg.conf. (both didn't work)

and I tried xserver-xorg-video-omap3 with fdevconfigured in xorg.conf (which is nonsense, yeah).

do you mind to take a look which one worked? (accordnig toyour pasted notes from the install you used omap3)

EDIT:

Perhaps some firmware-linux-(non)free which has to be installed, too?
 
Last edited by a moderator:
Try:

Code:
Section "module"
	
#	Load "tslib"
	Load "extmod"
	Load "dbe"
#	Disable "glx"
#	Disable "dri"
	Load "dri2"
#	Disable "udev"
EndSection

Section "ServerLayout"
	Identifier	"DefaultLayout"
	Screen          "Screen0"
#	Option		"BlankTime"		"0"
#	Option		"OffTime"		"0"
#	Option		"StandbyTime"		"0"
#	Option		"SuspendTime"		"0"
## Internal devices
#	InputDevice	"Keyboard"		"CoreKeyboard"
#	InputDevice	"Power button"
	InputDevice	"touchscreen"
## External devices

EndSection

#Section "ServerFlags"
#Option "AutoAddDevices" "false"
#EndSection


Section "Screen"
        Identifier      "Screen0"
        Device          "OMAPFB"
        Monitor         "Monitor0"
        DefaultDepth    16
        SubSection "Display"
	  Depth        16
	  Modes	"800x480"
       EndSubSection
EndSection

Section "Monitor"
        Identifier      "Monitor0"
EndSection

Section "Device"
        Identifier      "OMAPFB"
        Driver          "omapfb"
        Option		"fb"	"/dev/fb0"
EndSection

Section "Device"
	Identifier	"FBDEV"
	Driver		"fbdev"
	Option		"ShadowFB"		"false"
EndSection

#Section "InputDevice"
#	Identifier	"Keyboard"
#	Driver		"evdev"
#	Option		"XkbRules"		"xorg"
#	Option		"XkbModel"		"evdev"
#	Option		"Device"		"/dev/input/event4"
#EndSection

#Section "InputDevice"
#	Identifier	"Power button"
#	Driver		"evdev"
#	Option		"XkbRules"		"xorg"
#	Option		"XkbModel"		"evdev"
#	Option		"XkbLayout"		"us"
#	Option		"Device"		"/dev/input/event1"
#	Option		"SendCoreEvents"	"true"
#EndSection

Section "InputDevice"
	Identifier	"touchscreen"
	Driver		"evdev"
        Option 		"Calibration" 	"3944 112 3808 158"
	Option 		"Width"		"800"
	Option 		"Height"		"480"
#	Option          "Protocol"              "Auto"
#	Option "SwapX"     "true"
#	Option "SwapY"     "true"
Option		"Device"		"/dev/input/touchscreen0"
	Option          "CorePointer"	"true"
	Option		"SendCoreEvents"	"true"
EndSection
 
do you mind to take a look which one worked? (accordnig toyour pasted notes from the install you used omap3)
Is there an easy way to check.  Noob here.  I tried lsmod and neither showed up.  There is no xorg.conf file in /etc/X11, just xorg.conf.d/  Must be somewhere else.

edit:  it looks like I am using fbdev. 

/var/log/Xorg.0.log  shows 

   . . . LoadModule: "fbdev"

There is no instance of "omap3" in the log file.

Perhaps some firmware-linux-(non)free which has to be installed, too?
I don't remember going through any hoops like that. 
 
Last edited by a moderator:
do you mind to take a look which one worked? (accordnig toyour pasted notes from the install you used omap3)
Is there an easy way to check.  Noob here. 
I'd say: aptitude search xserver-xorg-video-fbdev

aptitude search xserver-xorg-video-omap3

at least you see which ine is installed (or if both) i=> installed  p=> not installed
 
I don't see the point in running X in chrooted qemu environment on an x86 PC, and am not sure if that is even possible. Booting the Debian on Pandora and running it there yes, but otherwise...?
 
Must be a misunderstanding.

I don't want to run the X chrooted on aquemu-env on the PC. I just use it to install things in chroot on the SD card, which I then start in the Pandora. Only ting was, I couldn't figure out which pair of xserver/xorg.conf ist working.

(I'd like to the the omap3 xserver running. since it does in zaxxon I should be possible), but fbdev would be good enought, I guess).

I give fbdev a run now (try to fix my install notes so we get a consitent one)
 
Last edited by a moderator:
Back
Top